Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

OracleDb sql hw help! SQL Tables In SQL Developer, create the following tables. Table: Movies Column_name Data_type Constraint movie_id number(8) primary key movie_name varchar2(30) not

OracleDb sql hw help!
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
SQL Tables In SQL Developer, create the following tables. Table: Movies Column_name Data_type Constraint movie_id number(8) primary key movie_name varchar2(30) not null movie_budget mumber(10.2) movie_budget > 0 gross_sales number(10,2) gross_sales >= 0 Paste the SQL for creating this table below: Table: People Column_name Data_type Constraint person_id number(8) primary key person_name varchar2(30) not null person_type varchar2(10) only Director' or 'Actor salary number(10,2) salary > 0 Paste the SQL for creating this table below: Table: Movie_People Column_name Data_type movie_id number(8) person_id number(8) Constraint foreign key (movie_id) foreign key (person_id) Paste the SQL for creating this table below: Updating the movie_people table Add a primary key constraint for the movie people table. The primary key is (movie_id, person_id). Paste the SQLs for doing this below: Insert the following data Movies: movie_name movie_budget gross_sales Last Call 75,000 113,000 No Return 450,000 300,000 The House on the Hill 100,000 190,000 Last Call, movie budget: 75,000, gross sales: 113,000 No Return, movie budget: 450,000, gross sales: 300,000 The House on the Hill, movie budget: 100,000, gross sales: 190,000 Paste the SQLs for inserting these into the movies table below (paste all SQLs; not just one SQL!): Directors: Jake William directed TWO movies. Derick Ross only directed one movie. person_name person_type salary movie_name movie_name Jake Williams Director 25,000 Last Call The House on the Hill Derick Ross Director 110,000 No Return Jake Williams, Salary: 25,000. Directed 'Last Call' and 'The House on the Hill Derick Ross, Salary: 110,000. Directed 'No Return Paste the SQLs for inserting these into the people table below (paste all SQLs; not just one SQL!): Paste the SQLs for inserting the movie id and person id for these into the movie people table below (paste all SQLs; not just one SQL!): Actors: person_name person_type salary movie_name movie_name Alice Hall Actor 10,000 Last Call Michael Smith Actor 10,000 Last Call No Return Alex Swift Actor 5,000 Last Call The House on the Hill Sue Williams Actor 5,000 Last Call The House on the Hill Joe Hamilton Actor 55,000 No Return The House on the Hill Mandy Isaacs Actor 32,000 No Return Alice Hall. Salary: 10,000. Appeared in the movie 'Last Call'. Michael Smith. Salary: 10,000. Appeared in the movies 'Last Call' and 'No Return'. Alex Swift. Salary: 5,000. Appeared in the movies 'Last Call' and 'The House on the Hill'. Sue Williams. Salary: 5,000. Appeared in the movies 'Last Call' and 'The House on the Hill'. Joe Hamilton. Salary: 55,000. Appeared in the movies 'No Return' and 'The House on the Hill'. Mandy Isaacs. Salary: 32,000. Appeared in 'No Return'. Paste the SQLs for inserting these into the people table below (paste all SQLs; not just one SQL!): Paste the SQLs for inserting the movie id and person id for these into the movie_people table below (paste all SQLs; not just one SQL!): Queries: Write the queries listed below and paste the SQL below each problem. 1. For all movies, display the movie name and gross sales, order by gross sales high to low. Paste the SQL here: 2. For each movie, get the name of the movie and the name the director. Paste the SQL here: 3. For each movie, get the name of the movie, the total salary of all people involved with that movie, and remaining budget (movie_budget - total salary) Paste the SQL here: 4. Display the name of the most expensive actor. Paste the SQL here: 5. Get a list of unique actor names who worked on movies directed by Johnie Franco. (tip: use the keyword "distinct" for the select https://www.w3schools.com/sql/sql distinct.asp) Paste the SQL here

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions