Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Ex. 4. Create query that requests input of a star’s ID number , then displays th

ID: 3587331 • Letter: E

Question

Ex. 4.    Create query that requests input of a star’s ID number, then displays the star name and the number of movies the star has starred in. Alias starname as Big_Star. The output should be two columns: Big_Star and Count_Of_Movies. You will need two tables to complete this and use the COUNT function. Be sure to join the two tables using the equi-join technique.   (Hint: count the mvnum’s).

Use starnum 99 to obtain your results. Show your results below:

Ex. 5.   Write an SQL Parameter Query that will request input of a country_id, and will display a count of movies made in that country, along with the country name. Two columns should be shown. Display the country name in the first column.

For this assignment submission, use France as the chosen country (id=FRN).

Ex. 6.   Write an SQL Parameter Query that will request input of a Director_ID, and will display the names of all Stars who have been directed by the requested DirectorID, as well as a column with the total number of movies directed. You will need 3 tables for this. Two columns to output: Starname and Count_of_Director.

For this assignment submission use Clint Eastwood as the chosen Director (id=8).

MOVIE MVNUM MVTITLE MVYEAR CATEGORY MPAA LEN NOMS AWRDS WWGROSS USGROSS CNTRYID DIRNUM Studio ID Awards Award_ID Award Name MOVSTAR MVNUM CATEGORY STARNUM studio 1CATID studio_id BESTM BESTF SUPM SUPF DIRECTOR CategoryDesc name Location Country DIRNUM DIRNAME CNTRYID DIRBORN DIRDIED SEX STAR COUNTRY 1STARNUM Field1 1CNTRYID STARNAME BIRTHPLACE CNTRYID STARBORN STARDIED SEX DEATHCAUSE Tbl List of Causes of Death Cause of Death CountryName

Explanation / Answer

Below are the requested SQL Parameter queries which satisfies your conditions.

4. select STARNAME as Big_Star ,count(MVNUM) as Count_Of_Movies from STAR s EQUI JOIN MOVSTAR m on s.STARNUM=m.STARNUM and s.STARNUM=&STARNUM;

5. select count(MVNUM) as Movies_count,CNTRYID from MOVIE where CNTRYID=&CNTRYID group by CNTRYID;

6. select s.STARNAME,count(m.MVNUM) as Count_of_Director from MOVIE m,MOVSTR ms,STAR s where s.STARNUM=ms.STARNUM and ms.MVNUM=m.MVNUM and m.DIRNUM=&DIRNUM group by s.STARNAME;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote