Description
Lab #5: SQL Joins
Learn how to write SELECT
statements that join two tables and three tables with inner and outer joins.
- Lab
- Description
- Help Section
- Instructions
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 theUSING
subclause and return the results designated by each step. - Step 2: Write
INNER JOIN
queries that use theON
subclause and return the results designated by each step. - Step 3: Write
INNER JOIN
queries that use theON
subclause to perform a self-join on theSYSTEM_USER
table. The solution requires that you create three copies of theSYSTEM_USER
table by using aliases likesu1
,su2
, andsu3
. - Step 4: Display the
RENTAL_ID
column from theRENTAL
table, theRENTAL_ID
andITEM_ID
from theRENTAL_ITEM
table, andITEM_ID
column from theITEM
table. You should make a join from theRENTAL
table to theRENTAL_ITEM
table, and then theITEM
table. Join the tables based on their respective primary and foreign key values. - Step 5: Display the
DEPARTMENT_NAME
from theDEPARTMENT
table and the average in whole dollars of theSALARY
column from theSALARY
table grouped by and ordered by theDEPARTMENT_NAME
column for the last two months.