Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago