Database Tutorial

Course Tutorial Site

Site Admin

Description

without comments

Lab #5: SQL Joins

Learn how to write SELECT statements that join two tables and three tables with inner and outer joins.

Lab Description

The lab requires you SELECT statements or queries that use joins between two and three tables. You will create an apply_oracle_lab5.sql script in the following direction.

/home/student/Data/cit225/oracle/lab5

The lab has five major parts, which you find after clicking on the Lab Instructions link. The steps are:

  • Step 1: Write INNER JOIN queries that use the USING subclause and return the results designated by each step.
  • Step 2: Write INNER JOIN queries that use the ON subclause and return the results designated by each step.
  • Step 3: Write INNER JOIN queries that use the ON subclause to perform a self-join on the SYSTEM_USER table. The solution requires that you create three copies of the SYSTEM_USER table by using aliases like su1, su2, and su3.
  • Step 4: Display the RENTAL_ID column from the RENTAL table, the RENTAL_ID and ITEM_ID from the RENTAL_ITEM table, and ITEM_ID column from the ITEM table. You should make a join from the RENTAL table to the RENTAL_ITEM table, and then the ITEM table. Join the tables based on their respective primary and foreign key values.
  • Step 5: Display the DEPARTMENT_NAME from the DEPARTMENT table and the average in whole dollars of the SALARY column from the SALARY table grouped by and ordered by the DEPARTMENT_NAME column for the last two months.

Written by michaelmclaughlin

August 13th, 2018 at 11:18 am

Posted in