-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebapi-benchmark.sql
58 lines (50 loc) · 2.19 KB
/
webapi-benchmark.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
49
50
51
52
53
54
55
56
57
58
/*
Navicat Premium Data Transfer
Source Server : Local Database
Source Server Type : MySQL
Source Server Version : 50724
Source Host : localhost:3306
Source Schema : webapi-benchmark
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : 65001
Date: 29/02/2020 09:43:21
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for classes
-- ----------------------------
DROP TABLE IF EXISTS `classes`;
CREATE TABLE `classes` (
`class_id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`class_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for enrollments
-- ----------------------------
DROP TABLE IF EXISTS `enrollments`;
CREATE TABLE `enrollments` (
`enrollment_id` int(11) NOT NULL AUTO_INCREMENT,
`student_id` int(11) NOT NULL,
`class_id` int(11) NOT NULL,
PRIMARY KEY (`enrollment_id`) USING BTREE,
INDEX `student_id`(`student_id`) USING BTREE,
INDEX `class_id`(`class_id`) USING BTREE,
CONSTRAINT `enrollments_ibfk_1` FOREIGN KEY (`student_id`) REFERENCES `students` (`student_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `enrollments_ibfk_2` FOREIGN KEY (`class_id`) REFERENCES `classes` (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for students
-- ----------------------------
DROP TABLE IF EXISTS `students`;
CREATE TABLE `students` (
`student_id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(16) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`lastname` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`birthdate` date NOT NULL,
PRIMARY KEY (`student_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;