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
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started