-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomputer_lab_monitoring.sql
More file actions
270 lines (249 loc) · 18.9 KB
/
Copy pathcomputer_lab_monitoring.sql
File metadata and controls
270 lines (249 loc) · 18.9 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
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
/*
Navicat Premium Data Transfer
Source Server : localhost - MYSQL 8.34
Source Server Type : MySQL
Source Server Version : 80034 (8.0.34)
Source Host : localhost:3307
Source Schema : computer_lab_monitoring
Target Server Type : MySQL
Target Server Version : 80034 (8.0.34)
File Encoding : 65001
Date: 03/12/2024 16:49:50
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for computer_software
-- ----------------------------
DROP TABLE IF EXISTS `computer_software`;
CREATE TABLE `computer_software` (
`computer_id` int NOT NULL,
`software_id` int NOT NULL,
`installation_date` date NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`computer_id`, `software_id`) USING BTREE,
INDEX `software_id`(`software_id` ASC) USING BTREE,
CONSTRAINT `computer_software_ibfk_1` FOREIGN KEY (`computer_id`) REFERENCES `computers` (`computer_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `computer_software_ibfk_2` FOREIGN KEY (`software_id`) REFERENCES `software_inventory` (`software_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of computer_software
-- ----------------------------
INSERT INTO `computer_software` VALUES (1, 1, '2023-01-15', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (1, 2, '2023-01-15', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (1, 4, '2023-01-16', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (2, 1, '2023-01-15', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (2, 2, '2023-01-15', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (2, 4, '2023-01-16', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (3, 1, '2023-02-20', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (3, 2, '2023-02-20', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (3, 3, '2023-02-21', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (3, 5, '2023-02-21', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (4, 1, '2023-02-20', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (4, 2, '2023-02-20', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (4, 3, '2023-02-21', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (4, 5, '2023-02-21', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (5, 1, '2023-03-10', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (5, 2, '2023-03-10', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (5, 4, '2023-03-11', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (6, 1, '2023-04-05', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (6, 2, '2023-04-05', '2024-11-29 17:12:41');
INSERT INTO `computer_software` VALUES (6, 3, '2024-11-30', '2024-11-30 00:02:59');
-- ----------------------------
-- Table structure for computers
-- ----------------------------
DROP TABLE IF EXISTS `computers`;
CREATE TABLE `computers` (
`computer_id` int NOT NULL AUTO_INCREMENT,
`lab_id` int NULL DEFAULT NULL,
`hostname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`ip_address` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`mac_address` varchar(17) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`specifications` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
`status` enum('Working','Under Maintenance','Out of Order') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'Working',
`purchase_date` date NULL DEFAULT NULL,
`warranty_expiry` date NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`computer_id`) USING BTREE,
INDEX `lab_id`(`lab_id` ASC) USING BTREE,
INDEX `idx_computer_status`(`status` ASC) USING BTREE,
CONSTRAINT `computers_ibfk_1` FOREIGN KEY (`lab_id`) REFERENCES `laboratories` (`lab_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of computers
-- ----------------------------
INSERT INTO `computers` VALUES (1, 1, 'PC-MAIN-01', '192.168.1.101', '00:1A:2B:3C:4D:5E', 'Intel i7, 16GB RAM, 512GB SSD', 'Working', '2023-01-15', '2026-01-15', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `computers` VALUES (2, 1, 'PC-MAIN-02', '192.168.1.102', '00:1A:2B:3C:4D:5F', 'Intel i7, 16GB RAM, 512GB SSD', 'Working', '2023-01-15', '2026-01-15', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `computers` VALUES (3, 2, 'PC-ADV-01', '192.168.1.201', '00:1A:2B:3C:4D:6E', 'Intel i9, 32GB RAM, 1TB SSD', 'Working', '2023-02-20', '2026-02-20', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `computers` VALUES (4, 2, 'PC-ADV-02', '192.168.1.202', '00:1A:2B:3C:4D:6F', 'Intel i9, 32GB RAM, 1TB SSD', 'Under Maintenance', '2023-02-20', '2026-02-20', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `computers` VALUES (5, 3, 'PC-PROG-01', '192.168.1.301', '00:1A:2B:3C:4D:7E', 'Intel i5, 8GB RAM, 256GB SSD', 'Working', '2023-03-10', '2026-03-10', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `computers` VALUES (6, 4, 'PC-NET-01', '192.168.1.401', '00:1A:2B:3C:4D:8E', 'Intel i7, 16GB RAM, 512GB SSD', 'Out of Order', '2023-04-05', '2026-04-05', '2024-11-27 21:23:18', '2024-11-29 21:23:18');
INSERT INTO `computers` VALUES (9, 4, 'PC-MAIN-2', '192.168.1.222', '00:1A:2B3:C:DE:FF', 'Intel i5, 16GB, 1TB SSD', 'Working', NULL, NULL, '2024-12-03 10:43:28', '2024-12-03 10:43:28');
-- ----------------------------
-- Table structure for issues
-- ----------------------------
DROP TABLE IF EXISTS `issues`;
CREATE TABLE `issues` (
`issue_id` int NOT NULL AUTO_INCREMENT,
`computer_id` int NULL DEFAULT NULL,
`reported_by` int NULL DEFAULT NULL,
`assigned_to` int NULL DEFAULT NULL,
`issue_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`priority` enum('Low','Medium','High') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'Medium',
`status` enum('Open','In Progress','Resolved','Closed') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'Open',
`reported_date` datetime NULL DEFAULT CURRENT_TIMESTAMP,
`resolved_date` datetime NULL DEFAULT NULL,
`resolution_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`issue_id`) USING BTREE,
INDEX `computer_id`(`computer_id` ASC) USING BTREE,
INDEX `reported_by`(`reported_by` ASC) USING BTREE,
INDEX `assigned_to`(`assigned_to` ASC) USING BTREE,
INDEX `idx_issues_status`(`status` ASC) USING BTREE,
CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`computer_id`) REFERENCES `computers` (`computer_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`reported_by`) REFERENCES `users` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `issues_ibfk_3` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of issues
-- ----------------------------
INSERT INTO `issues` VALUES (1, 4, 3, 2, 'Hardware', 'Computer not booting up properly', 'High', 'In Progress', '2024-11-15 09:30:00', NULL, NULL, '2024-11-29 17:12:41', '2024-11-29 17:12:41');
INSERT INTO `issues` VALUES (2, 6, 3, 5, 'Hardware', 'Power supply unit failure', 'High', 'In Progress', '2024-11-17 14:20:00', NULL, NULL, '2024-11-29 17:12:41', '2024-11-29 17:12:41');
INSERT INTO `issues` VALUES (3, 2, 4, 2, 'Software', 'Visual Studio crashes during compilation', 'Medium', 'Resolved', '2024-11-10 11:45:00', '2024-11-11 15:30:00', 'Reinstalled Visual Studio and updated drivers', '2024-11-29 17:12:41', '2024-11-29 17:12:41');
INSERT INTO `issues` VALUES (4, 1, 6, 2, 'Software', 'Microsoft Office not activating', 'Low', 'Closed', '2024-11-05 13:15:00', '2024-11-06 10:20:00', 'Reactivated license key', '2024-11-29 17:12:41', '2024-11-29 17:12:41');
INSERT INTO `issues` VALUES (5, 3, 3, 5, 'Hardware', 'USB ports not responding', 'Medium', 'Resolved', '2024-11-08 16:00:00', '2024-11-09 11:45:00', 'Updated USB drivers and cleaned ports', '2024-11-29 17:12:41', '2024-11-29 17:12:41');
INSERT INTO `issues` VALUES (6, 5, 4, 2, 'Software', 'System running slowly', 'Low', 'Open', '2024-11-28 10:30:00', NULL, NULL, '2024-11-29 17:12:41', '2024-11-29 17:12:41');
INSERT INTO `issues` VALUES (7, 2, 6, 5, 'Hardware', 'Monitor flickering intermittently', 'Medium', 'Open', '2024-11-29 09:15:00', NULL, NULL, '2024-11-29 17:12:41', '2024-11-29 17:12:41');
-- ----------------------------
-- Table structure for laboratories
-- ----------------------------
DROP TABLE IF EXISTS `laboratories`;
CREATE TABLE `laboratories` (
`lab_id` int NOT NULL AUTO_INCREMENT,
`lab_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`location` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`capacity` int NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`lab_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of laboratories
-- ----------------------------
INSERT INTO `laboratories` VALUES (1, 'Main Computer Lab', 'Ground Floor, Building A', 30, '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `laboratories` VALUES (2, 'Advanced Computing Lab', 'First Floor, Building B', 25, '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `laboratories` VALUES (3, 'Programming Lab', 'Second Floor, Building A', 20, '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `laboratories` VALUES (4, 'Networking Lab', 'Ground Floor, Building C', 15, '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `laboratories` VALUES (6, 'Computer Science Lab', '2nd Floor, CS Building A', 20, '2024-11-27 21:53:43', '2024-11-27 21:53:55');
-- ----------------------------
-- Table structure for maintenance_records
-- ----------------------------
DROP TABLE IF EXISTS `maintenance_records`;
CREATE TABLE `maintenance_records` (
`record_id` int NOT NULL AUTO_INCREMENT,
`computer_id` int NULL DEFAULT NULL,
`technician_id` int NULL DEFAULT NULL,
`maintenance_type` enum('Preventive','Corrective') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`maintenance_date` date NOT NULL,
`cost` decimal(10, 2) NULL DEFAULT NULL,
`status` enum('Pending','In Progress','Completed') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'Pending',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`record_id`) USING BTREE,
INDEX `computer_id`(`computer_id` ASC) USING BTREE,
INDEX `technician_id`(`technician_id` ASC) USING BTREE,
INDEX `idx_maintenance_date`(`maintenance_date` ASC) USING BTREE,
CONSTRAINT `maintenance_records_ibfk_1` FOREIGN KEY (`computer_id`) REFERENCES `computers` (`computer_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `maintenance_records_ibfk_2` FOREIGN KEY (`technician_id`) REFERENCES `users` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of maintenance_records
-- ----------------------------
INSERT INTO `maintenance_records` VALUES (1, 4, 2, 'Preventive', 'Regular cleaning and software updates', '2024-11-12', 50.00, 'Completed', '2024-11-12 21:23:18', '2024-11-12 21:23:18');
INSERT INTO `maintenance_records` VALUES (2, 6, 5, 'Corrective', 'Replace faulty power supply', '2024-11-17', 120.00, 'In Progress', '2024-11-17 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `maintenance_records` VALUES (3, 2, 2, 'Preventive', 'System optimization and virus scan', '2024-11-22', 30.00, 'Completed', '2024-11-22 21:23:18', '2024-11-22 21:23:18');
INSERT INTO `maintenance_records` VALUES (4, 1, 2, 'Preventive', 'Memory upgrade and OS update to linux', '2024-11-07', 200.00, 'Completed', '2024-11-07 21:23:18', '2024-11-29 22:28:09');
-- ----------------------------
-- Table structure for software_inventory
-- ----------------------------
DROP TABLE IF EXISTS `software_inventory`;
CREATE TABLE `software_inventory` (
`software_id` int NOT NULL AUTO_INCREMENT,
`software_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`license_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`license_expiry` date NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`software_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of software_inventory
-- ----------------------------
INSERT INTO `software_inventory` VALUES (1, 'Windows 11 Pro', '22H2', 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX', '2026-12-30', '2024-11-27 21:23:18', '2024-11-29 16:31:15');
INSERT INTO `software_inventory` VALUES (2, 'Microsoft Office', '2021', 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX', '2025-12-31', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `software_inventory` VALUES (3, 'Adobe Creative Suite', '2024', 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX', '2025-06-30', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `software_inventory` VALUES (4, 'Visual Studio', '2022', 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX', '2025-12-31', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `software_inventory` VALUES (5, 'MATLAB', 'R2024a', 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX', '2025-12-31', '2024-11-27 21:23:18', '2024-11-27 21:23:18');
INSERT INTO `software_inventory` VALUES (6, 'Capcut', '3', 'XXXXX-XXXXXX-XXXXX-XXXXXX-XXXXX-XXXXXX-', '2025-12-01', '2024-11-29 16:31:03', '2024-11-29 16:31:03');
-- ----------------------------
-- Table structure for usage_logs
-- ----------------------------
DROP TABLE IF EXISTS `usage_logs`;
CREATE TABLE `usage_logs` (
`log_id` int NOT NULL AUTO_INCREMENT,
`computer_id` int NULL DEFAULT NULL,
`user_id` int NULL DEFAULT NULL,
`login_time` datetime NOT NULL,
`logout_time` datetime NULL DEFAULT NULL,
`purpose` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`log_id`) USING BTREE,
INDEX `computer_id`(`computer_id` ASC) USING BTREE,
INDEX `user_id`(`user_id` ASC) USING BTREE,
INDEX `idx_usage_logs_date`(`login_time` ASC) USING BTREE,
CONSTRAINT `usage_logs_ibfk_1` FOREIGN KEY (`computer_id`) REFERENCES `computers` (`computer_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `usage_logs_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of usage_logs
-- ----------------------------
INSERT INTO `usage_logs` VALUES (1, 1, 4, '2024-11-26 21:23:18', '2024-11-27 21:23:18', 'Programming Class', '2024-11-26 21:23:18');
INSERT INTO `usage_logs` VALUES (2, 2, 6, '2024-11-25 21:23:18', '2024-11-26 21:23:18', 'Self-Study', '2024-11-25 21:23:18');
INSERT INTO `usage_logs` VALUES (3, 3, 4, '2024-11-24 21:23:18', '2024-11-25 21:23:18', 'Project Work', '2024-11-24 21:23:18');
INSERT INTO `usage_logs` VALUES (4, 1, 6, '2024-11-23 21:23:18', '2024-11-24 21:23:18', 'Assignment', '2024-11-23 21:23:18');
INSERT INTO `usage_logs` VALUES (5, 5, 4, '2024-11-22 21:23:18', '2024-11-23 21:23:18', 'Programming Practice', '2024-11-22 21:23:18');
INSERT INTO `usage_logs` VALUES (6, 2, 6, '2024-11-21 21:23:18', '2024-11-22 21:23:18', 'Self-Study', '2024-11-21 21:23:18');
INSERT INTO `usage_logs` VALUES (7, 3, 4, '2024-11-20 21:23:18', '2024-11-21 21:23:18', 'Project Work', '2024-11-20 21:23:18');
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`user_id` int NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`full_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`role` enum('Admin','Lab Technician','Instructor','Student') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`contact_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`user_id`) USING BTREE,
UNIQUE INDEX `username`(`username` ASC) USING BTREE,
UNIQUE INDEX `email`(`email` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES (1, 'admin1', 'admin1', 'Admin', 'Admin', 'adminn@email.com', '+639778066348', '2024-11-26 18:39:04', '2024-11-26 20:23:46');
INSERT INTO `users` VALUES (2, 'tech1', 'tech1', 'Technician1', 'Lab Technician', 'tech1@email.com', '+639778065341', '2024-11-26 18:39:04', '2024-11-27 20:17:51');
INSERT INTO `users` VALUES (3, 'inst1', 'inst1', 'Instructor1', 'Instructor', 'inst1n@email.com', '+639778062341', '2024-11-26 18:39:04', '2024-11-27 20:17:53');
INSERT INTO `users` VALUES (4, 'stud1', 'stud1', 'Student1', 'Student', 'stud1@email.com', '+639778966341', '2024-11-26 18:39:04', '2024-11-27 20:17:55');
INSERT INTO `users` VALUES (5, 'tech2', 'tech2', 'Technician2', 'Lab Technician', 'tech2n@email.com', '+639778026341', '2024-11-26 18:39:04', '2024-11-27 20:17:57');
INSERT INTO `users` VALUES (6, 'stud2', 'stud2', 'Student2', 'Student', 'stud2@email.com', '+639778096341', '2024-11-26 18:39:04', '2024-11-27 20:17:59');
SET FOREIGN_KEY_CHECKS = 1;