Your question is SQL Join Across Three Tables. Start with the requirements and the three tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Write a SQL join query using three tables.
Use the provided customers, orders, and payments tables. Return every order with its customer name and payment status, including orders that have no matching payment record.
customer_name, order_id, order_status, and payment_statusorder_id ascending| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| VARCHAR(255) | Customer email address |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer who placed the order |
| order_status | VARCHAR(30) | Current order status |
| order_date | DATE | Date the order was created |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| order_id | INT | Order associated with the payment |
| payment_status | VARCHAR(30) | Current payment status |
| amount | NUMERIC(10,2) | Payment amount |