Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Челендж: Інформація про Виліт Пасажирського Рейсу | Joining Tables
Розширений рівень SQL

Челендж: Інформація про Виліт Пасажирського РейсуЧелендж: Інформація про Виліт Пасажирського Рейсу

The company needs to find the minimum price of a product from each category in order to organize a marketing campaign. They have assigned you this task!

Just a reminder, 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.

Now let's get back to the task!

Завдання

Your task is to obtain the minimum price for each product category. However, to provide customers with options, you need to retrieve only those categories where there are more than 5 different products. You'll need to join two tables, aggregate the data, and use the HAVING clause.

Note

Pay attention that in the response, you should have 2 columns: category_name and min_price. So don't forget to set aliases for these columns!

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

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

Зміст курсу

Розширений рівень SQL

Челендж: Інформація про Виліт Пасажирського РейсуЧелендж: Інформація про Виліт Пасажирського Рейсу

The company needs to find the minimum price of a product from each category in order to organize a marketing campaign. They have assigned you this task!

Just a reminder, 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.

Now let's get back to the task!

Завдання

Your task is to obtain the minimum price for each product category. However, to provide customers with options, you need to retrieve only those categories where there are more than 5 different products. You'll need to join two tables, aggregate the data, and use the HAVING clause.

Note

Pay attention that in the response, you should have 2 columns: category_name and min_price. So don't forget to set aliases for these columns!

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

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