easyLazada · schema-design
Add a primary key to an unkeyed orders table
This orders table was created without a primary key — every column is nullable and nothing stops a duplicate id from being inserted. id is meant to uniquely identify a row and is never null in the data that's already there.
Add a PRIMARY KEY constraint on orders.id. Don't create a new table — alter the existing one.
Schema
▸orders
| id | INT |
| customer_id | INT |
| amount | NUMERIC |
Example input
▸orders
Stuck? Ask the coach for a nudge that won't give the answer away, or reveal the reference solution and a short walkthrough of why it works.