Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Eastwood has had played several iconic characters throughout his acting career. Write a subquery that returns the character name, total number of appearances in film,

Eastwood has had played several iconic characters throughout his acting career. Write a subquery that returns the character name, total number of appearances in film, total minutes on film, year of first appearance, and year of last appearance for each character that he has played more than once. In addition, return the average IMDB score, average number of votes, and average profit for the movies that character appears in. Make sure to rename calculated fields that appear in the results.

CREATE TABLE MOVIE ( MovieID VARCHAR2(10) NOT NULL, Title VARCHAR2(50) NOT NULL, ReleaseYear NUMBER(4,0), Runtime NUMBER(3,0), Score NUMBER(3,1), Votes NUMBER(7,0), Studio VARCHAR2(25) NOT NULL, Budget NUMBER(10,0), BoxOffice NUMBER(10,0), CONSTRAINT MOVIE_PK PRIMARY KEY (MovieID));

CREATE TABLE PERSON ( PersonID VARCHAR2(10) NOT NULL, PersonFirst VARCHAR2(25) NOT NULL, PersonMiddle VARCHAR2(25), PersonLast VARCHAR2(25) NOT NULL, BirthYear NUMBER(4,0), DeathYear NUMBER(4,0), CONSTRAINT PERSON_PK PRIMARY KEY (PersonID));

CREATE TABLE GENRE ( MovieID VARCHAR2(10) NOT NULL, Genre VARCHAR2(25) NOT NULL, CONSTRAINT MOVIE_GENRE_PK PRIMARY KEY (MovieID, Genre), CONSTRAINT MOVIE_GENRE_FK1 FOREIGN KEY (MovieID) REFERENCES MOVIE (MovieID));

CREATE TABLE PRINCIPAL ( MovieID VARCHAR2(10) NOT NULL, PersonID VARCHAR2(10) NOT NULL, Role VARCHAR2(25) NOT NULL, CharacterName VARCHAR(50), CONSTRAINT PRINCIPAL_PK PRIMARY KEY (MovieID, PersonID, Role), CONSTRAINT PRINCIPAL_FK1 FOREIGN KEY (MovieID) REFERENCES MOVIE (MovieID), CONSTRAINT PRINCIPAL_FK2 FOREIGN KEY (PersonID) REFERENCES PERSON (PersonID));

CREATE TABLE AWARD ( MovieID VARCHAR2(10) NOT NULL, PersonID VARCHAR2(10) NOT NULL, Role VARCHAR2(25) NOT NULL, Award VARCHAR2(50) NOT NULL, Won NUMBER(1,0) NOT NULL, CONSTRAINT AWARD_PK PRIMARY KEY (MovieID, PersonID, Role, Award), CONSTRAINT AWARD_FK1 FOREIGN KEY (MovieID) REFERENCES MOVIE (MovieID), CONSTRAINT AWARD_FK2 FOREIGN KEY (PersonID) REFERENCES PERSON (PersonID), CONSTRAINT AWARD_FK3 FOREIGN KEY (MovieID, PersonID, Role) REFERENCES PRINCIPAL (MovieID, PersonID, Role));

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

Question Can plan participants borrow from a VEBA?

Answered: 1 week ago

Question

Question What is an educational benefit trust and how is it used?

Answered: 1 week ago

Question

Question How are VEBA assets allocated when a plan terminates?

Answered: 1 week ago