question

frustratedstudent avatar image
frustratedstudent asked

How do I execute these queries?

I have 5 queries that i need to execute. hopefully someone can help we out. 1. execute a query that retrieves the visit date and patient key for all patients that reported a depression level over 5. 2. execute a query that retrieves the visit date and patient name, and depression level for all patients that reported a depression level over 5. 3.execute a query that retrieves the number of patient visits that occurred in which the patient had a pulse over 45. 4.execute a query that lists the visit date and patient name for each patient visit,sorted by depression level from lowest to highest. 5.execute a query that displays the patient's last name, average pulse and average depression level for each patient. Thank you so much if you can help!
queryhomework
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KenJ avatar image KenJ commented ·
Is this a homework question? Homework questions are welcome, it just helps with the answers if it's known. What have you tried so far? Can you post the queries you have so far?
1 Like 1 ·
frustratedstudent avatar image frustratedstudent commented ·
Yeah its for a final project and I just don't get it. It's just not my forte. I don't really have any queries so far though. Please help! Thank you
0 Likes 0 ·
frustratedstudent avatar image frustratedstudent commented ·
Thank you so much that helped a lot
0 Likes 0 ·

1 Answer

·
KenJ avatar image
KenJ answered
Something in the form of the following will get you a long way: `SELECT column1, column2 FROM table WHERE column3 > value` Add an `ORDER BY column4` at the end when you need it, replace all the 'column1' and the like with your column names, and you've got three of the five queries written. You'll also need to use the COUNT function for the third query and AVG and GROUP BY for the last query.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.