RelationalDesign: data_load.sql

File data_load.sql, 11.8 KB (added by 221511, 32 hours ago)
Line 
1SET search_path TO project;
2
3TRUNCATE TABLE reservations RESTART IDENTITY CASCADE;
4TRUNCATE TABLE resources RESTART IDENTITY CASCADE;
5TRUNCATE TABLE locations RESTART IDENTITY CASCADE;
6TRUNCATE TABLE resource_types RESTART IDENTITY CASCADE;
7TRUNCATE TABLE users RESTART IDENTITY CASCADE;
8TRUNCATE TABLE user_types RESTART IDENTITY CASCADE;
9
10INSERT INTO user_types (type_name, description) VALUES
11 ('Student', 'Students can view resource availability and access permitted resources for study and project work'),
12 ('Teaching Staff', 'Faculty members who can reserve resources for lectures, labs, office hours, and research activities'),
13 ('Administrator', 'System administrators who manage resources, approve reservations, and analyze usage data');
14
15INSERT INTO users (first_name, last_name, email, password, type_id) VALUES
16 ('Ana', 'Petrovska', 'ana.petrovska@finki.ukim.mk', '$2a$10$abc123hashplaceholder1', 3),
17 ('Marko', 'Dimitrovski', 'marko.dimitrovski@finki.ukim.mk', '$2a$10$abc123hashplaceholder2', 3),
18 ('Elena', 'Stojanova', 'elena.stojanova@finki.ukim.mk', '$2a$10$abc123hashplaceholder3', 2),
19 ('Nikola', 'Trajkovski', 'nikola.trajkovski@finki.ukim.mk', '$2a$10$abc123hashplaceholder4', 2),
20 ('Ivana', 'Kostadinova', 'ivana.kostadinova@finki.ukim.mk', '$2a$10$abc123hashplaceholder5', 2),
21 ('Aleksandar', 'Georgieski', 'aleksandar.georgieski@finki.ukim.mk', '$2a$10$abc123hashplaceholder6', 2),
22 ('Stefan', 'Nikolov', 'stefan.nikolov@students.finki.ukim.mk', '$2a$10$abc123hashplaceholder7', 1),
23 ('Martina', 'Ilievska', 'martina.ilievska@students.finki.ukim.mk', '$2a$10$abc123hashplaceholder8', 1),
24 ('David', 'Angelovski', 'david.angelovski@students.finki.ukim.mk', '$2a$10$abc123hashplaceholder9', 1),
25 ('Teodora', 'Manceva', 'teodora.manceva@students.finki.ukim.mk', '$2a$10$abc123hashplaceholder10', 1),
26 ('Filip', 'Ristovski', 'filip.ristovski@students.finki.ukim.mk', '$2a$10$abc123hashplaceholder11', 1),
27 ('Milena', 'Jovanovska', 'milena.jovanovska@students.finki.ukim.mk', '$2a$10$abc123hashplaceholder12', 1);
28
29INSERT INTO resource_types (type_name, is_physical) VALUES
30 ('Classroom', TRUE),
31 ('Computer Laboratory', TRUE),
32 ('Projector', TRUE),
33 ('Conference Room', TRUE),
34 ('3D Printer', TRUE),
35 ('Software License', FALSE),
36 ('Virtual Machine', FALSE),
37 ('Online Service', FALSE);
38
39INSERT INTO locations (building, room) VALUES
40 ('FINKI-A', '101'),
41 ('FINKI-A', '102'),
42 ('FINKI-A', '201'),
43 ('FINKI-A', '202'),
44 ('FINKI-A', '301'),
45 ('FINKI-B', 'Lab 1'),
46 ('FINKI-B', 'Lab 2'),
47 ('FINKI-B', 'Lab 3'),
48 ('FINKI-B', 'Lab 4'),
49 ('TMF', 'Conference Hall'),
50 ('TMF', 'Meeting Room A'),
51 ('TMF', 'Meeting Room B'),
52 ('Library', 'Study Room 1'),
53 ('Library', 'Study Room 2');
54
55INSERT INTO resources (name, description, available_from, available_to, available_weekends, type_id, location_id) VALUES
56 ('Classroom 101', 'Standard classroom with 60 seats, whiteboard, and built-in projector', '08:00', '20:00', FALSE, 1, 1),
57 ('Classroom 102', 'Small classroom with 30 seats, suitable for seminars and group work', '08:00', '20:00', FALSE, 1, 2),
58 ('Lecture Hall 201', 'Large lecture hall with 150 seats, amphitheater style seating', '08:00', '22:00', TRUE, 1, 3),
59 ('Classroom 202', 'Standard classroom with 45 seats, equipped with smart board', '08:00', '20:00', FALSE, 1, 4),
60 ('Programming Lab 1', 'Computer lab with 25 workstations, Linux/Windows dual boot, for programming courses', '08:00', '22:00', TRUE, 2, 6),
61 ('Programming Lab 2', 'Computer lab with 25 workstations, focused on web development tools', '08:00', '22:00', TRUE, 2, 7),
62 ('Networking Lab', 'Specialized lab with network equipment, routers, switches for hands-on practice', '09:00', '18:00', FALSE, 2, 8),
63 ('Database Lab', 'Lab with 20 workstations pre-configured with PostgreSQL, MySQL, Oracle', '08:00', '20:00', FALSE, 2, 9),
64 ('Portable Projector Epson EB-X51', 'Portable projector 3800 lumens, XGA resolution, HDMI and VGA inputs', '08:00', '20:00', TRUE, 3, NULL),
65 ('Portable Projector BenQ MH733', 'Full HD portable projector 4000 lumens, ideal for large rooms', '08:00', '20:00', TRUE, 3, NULL),
66 ('Main Conference Hall', 'Large conference hall with 100 seats, video conferencing system, recording equipment', '08:00', '20:00', FALSE, 4, 10),
67 ('Meeting Room A', 'Medium meeting room with 20 seats, whiteboard, TV screen for presentations', '08:00', '18:00', FALSE, 4, 11),
68 ('Meeting Room B', 'Small meeting room with 10 seats, suitable for thesis defenses and small meetings', '08:00', '18:00', FALSE, 4, 12),
69 ('Prusa i3 MK3S+', '3D printer for student projects, PLA/PETG filaments, max build volume 25x21x21cm', '09:00', '17:00', FALSE, 5, 6),
70 ('Ultimaker S3', 'Professional dual-extrusion 3D printer, supports various materials', '09:00', '17:00', FALSE, 5, 6),
71 ('Study Room 1', 'Quiet study room in library with 8 seats, power outlets, WiFi', '08:00', '22:00', TRUE, 1, 13),
72 ('Study Room 2', 'Group study room in library with 12 seats and whiteboard', '08:00', '22:00', TRUE, 1, 14);
73
74INSERT INTO resources (name, description, available_from, available_to, available_weekends, type_id, location_id) VALUES
75 ('MATLAB Academic License', 'Network license for MATLAB R2024a with all toolboxes, 50 concurrent users', '00:00', '23:59', TRUE, 6, NULL),
76 ('JetBrains Educational Pack', 'Access to IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs', '00:00', '23:59', TRUE, 6, NULL),
77 ('Microsoft Azure Dev Tools', 'Azure subscription for students with $100 credit and free services', '00:00', '23:59', TRUE, 6, NULL),
78 ('Adobe Creative Cloud', 'Full Creative Cloud suite - Photoshop, Illustrator, Premiere Pro, etc.', '00:00', '23:59', TRUE, 6, NULL),
79 ('GPU Compute Server', 'Virtual server with NVIDIA Tesla T4, 16GB VRAM, for ML/AI projects', '00:00', '23:59', TRUE, 7, NULL),
80 ('Development VM Pool', 'Pool of 10 Ubuntu VMs, 4 vCPU, 8GB RAM each, for student projects', '00:00', '23:59', TRUE, 7, NULL),
81 ('Windows Server Instance', 'Windows Server 2022 VM for .NET development and testing', '00:00', '23:59', TRUE, 7, NULL),
82 ('GitHub Enterprise', 'GitHub Enterprise account with unlimited private repositories', '00:00', '23:59', TRUE, 8, NULL),
83 ('AWS Academy Sandbox', 'AWS sandbox environment for cloud computing courses', '00:00', '23:59', TRUE, 8, NULL),
84 ('Google Cloud Credits', 'Google Cloud Platform credits for student projects and research', '00:00', '23:59', TRUE, 8, NULL);
85
86INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
87 ('2026-02-03 09:00:00', '2026-02-03 11:00:00', 'completed', 'Database Systems Lecture - Week 1', '2026-01-15 10:00:00', 'a1b2c3d4-e5f6-4789-abcd-ef0123456789', 3, 1, 3),
88 ('2026-02-10 09:00:00', '2026-02-10 11:00:00', 'approved', 'Database Systems Lecture - Week 2', '2026-01-15 10:00:00', 'a1b2c3d4-e5f6-4789-abcd-ef0123456789', 3, 1, 3),
89 ('2026-02-17 09:00:00', '2026-02-17 11:00:00', 'approved', 'Database Systems Lecture - Week 3', '2026-01-15 10:00:00', 'a1b2c3d4-e5f6-4789-abcd-ef0123456789', 3, 1, 3),
90 ('2026-02-24 09:00:00', '2026-02-24 11:00:00', 'pending', 'Database Systems Lecture - Week 4', '2026-01-15 10:00:00', 'a1b2c3d4-e5f6-4789-abcd-ef0123456789', 3, NULL, 3);
91
92INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
93 ('2026-02-04 14:00:00', '2026-02-04 16:00:00', 'completed', 'Web Development Lab - Week 1', '2026-01-16 09:30:00', 'b2c3d4e5-f6a7-4890-bcde-f01234567890', 4, 1, 5),
94 ('2026-02-11 14:00:00', '2026-02-11 16:00:00', 'approved', 'Web Development Lab - Week 2', '2026-01-16 09:30:00', 'b2c3d4e5-f6a7-4890-bcde-f01234567890', 4, 1, 5),
95 ('2026-02-18 14:00:00', '2026-02-18 16:00:00', 'approved', 'Web Development Lab - Week 3', '2026-01-16 09:30:00', 'b2c3d4e5-f6a7-4890-bcde-f01234567890', 4, 1, 5);
96
97INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
98 ('2026-02-05 15:00:00', '2026-02-05 18:00:00', 'approved', 'Group study session for Algorithms exam', '2026-02-01 14:00:00', NULL, 7, 2, 16),
99 ('2026-02-06 10:00:00', '2026-02-06 13:00:00', 'approved', 'Project team meeting - Software Engineering', '2026-02-02 11:30:00', NULL, 8, 2, 17),
100 ('2026-02-07 09:00:00', '2026-02-07 12:00:00', 'pending', 'Thesis writing session', '2026-02-03 08:00:00', NULL, 9, NULL, 16);
101
102INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
103 ('2026-02-10 14:00:00', '2026-02-10 16:00:00', 'approved', 'Master thesis defense - Machine Learning topic', '2026-01-25 09:00:00', NULL, 5, 1, 13);
104
105INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
106 ('2026-02-08 09:00:00', '2026-02-08 17:00:00', 'approved', 'Guest lecture requiring portable projector', '2026-02-01 08:00:00', NULL, 6, 2, 9),
107 ('2026-02-12 10:00:00', '2026-02-12 12:00:00', 'rejected', 'Projector needed but already booked', '2026-02-05 15:00:00', NULL, 4, 1, 9);
108
109INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
110 ('2026-02-06 09:00:00', '2026-02-06 17:00:00', 'approved', 'Printing prototype for IoT course project', '2026-02-01 16:00:00', NULL, 10, 2, 14),
111 ('2026-02-07 09:00:00', '2026-02-07 17:00:00', 'pending', '3D print parts for robotics competition', '2026-02-04 10:00:00', NULL, 11, NULL, 15);
112
113INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
114 ('2026-02-01 00:00:00', '2026-06-30 23:59:00', 'approved', 'MATLAB license for numerical analysis course', '2026-01-20 11:00:00', NULL, 3, 1, 18),
115 ('2026-02-01 00:00:00', '2026-06-30 23:59:00', 'approved', 'GPU server access for deep learning research', '2026-01-22 14:00:00', NULL, 5, 1, 23),
116 ('2026-02-01 00:00:00', '2026-06-30 23:59:00', 'approved', 'AWS Academy access for cloud computing course', '2026-01-23 09:00:00', NULL, 4, 2, 27);
117
118INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
119 ('2026-02-05 00:00:00', '2026-03-05 23:59:00', 'approved', 'Development VM for semester project', '2026-02-01 08:30:00', NULL, 7, 2, 24),
120 ('2026-02-05 00:00:00', '2026-03-05 23:59:00', 'pending', 'Windows Server VM for .NET project', '2026-02-04 12:00:00', NULL, 12, NULL, 25);
121
122INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
123 ('2026-02-15 10:00:00', '2026-02-15 12:00:00', 'cancelled', 'Meeting cancelled due to scheduling conflict', '2026-02-01 09:00:00', NULL, 6, 1, 12);
124
125INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
126 ('2026-02-06 08:00:00', '2026-02-06 10:00:00', 'approved', 'Morning lecture - Operating Systems', '2026-01-20 10:00:00', NULL, 3, 1, 1),
127 ('2026-02-06 10:15:00', '2026-02-06 12:15:00', 'approved', 'Computer Networks Lecture', '2026-01-20 10:30:00', NULL, 4, 1, 1),
128 ('2026-02-06 14:00:00', '2026-02-06 16:00:00', 'approved', 'Software Engineering Seminar', '2026-01-20 11:00:00', NULL, 5, 1, 1);
129
130INSERT INTO reservations (start_time, end_time, status, purpose, created_at, recurrence_group_id, user_id, approved_by, resource_id) VALUES
131 ('2026-02-05 09:00:00', '2026-02-05 13:00:00', 'completed', 'Network configuration practice - CCNA prep', '2026-01-28 14:00:00', NULL, 4, 2, 7),
132 ('2026-02-12 09:00:00', '2026-02-12 13:00:00', 'approved', 'Firewall and security lab session', '2026-02-03 09:00:00', NULL, 4, 2, 7);