-
Notifications
You must be signed in to change notification settings - Fork 0
/
LMS Database Model
187 lines (160 loc) · 8.62 KB
/
LMS Database Model
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
-- MySQL dump 10.13 Distrib 8.0.36, for macos
--
-- Database: Learning Management System
-- ------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `course_tags`
--
DROP TABLE IF EXISTS `course_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `course_tags` (
`course_id` int NOT NULL,
`tag_id` tinyint NOT NULL,
PRIMARY KEY (`tag_id`,`course_id`),
KEY `fk_course_tags_tags1_idx` (`tag_id`),
KEY `fk_course_tags_Courses1_idx` (`course_id`),
CONSTRAINT `fk_course_tags_Courses1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`),
CONSTRAINT `fk_course_tags_tags1` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `course_tags`
--
LOCK TABLES `course_tags` WRITE;
/*!40000 ALTER TABLE `course_tags` DISABLE KEYS */;
INSERT INTO `course_tags` VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10);
/*!40000 ALTER TABLE `course_tags` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `courses`
--
DROP TABLE IF EXISTS `courses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `courses` (
`course_id` int NOT NULL AUTO_INCREMENT,
`instructor_id` smallint NOT NULL,
`Title` varchar(255) NOT NULL,
`Price` decimal(7,2) NOT NULL,
PRIMARY KEY (`course_id`),
KEY `fk_Courses_instructors1_idx` (`instructor_id`),
CONSTRAINT `fk_Courses_instructors1` FOREIGN KEY (`instructor_id`) REFERENCES `instructors` (`instructor_id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `courses`
--
LOCK TABLES `courses` WRITE;
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
INSERT INTO `courses` VALUES (1,1,'Lean Six Sigma 101',1000.00),(2,2,'Advanced Lean Six Sigma',1200.00),(3,3,'Yellow Belt Lean Six Sigma',1500.00),(4,4,'Green Belt Lean Six Sigma',1800.00),(5,5,'Black Belt Lean Six Sigma',2000.00),(6,6,'Lean Six Sigma Project Management',2000.00),(7,7,'Lean Six Sigma for Healthcare',1800.00),(8,8,'Lean Six Sigma for Manufacturing',2200.00),(9,9,'Lean Six Sigma for IT Professionals',1900.00),(10,10,'Lean Six Sigma for Finance',2100.00);
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `enrollments`
--
DROP TABLE IF EXISTS `enrollments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `enrollments` (
`student_id` int NOT NULL,
`course_id` int NOT NULL,
`date` datetime NOT NULL,
`price` decimal(7,2) NOT NULL,
PRIMARY KEY (`student_id`,`course_id`),
KEY `fk_Enrollments_students_idx` (`student_id`),
KEY `fk_Enrollments_Courses1_idx` (`course_id`),
CONSTRAINT `fk_Enrollments_Courses` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`) ON UPDATE CASCADE,
CONSTRAINT `fk_Enrollments_students` FOREIGN KEY (`student_id`) REFERENCES `students` (`student_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `enrollments`
--
LOCK TABLES `enrollments` WRITE;
/*!40000 ALTER TABLE `enrollments` DISABLE KEYS */;
INSERT INTO `enrollments` VALUES (1,1,'2024-01-15 10:00:00',1000.00),(1,2,'2024-01-16 11:00:00',1200.00),(1,3,'2024-01-17 12:00:00',1500.00),(2,1,'2024-01-18 13:00:00',1000.00),(2,4,'2024-01-19 14:00:00',1800.00),(2,5,'2024-01-20 15:00:00',2000.00),(3,1,'2024-01-21 16:00:00',1000.00),(3,2,'2024-01-22 17:00:00',1200.00),(3,6,'2024-01-23 18:00:00',2000.00),(4,1,'2024-01-24 19:00:00',1000.00),(4,7,'2024-01-25 20:00:00',1800.00),(4,8,'2024-01-26 21:00:00',2200.00),(5,2,'2024-01-27 10:00:00',1200.00),(5,3,'2024-01-28 11:00:00',1500.00),(5,9,'2024-01-29 12:00:00',1900.00),(6,4,'2024-01-30 13:00:00',1800.00),(6,10,'2024-01-31 14:00:00',2100.00),(7,5,'2024-02-01 15:00:00',2000.00),(7,6,'2024-02-02 16:00:00',2000.00),(8,7,'2024-02-03 17:00:00',1800.00),(8,8,'2024-02-04 18:00:00',2200.00),(9,9,'2024-02-05 19:00:00',1900.00),(9,10,'2024-02-06 20:00:00',2100.00),(10,1,'2024-02-07 21:00:00',1000.00),(10,2,'2024-02-08 10:00:00',1200.00);
/*!40000 ALTER TABLE `enrollments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `instructors`
--
DROP TABLE IF EXISTS `instructors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `instructors` (
`instructor_id` smallint NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
PRIMARY KEY (`instructor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `instructors`
--
LOCK TABLES `instructors` WRITE;
/*!40000 ALTER TABLE `instructors` DISABLE KEYS */;
INSERT INTO `instructors` VALUES (1,'John Doe'),(2,'Jane Smith'),(3,'Jacob Jimenez'),(4,'Emily Davis'),(5,'Michael Thompson'),(6,'Sophia Martinez'),(7,'James Wilson'),(8,'Olivia Anderson'),(9,'Benjamin Garcia'),(10,'Isabella Johnson');
/*!40000 ALTER TABLE `instructors` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `students`
--
DROP TABLE IF EXISTS `students`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `students` (
`student_id` int NOT NULL AUTO_INCREMENT,
`first_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`email` varchar(255) NOT NULL,
`date_register` datetime NOT NULL,
PRIMARY KEY (`student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `students`
--
LOCK TABLES `students` WRITE;
/*!40000 ALTER TABLE `students` DISABLE KEYS */;
INSERT INTO `students` VALUES (1,'Alice','Johnson','[email protected]','2024-01-01 10:00:00'),(2,'Bob','Brown','[email protected]','2024-01-02 11:00:00'),(3,'Charlie','Wilson','[email protected]','2024-01-03 12:00:00'),(4,'Daisy','Miller','[email protected]','2024-01-04 13:00:00'),(5,'Ethan','Smith','[email protected]','2024-01-05 14:00:00'),(6,'Fiona','Johnson','[email protected]','2024-01-06 15:00:00'),(7,'George','Brown','[email protected]','2024-01-07 16:00:00'),(8,'Hannah','Davis','[email protected]','2024-01-08 17:00:00'),(9,'Isaac','Martinez','[email protected]','2024-01-09 18:00:00'),(10,'Julia','Garcia','[email protected]','2024-01-10 19:00:00'),(11,'Kevin','Rodriguez','[email protected]','2024-01-11 20:00:00'),(12,'Laura','Lee','[email protected]','2024-01-12 21:00:00');
/*!40000 ALTER TABLE `students` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tags`
--
DROP TABLE IF EXISTS `tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tags` (
`tag_id` tinyint NOT NULL,
`name` varchar(45) NOT NULL,
PRIMARY KEY (`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tags`
--
LOCK TABLES `tags` WRITE;
/*!40000 ALTER TABLE `tags` DISABLE KEYS */;
INSERT INTO `tags` VALUES (1,'Process Science 1'),(2,'Process Science 2'),(3,'Process Science 3'),(4,'Process Science 4'),(5,'Process Science 5'),(6,'Project Management'),(7,'Healthcare'),(8,'Manufacturing'),(9,'Finance'),(10,'Information Tech');
/*!40000 ALTER TABLE `tags` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-07-25 10:19:32