CREATE TABLE orders (id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL REFERENCES customers(id), product_id INTEGER NOT NULL REFERENCES products(id), quantity INTEGER NOT NULL, ordered_at TEXT NOT NULL);
Example rows of the orders table| id | customer_id | product_id | quantity | ordered_at |
|---|
| 1 | 1 | 2 | 1 | 2026-03-01 |
| 2 | 1 | 1 | 5 | 2026-03-02 |
| 3 | 2 | 3 | 3 | 2026-03-02 |
| 4 | 3 | 4 | 1 | 2026-03-03 |
| 5 | 4 | 5 | 1 | 2026-03-04 |
| 6 | 2 | 1 | 10 | 2026-03-05 |
| 7 | 5 | 6 | 4 | 2026-03-05 |
| 8 | 3 | 6 | 3 | 2026-03-06 |
| 9 | 4 | 4 | 2 | 2026-03-07 |
| 10 | 5 | 2 | 1 | 2026-03-08 |
| 11 | 1 | 3 | 2 | 2026-03-09 |