Foreign keys versus joins and their advantages.
Asked in the technical 1 stage. Use the tables below to identify order rows that have a valid customer reference.
order_id, customer_id, customer_name, and order_statuscustomer_id matches an existing customerorder_id ascending| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| segment | VARCHAR(50) | Customer segment label |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer reference from customers.customer_id |
| order_status | VARCHAR(20) | Current order status |
| order_amount | NUMERIC(10,2) | Order amount |