forked from Xenomorphing19/DBMS_HR_Operations_Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDBMS_HR_Queries.sql
111 lines (97 loc) · 2.77 KB
/
DBMS_HR_Queries.sql
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
CREATE DATABASE hr_ops_sys;
USE hr_ops_sys;
CREATE TABLE Departments (
dept_id VARCHAR (255) NOT NULL,
dept_name VARCHAR (255) NOT NULL,
dept_strength INT,
dept_vacancy INT,
PRIMARY KEY(dept_id)
);
CREATE TABLE Production (
emp_id VARCHAR (255) NOT NULL,
emp_name TEXT NOT NULL,
emp_password TEXT NOT NULL,
dept_role TINYTEXT NOT NULL,
dob DATE,
PRIMARY KEY(emp_id)
);
CREATE TABLE R_and_D (
emp_id VARCHAR (255) NOT NULL,
emp_name TEXT NOT NULL,
emp_password TEXT NOT NULL,
dept_role TINYTEXT NOT NULL,
dob DATE,
PRIMARY KEY(emp_id)
);
CREATE TABLE Sales (
emp_id VARCHAR (255) NOT NULL,
emp_name TEXT NOT NULL,
emp_password TEXT NOT NULL,
dept_role TINYTEXT NOT NULL,
dob DATE,
PRIMARY KEY(emp_id)
);
CREATE TABLE Marketing (
emp_id VARCHAR (255) NOT NULL,
emp_name TEXT NOT NULL,
emp_password TEXT NOT NULL,
dept_role TINYTEXT NOT NULL,
dob DATE,
PRIMARY KEY(emp_id)
);
CREATE TABLE Human_Resources (
emp_id VARCHAR (255) NOT NULL,
emp_name TEXT NOT NULL,
emp_password TEXT NOT NULL,
dept_role TINYTEXT NOT NULL,
dob DATE,
PRIMARY KEY(emp_id)
);
CREATE TABLE Q_and_A (
emp_id VARCHAR (255) NOT NULL,
emp_name TEXT NOT NULL,
emp_password TEXT NOT NULL,
dept_role TINYTEXT NOT NULL,
dob DATE,
PRIMARY KEY(emp_id)
);
CREATE TABLE Acc_and_Finance (
emp_id VARCHAR (255) NOT NULL,
emp_name TEXT NOT NULL,
emp_password TEXT NOT NULL,
dept_role TINYTEXT NOT NULL,
dob DATE,
PRIMARY KEY(emp_id)
);
CREATE TABLE Applicants (
app_id VARCHAR(255) NOT NULL,
app_name TEXT NOT NULL,
app_pass TEXT NOT NULL,
opportunity_id VARCHAR(255) NOT NULL, -- This references the department ID in the 'Departments' Table.
app_resume BLOB,
app_status TINYTEXT NOT NULL,
PRIMARY KEY(app_id)
);
CREATE TABLE Interviews (
int_id VARCHAR(255) NOT NULL,
int_dept VARCHAR(255) NOT NULL, -- This references the department ID in the 'Departments' Table.
int_member VARCHAR(255) NOT NULL, -- This references a 'Team Member' from any of the departments.
int_app VARCHAR(255) NOT NULL, -- This references an 'Applicant' from the 'Applicants' Table
int_resume BLOB, -- This is the same resume file as the one in the 'Applicants' Table
int_status TINYTEXT NOT NULL,
PRIMARY KEY(int_id)
);
CREATE TABLE Invitations (
letter_id VARCHAR(255) NOT NULL,
receiver VARCHAR(255) NOT NULL, -- This references an applicant from the 'Applicants' Table
response TEXT NOT NULL,
PRIMARY KEY(letter_id)
);
CREATE TABLE Administrators (
admin_id VARCHAR(255) NOT NULL,
admin_name TEXT NOT NULL,
admin_password TEXT NOT NULL,
PRIMARY KEY(admin_id)
);
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<PASSWORD>';
FLUSH privileges;