0% found this document useful (0 votes)
7 views

HR Database

The document outlines a project for designing a basic HR database schema to manage employee information, including personal details, employment history, training records, departments, benefits, and performance reviews. It specifies the tables and their relationships, detailing the structure and foreign key connections necessary for implementation in a relational database management system. Additionally, it provides SQL scripts for creating the necessary tables within the database.

Uploaded by

Angel김
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

HR Database

The document outlines a project for designing a basic HR database schema to manage employee information, including personal details, employment history, training records, departments, benefits, and performance reviews. It specifies the tables and their relationships, detailing the structure and foreign key connections necessary for implementation in a relational database management system. Additionally, it provides SQL scripts for creating the necessary tables within the database.

Uploaded by

Angel김
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Master's degree specialized in human

resources management
HR information system

framed by: Prf afandi Directed by: Azimat Malak


Peak: 19041481
CNE : P139225860

College year :
2024 - 2025
HR Database Design

Project Description: Design a basic HR database schema to store employee


information (e.g., personal details employment history, training records etc.)

Objective: Database schema design that ready for Implementation using any
relational database management system.

Deliverables: Database schema design

 These tables represent detailed information about employees, employment


history, training records, departments, benefits and performance review:
 The image shows a database schema with six tables, each representing
different aspects of employee management within an organization. The
relationships between the tables are depicted, showing how they are
connected. Here's a detailed explanation of each table and their
relationships:

Employees:

Columns: EmployeeID (Primary Key), FirstName, LastName, DateOfBirth,


Email, Phone.
Description: This table stores the personal information of employees.
Departments:

Columns: DepartmentID (Primary Key), DepartmentName, ManagerID.


Description: This table stores information about departments within the
organization. The ManagerID is likely a foreign key referencing an EmployeeID
from the Employees table, indicating the manager of the department.
EmploymentHistory:

Columns: HistoryID (Primary Key), EmployeeID (Foreign Key),


CompanyName, StartDate, EndDate, JobTitle, Salary.
Description: This table keeps a record of an employee's employment history,
including previous companies, job titles, and salary information. The
EmployeeID links to the Employees table.
Benefits:

Columns: BenefitID (Primary Key), EmployeeID (Foreign Key), BenefitType,


BenefitDescription, BenefitCost.
Description: This table contains information about the benefits provided to
employees, such as health insurance, retirement plans, etc. The EmployeeID
links to the Employees table.
PerformanceReviews:

Columns: ReviewID (Primary Key), EmployeeID (Foreign Key), ReviewDate,


ReviewerID, PerformanceScore, ReviewComments.
Description: This table holds performance review records for employees. The
EmployeeID links to the Employees table. The ReviewerID likely references
another EmployeeID, indicating who conducted the review.
TrainingRecords:

Columns: RecordID (Primary Key), EmployeeID (Foreign Key), TrainingDate,


TrainingSubject.
Description: This table tracks the training sessions attended by employees. The
EmployeeID links to the Employees table.
Relationships:

Employees to Departments: There is a relationship between Employees and


Departments, indicating that employees belong to departments.
Employees to EmploymentHistory: The EmploymentHistory table is linked to
the Employees table via the EmployeeID, indicating the employment history of
each employee.
Employees to Benefits: The Benefits table is linked to the Employees table via
the EmployeeID, detailing the benefits each employee receives.
Employees to PerformanceReviews: The PerformanceReviews table is linked to
the Employees table via the EmployeeID, storing performance reviews for each
employee.
Employees to TrainingRecords: The TrainingRecords table is linked to the
Employees table via the EmployeeID, recording training sessions for each
employee.
Overall, this schema captures essential aspects of employee management,
including personal details, departmental assignments, employment history,
benefits, performance reviews, and training records.

here is the script that helps us manage this diagram:


create database HR
use HR

-- Creating the Employee table


CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY IDENTITY(1,1),
FirstName NVARCHAR(50),
LastName NVARCHAR(50),
DateOfBirth DATE,
Email NVARCHAR(100),
Phone NVARCHAR(15)
);

-- Creating the EmploymentHistory table


CREATE TABLE EmploymentHistory (
HistoryID INT PRIMARY KEY IDENTITY(1,1),
EmployeeID INT,
CompanyName NVARCHAR(100),
StartDate DATE,
EndDate DATE,
JobTitle NVARCHAR(50),
Salary DECIMAL(10, 2),
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID)
);

-- Creating the TrainingRecords table


CREATE TABLE TrainingRecords (
RecordID INT PRIMARY KEY IDENTITY(1,1),
EmployeeID INT,
TrainingDate DATE,
TrainingSubject NVARCHAR(100),
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID)
);

-- Creating the Departments table


CREATE TABLE Departments (
DepartmentID INT PRIMARY KEY IDENTITY(1,1),
DepartmentName NVARCHAR (100),
ManagerID INT,
FOREIGN KEY (ManagerID) REFERENCES Employees(EmployeeID)
);

-- Creating the Benefits table


CREATE TABLE Benefits (
BenefitID INT PRIMARY KEY IDENTITY(1,1),
EmployeeID INT,
BenefitType NVARCHAR(100),
BenefitDescription TEXT,
BenefitCost DECIMAL(10, 2),
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID)
);

-- Creating the PerformanceReviews table


CREATE TABLE PerformanceReviews (
ReviewID INT PRIMARY KEY IDENTITY(1,1),
EmployeeID INT,
ReviewDate DATE,
ReviewerID INT,
PerformanceScore INT,
ReviewComments TEXT,
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
FOREIGN KEY (ReviewerID) REFERENCES Employees(EmployeeID)
);
 this following picture represent a HR data base that was created by using
Microsoft SQL server management studio

You might also like