Complete the code to combine two tables and get all unique rows.
SELECT * FROM table1 [1] SELECT * FROM table2;The UNION operation combines rows from two tables and removes duplicates, giving all unique rows.
Complete the code to find rows common to both tables.
SELECT * FROM table1 [1] SELECT * FROM table2;The INTERSECT operation returns only rows that appear in both tables.
Fix the error in the code to get rows in table1 but not in table2.
SELECT * FROM table1 [1] SELECT * FROM table2;The EXCEPT operation returns rows from the first table that are not in the second table.
Fill both blanks to combine two tables and keep all rows including duplicates.
SELECT * FROM table1 [1] SELECT * FROM table2 [2] id;
UNION ALL combines all rows from both tables including duplicates. ORDER BY sorts the final result.
Fill all three blanks to find rows in table1 not in table2 and sort by id.
SELECT * FROM table1 [1] SELECT * FROM table2 [2] id [3];
EXCEPT finds rows in table1 not in table2. ORDER BY sorts the result by id in ascending order (ASC).