-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabase.txt
More file actions
58 lines (47 loc) · 1.18 KB
/
Copy pathDatabase.txt
File metadata and controls
58 lines (47 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
DROP TABLE IF EXISTS (table_name);//complete delete
USE employeemanagementsystem;
//employee Table
CREATE TABLE employee (
name VARCHAR(100),
fname VARCHAR(100),
dob VARCHAR(20),
nid VARCHAR(30) UNIQUE,
phone VARCHAR(20),
email VARCHAR(100),
education VARCHAR(50),
empId INT PRIMARY KEY,
address VARCHAR(255),
designation VARCHAR(50),
salary VARCHAR(20)
);
//emplooyeelogin Table
//Create the employeelogin table with a foreign key referencing employee(empid)
CREATE TABLE employeelogin (
username VARCHAR(15) NOT NULL,
password VARCHAR(15) NOT NULL,
PRIMARY KEY (username),
FOREIGN KEY (username) REFERENCES employee(empid)
ON DELETE CASCADE
ON UPDATE CASCADE
);
//Leave_request Table
CREATE TABLE leave_requests (
id INT AUTO_INCREMENT PRIMARY KEY,
empId VARCHAR(20),
leaveType VARCHAR(50),
reason TEXT,
leaveDate DATE,
status VARCHAR(20)
);
//Attendance Table
CREATE TABLE attendance (
id INT PRIMARY KEY AUTO_INCREMENT,
empId VARCHAR(20),
date DATE,
status VARCHAR(20)
);
//Notice Table
CREATE TABLE notices (
id INT AUTO_INCREMENT PRIMARY KEY,
notice TEXT NOT NULL
);