-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate_database.sql
More file actions
50 lines (47 loc) · 1.92 KB
/
create_database.sql
File metadata and controls
50 lines (47 loc) · 1.92 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
-- Create the database if it doesn't exist
CREATE DATABASE IF NOT EXISTS vdart_hr;
-- Use the database
USE vdart_hr;
-- Create Exit Interviews Table
CREATE TABLE IF NOT EXISTS exit_interviews (
id INT AUTO_INCREMENT PRIMARY KEY,
employee_name VARCHAR(100) NOT NULL,
employee_id VARCHAR(20) NOT NULL,
designation VARCHAR(100) NOT NULL,
team VARCHAR(100) NOT NULL,
cal_dal VARCHAR(100) NOT NULL,
bu_head VARCHAR(100) NOT NULL,
doj VARCHAR(20) NOT NULL,
dor VARCHAR(20) NOT NULL,
resign_decision VARCHAR(100) NOT NULL,
explored_options ENUM('Yes', 'No') NOT NULL,
explored_options_desc TEXT,
specific_event ENUM('Yes', 'No') NOT NULL,
specific_event_desc TEXT,
recommend_company ENUM('Yes', 'No') NOT NULL,
recommend_company_desc TEXT,
open_to_reapply ENUM('Yes', 'No') NOT NULL,
open_to_reapply_desc TEXT,
encourage_to_stay TEXT,
factors_new_role TEXT,
areas_to_improve TEXT,
members_to_thank TEXT,
rating_pay ENUM('Excellent', 'Good', 'Fair', 'Poor') NOT NULL,
rating_training ENUM('Excellent', 'Good', 'Fair', 'Poor') NOT NULL,
rating_supervisor ENUM('Excellent', 'Good', 'Fair', 'Poor') NOT NULL,
rating_relationship ENUM('Excellent', 'Good', 'Fair', 'Poor') NOT NULL,
rating_benefits ENUM('Excellent', 'Good', 'Fair', 'Poor') NOT NULL,
rating_promotion ENUM('Excellent', 'Good', 'Fair', 'Poor') NOT NULL,
rating_performance ENUM('Excellent', 'Good', 'Fair', 'Poor') NOT NULL,
rating_discipline ENUM('Excellent', 'Good', 'Fair', 'Poor') NOT NULL,
hrbp_note TEXT,
submission_date DATETIME NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Create Exit Interview Reasons Table
CREATE TABLE IF NOT EXISTS exit_interview_reasons (
id INT AUTO_INCREMENT PRIMARY KEY,
interview_id INT NOT NULL,
reason VARCHAR(100) NOT NULL,
FOREIGN KEY (interview_id) REFERENCES exit_interviews(id) ON DELETE CASCADE
);