Car Shopping
You're buying a used car on a community-based commerce website called "Greg's List".
The cars for sale are in the cars
table.
cars
column_name | type |
---|---|
id | INTEGER |
make | VARCHAR |
model | VARCHAR |
year | INTEGER |
color | VARCHAR |
asking_price_usd | INTEGER |
miles_driven | NUMERIC |
is_paid_off | BOOL |
The asking_price_usd
column is the price of the car in US dollars.
The is_paid_off
column is the first boolean column we've seen.
It is TRUE
if the owner doesn't have loans (a lien) on the car.
You need to find a car for yourself that meets all of these requirements:
- The color is black, gray, silver, or white, because you don't like vibrant colors.
- The make is not Hyundai, because you don't like Hyundai.
- Has a price between $5000 and $7000 to fit in your budget.
- Hasn't been driven more than 125,000 miles.
- Is newer than year 2005, otherwise it's too old.
- Doesn't have a lien, meaning it has already been paid off.
Use a WHERE
clause and your knowledge of conditions and operators to find the cars that satisfy your needs.