Advanced SQL Flashcards

1
Q

A(n) ___ ___ clause is used to combine records from two or more tables in a database

based on a common field between them

A

SQL JOIN

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

return rows when there is at least one match in both tables.

A

INNER Join

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

an extension of INNER JOIN, does not require records in the two joined tables to have a matching record

A

OUTER Join

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

OUTER Join subdivision

A
  • left outer joins
  • right outer joins
  • full outer joins
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

returns all rows from the left table, even if there are no matches in the right table

A

LEFT JOIN

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

returns all the rows from the right table, even if there
are no matches in the left table

A

RIGHT JOIN

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

if rows are being matched in table A and table B, then all rows from table A are displayed even if there is no matching row in table B, and vice versa

A

FULL JOIN

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

returns all possible combinations of rows from the two tables.

A

CROSS Join

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

SELECT statement embedded within another SELECT statement.

A

Subqueries

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

Types of Subqueries

returns a single column and a single row, that is, a single value

A

Scalar subquery

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

Types of Subqueries

returns multiple columns, but only a single row

A

Row subquery

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

Types of Subqueries

returns one or more columns and multiple rows.

A

Table subquery

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

used to improve the efficiency of searches and to avoid duplicate column values.

A

SQL Indexes

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

used to delete index.

A

Drop Index

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

a virtual table based on a SELECT query

A

view

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

a data definition command that stores the subquery specification

A

CREATE VIEW

17
Q

Benefit of Views

reduce __________

A

complexity

18
Q

Benefit of Views

increase ___________

A

reusability

19
Q

Benefit of Views

________ format data

A

properly

20
Q

Benefit of Views

create ________ columns

A

calculated

21
Q

Benefit of Views

____ column names

A

rename

22
Q

Benefit of Views

create ____ of data

A

subset

23
Q

Benefit of Views

enforce ________ restrictions

A

security

24
Q

the keyword used to modify a created view

A

ALTER VIEW

25
Q

used to delete a view that was previously created

A

DROP VIEW