Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
See the whole table
Select some columns
Filtering rows
5. Select only a few rows
Logic
Text patterns
To be or NULL to be
A little bit of mathematics
Let's practice

Instruction

Our table is quite small, so if we wanted to get some information about Volkswagens, we could select all rows and just ignore the extra few which contain other brands. But what if our table consisted of thousands of rows?

SELECT *
FROM user
WHERE id = 100;

Look what happened. We've added WHERE and a condition. The simplest condition looks like the one in our example – we want to retrieve information about a user with a specific ID (100), so we use the appropriate condition: id = 100.

Exercise

Select all columns for those cars which were produced in 1999 (use the production_year column).

Stuck? Here's a hint!

Type:

SELECT *
FROM car
WHERE production_year = 1999;