Computer scienceFundamentalsSQL and DatabasesBasics SQLFunctions and operations

Conditional functions

Product catalog

Report a typo

Write a query that will select from the table products

product price
Milk 5
Meat 11
Tomato 10
Candy 3
Onion 1

product and product_category defined as follows:

  • if the price is bigger than 10, product_category should be 'expensive'
  • if the price is less than 3, product_category should be 'cheap'
  • by default, product_category should be 'average'.
Write an SQL statement





___

Create a free account to access the full topic