A project-based Employee Management System built using MySQL Workbench. This project covers real-world database design, CRUD operations, payroll processing, and interview-ready SQL queries.
This system manages:
- Employees
- Departments
- Job Roles
- Attendance
- Salaries
- Payroll (Monthly Salary Slips)
It is suitable for:
- SQL Beginners
- Internship / Fresher Interviews
- College Mini Projects
- Backend / Database Practice
-
Database: MySQL
-
Tool: MySQL Workbench
-
SQL Concepts:
- DDL (CREATE, ALTER)
- DML (INSERT, UPDATE, DELETE)
- Joins
- Constraints
- Subqueries
- Aggregation
departmentsjobsemployeesattendancesalariespayroll
All tables are connected using Primary Keys and Foreign Keys following real company standards.
- emp_id (PK)
- first_name
- last_name
- phone
- hire_date
- dept_id (FK)
- job_id (FK)
- payroll_id (PK)
- emp_id (FK)
- salary_month
- basic_salary
- bonus
- deductions
- net_salary
- generated_on
INSERT INTO employees (first_name, last_name, email, hire_date, dept_id, job_id)
VALUES ('Rahul', 'Mehta', 'rahul@gmail.com', '2025-01-01', 1, 2);SELECT * FROM employees;UPDATE employees SET dept_id = 2 WHERE emp_id = 1;DELETE FROM employees WHERE emp_id = 5;Net Salary Formula:
Net Salary = Basic Salary + Bonus – Deductions
UPDATE payroll
SET net_salary = basic_salary + bonus - deductions;SELECT salary_month, SUM(net_salary) AS total_expense
FROM payroll
GROUP BY salary_month;SELECT e.first_name, p.net_salary
FROM payroll p
JOIN employees e ON p.emp_id = e.emp_id
ORDER BY p.net_salary DESC
LIMIT 1;- One salary per employee per month
UNIQUE (emp_id, salary_month)- Employee must exist before payroll generation
- Salary history preserved using proper foreign keys
This project helps answer:
- What is Primary & Foreign Key?
- How do JOINs work?
- How to prevent duplicate records?
- How payroll systems work in real companies?
- Difference between DELETE vs TRUNCATE
- Open MySQL Workbench
- Create database
- Run table creation scripts
- Insert sample data
- Execute queries from this project
Prathamesh Vekhande B.Sc. IT Graduate SQL | MySQL | Backend Fundamentals
Give it a ⭐ on GitHub and use it for learning & interviews.