-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_database.sql
More file actions
39 lines (35 loc) · 1.7 KB
/
Copy pathsetup_database.sql
File metadata and controls
39 lines (35 loc) · 1.7 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
-- ========================================
-- FESTIVAL MANAGEMENT DATABASE SETUP
-- Lab 11 - JDBC Connectivity
-- ========================================
-- Drop table if exists (for clean setup)
DROP TABLE IF EXISTS Festival CASCADE;
-- Create Festival table
CREATE TABLE Festival (
Festival_ID VARCHAR(10) PRIMARY KEY,
Theme VARCHAR(100) NOT NULL,
Festival_Year VARCHAR(4) NOT NULL,
Start_date DATE NOT NULL,
End_date DATE NOT NULL,
CONSTRAINT check_dates CHECK (End_date >= Start_date)
);
-- Insert sample data
INSERT INTO Festival (Festival_ID, Theme, Festival_Year, Start_date, End_date) VALUES
('F2010', 'Mystic Woods', '2010', '2010-07-15', '2010-07-18'),
('F2011', 'Pixel Paradox', '2011', '2011-06-20', '2011-06-23'),
('F2012', 'Harry Potter Magic', '2012', '2012-08-01', '2012-08-05'),
('F2013', 'Cosmic Carnival', '2013', '2013-07-10', '2013-07-14'),
('F2014', 'Neon Dreams', '2014', '2014-09-05', '2014-09-08'),
('F2015', 'Winter Wonderland', '2015', '2015-12-18', '2015-12-21'),
('F2016', 'Cybernetic City', '2016', '2016-05-25', '2016-05-29'),
('F2017', 'Enchanted Kingdom', '2017', '2017-07-22', '2017-07-25'),
('F2018', 'Steampunk Saga', '2018', '2018-10-11', '2018-10-14'),
('F2019', 'Pirate''s Cove', '2019', '2019-06-30', '2019-07-03'),
('F2020', 'Jurassic Jungle', '2020', '2020-08-14', '2020-08-18'),
('F2021', 'Galactic Gateway', '2021', '2021-07-07', '2021-07-11'),
('F2022', 'Aetherium Echoes', '2022', '2022-09-15', '2022-09-19'),
('F2023', 'Solaris Bloom', '2023', '2023-06-12', '2023-06-15'),
('F2024', 'Quantum Quest', '2024', '2024-08-20', '2024-08-24'),
('F2025', 'Viking Vanguard', '2025', '2025-07-19', '2025-07-22');
-- Verify data
SELECT * FROM Festival ORDER BY Festival_Year;