-
Notifications
You must be signed in to change notification settings - Fork 0
/
cqms_db.sql
301 lines (241 loc) · 8.48 KB
/
cqms_db.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
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 01, 2023 at 07:53 PM
-- Server version: 8.0.29
-- PHP Version: 8.0.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!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 */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `cqms_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `advisors_tbl`
--
CREATE TABLE `advisors_tbl` (
`id` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `advisors_tbl_entries_ref`
--
CREATE TABLE `advisors_tbl_entries_ref` (
`Advisor_id` varchar(255) NOT NULL,
`entriesAssigned_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `entries_ref`
--
CREATE TABLE `entries_ref` (
`id` int NOT NULL,
`response` varchar(255) DEFAULT NULL,
`response_date` date DEFAULT NULL,
`advisorId_id` varchar(255) DEFAULT NULL,
`entryNo_entry_no` int DEFAULT NULL,
`supervisorId_id` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `entries_tbl`
--
CREATE TABLE `entries_tbl` (
`entry_no` int NOT NULL,
`category` varchar(255) NOT NULL,
`details` varchar(255) NOT NULL,
`request_date` date NOT NULL,
`status` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`studentId_id` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `entries_tbl`
--
INSERT INTO `entries_tbl` (`entry_no`, `category`, `details`, `request_date`, `status`, `type`, `studentId_id`) VALUES
(1, 'Progress Report', 'Where is my Progress report?', '2023-03-30', 'UNRESOLVED', 'QUERY', '10002'),
(2, 'Progress Report', 'Enter Your Query or Complaint', '2023-03-30', 'UNRESOLVED', 'QUERY', '10002'),
(3, 'Progress Report', 'skdfkdkdkdkdkdkd', '2023-03-31', 'UNRESOLVED', 'QUERY', '10002'),
(4, 'Progress Report', '', '2023-03-31', 'UNRESOLVED', 'QUERY', '10002');
-- --------------------------------------------------------
--
-- Table structure for table `students_tbl`
--
CREATE TABLE `students_tbl` (
`contact` varchar(255) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`id` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `students_tbl`
--
INSERT INTO `students_tbl` (`contact`, `email`, `id`) VALUES
('422-3432', 'pc@gmail.com', '10002');
-- --------------------------------------------------------
--
-- Table structure for table `students_tbl_entries_tbl`
--
CREATE TABLE `students_tbl_entries_tbl` (
`Student_id` varchar(255) NOT NULL,
`entriesLogged_entry_no` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `supervisors_tbl`
--
CREATE TABLE `supervisors_tbl` (
`id` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `supervisors_tbl_entries_ref`
--
CREATE TABLE `supervisors_tbl_entries_ref` (
`Supervisor_id` varchar(255) NOT NULL,
`entries_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users_tbl`
--
CREATE TABLE `users_tbl` (
`id` varchar(255) NOT NULL,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`userRole` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `users_tbl`
--
INSERT INTO `users_tbl` (`id`, `first_name`, `last_name`, `password`, `userRole`) VALUES
('10002', 'Carl', 'Peterson', 'cat', 'STUDENT');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `advisors_tbl`
--
ALTER TABLE `advisors_tbl`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `advisors_tbl_entries_ref`
--
ALTER TABLE `advisors_tbl_entries_ref`
ADD UNIQUE KEY `UK_tsqbi2mws8rvh58pjx8ptjlu` (`entriesAssigned_id`),
ADD KEY `FKssm5145gc2cqht04sowe56hd5` (`Advisor_id`);
--
-- Indexes for table `entries_ref`
--
ALTER TABLE `entries_ref`
ADD PRIMARY KEY (`id`),
ADD KEY `FK80m71qmg3fe1nki89rrk45bb5` (`advisorId_id`),
ADD KEY `FK5ekp8aduqpk8gr0bo2yxo2k7w` (`entryNo_entry_no`),
ADD KEY `FKgseycfayqob4r9fkwotpot4a8` (`supervisorId_id`);
--
-- Indexes for table `entries_tbl`
--
ALTER TABLE `entries_tbl`
ADD PRIMARY KEY (`entry_no`),
ADD KEY `FKt4u8dr6owo3ylqm6uqn3sfjxr` (`studentId_id`);
--
-- Indexes for table `students_tbl`
--
ALTER TABLE `students_tbl`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_ei6t3qhfupeehvh0cijbgm28h` (`email`),
ADD UNIQUE KEY `UK_l9tlo1sfose6rv6cfal2bealu` (`contact`);
--
-- Indexes for table `students_tbl_entries_tbl`
--
ALTER TABLE `students_tbl_entries_tbl`
ADD UNIQUE KEY `UK_gdseuspw5387jqwbb6sbsx7sv` (`entriesLogged_entry_no`),
ADD KEY `FKfxrhosvdjl3hvcr2yqjv4hi5r` (`Student_id`);
--
-- Indexes for table `supervisors_tbl`
--
ALTER TABLE `supervisors_tbl`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `supervisors_tbl_entries_ref`
--
ALTER TABLE `supervisors_tbl_entries_ref`
ADD UNIQUE KEY `UK_r8vkhdijur24llb86q2e6j9rj` (`entries_id`),
ADD KEY `FK96xis3ghuhdk4bpg4lbrr9han` (`Supervisor_id`);
--
-- Indexes for table `users_tbl`
--
ALTER TABLE `users_tbl`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `entries_ref`
--
ALTER TABLE `entries_ref`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `entries_tbl`
--
ALTER TABLE `entries_tbl`
MODIFY `entry_no` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `advisors_tbl`
--
ALTER TABLE `advisors_tbl`
ADD CONSTRAINT `FKqnpribhf3fg0jt0neim8y5v1t` FOREIGN KEY (`id`) REFERENCES `users_tbl` (`id`);
--
-- Constraints for table `advisors_tbl_entries_ref`
--
ALTER TABLE `advisors_tbl_entries_ref`
ADD CONSTRAINT `FKd3ltyqvh70mxqbh59xmpioekf` FOREIGN KEY (`entriesAssigned_id`) REFERENCES `entries_ref` (`id`),
ADD CONSTRAINT `FKssm5145gc2cqht04sowe56hd5` FOREIGN KEY (`Advisor_id`) REFERENCES `advisors_tbl` (`id`);
--
-- Constraints for table `entries_ref`
--
ALTER TABLE `entries_ref`
ADD CONSTRAINT `FK5ekp8aduqpk8gr0bo2yxo2k7w` FOREIGN KEY (`entryNo_entry_no`) REFERENCES `entries_tbl` (`entry_no`),
ADD CONSTRAINT `FK80m71qmg3fe1nki89rrk45bb5` FOREIGN KEY (`advisorId_id`) REFERENCES `advisors_tbl` (`id`),
ADD CONSTRAINT `FKgseycfayqob4r9fkwotpot4a8` FOREIGN KEY (`supervisorId_id`) REFERENCES `supervisors_tbl` (`id`);
--
-- Constraints for table `entries_tbl`
--
ALTER TABLE `entries_tbl`
ADD CONSTRAINT `FKt4u8dr6owo3ylqm6uqn3sfjxr` FOREIGN KEY (`studentId_id`) REFERENCES `students_tbl` (`id`);
--
-- Constraints for table `students_tbl`
--
ALTER TABLE `students_tbl`
ADD CONSTRAINT `FK9oyu60a247wboig217caepopb` FOREIGN KEY (`id`) REFERENCES `users_tbl` (`id`);
--
-- Constraints for table `students_tbl_entries_tbl`
--
ALTER TABLE `students_tbl_entries_tbl`
ADD CONSTRAINT `FKcakn73sq0r39x8mihfneetth4` FOREIGN KEY (`entriesLogged_entry_no`) REFERENCES `entries_tbl` (`entry_no`),
ADD CONSTRAINT `FKfxrhosvdjl3hvcr2yqjv4hi5r` FOREIGN KEY (`Student_id`) REFERENCES `students_tbl` (`id`);
--
-- Constraints for table `supervisors_tbl`
--
ALTER TABLE `supervisors_tbl`
ADD CONSTRAINT `FKfsic23r6vqg7hd72ac25vhpeu` FOREIGN KEY (`id`) REFERENCES `users_tbl` (`id`);
--
-- Constraints for table `supervisors_tbl_entries_ref`
--
ALTER TABLE `supervisors_tbl_entries_ref`
ADD CONSTRAINT `FK96xis3ghuhdk4bpg4lbrr9han` FOREIGN KEY (`Supervisor_id`) REFERENCES `supervisors_tbl` (`id`),
ADD CONSTRAINT `FKqcsi59ukbp7pufeaef3bou4wb` FOREIGN KEY (`entries_id`) REFERENCES `entries_ref` (`id`);
COMMIT;
/*!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 */;