Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with all parts! nswer the following questions. 1. (10 points) Write an SQL statement to find the information of a client named 'Peter

image text in transcribed

image text in transcribed

Need help with all parts!

nswer the following questions. 1. (10 points) Write an SQL statement to find the information of a client named 'Peter Smith'. Show the client's id, name, phone number, and address. 2. (10 points) A video is defined to be a short video if its length is shorter than 2. Write an SQL statement to find all the short videos and show the video code of all such short videos. 3. (10 points) Write an SQL statement to find all the sites that are located on 'University Dr'. Note that an address consists of both the street name and street no. Show the site's code, type, address, and phone number. 4. (10 points) Write an SQL statement to find the administrators who administers at the site with site code 111. Show such administers' id, name, and gender information. 5. (10 points) Write an SQL statement to find the clients who ever purchased packages from the salesman named 'John'. Show such employees' id, the clients' id, name, and phone information. 6. (10 points) Write an SQL statement to find the digital displays that locate at the site with site code 112. Show the digital display's serial numbers. 7. (10 points) Write an SQL statement to find the digital displays that locate at the site with site code 112. Show the distinct schedule systems of such displays. 8. (10 points) Find the information of all the technical supports who specializes in repairing at least one digital display with "Random" scheduler system. You should return the empld and the name for such technical supports. 9. (10 points) Find the videos that are broadcasted at site 111, but not site 112. Show the code and length of such videos. 10. (10 points) Find the salesman who sold packages with the highest commission rate from the purchase. Show the highest commission rate, and the ids and names of such employees. irading criteria: - Please use ONE and ONLY ONE SQL statement to answer each question. (a single SQL statement can have multiple lines.) 1. Video (videoCode: integer, videolength: integer) 2. Model (modelNo: char(10), width: numeric (6,2), height: numeric (6,2), weight: numeric (6,2), depth: numeric (6,2), screenSize: numeric (6,2)) 3. Site (siteCode: integer, type: varchar (16), address: varchar(100), phone: varchar(16)) 4. DigitalDisplay (serialNo: char(10), schedulerSystem: char(10), modelNo: char(10)) Foreign key: modelNo references Model (modelNo) 5. Client (clientld: integer, name: varchar (40), phone: varchar (16), address: varchar (100)) 6. TechnicalSupport (empld: integer, name: varchar (40), gender: char (1)) 7. Administrator (empld: integer, name: varchar (40), gender: char (1)) 8. Salesman (empld: integer, name: varchar (40), gender: char (1)) 9. AirtimePackage (packageld: integer, class: varchar (16), startDate: date, lastDate: date, frequency: integer, videoCode: integer) 10. AdmWorkHours (empld: integer, day: date, hours: numeric (4,2) ) Foreign key: empld references Administrator (empld) 11. Broadcasts (videoCode: integer, siteCode: integer) Foreign key: videoCode references Video (videoCode) Foreign key: siteCode references Site (siteCode) 12. Administers (empld: integer, siteCode: integer) Foreign key: empld references Administrator (empid) Foreign key: siteCode references Site (siteCode) 13. Specializes (empld: integer, modelNo: char(10)) Foreign key: empld references TechnicalSupport (empld) Foreign key: modelNo references Model (modelNo) 14. Purchases (clientld: integer, empld: integer, packageld: integer, commissionRate: numeric (4,2)) Foreign key: clientld references Client (clientld) Foreign key: empld references Salesman (empld) Foreign key: packageld references AintimePackage (packageld) 15. Locates (serialNo: char (10), siteCode: integer) Foreign key: serialNo references DigitalDisplay (serialNo) Foreign key: siteCode references Sitte (siteCode)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago

Question

Is this investment worthwhile? Why or why not?

Answered: 1 week ago