MySQL Database Management System

A comprehensive database design project demonstrating relational modeling, data normalization, and complex query optimization for a multi-tiered corporate workforce management system.

View ERD Diagram → View Query Results
MySQL MySQL Workbench SQL Database Design ERD Modeling

Project Overview

This database management project was the culminating assignment for my Database Concepts course, where I applied everything I'd learned about relational database design throughout the semester. The challenge was to create a comprehensive system to manage a fictional company's workforce, tracking employees, departments, projects, and performance evaluations in a way that reflects real business operations.

The project required me to think through complex organizational relationships: How do you handle employees who both work in departments and manage them? What's the best way to store information for both full-time and part-time workers? How do you track project assignments and performance over time?

I built the entire system using MySQL Workbench, creating tables that work together seamlessly while maintaining data accuracy and preventing inconsistencies. The final deliverable included a complete database structure, realistic employee and project data, and a set of SQL queries that demonstrate different ways to extract useful business insights from the data.

Database Design & Architecture

Understanding the Business Structure

The first step was mapping out how a real company might organize its workforce. I needed to capture several key relationships:

  • Employee information including personal details and whether they work full-time or part-time
  • Company organization with departments grouped into larger divisions
  • Management structure where certain employees lead departments or divisions
  • Project work where employees are assigned to specific projects with start dates, end dates, and performance evaluations

The trickiest part was figuring out how to handle different types of employees. Full-time workers have annual salaries, while part-time workers have hourly rates and maximum weekly hours. Rather than mixing all this information in one table, I created separate tables for each employment type. This keeps the data clean and prevents errors like accidentally giving a part-time worker an annual salary.

Entity-Relationship Modeling

Using MySQL Workbench's visual design tools, I created a diagram that shows how all the database tables connect to each other. This diagram, called an Entity-Relationship Diagram (ERD), serves as the blueprint for the entire system.

The main components include:

  • Employee as the central table containing basic information like name, address, and employment type
  • Department and Division tables that represent the company's organizational structure
  • Project and Assignment tables that track work assignments and how well employees performed
  • Full_Time and Part_Time tables that store employment-specific details like pay information

What makes this design effective is how the tables reference each other through shared ID numbers. For example, each employee record includes a department ID that links to their specific department, and each department record includes an employee ID for whoever manages that department.

Table Structure Implementation

Once the visual design was complete, MySQL Workbench generated the actual database creation code. This process, called forward engineering, transforms the diagram into working database tables with proper data types and relationships.

Each piece of information needed the right data type: phone numbers became large integers, ZIP codes became fixed-length character fields, and employment type used a special enumerated field that only accepts 'f' for full-time or 'p' for part-time. The database also includes built-in rules that prevent invalid data. For example, you can't delete an employee who manages a department until you assign a new manager.

Key Features & Database Logic

Smart Employee Type Handling

One of the most important design decisions was how to handle different employment types. Instead of having one large table with lots of empty fields, I used an inheritance pattern that's both efficient and logical:

  • The main employee table contains information that applies to everyone (name, address, contact details)
  • A special field indicates whether each employee is full-time ('f') or part-time ('p')
  • Separate tables store type-specific information like annual salary for full-time workers or hourly rate for part-time workers

This approach ensures data accuracy. The database structure itself prevents mistakes like assigning both a salary and an hourly rate to the same person.

Organizational Hierarchy

The department and division structure reflects how real companies operate. Employees belong to departments, departments belong to divisions, and both departments and divisions have employee managers. These relationships create a web of connections that the database maintains automatically.

For example, if you try to delete an employee who manages a department, the database will prevent the deletion until you assign a new manager. This built-in protection keeps the data consistent and prevents organizational charts from breaking.

Project Assignment Tracking

The assignment system goes beyond simple employee-to-project connections. Each assignment includes start and end dates, performance evaluations (pass or fail), and space for additional notes. This creates a historical record of who worked on what projects and how they performed, valuable information for performance reviews and future project planning.

SQL Query Implementation

Employee Search with Pattern Matching

Query Purpose: Find employees by partial name matching for directory lookups or HR searches.

LIKE Pattern Matching Query SQL

SELECT emp_id, emp_first, emp_last, emp_email 

FROM employee 

WHERE emp_first LIKE '%Karen%';

This query uses the LIKE operator with wildcards (%) to find any employee whose first name contains "Karen" anywhere within it. The % symbols mean "match any characters before or after Karen."

Query Result:
emp_id emp_first emp_last emp_email
1 Karen Williams [email protected]

Full-Time Employee Identification

Query Purpose: List all employees who are classified as full-time workers.

EXISTS Subquery SQL

SELECT emp_id, emp_first, emp_last 

FROM employee 

WHERE EXISTS

  SELECT

  FROM full_time 

  WHERE full_time.emp_id = employee.emp_id 

);

The EXISTS clause checks whether each employee has a corresponding record in the full_time table. If they do, they're included in the results. This approach efficiently identifies full-time employees without requiring complex table joins.

Query Result:
emp_id emp_first emp_last
1 Karen Williams
2 Michael Scott
3 Lucas Nathans

Department Staffing Analysis

Query Purpose: Count how many employees work in each department for organizational planning.

GROUP BY Aggregation SQL

SELECT dpt_name, COUNT(emp_id) AS employee_count 

FROM department 

GROUP BY dpt_name;

The GROUP BY clause organizes the data by department name, while COUNT tallies how many employees are assigned to each department. This type of summary is essential for understanding resource allocation across the organization.

Query Result:
dpt_name employee_count
sales 1
services 1
finances 1
insurance 1
marketing 1

Average Salary Calculation

Query Purpose: Calculate compensation statistics for budgeting and HR analysis.

Built-in Functions SQL

SELECT ROUND(AVG(annualsalary), 2) AS avg_salary 

FROM full_time;

This query demonstrates two built-in SQL functions working together: AVG calculates the average of all annual salaries, while ROUND formats the result to two decimal places for currency display. The result provides meaningful financial data for business decision-making.

Query Result:
avg_salary
42567.76

Challenges & Solutions

Applying Course Concepts to Real Design

Throughout the Database Concepts course, we learned about normalization, relationships, and SQL syntax in isolation. This project required bringing all those concepts together into a cohesive system. The challenge was translating theoretical knowledge into practical database design decisions.

For example, understanding that "third normal form" means eliminating redundant data is one thing, but actually deciding whether to separate address information into its own table requires weighing the benefits of normalization against query complexity. I learned to make these decisions based on how the database would actually be used.

Balancing Data Organization with Usability

The final design keeps commonly-used information together (like employee contact details) while separating specialized data (like employment-specific pay information) into dedicated tables. This makes everyday queries straightforward while maintaining data integrity.

Understanding Business Relationships

The most valuable lesson was learning to think about databases in terms of business processes rather than just technical structures. Every table relationship represents a real-world business rule, and every constraint enforces organizational policy.

For instance, the requirement that every department must have a manager isn't just a database rule, it reflects how companies actually operate. Understanding these business relationships helped me create a database that supports real organizational needs.

"This project taught me that effective database design requires understanding both technical concepts and business operations. The best database structure is one that makes business processes easier, not harder."

Visual Showcase

The Entity-Relationship Diagram shows the complete system architecture with all tables, fields, and relationships clearly defined. The color-coded design helps distinguish between different types of entities: main business objects like employees and departments, specialized subtypes like full-time and part-time workers, and linking tables that connect everything together.

Entity-Relationship Diagram showing complete database structure with color-coded tables and relationships
Complete Entity-Relationship Diagram created in MySQL Workbench

The diagram clearly shows how inheritance is handled through the employee type discriminator and separate subtype tables for full-time and part-time workers. The assignment table demonstrates a many-to-many relationship with additional attributes for tracking project performance over time.

Lessons Learned

Database Design Reflects Business Logic

Before this project, I thought databases were purely technical: tables, fields, and relationships. I learned that effective database design requires understanding how businesses actually operate. Every connection between tables represents a real business relationship, and every rule enforced by the database reflects organizational policy.

This understanding changed how I approach all system design work. Now I always start by understanding the business requirements and user needs before thinking about technical implementation.

SQL is a Business Intelligence Tool

Writing queries that answered practical questions like average salaries and department staffing levels showed me that SQL is more than just a programming language. It's a tool for transforming raw data into business insights that help organizations make informed decisions.

The queries I wrote are exactly the types of analysis that HR departments, finance teams, and managers need for day-to-day operations and strategic planning.

Visual Design Improves Understanding

Creating the Entity-Relationship Diagram before writing any code helped me understand the system as a whole. The visual representation made it easier to spot potential issues and ensure that all the business relationships made sense.

This experience reinforced the value of planning and design in all development work. Taking time to visualize the solution before implementation leads to better results.

Data Structure Enforces Quality

Implementing proper constraints and relationships taught me that databases can actively maintain data quality. Rather than relying on application code to prevent errors, the database structure itself ensures consistency and prevents invalid information from being stored.

This defensive approach to data management has influenced how I think about error prevention and system reliability in all my technical work.

Future Improvements

While this project fulfilled the course requirements, there are several enhancements that would make it more suitable for real-world use:

Enhanced Employee Management

  • Historical records for salary changes and department transfers
  • Performance review system that builds on the existing assignment evaluation framework
  • Skills tracking for better project assignment decisions

System Integration

  • Web interface development using my frontend skills to make the database accessible through a browser
  • Basic reporting for common business questions like employee counts and project status
  • Data export capabilities for sharing information with other business systems

This database foundation provides a solid starting point for building workforce management applications that could help organizations track and organize their human resources more effectively.