Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Obtener Categoría Por Precio de Producto | Uniendo Tablas
SQL Intermedio

Desliza para mostrar el menú

book
Obtener Categoría Por Precio de Producto

Excelente, hemos obtenido la cantidad de productos en cada categoría. Ahora necesitamos recuperar las categorías donde los productos cuestan más de cierta cantidad de dinero.

Solo un recordatorio de que estamos trabajando con dos tablas.

product:

Tarea

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.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 2
Lamentamos que algo salió mal. ¿Qué pasó?

Pregunte a AI

expand
ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

book
Obtener Categoría Por Precio de Producto

Excelente, hemos obtenido la cantidad de productos en cada categoría. Ahora necesitamos recuperar las categorías donde los productos cuestan más de cierta cantidad de dinero.

Solo un recordatorio de que estamos trabajando con dos tablas.

product:

Tarea

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.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 2
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Lamentamos que algo salió mal. ¿Qué pasó?
some-alt