Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with the following: Write the SQL code to create the table structures for the entities shown in Figure 1. The structures should contain

Please help with the following:

Write the SQL code to create the table structures for the entities shown in Figure 1. The structures should contain the attributes specified in the ERD. Use data types that are appropriate for the data that will need to be stored in each attribute. Enforce primary key and foreign key constraints as indicated by the ERD.The tables in Figure 2 provide a very small portion of the data that will be kept in the database. This data needs to be inserted into the database for testing purposes. Write the appropriate command necessary to place the data in the tables that were created

image text in transcribed

image text in transcribed

Figure 1: DETAILRENTAL PK,FK1 RENT NUM PK,FK2 VID NUM MEMBERSHIP RENTAL PK MEM NUM PK RENT_NUM FH--0 MEM_FNAME MEM LNAME RENT DATE MEM STREET FK1 MEM_NUM MEM CITY MEM STATE MEM ZIP MEM BALANCE DETAIL_FEE DETAIL DUEDATE DETAIL_RETURNDATE DETAIL_DAILYLATEFEE MOVIE PK MOVIE NUM PRICE PK PRICE CODE PRICE_DESCRIPTION PRICE_RENTFEE PRICE_DAILYLATEFEE VIDEO PK VID NUM -H-0 VID INDATE FK1 MOVIE_NUM MOVIE TITLE toos MOVIE YEAR MOVIE COST MOVIE GENRE FK1 PRICE CODE Figure 2: MEM CITY MEM ZIP MEM BALANCE 11 6 MEMBERSHIP MEM MEM NUM FNAME 102 Tami 103 Curt 104 Jamal 105 Iva 106 Miranda 107 Rosario 108 Mattie MEM MEM STREET LNAME Dawson 2632 Takli Circle Knight 4025 Cornell Court Melendez 788 East 145th Avenue Mcclain 6045 Musket Ball Circle Parks 4469 Maxwell Place Elliott 7578 Danner Avenue Guy 4390 Evergreen Street MEM STATE TN KY TN KY TN TN Norene Flatgap Quebeck Summit Germantown Columbia Lily 0 37136 41219 38579 42783 38183 38402 40740 15 0 5 KY 0 MEM NUM 103 RENTAL RENT NUM 1001 1002 1003 1004 1005 RENT DATE 01-MAR-09 01-MAR-09 02-MAR-09 02-MAR-09 02-MAR-09 105 102 110 111 DETAIL FEE DETAIL DAILYLATEFEE 1 1 2 2 DETAILRENTAL RENT VID NUM NUM 1001 34342 1001 61353 1002 59237 1003 54325 1003 61369 1003 61388 1004 44392 1004 34367 1004 34341 1005 34342 1005 44397 3.5 3.5 2 DETAIL DUEDATE 04-MAR-09 04-MAR-09 04-MAR-09 04-MAR-09 - 06-MAR-09 06-MAR-09 05-MAR-09 05-MAR-09 07-MAR-09 07-MAR-09 05-MAR-09 DETAIL RETURNDATE 02-MAR-09 03-MAR-09 04-MAR-09 09-MAR-09 09-MAR-09 09-MAR-09 07-MAR-09 07-MAR-09 07-MAR-09 05-MAR-09 05-MAR-09 3 3 1 0 1 3.5 3.5 3 3 1 2 2 1 3.5 3 VIDEO VID NUM 54321 54324 54325 34341 34342 34366 34367 34368 34369 44392 VID INDATE 18-JUN-08 18-JUN-08 18-JUN-08 22-JAN-07 22-JAN-07 02-MAR-09 02-MAR-09 02-MAR-09 02-MAR-09 21-OCT-08 MOVIE NUM 1234 1234 1234 1235 1235 1236 1236 1236 1236 1237 MOVIE YEAR MOVIE COST MOVIE_GENRE PRICE_CODE 2007 39.95 FAMILY 2 2004 59.95 ACTION 1 MOVIE MOVIE_NUM MOVIE_NAME The Cesar Family 1234 Christmas Smokey Mountain 1235 Wildlife 1236 Richard Goodhope 1237 Beatnik Fever 1238 Constant Companion 1239 Where Hope Dies 1245 Time to Burn 1246 What He Doesn't know 2 2 2008 2007 2008 1998 2005 2006 59.95 29.95 89.95 25.49 45.49 58.29 DRAMA COMEDY DRAMA DRAMA ACTION COMEDY 2 3 1 1 PRICE PRICE CODE 1 1 2 2 3 4 PRICE DESCRIPTION Standard New Release Discount Weekly Special PRICE RENTFEE 2 3.5 1.5 1 PRICE DAILYLATEFEE 1 3 1 .5

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

7. Determine what feedback is provided to employees.

Answered: 1 week ago