-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsql.text
16 lines (12 loc) · 1.2 KB
/
sql.text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
TABLE:
create table worker ( worker_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, f_name CHAR(25), l_name CHAR(25), salary INT(15), joining_date DATETIME, dept CHAR(25) );
VALUES:
INSERT INTO worker VALUES (01, "JAYANT", "GUPTA", 10000, "14-02-20 07.25.00", "HR"), (02, "AMAN", "GUPTA", 10320, "16-12-20 07.25.00", "PR"), (03, "AKASH", "ARORA", 13400, "14-011-22 07.25.00", "QR"), (04, "SANJEEV", "KUMAR", 32300, "12-05-20 07.25.00", "TR"), (05, "ROHIT", "VERMA", 3250, "15-02-22 07.25.00", "AR");
TABLE:
CREATE TABLE Bonus ( worker_ref_id int, bonus_amount int(10), bonus_date DATETIME, FOREIGN KEY (worker_ref_id) REFERENCES Worker(worker_id) ON DELETE CASCADE );
VALUES:
INSERT INTO Bonus VALUES (01, 5000, '16-02-20'), (02, 1000, '13-02-20'), (03, 1200, '16-05-20'), (04, 5320, '16-02-22'), (05, 1000, '16-12-21') ;
Table:
CREATE TABLE Title ( WORKER_REF_ID INT, WORKER_TITLE CHAR(25), AFFECTED_FORM DATETIME, FOREIGN KEY (WORKER_REF_ID) REFERENCES Worker(worker_id) ON DELETE CASCADE );
Values:
INSERT INTO Title VALUES (01, "MANAGER", "2016-02-20 00:00:00"), (02, "EXECUTIVE", "2012-02-10 00:00:00"), (03, "EXECUTIVE", "2016-02-20 00:00:00"), (04, "EMPLOYEE", "2018-02-20 00:00:00"), (05, "INTERN", "2020-02-20 00:00:00");