/goit-rdb-hw-03

Master's degree. Relational databases: downloading data | DQL commands

goit-rdb-hw-03

  1. Write an SQL command to:
  • Select all columns (using wildcard "*") from the "products" table. task 1.1 result
  • Select only the columns "name" and "phone" from the "shippers" table. Verify its correctness in MySQL Workbench. task 1.1 result
  1. Write an SQL command to find the average, maximum, and minimum value of the "price" column in the "products" table. Verify its correctness in MySQL Workbench. task 2 result

  2. Write an SQL command to select unique values of the columns "category_id" and "price". Order the output by descending "price" values and select only 10 rows. Verify its correctness in MySQL Workbench. task 3 result

  3. Write an SQL command to find the number of products (rows) that have prices within the range from 20 to 100. Verify its correctness in MySQL Workbench. task 4 result

  4. Write an SQL command to find the number of products (rows) and the average price (price) for each supplier (supplier_id). Verify its correctness in MySQL Workbench. task 5 result