Module 03 Problems ICA

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Module 3 Problems

The problems use the Customer, Facility, and Location tables of the intercollegiate
athletic database. The Customer table contains clients who initiate event requests. The Facility
table contains available facilities. The Location table contains several locations inside facilities.
The primary keys of the tables are CustNo for Customer, FacNo for Facility, and LocNo for
Location.

Customer
custno
C100
C101
C103
C104
C105

custname
Football
Men's Basketball
Baseball
Women's Softball
High School Football

address
Box 352200
Box 352400
Box 352020
Box 351200
123 AnyStreet

Internal
Y
Y
Y
Y
N

contact
Mary Manager
Sally Supervisor
Bill Baseball
Sue Softball
Coach Bob

phone
6857100
5431700
5431234
5434321
4441234

city
Boulder
Boulder
Boulder
Boulder
Louisville

state
CO
CO
CO
CO
CO

zip
80309
80309
80309
80309
80027

Facility
facno
F100
F101
F102
F103

facname
Football stadium
Basketball arena
Baseball field
Recreation room

Location
locno
L100
L101
L102
L103
L104
L105
L106

facno
F100
F100
F100
F101
F100
F101
F100

locname
Locker room
Plaza
Vehicle gate
Locker room
Ticket Booth
Gate
Pedestrian gate

1. Write a CREATE TABLE statement for the Customer table. Choose data types appropriate
for the DBMS used in your course. All columns are required (not null).
2. Write a CREATE TABLE statement for the Facility table. Choose data types appropriate for
the DBMS used in your course. All columns are required (not null).

9/20/2016

Module 3 Problems

3. Write a CREATE TABLE statement for the Location table. Choose data types appropriate
for the DBMS used in your course. LocName column is required (not null).
4. Identify the foreign key(s) and 1-M relationship(s) among the Customer, Facility, and
Location tables. For each relationship, identify the parent table and the child table.
5. Extend your CREATE TABLE statement from problem (3) with referential integrity
constraints.
1. From examination of the sample data and your common understanding of scheduling and
operation of events, are null values allowed for the foreign key in the Location table? Why or
why not? Extend the CREATE TABLE statement in problem (5) to enforce the null value
restrictions if any.
2. Extend your CREATE TABLE statement for the Facility table (problem 2) with a unique
constraint for FacName. Use an external named constraint clause for the unique constraint.

You might also like