Challenge: Get Category by Product Price
You have obtained the quantity of products in each category. Now, the company tasked you to retrieve the categories where the products cost more than a certain amount of money, so they can put a discount on them.
フィードバックありがとうございます!
single
Challenge: Get Category by Product Price
メニューを表示するにはスワイプしてください
You have obtained the quantity of products in each category. Now, the company tasked you to retrieve the categories where the products cost more than a certain amount of money, so they can put a discount on them.
スワイプしてコーディングを開始
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.
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.
Brief Instructions
- Retrieve the
category.namecolumn from thecategorytable. - Use
DISTINCTto get only unique values. - Join the
producttable using aJOINstatement. - The common column for both tables is
category.id = product.category_id. - Use a
WHEREclause with the conditionprice > 450. - Do not use aliases in this task.
解答
フィードバックありがとうございます!
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください