0
0
SQLquery~5 mins

RIGHT JOIN execution behavior in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does a RIGHT JOIN do in SQL?
A RIGHT JOIN returns all rows from the right table and the matching rows from the left table. If there is no match, the result will contain NULLs for columns from the left table.
Click to reveal answer
beginner
In a RIGHT JOIN, what happens when a row in the right table has no matching row in the left table?
The row from the right table still appears in the result, but columns from the left table will have NULL values.
Click to reveal answer
intermediate
How is a RIGHT JOIN different from a LEFT JOIN?
A RIGHT JOIN returns all rows from the right table and matching rows from the left, while a LEFT JOIN returns all rows from the left table and matching rows from the right.
Click to reveal answer
intermediate
Consider these tables:<br>Table A: ids 1, 2<br>Table B: ids 2, 3<br>What rows will a RIGHT JOIN on id return?
It will return rows with ids 2 and 3. For id 2, matching data from both tables appears. For id 3, data from Table A will be NULL because there is no match.
Click to reveal answer
intermediate
Why might you use a RIGHT JOIN instead of a LEFT JOIN?
You use a RIGHT JOIN when you want to keep all rows from the right table regardless of matches in the left table. It depends on which table's data you want to preserve fully.
Click to reveal answer
What does a RIGHT JOIN return?
AAll rows from the right table and matching rows from the left table
BAll rows from the left table and matching rows from the right table
COnly matching rows from both tables
DAll rows from both tables
If a row in the right table has no match in the left table, what will the LEFT table columns show?
AZeroes
BThe matching values
CNULL values
DEmpty strings
Which SQL join is the opposite of RIGHT JOIN?
ALEFT JOIN
BINNER JOIN
CFULL JOIN
DCROSS JOIN
In a RIGHT JOIN, which table's rows are always fully included?
ALeft table
BRight table
CBoth tables
DNeither table
What will be the result of RIGHT JOIN if both tables have no matching rows?
AAll rows from both tables
BAll rows from left table with NULLs
CEmpty result
DAll rows from right table with NULLs for left table columns
Explain how a RIGHT JOIN works and when you would use it.
Think about which table's rows you want to keep completely.
You got /4 concepts.
    Describe the difference between LEFT JOIN and RIGHT JOIN with an example.
    Consider two tables with overlapping and unique ids.
    You got /4 concepts.