Complete the code to combine two tables and order the results by the column 'name'.
SELECT name FROM employees UNION SELECT name FROM managers ORDER BY [1];The ORDER BY clause sorts the combined results by the 'name' column.
Complete the code to get all unique product IDs from two tables and order them in descending order.
SELECT product_id FROM sales UNION SELECT product_id FROM returns ORDER BY [1] DESC;The ORDER BY clause sorts the combined unique product IDs in descending order.
Fix the error in the query by completing the ORDER BY clause to sort by 'score'.
SELECT user_id, score FROM game1 INTERSECT SELECT user_id, score FROM game2 ORDER BY [1];The ORDER BY clause must use a column from the SELECT list. Here, sorting by 'score' is correct.
Fill both blanks to combine two tables with UNION ALL and order by 'date' ascending and 'amount' descending.
SELECT date, amount FROM payments UNION ALL SELECT date, amount FROM refunds ORDER BY [1] ASC, [2] DESC;
The query orders results first by 'date' ascending, then by 'amount' descending.
Fill all three blanks to combine two tables with EXCEPT and order by 'category' ascending, 'price' ascending, and 'stock' descending.
SELECT category, price, stock FROM inventory1 EXCEPT SELECT category, price, stock FROM inventory2 ORDER BY [1] ASC, [2] ASC, [3] DESC;
The query orders results by 'category' ascending, then 'price' ascending, and finally 'stock' descending.