W3. SQL Full Join Flashcards

1
Q

Q: What does the SQL FULL OUTER JOIN keyword do?

A

A: It returns all records when there is a match in either the left or right table. Unmatched records in each table are also included.

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

Q: Is there a difference between FULL OUTER JOIN and FULL JOIN?

A

A: No, FULL OUTER JOIN and FULL JOIN are the same.

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

Q: Write the syntax for a FULL OUTER JOIN.

A

SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name = table2.column_name
WHERE condition;

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

Q: Write a query to return all customers and all orders, using FULL OUTER JOIN.

A

SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
FULL OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
ORDER BY Customers.CustomerName;

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

Q: What happens to rows without matches in a FULL OUTER JOIN?

A

A: Rows without matches in one table are included, with NULLs for columns from the other table.

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

Q: Why should you be cautious when using FULL OUTER JOIN?

A

A: It can return very large result sets, especially with large tables.

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