Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SET AUTOCOMMIT ON; under the comment header and execute it Consider the following table specifications: Part A (DDL): 1. Create table the following tables

SET AUTOCOMMIT ON; under the comment header and execute it Consider the following table specifications: Part L5_ACTORS (actorid:int, name: varchar (20), lastname:varchar Column Column Name Data Type Int aid firstName 2. Modify the movies table to create a foreign key constraint that refers to table directors. 3. Modify the

SET AUTOCOMMIT ON; under the comment header and execute it Consider the following table specifications: Part A (DDL): 1. Create table the following tables and their given constraints: L5 MOVIES (movieid:int, title:varchar (35), year:int, director : int, score: decimal (3,2)) PK Not Unique FK Default Validation Null Value Column Column Name mid title Data Type Int varchar(35) release Year Int director Int score decimal(3,2) L5_ACTORS (actorid: int, name: varchar (20), lastname: varchar(30)) Column Column Name DataType Int aid <5 and > 0 firstName varchar(20) lastName Varchar(30) PK Not Unique FK Default Validation Null Value L5_ACTORS (actorid:int, name: varchar (20), lastname: varchar(30) ) Column Column Name Data Type aid Int firstName varchar(20) lastName Varchar(30) PK Not Unique FK Default Validation Null Value L5_CASTINGS (movieid:int, actorid:int) - Column Column PK Not Unique FK Name DataType Null movieid Int actorid int (movies) (actors) Default Validation Valuc L5_DIRECTORS (id:int, name: varchar (20), lastname: varchar (30)) Column Column Name DataType directorid Int PK Not Unique FK Default Validation Null Value firstname varchar(20) lastname varchar(30) 2. Modify the movies table to create a foreign key constraint that refers to table directors. 3. Modify the movies table to create a new constraint so the uniqueness of the movie title is guaranteed. 4. Write insert statements to add the following data to table directors and movies. Director directorid First name Last name 1010 Rob Minkoff Bill Condon Cooley Bird Bell 1020 1050 Josh 2010 Brad 3020 Lake Movies id title 100 The Lion King 200 Beauty and the Beast 300 Toy Story 4 400 Mission Impossible 500 The Secret Life of Pets year director score 2019 3020 2017 1050 3.50 4.20 2019 1020 4.50 2018 2010 5.00 2016 1010 3.90 5. Write SQL statements to remove all above tables. Is the order of tables important when removing? Why?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

1 CREATE TABLE aemployees as SELECT FROM employees 2 TRUNCATE TABLE aemployees 3 INSERT into aemploy... blur-text-image

Get Instant Access with AI-Powered 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

Management Accounting Information for Decision-Making and Strategy Execution

Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young

6th Edition

137024975, 978-0137024971

More Books

Students also viewed these Databases questions