Grokking SQL for Tech Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
12. Generate the Invoice
On this page

Problem

Table: Products

+-------------+------+
| Column Name | Type |
+-------------+------+
| product_id  | int  |
| price       | int  |
+-------------+------+
product_id contains unique values.
Each row in this table shows the ID of a product and the price of one unit.

Table: Purchases

+-------------+------+
| Column Name | Type |
+-------------+------+
| invoice_id  | int  |
| product_id  | int  |
| quantity    | int  |
+-------------+------+
(invoice_id, product_id) is the primary key (combination of columns with unique values) for this table.

.....

.....

.....

Like the course? Get enrolled and start learning!

On this page