Learn SQL: SELECT

Picking one column

Mo from the warehouse only needs the names of the products. No prices, no stock, just names. "Can you do that?" Of course you can.

Picking one column

With SELECT * you get all columns. Often you only need one.

Then put the name of that column after SELECT, instead of the star. This query shows only the names of the products.

SELECT name FROM products
Result
name
House Blend
Ethiopia Yirgacheffe
Colombia Huila
Espresso Forte
Mild Decaf
Morning Filter Grind
Lungo Capsules
Ristretto Capsules

Try it yourself

Mo wants to know which category each product is in. Show that column.

Ready for more?

The full lesson has 6 exercises, from easy to challenging, with hints, points and a streak you can build.

Start the lesson