Moving beyond Excel: How I built a relational database system to handle Employee Data, Payroll, and Security.
Most HR departments rely on "Excel Chaos." Data is scattered across spreadsheets, leading to:
I built this system to demonstrate how Relational Databases (SQL) solve these specific HR operational failures.
Unlike Excel, I used a normalized SQL database structure to ensure data integrity. Here is a simplified view of the Entity Relationship Diagram (ERD) I designed:
The FK (Foreign Key) relationships ensure that you cannot pay a salary to an employee who doesn't exist—an error impossible to prevent in Excel.
HR data is sensitive. I implemented Password Hashing using bcrypt instead of storing plain text, and JWT (JSON Web Tokens) for API access.
class Employee(db.Model):
__tablename__ = 'employees'
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True, nullable=False)
password_hash = db.Column(db.String(256))
def set_password(self, password):
# Never store plain text!
self.password_hash = generate_password_hash(password)
def check_password(self, password):
return check_password_hash(self.password_hash, password)
This code proves I understand GDPR/Data Privacy compliance at a technical level, not just a policy level.
This project serves as a "Proof of Concept" for a headless HR backend. By decoupling the data (Backend) from the view (Frontend), this system allows for: