Skip to content

codeHariharan/SQL_Task4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Task 4: Aggregate Functions and Grouping – SQL Developer Internship Objective This task demonstrates the use of aggregate functions and grouping to summarize and analyze hospital data from the HospitalDB database.

Work Summary:

Used aggregate functions such as:

COUNT() to count patients, appointments, and prescriptions. AVG() to calculate the average patient age. SUM() to calculate total bill amounts. Grouped data using GROUP BY to categorize results by gender, doctor, or department. Filtered grouped data using the HAVING clause to display results based on aggregate conditions (for example, departments with more than one appointment). Joined multiple tables (Appointment, Doctor, Department, Patient, Prescription) to retrieve meaningful aggregated reports.

Created queries to achieve the following:

Patient count by gender Number of appointments per doctor Average patient age by department Departments with more than one appointment Most frequently prescribed medication Total revenue per department using SUM()

Outcome Through this task, I practiced the use of aggregate functions in SQL to summarize and analyze data. I applied COUNT, AVG, and SUM functions with GROUP BY to categorize information and HAVING to filter grouped results. I also worked with table joins to produce meaningful reports from related tables. This task improved my ability to handle analytical queries in relational databases in a real-world hospital management context.

About

Aggregate Functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published