List the doctor ID, first name, last name, and count of appointments for each doctor. Combine the
Question:
List the doctor ID, first name, last name, and count of appointments for each doctor. Combine the first and last name into one column and use the following column headings: Dr ID, Dr Name, Appt Count. Sort by doctor last name.
List the patient ID, patient first name, patient last name, and total number of appointments for each patient. Sort by appointment count in descending order. Use the following column headings: Patient ID, Patient First Name, Patient Last Name, Appt Count. Hint:use a GROUP BY clause.
For each appointment, list the appt ID, date, patient ID, patient first name, patient last name, doctor ID, doctor last name, and count of reason codes; combine the patient first and last name into one column, and sort by count of reason codes in descending order, then by appt ID in ascending order. Show the date formatted as ‘mm-dd-yyyy.’ Use the following column headings: Appt, Date, Patient ID, Patient Name, Dr ID, Dr Name, Code Count. Hint: use a GROUP BY clause.
List the appt ID, appt date, appt time, and total number of minutes for the appointment(s) with the highest total minutes.Sort by appt ID. Use the following column headings:ApptID, Date, Time, TotalMinutes.Hint:use a GROUP BY clause and a nested SELECT or HAVING.
Cost Management Accounting and Control
ISBN: 978-0324559675
6th Edition
Authors: Don R. Hansen, Maryanne M. Mowen, Liming Guan