Question: May I ask the SQL code as follow? Consider the given relational database moviedb which has the following relation schemas: Movie(title, production year, country, run

May I ask the SQL code as follow? Consider the given relational database moviedb which has the following relation schemas: Movie(title, production year, country, run time, major genre) primary key : ftitle, production yearg Person(id, rst name, last name, year born) primary key : fidg Director(id, title, production year) primary key : ftitle, production yearg foreign keys : [title, production year] Movie[title, production year] [id] Person[id] Writer(id, title, production year, credits) primary key : fid, title, production yearg foreign keys : [title, production year] Movie[title, production year] [id] Person[id] Your task is to answer the following questions using SQL queries. For each question, your answer must be a single SQL query that may contain subqueries, and you must write your answers into the template le myqueries.sql. 1 How many writers were born in 1935? 2 How many movies were produced in 1993, 1992 and 1991? List the production years and the corresponding numbers of movies. 3 How many persons have never directed any movies in this database? List the total number of such persons. 4 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, rst and last names. 5 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). 6 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

1 Expert Approved Answer
Step: 1 Unlock 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!