0
0
DBMS Theoryknowledge~5 mins

Joins in SQL in DBMS Theory - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a JOIN in SQL?
A JOIN in SQL is a way to combine rows from two or more tables based on a related column between them.
Click to reveal answer
beginner
What does an INNER JOIN do?
An INNER JOIN returns only the rows where there is a match in both tables based on the join condition.
Click to reveal answer
beginner
Explain LEFT JOIN in SQL.
A LEFT JOIN returns all rows from the left table and the matched rows from the right table. If there is no match, the result will have NULLs for the right table's columns.
Click to reveal answer
intermediate
What is the difference between LEFT JOIN and RIGHT JOIN?
LEFT JOIN returns all rows from the left table and matching rows from the right. RIGHT JOIN returns all rows from the right table and matching rows from the left.
Click to reveal answer
intermediate
What is a FULL OUTER JOIN?
A FULL OUTER JOIN returns all rows when there is a match in one of the tables. It combines the results of LEFT JOIN and RIGHT JOIN, showing all rows from both tables with NULLs where there is no match.
Click to reveal answer
Which JOIN returns only matching rows from both tables?
ALEFT JOIN
BINNER JOIN
CRIGHT JOIN
DFULL OUTER JOIN
What does a LEFT JOIN return?
AOnly rows matching in both tables
BAll rows from the right table and matching rows from the left
CAll rows from the left table and matching rows from the right
DAll rows from both tables
If you want all rows from both tables, which JOIN should you use?
AINNER JOIN
BLEFT JOIN
CRIGHT JOIN
DFULL OUTER JOIN
Which JOIN can result in NULL values in the result set?
AB and D
BLEFT JOIN
CINNER JOIN
DRIGHT JOIN
What is the main purpose of using JOINs in SQL?
ATo combine rows from two or more tables
BTo delete rows from tables
CTo create new tables
DTo update data in a table
Describe the differences between INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN.
Think about which table's rows are always included and where NULLs appear.
You got /4 concepts.
    Explain a real-life situation where you might use a LEFT JOIN in a database query.
    Consider a list of people and their activities where some people might not have done the activity.
    You got /4 concepts.