Medium
INNER JOIN
Largest 2 Orders
Return the 2 orders with the highest totals, including customer names. Return columns: order_id, total_amount, customer_name. Order results by: o.total_amount DESC, o.id.
Preparing the interactive SQL workspace...
Return the 2 orders with the highest totals, including customer names. Return columns: order_id, total_amount, customer_name. Order results by: o.total_amount DESC, o.id.
Preparing the interactive SQL workspace...
Return the 2 orders with the highest totals, including customer names. Return columns: order_id, total_amount, customer_name. Order results by: o.total_amount DESC, o.id.
| id INTEGER | name TEXT | email TEXT | country TEXT | joined_date TEXT |
|---|---|---|---|---|
| 1 | Acme Corp | acme@corp.com | USA | 2020-01-15 |
| 2 | TechStart Ltd | ts@techstart.io | UK | 2020-03-22 |
| 3 | DataFlow Inc | info@dataflow.com | USA | 2021-06-10 |
| id INTEGER | name TEXT | category TEXT | price REAL | stock INTEGER |
|---|---|---|---|---|
| 1 | Analytics Dashboard | Software | 299 | 999 |
| 2 | Data Warehouse | Infrastructure | 1499 | 50 |
| 3 | ML Pipeline | Software | 799 | 999 |
| id INTEGER | customer_id INTEGER | order_date TEXT | total_amount REAL | status TEXT |
|---|---|---|---|---|
| 1 | 1 | 2024-01-10 | 2697 | completed |
| 2 | 2 | 2024-01-15 | 799 | completed |
| 3 | 1 | 2024-02-01 | 1499 | completed |
| id INTEGER | order_id INTEGER | product_id INTEGER | quantity INTEGER | unit_price REAL |
|---|---|---|---|---|
| 1 | 1 | 1 | 3 | 299 |
| 2 | 1 | 4 | 8 | 99 |
| 3 | 2 | 3 | 1 | 799 |