Kotomarket showcase: three categories with IN

Kotomarket showcase: three categories with IN

The Kotomarket catalogue has a single flat table products with columns id, name, category, and price (in rubles). A manager is building a "For cat and owner" showcase and wants to display only products from three categories: корм (food), игрушки (toys), and лежанки (beds). Write a query that returns the columns name, category, and price only for products whose category is in that list of three values. All other categories must be excluded. Hint: it is cleanest to list the categories in a single IN (...) clause rather than chaining three OR conditions. Lesson limits: only SELECT and WHERE. No ORDER BY, no aggregates, JOIN, DISTINCT, CASE, or subqueries. Row order does not matter.

Exemplo de resposta esperada

É assim que se parece uma resposta correta: ela tem seu próprio número de linhas e não precisa coincidir com as tabelas do esquema. Sua resposta precisa retornar os mesmos nomes de colunas do exemplo: use AS para renomeá-las se for preciso.

namecategoryprice
Сухой корм Acana 2кгкорм2890.00
Паучи с курицей 12шткорм640.00
Дразнилка-удочкаигрушки320.00
PostgreSQLv16
Entre para enviar

O resultado da sua consulta aparecerá aqui

Focus radio
Paused · SomaFM · Fluid