Databases · Junior · Question 17 of 75
How do you get the 10 newest orders?
- ✓Correct answer:
SELECT * FROM orders ORDER BY created_at DESC LIMIT 10; - 2
SELECT * FROM orders LIMIT 10; - 3
SELECT TOP 10 FROM orders;
Explanation
Without ORDER BY the order of rows is not guaranteed, so LIMIT alone returns any 10 rows. TOP is SQL Server syntax.