Try me

Open In ColabBinder

In these exercises you are going to work with the car_retail.sql database in the folder test_databases. Copy the contents of the file in your test environment and execute it. Then, build queries as instructed in the exercises below and copy your answers in the markdown cells provided.

  1. Write down a select query using a join statement to return, for each employee, the name of the department, and the first and last name of each employee.

-- Insert you answer here
  1. Write down a Select query using a join statement to return, for each department, the name of the department. If the department has any employees, it should return the last name of each employee in different records, in a column named employee_last_name. If the department does not have any employee, then this column should be empty.

-- Insert you answer here
  1. Write down a select query using a join statement to return, for each car, the model of the car, the first name and last name of the customer, and the first name and last name of the employee that sold the car.

-- Insert you answer here
  1. Write down a select query using a join statement to return, for each manager, the first name and last name of the manager, and the first name and last name of the employees that work for the manager.

-- Insert you answer here

In these exercises you are going to work with the book_authors.sql database in the folder test_databases. Copy the contents of the file in the schema panel and click build schema. Then, build queries as instructed in the exercises below:

  1. write down a select query that returns the title of the book and the name of the corresponding author

-- Insert you answer here