The Employee Management System (EMS) is a MySQL-based database project created to manage and analyze employee-related information.
The project contains employee, department, job, attendance, leave, performance, salary, and HR-related data.
The main purpose of this project is to practice and demonstrate SQL skills using a real-world business scenario.
- Manage employee information
- Store department and job details
- Track employee attendance and leaves
- Store employee performance information
- Analyze employee salaries
- Perform business-related data analysis
- Practice advanced SQL concepts
- Understand database objects and transaction management
- MySQL
- MySQL Workbench
- SQL
| File | Description |
|---|---|
01_database.sql |
Creates the EMS database |
02_tables.sql |
Creates tables and defines constraints |
03_insert_data.sql |
Inserts sample data |
04_queries.sql |
Contains SQL analysis and practice queries |
05_views.sql |
Creates reusable SQL views |
06_stored_procedures.sql |
Creates stored procedures |
07_triggers.sql |
Creates database triggers |
08_transactions.sql |
Demonstrates transactions and savepoints |
09_indexes.sql |
Creates and analyzes indexes |
The project contains the following main tables:
Stores department information such as:
- Department ID
- Department Name
- Location
Stores job-related information such as:
- Job ID
- Job Title
- Minimum Salary
- Maximum Salary
Stores employee information such as:
- Employee ID
- First Name
- Last Name
- Gender
- Phone
- Hire Date
- Salary
- Department
- Job
- Manager
Stores employee attendance records.
Stores employee leave information.
Stores employee performance reviews and ratings.
- SELECT
- WHERE
- ORDER BY
- DISTINCT
- LIKE
- IN
- BETWEEN
- COUNT()
- SUM()
- AVG()
- MIN()
- MAX()
- GROUP BY
- HAVING
- INNER JOIN
- LEFT JOIN
- RIGHT JOIN
- CROSS JOIN
- SELF JOIN
- Subqueries
- Common Table Expressions (CTEs)
- CASE statements
- Window Functions
- RANK()
- DENSE_RANK()
- ROW_NUMBER()
- LAG()
- LEAD()
- Views
- Stored Procedures
- Triggers
- Indexes
- START TRANSACTION
- COMMIT
- ROLLBACK
- SAVEPOINT
- ROLLBACK TO SAVEPOINT
- CREATE INDEX
- DROP INDEX
- UNIQUE INDEX
- Composite Index
- EXPLAIN
SELECT *
FROM employees
WHERE salary = (
SELECT MAX(salary)
FROM employees
);