Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Get Category By Product Price | Joining Tables
Intermediate SQL
course content

Contenuti del Corso

Intermediate SQL

Intermediate SQL

1. Grouping
2. Nested Subqueries
3. Joining Tables
4. DDL and DML in SQL

book
Challenge: Get Category By Product Price

We have obtained the quantity of products in each category. Now, the company tasked us to retrieve the categories where the products cost more than a certain amount of money, so they can put a discount on them.

Compito

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.name column from the category table.
  • Use DISTINCT to get only unique values.
  • Join the product table using a JOIN statement.
  • The common column for both tables is category.id = product.category_id.
  • Use a WHERE clause with the condition price > 450.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 2
toggle bottom row

book
Challenge: Get Category By Product Price

We have obtained the quantity of products in each category. Now, the company tasked us to retrieve the categories where the products cost more than a certain amount of money, so they can put a discount on them.

Compito

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.name column from the category table.
  • Use DISTINCT to get only unique values.
  • Join the product table using a JOIN statement.
  • The common column for both tables is category.id = product.category_id.
  • Use a WHERE clause with the condition price > 450.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 2
Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Siamo spiacenti che qualcosa sia andato storto. Cosa è successo?
some-alt