Skip to main content
All Problems
medium0% acceptance

Number of Lab Tests per Visit

The lab director wants to know how many tests are ordered per visit on average. Return the visit_id, visit_date, diagnosis, and test_count for each visit that had lab tests. Order by test_count descending, then visit_date.

Schema

🔑idINT
🔗patient_idINT
🔗doctor_idINT
visit_dateTEXT
diagnosisTEXT
notesTEXTNULL
follow_up_dateTEXTNULL
statusTEXT
postgresql

Run your query to see results

Press Ctrl + Enter to execute