SQL Flashcards

1
Q

An organized collection of data or information

A

Database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A set of computer programs for organizing the information in a database

A

Database Management System

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A DBMS provides tools for data input, storage, retrieval and manipulation

A

x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where are Database applications

A

everywhere from Banking, online ticket booking, online retailer, etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does DBMS do?

A

DBMS controls all functions of capturing, processing, storing, retrieving data and generates various forms of data output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data is organized in

A

tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Table contains

A

rows and columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Tables can be related to one another through common values called

A

Keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Uniquely identifies each row of the table

A

Primary Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Column in one table that serves as a primary key in another

A

Foreign Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are different types of relationship exist

A

One to One, One to Many, Many to Many

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A set of rules to help designers to reduce redundancy and avoid data update anomalies

A

Normalization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Entity and Attributes

A

X

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Language for accessing and manipulating the data

A

DML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Language for Create, Alter, Drop, Truncate, Comment and Rename

A

DDL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

DDL stands for

A

Data Definition Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which language is used for the control of data

A

Data Control Language DCL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What operations can you perform using DCL

A

Grant and Revoke

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are transaction control statements

A

Commit, Rollback, Savepoint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Restore database to original from the last COMMIT

A

Rollback

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Save work done

A

Commit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Data Types in SQL

A

Character, Varchar, Boolean, Integer, Float, Date, Time, Timestamp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Fixed width character string

A

Char

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Variable width character string

25
Whole numbers
int
26
Floating precision number
float
27
Syntax for creating a table
Create Table table_name (column1 data_type (size), column2 data_type (size));
28
What are the different types of Operators in SQL
Arithmetic Operator, Relational Operator, Logical Operator and Comparison Operator
29
+ - * / are
Arithmetic Operators
30
=, != and <>, >, =, <=, !
Relational Operators
31
AND OR NOT
Logical Operators
32
IN BETWEEN LIKE
Comparison Operators
33
Used to temporarily rename a table or a column heading. to make them more readable
Alias
34
Where Clause
It's a condition to select particular rows or data from the table
35
Delete command
Used to delete the rows from the table
36
This command removes all rows from the table
Truncate
37
This command removes table from the database
Drop
38
Drop Command
Drop Table
39
Delete Command
Delete Table where
40
Truncate Command
Truncate Table
41
Drop and Truncate are
DDL commands
42
Delete is a
DML command
43
SQL INSERT INTO syntax
INSERT INTO table_name (column1, column2, colum3) Values (value1, value2, value3);
44
Create Table Statement
Used to create table in a database
45
Create Table Syntax
Create Table (column1 data type (size), column2 data type (size), column3 data type (size));
46
Instructions used to communicate with the database to perform specific task that with data
SQL commands
47
Create Alter and Drop; Grant and Revoke
DDL commands
48
Select, Insert, Update, and Delete
DML commands
49
These SQL commands are used for storing, retrieving, modifying and deleting data
DML
50
A clause used to combine records from two or more tables in a database
JOINS
51
What are the different types of Join available in SQL
Inner Join, Left Join, Right Join, Full Join, Self Join, Cartesian Join
52
What's the most frequently used Join statement
Inner Join
53
Inner Join creates a new result table by combining column values of two tables
table 1 and table 2
54
Basic Syntax of Inner Join
Select table1.column1, table2.column2 from table1 inner join table2 ON table1.common_filed = table2.commond_field
55
Left Join returns all rows from the left table even if there are no matches in the right table
x
56
Basic Syntax for Left Join
Select column1, column2, column3 from table 1 left join table 2 On table1.common_field = table2.common_field
57
Right Join returns all the rows from the right table even if there are no matches in the left table
x
58
Basic Syntax for Right Join
Select column1, column2, column3 from table1 right join table 2 on table1.common_field = table2.common_field