Skip to main content

Exercise: SQL joins

Exercise 1#

  1. Open MySQL Workbench:

    1. Type in the search bar mysql
    2. Then click on MySQL Workbench
  2. Once MySQL opens up:

  3. Click on the Local Instance MySQL80 box

  4. Enter your password:

    1. Password
  5. Once the workbench opens up:

  6. Open a new Tab:

  7. File > New Query Tab or ctrl + t

  8. Paste the SQL Exercise below into the MySQL Editor:

  9. Create a SQL Statement for each comment below

Prompts#

/* joins: select all the computers from the products table:
using the products table and the categories table, return the product name and the category name */
/* joins: find all product names, product prices, and products ratings that have a rating of 5 */
/* joins: find the employee with the most total quantity sold. use the sum() function and group by */
/* joins: find the name of the department, and the name of the category for Appliances and Games */
/* joins: find the product name, total # sold, and total price sold,
for Eagles: Hotel California --You may need to use SUM() */
/* joins: find Product name, reviewer name, rating, and comment on the Visio TV. (only return for the lowest rating!) */
-- ------------------------------------------ Extra - May be difficult
/* Your goal is to write a query that serves as an employee sales report.
This query should return the employeeID, the employee's first and last name, the name of each product, how many of that product they sold */