Question: Write SQL DDL to create the five relations shown below using Oracle. Primary keys are underlined. You need to define primary keys for all

Write SQL DDL to create the five relations shown below using Oracle. Primary keys are underlined. You need to

Write SQL DDL to create the five relations shown below using Oracle. Primary keys are underlined. You need to define primary keys for all tables. Data types are indicated in parentheses next to the attributes Other constraints are specified next to the attributes. 1. publisher publisher_id (5 digital number) city (20 characters) 2. book . capital (15-digit number) Not NULL book ID (5 digit number) title (25 characters) Not NULL language (15 characters) genre (10 characters) Not NULL; The value should only be one of the follow: Adventure, Fantasy, Horror, Science Fiction. rank (10-digitl number); has digital_version (1 character); The default value is N. Another possible value is Y. publisher_id references publisher_id in Publisher table ON DELETE SET NULL 3. library . library_name (15 characters) capacity (8-digit number); The default value is 1000. contact number (10 characters) Not NULL contact_email (50 characters) closing date (10 characters): The value could only be Monday, Tuesday, and Wednesday. 4. author author_id (4 characters) name (20 characters): Not NULL & Unique birthday (DATE): Not NULL default is 1990/1/1 experience (3-digit number): The value should be less than 100. 5. collect library name references library_name in Library table ON DELETE SET NULL book id references book id in Book table ON DELETE CASCADE cost (10-digit number): Not NULL 6. writtenby book ID references book_id in Book table ON DELETE CASCADE author ID references author_id in Author table work hour (6-digit number): Not NULL default is 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly Here is the SQL Data Definition Language DDL for creating the five relations using Oracle ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!