D205 - Data Acquisition Questions and Answers
SELECT product_id, model
Return the product_id column
followed by the model
FROM products;
column in the products table
SELECT
Show the model names from
model
the products table with the
model year of 2014
FROM
products
WHERE year=2014;
SELECT
Show the model names from
model
the products table with the
model year of 2014 and also
FROM
have a manufacturer's
suggested retail (MSRP) of
products
less than $1,000.
WHERE
year=2014
AND msrp<=1000;
SELECT
Select the model names from model
the products table with the
model year of 2014 or had a FROM
product type (product_type) of
automobile products
WHERE
year=2014
OR product_type='automobile';
SELECT *
, FROM
Select the model names from
the products table with products
models in the years between
2014 and 2016, as well as any WHERE
products that are scooters (in
the product_type column) year>2014
AND year<2016
OR product_type = 'scooter';
, SELECT
model
Select the model names from
the products table in the year FROM
2014, 2016, or 2019 using the
OR statement products
WHERE year =
2014
OR year = 2016
OR year = 2019;
SELECT
Select the model names from
the products table in the year model
2014, 2016, or 2019 using the
IN statement FROM
products
WHERE year IN (2014, 2016, 2019);
SELECT
Select the model names from
the products table that were model
NOT in a years 2014, 2016,
and 2019 FROM
products
WHERE year NOT IN (2014, 2016, 2019);
SELECT
Show all of the model names
from the products table listed
model
by the date when they were
first produced
FROM
(production_start_date), from
earliest to latest.
products
ORDER BY production_start_date;
SELECT
Show all of the model names
SELECT product_id, model
Return the product_id column
followed by the model
FROM products;
column in the products table
SELECT
Show the model names from
model
the products table with the
model year of 2014
FROM
products
WHERE year=2014;
SELECT
Show the model names from
model
the products table with the
model year of 2014 and also
FROM
have a manufacturer's
suggested retail (MSRP) of
products
less than $1,000.
WHERE
year=2014
AND msrp<=1000;
SELECT
Select the model names from model
the products table with the
model year of 2014 or had a FROM
product type (product_type) of
automobile products
WHERE
year=2014
OR product_type='automobile';
SELECT *
, FROM
Select the model names from
the products table with products
models in the years between
2014 and 2016, as well as any WHERE
products that are scooters (in
the product_type column) year>2014
AND year<2016
OR product_type = 'scooter';
, SELECT
model
Select the model names from
the products table in the year FROM
2014, 2016, or 2019 using the
OR statement products
WHERE year =
2014
OR year = 2016
OR year = 2019;
SELECT
Select the model names from
the products table in the year model
2014, 2016, or 2019 using the
IN statement FROM
products
WHERE year IN (2014, 2016, 2019);
SELECT
Select the model names from
the products table that were model
NOT in a years 2014, 2016,
and 2019 FROM
products
WHERE year NOT IN (2014, 2016, 2019);
SELECT
Show all of the model names
from the products table listed
model
by the date when they were
first produced
FROM
(production_start_date), from
earliest to latest.
products
ORDER BY production_start_date;
SELECT
Show all of the model names