Database Programming With SQL 6-3: Inner Versus Outer Joins Practice Activities
Database Programming With SQL 6-3: Inner Versus Outer Joins Practice Activities
Database Programming With SQL 6-3: Inner Versus Outer Joins Practice Activities
Try It / Solve It
1. Return the first name, last name, and department name for all employees including those
employees not assigned to a department.
Ans:
OUTPUT:
First Name Last Name
Steven King
Neena Kochhar
Lex De Haan
2. Return the first name, last name, and department name for all employees including those
departments that do not have an employee assigned to them.
Ans:
OUTPUT:
Jennifer Whalen
Michael Hartstein
Pat Fay
3. Return the first name, last name, and department name for all employees including those
departments that do not have an employee assigned to them and those employees not assigned
to a department.
Ans:
Steven King
Neena Kochhar
Lex De Haan
4. Create a query of the DJs on Demand database to return the first name, last name, event date,
and description of the event the client held. Include all the clients even if they have not had an
event scheduled.
Ans:
OUTPUT:
Serena Jones -
5. Using the Global Fast Foods database, show the shift description and shift assignment date even
if there is no date assigned for each shift description.
Ans:
SELECT f_shifts.description "shift description", f_shift_assignments.shift_assign_date AS "shift
assignment date" FROM f_shifts LEFT OUTER JOIN f_shift_assignments ON f_shifts.code =
f_shift_assignments.code;
OUTPUT:
shift description
6pm to 10pm -