Model the employee table for an HRIS database.
- User
Model the employee table for an HRIS database.
- Assistant
Below is a possible schema for an employee table in an HRIS (Human Resources Information System) database:
CREATE TABLE Employee ( EmployeeID INT NOT NULL PRIMARY KEY, FirstName VARCHAR(50) NOT NULL, LastName VARCHAR(50) NOT NULL, Email VARCHAR(100) NOT NULL UNIQUE, Phone VARCHAR(20), HireDate DATE NOT NULL, JobTitle VARCHAR(100) NOT NULL, DepartmentID INT NOT NULL, ManagerID INT, FOREIGN KEY (DepartmentID) REFERENCES Department(DepartmentID), FOREIGN KEY (ManagerID) REFERENCES Employee(EmployeeID) );In this schema, each employee has a unique EmployeeID, which serves as the primary key. The table also includes columns for the employee's first and last name, email address, phone number, hire date, job title, department ID, and manager ID. The DepartmentID and ManagerID columns are foreign keys referencing the Department and Employee tables, respectively.
The
HireDatecolumn stores the date the employee was hired. TheJobTitlecolumn stores the employee's current job title, while theDepartmentIDcolumn stores the employee's assigned department. TheManagerIDcolumn stores the ID of the employee's manager.The
Emailcolumn is defined asUNIQUE, which ensures that each employee has a unique email address.The
FOREIGN KEYconstraints ensure referential integrity by preventing invalid data from being inserted into the table. For example, theDepartmentIDmust exist in theDepartmenttable, and theManagerIDmust exist in theEmployeetable.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.