Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Returning all data from a table
Select some columns
Filtering rows
8. Conditional operators and selecting columns
Logic
Text patterns
To be or NULL to be
A bit of mathematics
Let's practice

Instruction

You've got the hang of it already, haven't you? Let's combine what we know about conditional operators with what we know about selecting specific columns:

SELECT
  Id,
  Age
FROM User
WHERE Age <= 21;

Easy, right? Instead of the asterisk (*), we just name the specific columns we're interested in.

Exercise

Select the brand, model, and production year of all cars that cost 10,000 or less.

Stuck? Here's a hint!

Type:

SELECT
  Brand,
  Model,
  ProductionYear
FROM Car
WHERE Price <= 10000;