Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A company called Complete Pet Care provides private health-care for domestic pets throughout the UK. Complete Pet Care, which currently has over one hundred surgeries

A company called Complete Pet Care provides private health-care for domestic pets throughout the UK. Complete Pet Care, which currently has over one hundred surgeries and opens a new surgery almost every month, has decided to distribute its operations according to areas of the country (i.e. Scotland, North England, South East England, South West England, Wales and Northern Ireland). The company proposes to distribute staff details to the appropriate areas, however staff payroll details will be processed by the Head Office of Complete Pet Care, which is located in the Scotland. Owner (ownerNo, oName, oAddress, oTelNo) Pet (petNo, petName, petDescription, petSex, petDOB, dateRegistered, ownerNo, surgeryNo) Staff (staffNo, sName, sAddress, sTelNo, sex, DOB, position, NIN, taxCode, salary, surgeryNo) Surgery (surgeryNo, surgeryAddress, surgeryTelNo, surgeryFaxNo, mgrStaffNo, areaNo) Prescription (prescNo, petNo, medNo, prescStaffNo, adminMethod, unitsPerDay, startDate, finishDate) Medication (medNo, medName, description, medCategory, dosage, cost) Area (areaNo, areaName) a. In SQL, a SELECT statement is used to retrieve data from database. Explain the function of each of the clauses in the SELECT statement. b. Write the SQL commands to answer the following: i. List the details of (A) all owners alphabetically by name, (B) all male pets and (C) all prescriptions which end today (use date(now) to retrieve todays date). ii. Using logical operators, list the staff whose salary is between 1500 to 2900, and not a manager. iii. List the medCategory and total number of medication in that category which cost is less than 30. iv. List the surgeryNo, surgeryAddress, surgeryTelNo, surgeryFaxNo, areaName for Scotland. v. Assume the salary of staff with taxCode of 3 and below is increased by 10% and other salary is by 5%. Reflect these changes in the relevant table. vi. List ownerNo, oName, oTelNo, petNo, petName, petDescription and dateRegistered. Arrange the list in descending order of dateRegistered and ownerNo.

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

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

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions