Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What does a FULL OUTER JOIN do in SQL?
It returns all rows from both tables, matching rows where possible. If there is no match, it fills with NULLs for the missing side.
Click to reveal answer
beginner
How does FULL OUTER JOIN differ from INNER JOIN?
INNER JOIN returns only rows with matching keys in both tables. FULL OUTER JOIN returns all rows from both tables, matching where possible and filling NULLs where no match exists.
Click to reveal answer
beginner
In a FULL OUTER JOIN, what happens if a row in the left table has no matching row in the right table?
The row from the left table appears in the result with NULL values for the right table's columns.
Click to reveal answer
beginner
Write a simple SQL query using FULL OUTER JOIN between tables A and B on column id.
SELECT * FROM A FULL OUTER JOIN B ON A.id = B.id;
Click to reveal answer
intermediate
Why might you use FULL OUTER JOIN instead of LEFT or RIGHT JOIN?
To get a complete view of all data from both tables, including unmatched rows from both sides.
Click to reveal answer
What does FULL OUTER JOIN return?
AAll rows from the left table only
BOnly matching rows from both tables
CAll rows from the right table only
DAll rows from both tables, matching where possible, NULLs otherwise
✗ Incorrect
FULL OUTER JOIN returns all rows from both tables, matching rows where possible and filling NULLs where no match exists.
If a row in the right table has no match in the left table, what does FULL OUTER JOIN do?
AExcludes the row
BIncludes the row with NULLs for left table columns
CIncludes the row with NULLs for right table columns
DReturns an error
✗ Incorrect
FULL OUTER JOIN includes unmatched rows from both tables, filling NULLs for the missing side's columns.
Which JOIN type returns only rows with matching keys in both tables?
AFULL OUTER JOIN
BLEFT JOIN
CINNER JOIN
DRIGHT JOIN
✗ Incorrect
INNER JOIN returns only rows where keys match in both tables.
What keyword is used in SQL for a FULL OUTER JOIN?
AFULL OUTER JOIN
BALL JOIN
COUTER JOIN
DFULL JOIN
✗ Incorrect
The correct syntax is FULL OUTER JOIN to include all rows from both tables.
Which scenario best fits using FULL OUTER JOIN?
AYou want all records from both tables, including unmatched
BYou want all records from left table only
CYou want only matching records
DYou want only unmatched records
✗ Incorrect
FULL OUTER JOIN returns all records from both tables, including unmatched rows.
Explain in your own words how FULL OUTER JOIN works and when you would use it.
Think about combining two lists fully, including unmatched items.
You got /4 concepts.
Write a simple SQL query using FULL OUTER JOIN and describe what the output will look like.
Use SELECT * FROM table1 FULL OUTER JOIN table2 ON condition.
You got /4 concepts.
Practice
(1/5)
1. What does a FULL OUTER JOIN do in SQL?
easy
A. Returns all rows from the left table and matching rows from the right table.
B. Returns only rows that have matching values in both tables.
C. Returns all rows from both tables, matching where possible and NULLs where no match exists.
D. Returns all rows from the right table and matching rows from the left table.
Solution
Step 1: Understand join types
INNER JOIN returns only matching rows; LEFT JOIN returns all from left plus matches; RIGHT JOIN returns all from right plus matches.
Step 2: Define FULL OUTER JOIN behavior
FULL OUTER JOIN returns all rows from both tables, matching where possible, and fills NULLs where no match exists.
Final Answer:
Returns all rows from both tables, matching where possible and NULLs where no match exists. -> Option C
Quick Check:
FULL OUTER JOIN = all rows both tables [OK]
Hint: Full outer join keeps all rows from both tables [OK]
Common Mistakes:
Confusing FULL OUTER JOIN with INNER JOIN
Thinking FULL OUTER JOIN returns only matches
Mixing up LEFT and RIGHT JOIN behavior
2. Which of the following is the correct syntax for a FULL OUTER JOIN between tables Employees and Departments on DeptID?
easy
A. SELECT * FROM Employees FULL OUTER JOIN Departments ON Employees.DeptID = Departments.DeptID;
B. SELECT * FROM Employees INNER JOIN Departments ON Employees.DeptID = Departments.DeptID;
C. SELECT * FROM Employees LEFT JOIN Departments ON Employees.DeptID = Departments.DeptID;
D. SELECT * FROM Employees RIGHT JOIN Departments ON Employees.DeptID = Departments.DeptID;
Solution
Step 1: Identify FULL OUTER JOIN syntax
The correct syntax uses the keywords FULL OUTER JOIN between the two tables with an ON condition.
Step 2: Compare options
SELECT * FROM Employees FULL OUTER JOIN Departments ON Employees.DeptID = Departments.DeptID; uses FULL OUTER JOIN correctly; others use INNER, LEFT, or RIGHT JOIN which are different join types.
Final Answer:
SELECT * FROM Employees FULL OUTER JOIN Departments ON Employees.DeptID = Departments.DeptID; -> Option A
Quick Check:
FULL OUTER JOIN syntax = SELECT * FROM Employees FULL OUTER JOIN Departments ON Employees.DeptID = Departments.DeptID; [OK]
Hint: FULL OUTER JOIN syntax includes FULL OUTER JOIN keywords [OK]
Common Mistakes:
Using INNER JOIN instead of FULL OUTER JOIN
Omitting FULL keyword and writing only OUTER JOIN
Confusing LEFT or RIGHT JOIN with FULL OUTER JOIN
3. Given these tables:
Table A: ID | Name 1 | Alice 2 | Bob 4 | Dana
Table B: ID | City 2 | Boston 3 | Chicago 4 | Denver
What is the result of this query?
SELECT A.ID, A.Name, B.City FROM A FULL OUTER JOIN B ON A.ID = B.ID ORDER BY A.ID;
IDs 2 and 4 appear in both tables, so their rows combine. ID 1 is only in A, ID 3 only in B.
Step 2: Fill NULLs for missing matches
For ID 1 (A only), City is NULL; for ID 3 (B only), A.ID=NULL, A.Name=NULL, City='Chicago'. ORDER BY A.ID ASC places NULL last: rows for 1,2,4 then NULL row.
You want a query to list all products and sales quantities, including products with no sales and sales for unknown products.
Which query correctly achieves this?
hard
A. SELECT Products.ProductID, Products.Name, Sales.Quantity FROM Products FULL OUTER JOIN Sales ON Products.ProductID = Sales.ProductID;
B. SELECT Products.ProductID, Products.Name, Sales.Quantity FROM Products LEFT JOIN Sales ON Products.ProductID = Sales.ProductID;
C. SELECT Products.ProductID, Products.Name, Sales.Quantity FROM Sales RIGHT JOIN Products ON Sales.ProductID = Products.ProductID;
D. SELECT Products.ProductID, Products.Name, Sales.Quantity FROM Products INNER JOIN Sales ON Products.ProductID = Sales.ProductID;
Solution
Step 1: Identify requirement for all products and all sales
We want all products even if no sales, and all sales even if product unknown.
Step 2: Choose join type
FULL OUTER JOIN returns all rows from both tables, matching where possible, filling NULLs otherwise.
Step 3: Check options
SELECT Products.ProductID, Products.Name, Sales.Quantity FROM Products FULL OUTER JOIN Sales ON Products.ProductID = Sales.ProductID; uses FULL OUTER JOIN correctly; others exclude unmatched rows from one side.
Final Answer:
SELECT Products.ProductID, Products.Name, Sales.Quantity FROM Products FULL OUTER JOIN Sales ON Products.ProductID = Sales.ProductID; -> Option A
Quick Check:
FULL OUTER JOIN = all products and sales [OK]
Hint: Use FULL OUTER JOIN to include all rows from both tables [OK]