Question: Define a nested table to represent the one-to-many relationship between course and section. To complete this lab, do the following steps: 1) Define an Abstract

Define a nested table to represent the one-to-many relationship between course and section. To complete this lab, do the following steps:

1) Define an Abstract Data Type (ADT) called Section_ADT and include in it the following fields:

Attribute

Data Type

SecID

NUMBER

Semester

VARCHAR(20)

Year

NUMBER

2) Use the CREATE TYPE command to create a nested table called Section_NT as a table of Section_ADT.

3) Create the Course table and include it the following attributes (the underlined attribute refers to the primary key):

Attribute

Data Type

CourseID

VARCHAR(10)

Title

VARCHAR(20)

Sections

Section_NT

Note: Do not forget to name the physical table which will store the data for the nested table Sections.

4) Insert, in the table Courses, the following courses and their sections:

Course Details

Sections Details

CourseID=GEIT1411

Title=Computer Science I

SecID=1 Semester=Spring Year=2017

SecID=2 Semester=Spring Year=2017

CourseID=GEIT1412

Title=Computer Science II

SecID=1 Semester=Summer Year=2017

SecID=2 Semester=Summer Year=2017

CourseID=GEIT2291

Title=Professional Ethics

SecID=1 Semester=Fall Year=2017

SecID=2 Semester=Fall Year=2017

CourseID=GEIT3341

Title=Database I

SecID=1 Semester=Fall Year=2017

SecID=2 Semester=Fall Year=2017

CourseID=ITAP3371

Title=Database II

SecID=1 Semester=Spring Year=2017

SecID=2 Semester=Spring Year=2017

SecID=3 Semester=Spring Year=2017

5) Using the populated Courses table, write a query to display the sections of the course GEIT1411 like this:

SecID Semester Year

==================================

1 Spring 2017

2 Spring 2017

6) Write an update query to update the semester of section 3 of ITAP3371 from Spring to Fall.
7) Finally, write a delete query to delete section 3 of ITAP3371.

Hand in:

1) Definition of the Courses table.
2) The insert commands used to fill the Coursestable.
3) The select query in step 5 and its output.
4) The update query in step 6.
5) The delete query in step 7.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!