Ex. 1. Create a query that requests the user input the Starnum and the output in
ID: 3587327 • Letter: E
Question
Ex. 1. Create a query that requests the user input the Starnum and the output includes the Starname, Birthplace, DOB and Sex.
For the Starnum, enter 8 for Jimmy Stewart. Copy screen captures of your SQL code and results below:
Ex. 2. Modify the previous query you just created to request the user to input the Name of a Star. However, since you sometimes don’t know how to spell the star’s name, you will need to use LIKE and wild cards to obtain the results. (Hint: You will need to use multiple wild cards * and the & character with your parameter statement.)
When you run this query, enter Brad to obtain the results.
Ex. 3. Study the relationships between tables carefully. You will need to determine which tables will be used for to create the following query properly. Also, you will use the same field name from multiple tables. Therefore, you should be explicit in your field designations. For example, star.starnum and movstar.starnum both refer to the starnum field in two different tables. This exercise will have two parts.
Part A. Create a query that displays a list movie stars and the movies they stared in. There should be two columns of results. NOTE: You may NOT use an INNER JOIN statement in this exercise (which is the default syntax of design view in Access). You must use a natural join. This is not a parameter query. Copy your code and paste the first few records displayed below:
Part B. Modify your query in Part A to request the user to input a star’s name and then displays a list of movies for that star. Use Liz for your search. Copy and paste your code and results here:
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 CountryNameExplanation / Answer
Ex. 1.
SELECT STARNAME,BIRTHPLACE,STARBORN,SEX FROM STAR WHERE STARNUM = &STARNUM;
Ex. 2.
SELECT STARNAME,BIRTHPLACE,STARBORN,SEX FROM STAR WHERE STARNAME LIKE '%' + '@STARNAME' + '%';
Ex. 3.
Part A.
SELECT STARNAME,MVTITLE FROM STAR NATURAL JOIN MOVSTAR NATURAL JOIN MOVIE ;
Part B.
SELECT STARNAME,MVTITLE FROM STAR NATURAL JOIN MOVSTAR NATURAL JOIN MOVIE WHERE STARNAME = '&STARNAME';
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.