CHIP 490.297: Into to Databases in Healthcare
https://jonathantweedy.com/www/work/CHIP/CHIP490DB…
Using the Patient, Medications, Prescriptions and Temperatures Schema that we arrived at in class, insert some fake data and then write SQLto do the following:
[5%]
Write a SELECT that lists all patients and the COUNT of the prescriptions that they currently have. – use GROUP BY
[5%]
Write a SELECT to find the maximum and minimum temperatures taken for each of your patients. If the patient has no temps in their list, then their name should still come back, but with NULLs in their min and max columns.
In the same select , make the NULL values say “” instead of just ‘NULL’ by using CASE WHEN ELSE syntax in your SELECT statement. You can write this as a separate select, or you can just modify the one above to include it.
[5%]
Write a SELECT that returns the name(s) of the patient(s) with the absolute highest and lowest recorded temperatures. It should be one row with a maxtemp column and a mintemp column, and those columns should contain the name(s) of the patient(s) who had those maximums.
Write a SELECT to find the maximum and minimum temperatures taken for each of your patients. If the patient has no temps in their list, then their name should still come back, but with NULLs in their min and max columns.
Share :
Latest News
Discover your perfect program in our courses.