This project demonstrates relational database design and SQL querying skills using an Employee–Department–Project management system.
It focuses on table creation, data insertion, joins, aggregations, subqueries, and real-world business queries commonly asked in interviews and assessments.
The database consists of four related tables:
Stores employee details such as salary, department, and hire date.
| Column | Description |
|---|---|
| EmployeeID | Unique employee identifier |
| Name | Employee name |
| DepartmentID | Department reference |
| Salary | Employee salary |
| HireDate | Date of joining |
Stores department master data.
| Column | Description |
|---|---|
| DepartmentID | Unique department identifier |
| DepartmentName | Department name |
Stores project details with start and end dates.
| Column | Description |
|---|---|
| ProjectID | Unique project identifier |
| ProjectName | Project name |
| StartDate | Project start date |
| EndDate | Project end date |
Represents a many-to-many relationship between employees and projects.
| Column | Description |
|---|---|
| EmployeeID | Employee reference |
| ProjectID | Project reference |
This project answers real-world HR and project management questions, including:
- Employees working in a specific department (IT)
- High salary employees
- Employees hired after a certain date
- Total salary cost per department
- Employees not assigned to any project
- Employee count per department
- Employees working on a specific project
- Highest salary in each department
- Employee–department mapping
- Average salary of senior employees
- Employees working on multiple projects
- Employees working on completed projects
- Second highest salary in the organization
- Departments with no employees
- Project count per employee
CREATE TABLEINSERT INTOINNER JOIN,LEFT JOIN,RIGHT JOINGROUP BY,HAVING- Aggregate functions:
SUM,COUNT,AVG,MAX - Subqueries
- Date filtering
- DISTINCT records
- Many-to-many relationship handling
- IT and Finance departments have higher salary allocations
- Some employees work on multiple projects
- Certain departments may exist without active employees
- Senior employees (hired before 2020) have higher average salaries
- Project timelines help identify completed assignments
- SQL (MySQL / SQL Server compatible)
- Relational Database Design
- Query Optimization Techniques
Hotel, Orders & Customer SQL Database.sql
(Contains table creation, data insertion, and all analysis queries)
This project reflects interview-level SQL knowledge, covering:
- Data modeling
- Joins & aggregations
- Analytical queries
- Business-driven problem solving
It is suitable for Data Analyst, SQL Developer, and Fresher-level roles.
This project is part of my SQL portfolio, demonstrating hands-on experience with relational databases and real-world query scenarios.