https://github.com/ashwin331133/sql-healthcare-data
This repository contains SQL queries designed to analyze health care data. The queries focus on patient demographics, encounter costs, and flu shot statistics, aiming to provide insights into patient behavior and financial impacts. The datasets include information on patient encounters, flu shots, and hospital admissions.
https://github.com/ashwin331133/sql-healthcare-data
data-analysis mysql sql
Last synced: 8 months ago
JSON representation
This repository contains SQL queries designed to analyze health care data. The queries focus on patient demographics, encounter costs, and flu shot statistics, aiming to provide insights into patient behavior and financial impacts. The datasets include information on patient encounters, flu shots, and hospital admissions.
- Host: GitHub
- URL: https://github.com/ashwin331133/sql-healthcare-data
- Owner: Ashwin331133
- Created: 2024-09-11T14:10:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-11T14:24:06.000Z (almost 2 years ago)
- Last Synced: 2025-03-23T04:42:26.946Z (over 1 year ago)
- Topics: data-analysis, mysql, sql
- Homepage:
- Size: 1.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SQL Queries for Health Care Data Analysis
## Project Overview
This project contains SQL queries designed to analyze various aspects of health care data, focusing on flu shots, patient encounters, and hospital information. The queries provide insights into patient demographics, encounter costs, and flu shot statistics.
## Dataset Description
- **flu_shot**: Contains data on patients, including their race, county, and whether they received a flu shot in 2019.
- **flu_demo_data**: Includes patient information such as age, ethnicity, gender, and flu shot data for 2022.
- **Health_care_demo**: Details patient encounters, including encounter costs, organization details, and payer information.
- **Hospital_ER**: Records patient visits to different departments, including waiting times and demographic details.
## Queries Included
1. **How many encounters did we have before the year 2022?**
2. **How many distinct patients did we treat before the year 2020?**
3. **How many distinct encounter classes are documented in the HEALTHCARE DEMO DATA table?**
4. **What is our patient mix by gender, race, and ethnicity?**
5. **Maximum and Minimum age of patients in the Hospital ER Table?**
6. **Which county had the highest number of patients from FLU DEMO DATA?**
7. **How many patients got a flu shot in 2019 based on County?**
8. **Find the average age of patients by county.**
9. **Calculate the total number of encounters by organization city.**
10. **Count the number of patients admitted by race.**
11. **Find the patient with the maximum waiting time.**
12. **Identify the average SAT score for each gender.**
13. **Find the average waiting time for patients grouped by department referral.**
14. **Find the total number of patients who have 'Medicare' as a payer.**
15. **Find the number of patients who received a flu shot in 2019 by race and county.**
16. **Is there any patient who received both a flu shot in 2019 and an encounter in 2022?**
17. **Find the total encounter costs per patient (Top 5) who has been admitted in the 'Hospital Encounter with Problem' category.**
18. **Are there any patients who were treated in multiple counties?**
19. **Find the average waiting time for patients grouped by both gender and race.**
20. **Identify the top 3 counties with the highest average patient age in the flu dataset.**
21. **Calculate the percentage of patients who received a flu shot in 2019 per race category.**
22. **Find the average waiting time for male and female patients across different departments in the Hospital_ER table.**
23. **Determine which organization city has the highest total encounter cost, and what percentage it contributes to the overall encounter cost.**