Introduction To RDBMS and SQL
Module 9: Union-Intersect-Minus
Module 9 Activity 6.1 Union/Intersect/Minus
functions against the table
Estimated Completion Time: 45 minutes
Overview
This exercise will require participants to query on the tables in Oracle SQL PLUS using the
SQL language.
Instructions
Querying records in tables should be done in Oracle SQL PLUS.
1. In order to proceed with querying records in the tables, login using your user name
created in Exercise 01 and then proceed to use the SET operators.
Hints
1. Ensure the following while creating the queries on the table:
Execute the query in SQL PLUS.
After each successful command save the command in the file.
IDCGRF002
2009 Accenture. All Rights Reserved.
To save the file - C:\RDBMS\Day3\UnIntMin.sql append.
264257744.doc.doc
Introduction To RDBMS and SQL
Module 9: Union-Intersect-Minus
Union/Intersect and Minus
1) Display the first name and last name of both the instructor and student in one result set.
2) Modify the above query to display duplicate names also.
3) Modify the above query to add a column Name to display text as 'Instructor' or 'Student' in each row.
4) Display the instructor id not having any section.
5) Display the course no having section.
6) Display a list of courses and section having no students enrolled. Add a new column called as status
that displays text as 'No Student Enrolled'.
7) Display all the zip codes that are present in both the instructor and the student tables.
8) Display the student ids who have enrolled.
IDCGRF002
2009 Accenture. All Rights Reserved.
264257744.doc.doc