This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo_init.sql
48 lines (38 loc) · 1.98 KB
/
demo_init.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
DROP TABLE IF EXISTS departments;
DROP TABLE IF EXISTS employees;
CREATE TABLE IF NOT EXISTS departments (
DEPARTMENT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
DEPARTMENT_NAME VARCHAR(100) NOT NULL,
PRIMARY KEY (DEPARTMENT_ID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS employees (
EMPLOYEE_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
EMPLOYEE_DEPARTMENT_ID INT(10) UNSIGNED NOT NULL,
EMPLOYEE_SURNAME VARCHAR(100) NOT NULL,
EMPLOYEE_NAME VARCHAR(100) NOT NULL,
EMPLOYEE_PATRONYMIC VARCHAR(100) NOT NULL,
EMPLOYEE_DATE_OF_BIRTHDAY DATE NOT NULL,
EMPLOYEE_SALARY INT(10) UNSIGNED NOT NULL,
PRIMARY KEY (EMPLOYEE_ID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
INSERT INTO departments ( DEPARTMENT_ID, DEPARTMENT_NAME ) VALUES
(1, 'Department of Energy'),
(2, 'Department of Homeland Security'),
(3, 'Department of Veterinary and Food Control'),
(4, 'Department of Defense');
INSERT INTO employees ( EMPLOYEE_ID, EMPLOYEE_DEPARTMENT_ID, EMPLOYEE_SURNAME, EMPLOYEE_NAME, EMPLOYEE_PATRONYMIC, EMPLOYEE_DATE_OF_BIRTHDAY, EMPLOYEE_SALARY) VALUES
(1, 1, 'Williamson', 'Precious', 'John', '1990-04-05', 3500),
(2, 1, 'Ibarra', 'Helen', 'Lee', '1987-01-15', 1500),
(3, 1, 'Walsh', 'Max', 'John', '1991-09-12', 2500),
(4, 1, 'Thomas', 'Isaac', 'Houston', '1995-07-07', 1900),
(5, 1, 'Mike', 'Gordon', 'Iris', '1992-09-03', 2000),
(6, 2, 'Ella', 'Gutierrez', 'Martin', '1990-04-01', 1200),
(7, 2, 'Shiloh', 'Acosta', 'Coffey', '1990-03-10', 1100),
(8, 2, 'Alessandro', 'Mccullough', 'Molly', '1989-11-13', 2100),
(9, 2, 'Briana', 'Green', 'Immanuel', '1996-01-06', 1250),
(10, 2, 'Kieran', 'Mathis', 'Yates', '1972-02-09', 4300),
(11, 3, 'Elijah', 'Marquez', 'Brandon', '1988-05-02', 1900),
(12, 3, 'Aniya', 'Ballard', 'Dario', '1994-05-06', 2230),
(13, 3, 'Aurora', 'Bright', 'Guerra', '1994-02-06', 1890),
(14, 4, 'Zariah', 'Marks', 'Austin', '1990-03-09', 1290),
(15, 4, 'Cordell', 'Wilson', 'Azul', '1991-04-05', 3200);