Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Get Category By Product Price | Joining Tables
Intermediate SQL

Get Category By Product PriceGet Category By Product Price

Great, we have obtained the quantity of products in each category. Now we need to retrieve the categories where the products cost more than a certain amount of money.

Just a reminder that we are working with two tables.

product:

id name amount price category_id
1 Shrimp 50 450.00 1
2 Salmon 30 300.00 1
3 Tuna 40 350.00 1
4 Rice 100 200.00 2
... ... ... ... ...
62 Frozen Pie 25 300.00 10

category:

id name description
1 Seafood Products from the sea, including fish and shellfish.
2 Grains Grain-based foods such as rice, wheat, and quinoa.
3 Vegetables Fresh vegetables including leafy greens, roots, and tubers.
4 Fruits Fresh fruits such as apples, bananas, and berries.
... ... ...
10 Frozen Foods Frozen products including meals, desserts, and vegetables.

And now, let's move to the task:

Завдання

Your task is to retrieve the unique category names that have products with a price higher than 450. Use the WHERE clause for this, where you compare 450 with the value of the price column.

Note

Please note that there should be only one column in the output - category.name. You do not include the price column in the SELECT section; you only use it in the WHERE section.

Good luck!

Все було зрозуміло?

Секція 3. Розділ 2
toggle bottom row
course content

Зміст курсу

Intermediate SQL

Get Category By Product PriceGet Category By Product Price

Great, we have obtained the quantity of products in each category. Now we need to retrieve the categories where the products cost more than a certain amount of money.

Just a reminder that we are working with two tables.

product:

id name amount price category_id
1 Shrimp 50 450.00 1
2 Salmon 30 300.00 1
3 Tuna 40 350.00 1
4 Rice 100 200.00 2
... ... ... ... ...
62 Frozen Pie 25 300.00 10

category:

id name description
1 Seafood Products from the sea, including fish and shellfish.
2 Grains Grain-based foods such as rice, wheat, and quinoa.
3 Vegetables Fresh vegetables including leafy greens, roots, and tubers.
4 Fruits Fresh fruits such as apples, bananas, and berries.
... ... ...
10 Frozen Foods Frozen products including meals, desserts, and vegetables.

And now, let's move to the task:

Завдання

Your task is to retrieve the unique category names that have products with a price higher than 450. Use the WHERE clause for this, where you compare 450 with the value of the price column.

Note

Please note that there should be only one column in the output - category.name. You do not include the price column in the SELECT section; you only use it in the WHERE section.

Good luck!

Все було зрозуміло?

Секція 3. Розділ 2
toggle bottom row
some-alt