SQL Full Outer Join
1.What is the result of a FULL OUTER JOIN?
-
A. Only matched rows
-
B. All rows from both tables
-
C. Rows from left table only
-
D. Rows from right table only
All rows from both tables
All rows from both tables
2.Which SQL is correct for FULL OUTER JOIN?
SELECT * FROM A FULL OUTER JOIN B ON A.id = B.id;
-
A. Correct syntax
-
B. Invalid in MySQL without workaround
-
C. Invalid everywhere
-
D. Only works in SQLite
Invalid in MySQL without workaround
Invalid in MySQL without workaround
3.If A has 2 rows, B has 3 rows, and only 1 match – how many rows from FULL OUTER JOIN?
-
A. 1
-
B. 3
-
C. 4
-
D. 5
5
5
4.What does this query return?
Table A Table B
id | name id | city
1 | Arjun 2 | Pune
3 | Karan 1 | Delhi
SELECT A.id, B.city
FROM A FULL OUTER JOIN B ON A.id = B.id;
-
A. 2 rows
-
B. 3 rows
-
C. 1 row
-
D. 4 rows
3 rows
3 rows
5.Which databases support FULL OUTER JOIN natively?
-
A. SQL Server, PostgreSQL
-
B. MySQL 5+
-
C. SQLite
-
D. Oracle 6 only
SQL Server, PostgreSQL
SQL Server, PostgreSQL