Question
Problem 1. Please create the following tables for UMBC bookstores textbook management system with appropriate primary keys & foreign keys. [50 points] Assumptions: Each teacher
Problem 1. Please create the following tables for UMBC bookstores textbook management system with appropriate primary keys & foreign keys. [50 points]
Assumptions:
- Each teacher can teach one or more scheduled course sections. Each scheduled course section is taught by one teacher.
- Each course is scheduled in different year, semester and may have multiple sections.
- Each course belongs to a program. Each program has multiple courses.
- Each scheduled course section has one or more textbooks.
- Each text book has one or more authors, each author can write one or more textbooks.
The list of tables is:
Program table:
pid, --- program id
pname, --- program name
ptype --- program type (1: undergraduate, 2: graduate)
Teacher table:
tid, --- teacher id
tname --- teacher name
Author table:
aid, --- author id
aname --- author name
Textbook table:
tbid, --- text book id
title, ---- title of book
publisher, --- publisher name
edition, --- edition, e.g., 3 means 3rd edition
quantity, --- number of copies in store
price --- price of the book
Course table:
cid, --- course id
cname, --- course name
pid --- program id
Schedule table: (scheduled course sections)
sid, --- schedule id, unique for each scheduled class section
cid, --- class id
snumber, --- section number, e.g., 2 means section 2 of the class
semester, --- spring, fall, summer, winter,
year, --- year of the class
tid, --- teach id who teaches this section
num_registered --- number of registered students for this class section
Textbook_author table:
aid, --- author id
tbid --- text book id
Textbook_schedule table:
sid, --- schedule id
tbid --- text book id
Problem 2. Insert at least three rows of data to each table. Make sure you satisfy the primary key and foreign key constraints. [50 points]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started