0
0
SQLquery~20 mins

FULL OUTER JOIN availability across databases in SQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
FULL OUTER JOIN Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Which databases support FULL OUTER JOIN natively?
Consider these popular SQL databases: MySQL, PostgreSQL, SQL Server, and SQLite. Which of them supports FULL OUTER JOIN as a native SQL feature?
ANone support FULL OUTER JOIN natively
BPostgreSQL and SQL Server only
CAll four support FULL OUTER JOIN natively
DMySQL and SQLite only
Attempts:
2 left
💡 Hint
Think about which databases have FULL OUTER JOIN as a direct keyword in their SQL syntax.
query_result
intermediate
2:00remaining
What is the output of this FULL OUTER JOIN query in PostgreSQL?
Given two tables:

Table A:
id | name
1 | Alice
2 | Bob

Table B:
id | city
2 | Paris
3 | Tokyo

What is the result of:
SELECT A.id, A.name, B.city FROM A FULL OUTER JOIN B ON A.id = B.id ORDER BY A.id, B.id;
SQL
CREATE TABLE A (id INT, name TEXT);
INSERT INTO A VALUES (1, 'Alice'), (2, 'Bob');
CREATE TABLE B (id INT, city TEXT);
INSERT INTO B VALUES (2, 'Paris'), (3, 'Tokyo');

SELECT A.id, A.name, B.city FROM A FULL OUTER JOIN B ON A.id = B.id ORDER BY A.id, B.id;
A
1 | Alice | NULL
2 | Bob   | Paris
3 | NULL  | Tokyo
B
1 | Alice | NULL
2 | Bob   | Paris
C
1 | Alice | NULL
2 | Bob   | Paris
NULL | NULL | Tokyo
D
2 | Bob   | Paris
3 | NULL  | Tokyo
Attempts:
2 left
💡 Hint
FULL OUTER JOIN returns all rows from both tables, matching where possible.
📝 Syntax
advanced
2:00remaining
Which query correctly simulates FULL OUTER JOIN in MySQL?
MySQL does not support FULL OUTER JOIN natively. Which of these queries correctly simulates a FULL OUTER JOIN between tables A and B on column id?
ASELECT A.id, A.name, B.city FROM A LEFT JOIN B ON A.id = B.id UNION ALL SELECT B.id, A.name, B.city FROM B LEFT JOIN A ON B.id = A.id WHERE A.id IS NULL;
BSELECT * FROM A FULL OUTER JOIN B ON A.id = B.id;
CSELECT A.id, A.name, B.city FROM A INNER JOIN B ON A.id = B.id;
DSELECT A.id, A.name, B.city FROM A LEFT JOIN B ON A.id = B.id UNION SELECT B.id, A.name, B.city FROM B LEFT JOIN A ON B.id = A.id;
Attempts:
2 left
💡 Hint
FULL OUTER JOIN can be simulated by combining LEFT JOIN and RIGHT JOIN results with UNION.
optimization
advanced
1:30remaining
Which optimization improves FULL OUTER JOIN performance in SQL Server?
You have a large FULL OUTER JOIN query joining tables A and B on id. Which optimization can improve performance?
ACreate indexes on the join columns in both tables
BUse CROSS JOIN instead of FULL OUTER JOIN
CRemove indexes on join columns to speed up scanning
DUse subqueries without indexes
Attempts:
2 left
💡 Hint
Indexes help the database find matching rows faster.
🔧 Debug
expert
1:30remaining
Why does this FULL OUTER JOIN query fail in SQLite?
Given this query:
SELECT A.id, B.id FROM A FULL OUTER JOIN B ON A.id = B.id;

Why does it fail in SQLite?
ASQLite does not support FULL OUTER JOIN syntax
BThe ON clause is missing a condition
CTable aliases are required in SQLite
DSQLite requires USING instead of ON for joins
Attempts:
2 left
💡 Hint
Check SQLite's join capabilities.