Suppose that you need to create two-table database to record information for a D
ID: 3818661 • Letter: S
Question
Suppose that you need to create two-table database to record information for a DVD rental kiosk. The following information needs to be recorded.
For all movies: Movie number, title, category, rental rate, and whether or not it is available for rent; for all rented movies, the customer who rented the movie and the due date will also need to be recorded.
For all customers: Customer number, name, address, city, state, ZIP code, and phone number.
Create a preliminary design (use Figure 12-14 in the book for reference if needed) for a possible two-table database for this scenario (Movie table and Customer table), locating the fields in the most appropriate tables and having a minimum of redundancy.
Explanation / Answer
Create table movies{
Movie_number int NOT NULL,
title varchar2(50),
category varchar2(25),
rental_date DATE,
availability varchar2(1),
Customer_number int NOT NULL,
Due_Date DATE,
PRIMARY KEY(Movie_number_number),
PRIMARY KEY(Customer_number) REFERENCES Customers(Customer_number)
);
Create table Customers{
Customer_number int NOT NULL,
name varchar2(50),
address varchar2(25),
city VARCHAR2(50),
state VARCHAR2(50),
ZIP_code NUMBER,
phone_number NUMBER,
Due_Date DATE,
PRIMARY KEY(Customer_number)
);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.