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| price | name |
|---|---|
| 12.5 | House Blend |
| 16.9 | Ethiopia Yirgacheffe |
| 14.75 | Colombia Huila |
| 11.95 | Espresso Forte |
| 13.2 | Mild Decaf |
| 10.8 | Morning Filter Grind |
| 4.99 | Lungo Capsules |
| 5.49 | Ristretto 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