Problem Statement: Hospital Records Analysis for Public Health Programme
As part of a public health initiative, you have been tasked with analyzing hospital records to track the progress of common illnesses. The data is stored across three tables: patients, symptom, and visit. The patients table contains information about each patient, including their age and city of residence. The symptom table records the symptoms reported by patients during their visits, while the visit table documents each patient's visit to the hospital, including the diagnosis made during each visit.
Your objective is to extract meaningful insights from this data to inform the development of a public health program. To accomplish this, you need to write SQL queries to address various analytical questions:
1.Retrieve all patients who have been diagnosed with COVID-19. 2.Retrieve the number of visits made by each patient, ordered by the number of visits in descending order. 3.Calculate the average age of patients who have been diagnosed with Pneumonia. 4.Retrieve the top 3 most common symptoms among all visits. 5.Retrieve the patient who has the highest number of different symptoms reported. 6.Calculate the percentage of patients who have been diagnosed with COVID-19 out of the total number of patients. 7.Retrieve the top 5 cities with the highest number of visits, along with the count of visits in each city. 8.Find the patient who has the highest number of visits in a single day, along with the corresponding visit date. 9.Retrieve the average age of patients for each diagnosis, ordered by the average age in descending order. 10.Calculate the cumulative count of visits over time, ordered by the visit date.