List the movies which have more than one director

Assignment Help PL-SQL Programming
Reference no: EM131310314

Writing SQL statements.

1. For each movie category, show the number of movies in the database of that category, the total number (sum) of nominations (NOMS) and the average length of that type. Include only those categories for which there are more than 5 movies in the database (i.e. use having). List the output with the greatest number of movies shown first (i.e. the highest count).

2. List the names (first and last) of stars, who are also directors. Include the star's director number in the results. Please note: the director may not have starred in the movie he/she directed, but has been a star in at least one movie and directed as least one movie.

3. List the movies which have more than one director. Include the year, title, last and first name of directors. Sort the output by last name within title. (use subquery)

4. List the movie titles that won both best actor and best actress awards.

5. List the countries (name) where no star was born. (the country name should be listed only once).

6. List the last and first names of all directors who have directed only one movie.

Movies Database

The following is an explanation of the columns in the tables in the Movie Database.

DIRECTOR (DirNum, CntryID, DirBorn, DirDied, Sex, LastName, FirstName)
DirNum - a unique numeric identifier for each director.
CntryID - Code for the country of birth. (Foreign key referencing COUNTRY).
DirBorn -The director's date of birth (mm/dd/yyyy). Some dates are prior to 1900. Null if unknown.
DirDied - date of death if deceased, otherwise null.
Sex - Gender of the director (M or F).
LastName - Director's last name.
FirstName - Director's first name.
MOVIE (MvNum, MvTitle, MvYear, CatID, MPAA, Len, Noms, Awrds, WWGross, USGross,

NonUSGross, CntryID, DirNum, BestDir, BestPic, BestEdit, BestFor, BestWrite)
MvNum - a unique numeric identifier for each movie.
MvTitle - The official title of the movie
MvYear - Usually, the year of release in the U.S. For some foreign movies, the release date in the originating country may have been a year earlier.

CatID - a 3-character code for the category of the movie. This is a foreign key referencing the CATEGORY table which contains an explanation of a code.

MPAA - Designates the U.S. rating of the system: R, PG13, PG, etc. Only movies released since the late 1960's are rated: older ones are coded NR.

Len - An integer representing the movie's length in minutes of running time.
Noms - An integer representing the number of Academy Awards for which the movie was nominated.
Awrds - An integer for the number of Academy Awards actually won.
WWGross - The movie's worldwide gross, in thousands of dollars (as of 12/31/2004).
USGross - The movie's U.S. gross, in thousands of dollars (as of 12/31/2004).
CntryID - A 2- or 3-character code for the country which produced the movie. A foreign key referencing the COUNTRY table.
DirNum - A foreign key referencing the Director table.
BestDir - A W in this column means that the movie won the Oscar for Best Director for the year of release. An N indicates a nomination for the Oscar but it did not win.
BestPic - W for Best Picture Oscar; N for nominee.
BestEdit - W for the Oscar for best editing; N for nominee.
BestFor - W for the Oscar for best foreign movie; N for nominees.
BestWrite - W for best writing; N for nominees.
MOVDIR (MVNUM, DIRNUM)
(MVNUM, DIRNUM) - composite primary key
MVNUM - A foreign key referencing the Movie table
DIRNUM - A foreign key referencing the Director table.
STAR (StarNum, CntryID, StarBorn, StarDied, Sex, DeathCause, FirstName, LastName, BirthCity,

BirthState)

StarNum - A unique numeric identifier for a movie actor.

CntryID - A 2- or 3-character code for the country where the star was born. A foreign key referencing the COUNTRY table.
StarBorn - Date of birth of the star: mm/dd/yyyy. May be null.
StarDied - Date of death if deceased.
Sex - Gender of the star ( M or F).
DeathCause - If the actor is deceased, the cause of death is indicated here.
FirstName - Star's first name.
LastName - Star's last name.
BirthCity - City where the star was born; e.g. New York. If born in Canada, the province is also given: e.g. Montreal, Quebec.
BirthState - State where the star is born.
MOVSTAR ( MvNum, StarNum, BestM, BestF, SupM, SupF)
MvNum - part of the primary key; also a foreign key referencing MOVIE.
StarNum - part of the primary key; also a foreign key referencing STAR.
BestM - A W in this column indicates an Oscar for Best Male Actor for this star. N indicates a nomination for this award.
BestF - W for the Oscar for Best Female Actress; N for the nomination
SupM - W for the Oscar for Best Supporting Male Actor; N for nominees.
SupF - W for the Oscar for Best Supporting Female Actress; N for nominees.
CATEGORY ( CatId, CategoryDesc)
Catid - A 3-character code for the category of the movie.
CategoryDesc - description for the category code.
COUNTRY (CntryID, CountryName)
CntryID - A 2-or 3-characert code for the country.
CountryName - the name of the country.

Reference no: EM131310314

Questions Cloud

Determine the expected time to meet this probability : The system administrators want to expire passwords once they have a probability of 0.10 of having been guessed. Determine the expected time to meet this probability under each of the following conditions.
Explain how logistics performance is crucial to jit : Why would a companys costs of manufacturing and procurement tend to increase as the firm changes from an MTP to an MTO strategy?
Critique the components of your talent management strategy : Evaluate the effectiveness of the roles that the strategic leaders played in the formation of the performance management strategy.Develop a five (5) point criteria for evaluating the effectiveness of the talent management strategy and how the dat..
Compare and contrast economic market and relevancy value : Explain the folIowing statement: "The methodology is systems analysis and the theoretical framework is the systems concept."
List the movies which have more than one director : List the movies which have more than one director. Include the year, title, last and first name of directors. Sort the output by last name within title. (use subquery)
What is the meaning of the phrase cradle to cradle logistics : What is the meaning of the phrase cradle-to-cradle logistics? Discuss the operational differences of original versus reverse logistics.
What creates power in context of supply chain collaboration : What creates power in the context of supply chain collaboration? Why do many observers feel power is shifting forward or closer to end consumers in many supply chain arrangements?
Discuss about the risk management perspective : Discuss about the risk management perspective.Policy and procedures act as guidelines for hospitals; they give the people proper relationship with the hospital since they see that they can be reliable and that they are well organized.
Problem regarding the database controls : Based on your research conducted earlier in this unit, identify the types of controls that are available to mitigate some of the vulnerabilities, threats, and risks you identified in the Unit 5 discussion.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd