Obter Categoria pelo Preço do Produto
Ótimo, obtivemos a quantidade de produtos em cada categoria. Agora precisamos recuperar as categorias onde os produtos custam mais do que uma certa quantia em dinheiro.
Apenas um lembrete de que estamos trabalhando com duas tabelas.
product:
Swipe to start coding
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.
Solução
Obrigado pelo seu feedback!
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
What is the specific amount of money to use as the threshold?
Can you show me how to filter the categories based on product price?
Which data source or table should I use to retrieve the product prices?
Awesome!
Completion rate improved to 4
Obter Categoria pelo Preço do Produto
Deslize para mostrar o menu
Ótimo, obtivemos a quantidade de produtos em cada categoria. Agora precisamos recuperar as categorias onde os produtos custam mais do que uma certa quantia em dinheiro.
Apenas um lembrete de que estamos trabalhando com duas tabelas.
product:
Swipe to start coding
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.
Solução
Obrigado pelo seu feedback!
single