Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

May I ask the SQL code as the follow Movie(title, production year, country, run time, major genre) primary key : {title, production year} Person(id, first

May I ask the SQL code as the follow

Movie(title, production year, country, run time, major genre) primary key : {title, production year} Person(id, first name, last name, year born) primary key : {id} Director(id, title, production year) primary key : {title, production year} foreign keys : [title, production year] Movie[title, production year] [id] Person[id] Writer(id, title, production year, credits) primary key : {id, title, production year} foreign keys : [title, production year] Movie[title, production year] [id] Person[id]

1.Who have directed at least two movies that were written by themselves (i.e., a director is one of the writers for the same movie)? Show their ids, first and last names. 2.Assume persons who were born in the same year are the same age and there is only one youngest person (with no ties/draws) in this database, who is/are the second youngest person(s) in the database? List the id(s) of the person(s). 3.A person has worked on a movie if this person is a director, a writer, or both a director and writer of this movie. Who has/have worked on the largest number of distinct movies in this database? List the id(s) of the person(s).

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions