By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
12 rows affected
9 rows affected
| CustomerID | Name | Age |
|---|---|---|
| 1 | Fred | 20 |
| 2 | Bob | 30 |
| 3 | Joe | 40 |
| 4 | Bob | 30 |
| 5 | Joe | 40 |
| InvoiceID | CustomerID | Date |
|---|---|---|
| 1 | 1 | 2020-01-01 00:00:00.000 |
| 2 | 2 | 2020-02-02 00:00:00.000 |
| 3 | 2 | 2020-03-03 00:00:00.000 |
| 4 | 3 | 2020-04-04 00:00:00.000 |
| 5 | 4 | 2020-02-02 00:00:00.000 |
| 6 | 4 | 2020-03-03 00:00:00.000 |
| 7 | 5 | 2020-04-04 00:00:00.000 |
| LineItemID | InvoiceID | Item | Price | Qty |
|---|---|---|---|---|
| 1 | 1 | Apples | 1 | 5 |
| 2 | 2 | Oranges | 2 | 3 |
| 3 | 2 | Peaches | 2 | 6 |
| 4 | 3 | Grapes | 3 | 10 |
| 5 | 4 | Pineapple | 5 | 1 |
| 6 | 5 | Oranges | 2 | 3 |
| 7 | 5 | Peaches | 2 | 6 |
| 8 | 6 | Grapes | 3 | 10 |
| 9 | 7 | Pineapple | 5 | 1 |