Question: a ) ( 9 points ) Find the procedure type, procedure subcode, and price of the most expensive procedure ( s ) . sql b
a points Find the procedure type, procedure subcode, and price of the most expensive procedures sql
b points For each type of procedure, find the number of its subtypes subcodes Requirements:
Report each procedure type and the number of subcodes it has.
The calculated column the number of subcodes per procedure type should be named nrsubcodes.
Order the report in descending order of the number of subcodes per procedure.
c points Report the owner id their first and last name, and number of pets owned by each owner who has at least different see below pets that received pet care services. Requirements:
The calculated column the number of different pets owned by each customer should be named nrofpets.
Order the report in descending order of the number of pets per owner.
For each pet owner, you should count how many different pets they have; if someone used the vet services for a pet more than once, that pet should only be counted once.
d points Report the proceduretype and proceduresubcode of all procedures that have never been used. In the template below, you must use a correlated subquery in the highlighted portion. Hint: The subquery will find, for each procedure row in the outer query, data about the history of usage of that procedure; the subquery can be used in combination with comparison to a scalar or in combination with the NOT EXISTS operator.
SELECT proceduretype, proceduresubcode
FROM proceduredetails D
WHERE correlated subquery
e points Increase by the price of all procedures under $ and by the price of all procedures that cost $ or more. You must use:
a single UPDATE statement,
with the CASE operator.
f points Delete all procedure history records for the pets whose names start with the letter J It is required that you use a subquery to find who are these pets.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
