forked from Nabil-Nader/test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpledemp.sql
More file actions
64 lines (45 loc) · 1.39 KB
/
simpledemp.sql
File metadata and controls
64 lines (45 loc) · 1.39 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
51
52
53
54
55
56
57
58
59
60
CREATE DATABASE IF NOT EXISTS `simpledemp`;
USE `simpledemp`;
CREATE TABLE `teacher` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(45) DEFAULT NULL,
`last_name` varchar(45) DEFAULT NULL,
`email` varchar(45) DEFAULT NULL,
`job_title` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
--
-- Data for table `teacher`
--
--
-- Data for table `student`
--
INSERT INTO `teacher` VALUES
(1,'Billy','Andrews','billy@gmail.com','English Teacher'),
(2,'Sophie ','Baumgarten','sophie@gmail.com','Math Teacher'),
--
-- Table structure for table `student`
--
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(45) DEFAULT NULL,
`last_name` varchar(45) DEFAULT NULL,
`email` varchar(45) DEFAULT NULL,
`teacher_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_TEACHER_idx`(`teacher_id`),
CONSTANT `FK_TEACHER`
FOREIGN KEY (`teacher_id`)
REFERENCES `teacher`(`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
--
-- Data for table `student`
--
INSERT INTO `student` VALUES
(1,'Leslie','Andrews','leslie@gmail.com',1),
(2,'Emma','Baumgarten','emma@gmail.com',1),
(3,'Avani','Gupta','avani@gmail.com',2),
(4,'Yuri','Petrov','yuri@gmail.com',2),
(5,'Juan','Vega','juan@gmail.com',2);
(6,'Eddy ','Thomas','eddy@gmail.com',1),