Learn SQL: Picking columns

Several columns

Lien from marketing is planning a tasting in every city and wants to know who lives where. One column is no longer enough.

Several columns

Want to see more than one column? Put them all after SELECT, separated by a comma.

The order in which you name them is the order in the result. Here the price comes first.

SELECT price, name FROM products
Result
pricename
12.5House Blend
16.9Ethiopia Yirgacheffe
14.75Colombia Huila
11.95Espresso Forte
13.2Mild Decaf
10.8Morning Filter Grind
4.99Lungo Capsules
5.49Ristretto Capsules

Try it yourself

Lien wants the name and the email address of each customer.

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