SlideShare a Scribd company logo
1 of 2
Download to read offline
please help and include explanations for a better understanding thanks.
CREATE DATABASE starwars;
c starwars
CREATE TABLE AgeGroups (
seq INT PRIMARY KEY,
description VARCHAR(15) NOT NULL
);
CREATE TABLE EducationLevels (
seq INT PRIMARY KEY,
description VARCHAR(35) NOT NULL
);
CREATE TABLE IncomeLevels (
seq INT PRIMARY KEY,
description VARCHAR(20) NOT NULL
);
CREATE TABLE Fans (
id INT PRIMARY KEY,
age INT NOT NULL,
FOREIGN KEY (age) REFERENCES AgeGroups (seq),
education INT NOT NULL,
FOREIGN KEY (education) REFERENCES EducationLevels (seq),
income INT NOT NULL,
FOREIGN KEY (income) REFERENCES IncomeLevels (seq)
);
CREATE TABLE Characters (
id INT PRIMARY KEY,
name VARCHAR(20) NOT NULL
);
CREATE TABLE CharacterRatings (
fan INT NOT NULL,
FOREIGN KEY (fan) REFERENCES Fans (id),
character INT NOT NULL,
FOREIGN KEY (character) REFERENCES Characters (id),
PRIMARY KEY (fan, character),
rating INT NOT NULL
);
CREATE TABLE Films (
id INT PRIMARY KEY,
title VARCHAR(45) NOT NULL
);
CREATE TABLE FilmRatings (
fan INT NOT NULL,
FOREIGN KEY (fan) REFERENCES Fans (id),
film INT NOT NULL,
FOREIGN KEY (film) REFERENCES Films (id),
PRIMARY KEY (fan, film),
rating INT NOT NULL
);
h) the top rated star wars film by the fans
j) the top rated film by fans with income '$150,000+'
k) the number of ratings AND the average rating received by "Princess Leia", rounded to 2
decimals
l) the average rating of "Star Wars: Episode V The Empire Strikes Back", rounded to 2 decimals
m) the name of the character that received the least number of ratings
n) the favorite character according the yongest fan audience
o) the income levels (descriptions) that has at least 100 fans, ordered by income sequential
number

More Related Content

More from amarrex323

Please look at the customer-introduced variable and service designed.pdf
Please look at the customer-introduced variable and service designed.pdfPlease look at the customer-introduced variable and service designed.pdf
Please look at the customer-introduced variable and service designed.pdf
amarrex323
 
Please I want an exact and correct answerQuality Management Modu.pdf
Please I want an exact and correct answerQuality Management Modu.pdfPlease I want an exact and correct answerQuality Management Modu.pdf
Please I want an exact and correct answerQuality Management Modu.pdf
amarrex323
 
Please help with this question.Please help with this question. O.pdf
Please help with this question.Please help with this question. O.pdfPlease help with this question.Please help with this question. O.pdf
Please help with this question.Please help with this question. O.pdf
amarrex323
 
please help implement the following in C. below are instructions and.pdf
please help implement the following in C. below are instructions and.pdfplease help implement the following in C. below are instructions and.pdf
please help implement the following in C. below are instructions and.pdf
amarrex323
 
Please help me get this Mind - tap homework to validateProgramming.pdf
Please help me get this Mind - tap homework to validateProgramming.pdfPlease help me get this Mind - tap homework to validateProgramming.pdf
Please help me get this Mind - tap homework to validateProgramming.pdf
amarrex323
 

More from amarrex323 (14)

please match each of these terms with the best description each o.pdf
please match each of these terms with the best description  each o.pdfplease match each of these terms with the best description  each o.pdf
please match each of these terms with the best description each o.pdf
 
Please look at the customer-introduced variable and service designed.pdf
Please look at the customer-introduced variable and service designed.pdfPlease look at the customer-introduced variable and service designed.pdf
Please look at the customer-introduced variable and service designed.pdf
 
Please I want an exact and correct answerQuality Management Modu.pdf
Please I want an exact and correct answerQuality Management Modu.pdfPlease I want an exact and correct answerQuality Management Modu.pdf
Please I want an exact and correct answerQuality Management Modu.pdf
 
please i need help to write paper and which should be 5-8 pages i.pdf
please i need help to write paper  and which should be 5-8 pages i.pdfplease i need help to write paper  and which should be 5-8 pages i.pdf
please i need help to write paper and which should be 5-8 pages i.pdf
 
please helpWrite the vhdl code of a delay flip flop with the .pdf
please helpWrite the vhdl code of  a delay flip flop with the .pdfplease helpWrite the vhdl code of  a delay flip flop with the .pdf
please helpWrite the vhdl code of a delay flip flop with the .pdf
 
Please Help!5.list of all sentences along with criminals informati.pdf
Please Help!5.list of all sentences along with criminals informati.pdfPlease Help!5.list of all sentences along with criminals informati.pdf
Please Help!5.list of all sentences along with criminals informati.pdf
 
please help asap!!! Alternation of generationsThe paragraph below.pdf
please help asap!!! Alternation of generationsThe paragraph below.pdfplease help asap!!! Alternation of generationsThe paragraph below.pdf
please help asap!!! Alternation of generationsThe paragraph below.pdf
 
Please help with this question.Please help with this question. O.pdf
Please help with this question.Please help with this question. O.pdfPlease help with this question.Please help with this question. O.pdf
Please help with this question.Please help with this question. O.pdf
 
please help implement the following in C. below are instructions and.pdf
please help implement the following in C. below are instructions and.pdfplease help implement the following in C. below are instructions and.pdf
please help implement the following in C. below are instructions and.pdf
 
Please help me with this. Thank you. .pdf
Please help me with this. Thank you.                            .pdfPlease help me with this. Thank you.                            .pdf
Please help me with this. Thank you. .pdf
 
Please help with ALL parts of the question. I will upvote if correct.pdf
Please help with ALL parts of the question. I will upvote if correct.pdfPlease help with ALL parts of the question. I will upvote if correct.pdf
Please help with ALL parts of the question. I will upvote if correct.pdf
 
Please help me understand these problems! 7. [LO2] Write the command.pdf
Please help me understand these problems! 7. [LO2] Write the command.pdfPlease help me understand these problems! 7. [LO2] Write the command.pdf
Please help me understand these problems! 7. [LO2] Write the command.pdf
 
Please help me get this Mind - tap homework to validateProgramming.pdf
Please help me get this Mind - tap homework to validateProgramming.pdfPlease help me get this Mind - tap homework to validateProgramming.pdf
Please help me get this Mind - tap homework to validateProgramming.pdf
 
please help 4. Methods of increasibg freshwater supplies Muman pop.pdf
please help 4. Methods of increasibg freshwater supplies Muman pop.pdfplease help 4. Methods of increasibg freshwater supplies Muman pop.pdf
please help 4. Methods of increasibg freshwater supplies Muman pop.pdf
 

Recently uploaded

Recently uploaded (20)

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 

please help and include explanations for a better understanding than.pdf

  • 1. please help and include explanations for a better understanding thanks. CREATE DATABASE starwars; c starwars CREATE TABLE AgeGroups ( seq INT PRIMARY KEY, description VARCHAR(15) NOT NULL ); CREATE TABLE EducationLevels ( seq INT PRIMARY KEY, description VARCHAR(35) NOT NULL ); CREATE TABLE IncomeLevels ( seq INT PRIMARY KEY, description VARCHAR(20) NOT NULL ); CREATE TABLE Fans ( id INT PRIMARY KEY, age INT NOT NULL, FOREIGN KEY (age) REFERENCES AgeGroups (seq), education INT NOT NULL, FOREIGN KEY (education) REFERENCES EducationLevels (seq), income INT NOT NULL, FOREIGN KEY (income) REFERENCES IncomeLevels (seq) ); CREATE TABLE Characters ( id INT PRIMARY KEY, name VARCHAR(20) NOT NULL ); CREATE TABLE CharacterRatings ( fan INT NOT NULL, FOREIGN KEY (fan) REFERENCES Fans (id), character INT NOT NULL, FOREIGN KEY (character) REFERENCES Characters (id), PRIMARY KEY (fan, character), rating INT NOT NULL
  • 2. ); CREATE TABLE Films ( id INT PRIMARY KEY, title VARCHAR(45) NOT NULL ); CREATE TABLE FilmRatings ( fan INT NOT NULL, FOREIGN KEY (fan) REFERENCES Fans (id), film INT NOT NULL, FOREIGN KEY (film) REFERENCES Films (id), PRIMARY KEY (fan, film), rating INT NOT NULL ); h) the top rated star wars film by the fans j) the top rated film by fans with income '$150,000+' k) the number of ratings AND the average rating received by "Princess Leia", rounded to 2 decimals l) the average rating of "Star Wars: Episode V The Empire Strikes Back", rounded to 2 decimals m) the name of the character that received the least number of ratings n) the favorite character according the yongest fan audience o) the income levels (descriptions) that has at least 100 fans, ordered by income sequential number