Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 5 : QueriesSummary:Write queries on the video store database in Access. There is no rubric for this assignment. Each question isworth 1 2 .

Assignment 5: QueriesSummary:Write queries on the video store database in Access. There is no rubric for this assignment. Each question isworth 12.5 points.SetupDownload the video store database (also available from Content->Resources - CIS125D) for the first part ofthe assignment. Rename the file YLN_a5.accdb, using your last name, e.g., Smith_a5.accdb. Execute Accessand open this file. You will probably find it helpful to look at the ERD for it in Resources CIS 125D.[100%] Queries in AccessWrite the following queries on your video store database, saving each query with the indicated name (Q1, Q2,etc.). Each query is worth 12.5 points. Be sure to write each query exactly as specified and show only thecolumns requested.Q1: Produce a list of all movies in the video store, displaying the title and year (only). Sort by year with thenewest movies first.Q2: Select customer accounts which have a credit card on file and have a deposit amount greater than 10.Display the customer account id and date enrolled (only) and sort by date enrolled. Hint: This query shouldreturn 2 rows of data.Q3: Show a list of employee name (given and family) and hire dates. Sort by family name. Hint: You willneed to join the EMPLOYEE and PERSON tables.Q4: List in alphabetical order the languages that the movie Das Boot is available in. The query result shouldhave only one column named "Das Boot Languages" and three rows giving the names of the 3 languages.The video store ERD will be helpful to figure out what 3 tables are needed, even though you are projectingonly one column. I.e., the result should look like this:Q5: Produce a list of movies that are currently rented out (i.e., the returned date in the MOVIE_RENTALtable is null). Show the movie title, copy number, and customer account id for the rental. Sort by movie titleand then copy number. Hints: You may need to join 4 tables together for this query. This query shouldreturn 6 rows of data.Q6: Write a query that shows what the movie rental fees for all rentals in the database would be if reducedby 18%(e.g., a $6 fee would become $4.92). Use the MOVIE_RENTAL table and display the movie id,CIS125D_A5.docx 20231106 Page 2 of 3transaction id, and the rental fee reduced by 18%. Name this last column "Reduced Rental Fee". Round to 2decimal places using the Round function.Q7: Use aggregates (on the 'Total:' line - use Totals button) to show the minimum, maximum, and averageamount paid in sales tax on a customer transaction. The result should have one row that looks like this(name columns appropriately):Q8: Show a list of movies in the database along with the number of languages associated with each movie.Display the movie title (column name: "Title") and the number of languages (column name: "Number ofLanguages"). Sort by the count descending. Hint: You will need to use an aggregate for this,specifically, Count, and you can count the column LANGUAGE_CODE in the MOVIE_LANGUAGEtable.SubmissionUpload your database file containing Q1 through Q8, YLN_a5.accdb as usual to the assignment folder.Script to copyCREATE TABLE EMPLOYEE (EMP_NUM varchar(3),EMP_LNAME varchar(15),EMP_FNAME varchar(15),EMP_INITIAL varchar(1),EMP_HIREDATE datetime,JOB_CODE varchar(3),EMP_YEARS int);INSERT INTO EMPLOYEE VALUES('101','News','John','G','2000-11-08','502','4');INSERT INTO EMPLOYEE VALUES('102','Senior','David','H','1989-7-12','501','15');INSERT INTO EMPLOYEE VALUES('103','Arbough','June','E','1996-12-01','503','8');INSERT INTO EMPLOYEE VALUES('104','Ramoras','Anne','K','1987-11-05','501','17');INSERT INTO EMPLOYEE VALUES('105','Johnson','Alice','K','1993-02-01','502','12');INSERT INTO EMPLOYEE VALUES('106','Smithfield','William','','2004-06-22','500','0');INSERT INTO EMPLOYEE VALUES('107','Alonzo','Maria','D','1993-10-10','500','11');INSERT INTO EMPLOYEE VALUES('108','Washington','Ralph','B','1991-08-22','501','13');INSERT INTO EMPLOYEE VALUES('109','Smith','Larry','W','1997-07-18','501','7');INSERT INTO EMPLOYEE VALUES('110','Olenko','Gerald','A','1995-12-11','505','9');INSERT INTO EMPLOYEE VALUES('111','Wabash','Geoff','B','1991-04-04','506','14');INSERT INTO EMPLOYEE VALUES('112','Smithson','Darlene','M','1994-10-23','507','10');INSERT INTO EMPLOYEE VALUES('113','Joenbrood','Delbert','K','1996-11-15','508','8');INSERT INTO EMPLOYEE VALUES('114','Jones','Annelise','','1993-08-20','508','11');INSERT INTO EMPLOYEE VALUES('115','Bawangi','Travis','B','1992-01-25','501','13');INSERT INTO EMPLOYEE VALUES('116','Pratt','Gerald','L','1997-03-05','510','8');INSERT INTO EMPLOYEE VALUES('117','Williamson','Angie','H','1996-06-19','509','8');INSERT INTO EMPLOYEE VALUES('118','Frommer','James','J','2005-01-04','510','0');CREATE TABLE JOB (JOB_CODE varchar(3),JOB_DESCRIPTION varchar(25),JOB_CHG_HOUR float(8),JOB_LAST_UPDATE datetime);INSERT INTO JOB VALUES('500','Programmer','35.75','2011-11-20');INSERT INTO JOB VALUES('501','Systems Analyst','96.75','2011-11-20');INSERT INTO JOB VALUES('502','Database Designer','125','2012-03-24');INSERT INTO JOB VALUES('503','Electrical Engineer','84.5','2011-11-20');INSERT INTO JOB VALUES('504','Mechanical Engineer','67.9','2011-11-20');INSERT INTO JOB VALUES('505','Civil Engineer','55.78','2011-11-20');INSERT INTO JOB VALUES('506','Clerical Support','26.87','2011-11-20');CIS125D_A5.docx 20231106 Page 3 of 3INSERT INTO JOB VALUES('507','DSS Analyst','45.95','2011-11-20');INSERT INTO JOB VALUES('508','Applications Designer','48.1','2012-03-24');INSERT INTO JOB VALUES('509','Bio Technician','34.55','2011-11-20');INSERT INTO JOB VALUES('510','General Support','18.36','2011-11-20');

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions