-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.sql
30 lines (27 loc) · 981 Bytes
/
database.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
CREATE TABLE department (
Id int(11) NOT NULL AUTO_INCREMENT,
Name varchar(60) DEFAULT NULL,
PRIMARY KEY (Id)
);
CREATE TABLE seller (
Id int(11) NOT NULL AUTO_INCREMENT,
Name varchar(60) NOT NULL,
Email varchar(100) NOT NULL,
BirthDate datetime NOT NULL,
BaseSalary double NOT NULL,
DepartmentId int(11) NOT NULL,
PRIMARY KEY (Id),
FOREIGN KEY (DepartmentId) REFERENCES department (id)
);
INSERT INTO department (Name) VALUES
('Computers'),
('Electronics'),
('Fashion'),
('Books');
INSERT INTO seller (Name, Email, BirthDate, BaseSalary, DepartmentId) VALUES
('Bob Brown','bob@gmail.com','1998-04-21 00:00:00',1000,1),
('Maria Green','maria@gmail.com','1979-12-31 00:00:00',3500,2),
('Alex Grey','alex@gmail.com','1988-01-15 00:00:00',2200,1),
('Martha Red','martha@gmail.com','1993-11-30 00:00:00',3000,4),
('Donald Blue','donald@gmail.com','2000-01-09 00:00:00',4000,3),
('Alex Pink','bob@gmail.com','1997-03-04 00:00:00',3000,2);