The initial archive with database dataset data in CSV format is located here.
The list of tasks:
- Write an SQL command to:
- Select all columns (using the wildcard '
*
') from theproducts
table; - Select only the
name
andphone
columns from theshippers
table, and check its execution in MySQL Workbench.
- Select all columns (using the wildcard '
- Write an SQL command to find the average, maximum, and minimum values of the
price
column in theproducts
table, and check its execution in MySQL Workbench. - Write an SQL command to select unique values of the
category_id
andprice
columns from theproducts
table. Order the output by theprice
in descending order and select only 10 rows. Check the correctness of the command in MySQL Workbench. - Write an SQL command to find the number of products (rows) that are within the price range of 20 to 100, and check its execution in MySQL Workbench.
- Write an SQL command to find the number of products (rows) and the average price (
price
) for each supplier (supplier_id
), and check its execution in MySQL Workbench.
Solutions are represented in homework folder:
-
Part 1:
Part 1.1: SQL | MySQL Workbench screenshot.
Part 1.2: SQL | MySQL Workbench screenshot.
-
Part 2: SQL | MySQL Workbench screenshot.
-
Part 3: SQL | MySQL Workbench screenshot.
-
Part 4: SQL | MySQL Workbench screenshot.
-
Part 5: SQL | MySQL Workbench screenshot.