275 SQL Flashcards

1
Q

A full outer join includes rows that satisfy the join condition, plus

A

Rows in both tables that don’t satisfy the join condition

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

When applying multiple join conditions (i.e. more than one condition which must be true) to an inner join in explicit syntax, the extra conditions can be applied:

A

In the WHERE clause and/or the ON section

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

The basic format for an inner join using explicit syntax is:

A

SELECT … FROM table1 JOIN table2 ON join_condition

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

In most cases, the join condition of an inner join compares the primary key of one table to the ____________________ key of another table.

A

foreign

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

When performing an inner join using implicit join syntax, you should place the join condition(s):

A

In the WHERE clause

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

In a cross join, all of the rows in the first table are joined with…

A

all rows in the second table

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

SELECT v.VendorName AS Vendor, i.InvDate AS Date
FROM Vendors v
JOIN Invoices i ON v.VendorID = i.VendorID;

In this example, “i” is known as…

A

a table alias

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

Correlation names (aka table aliases) can be specified with the option AS keyword to temporarily re-name a table within the scope of the query. When/how is the best practice for using correlation names?

A

When they simplify or clarify the query.

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

Queries combined with UNION must use the same tables to avoid an error.

A

False

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

SELECT VendorName, InvoiceNumber
FROM Invoices i
RIGHT JOIN Vendors v ON i.VendorID = v.VendorID;

If the RIGHT keyword is replaced with the LEFT keyword, the query…

A

keeps unmatched rows in the Invoices tab

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