Апликативен дизајн-Случаи на употреба и Сценарија за пристап до базата - SQL Поглед: dmlscript-populate.sql

File dmlscript-populate.sql, 5.4 KB (added by 173067, 10 days ago)
Line 
1INSERT INTO application_user (userid, name, surname, email, password, phone_number, date_joined)
2VALUES
3(6, 'Alice', 'Johnson', 'alice.johnson@email.com', 'pass123', '1234567890', '2023-01-15'),
4(7, 'Bob', 'Smith', 'bob.smith@email.com', 'securepass', '0987654321', '2023-02-20');
5
6
7INSERT INTO destination (destinationid, best_time_to_visit, country, description, name, popular_attraction)
8VALUES
9(1, 'Spring (March to May)', 'France', 'Capital city of France, known for its art, fashion, and landmarks.', 'Paris', 'Eiffel Tower'),
10(2, 'Fall (September to November)', 'USA', 'A major cultural, financial, and media capital, known for its skyline and landmarks.', 'New York', 'Statue of Liberty'),
11(3, 'Spring (March to May)', 'Japan', 'A bustling city with a unique mix of traditional and modern attractions.', 'Tokyo', 'Shibuya Crossing'),
12(4, 'Summer (June to August)', 'United Kingdom', 'The capital of England, famous for its history, culture, and landmarks.', 'London', 'Big Ben'),
13(5, 'Fall (September to November)', 'Spain', 'A vibrant city known for its architecture, beaches, and culture.', 'Barcelona', 'Sagrada Família');
14
15
16INSERT INTO airport (airportid, city, code, country, name)
17VALUES
18(1, 1, 'CDG', 'France', 'Charles de Gaulle Airport'),
19(2, 2, 'JFK', 'USA', 'John F. Kennedy International Airport'),
20(3, 4, 'LHR', 'United Kingdom', 'London Heathrow Airport'),
21(4, 3, 'JAP', 'Japan', 'Tokyo International Airport'),
22(5, 5, 'SPN', 'Spain','Barselona Airport');
23
24INSERT INTO flight (arrival_airport, arrival_time, available_seats, departure_airport, departure_time, price, flightid,
25 flight_number, departuredate, returndate)
26VALUES
27(2, '12:30:00', 100, 1, '10:00:00', 250.00, 1, 'FL1001', '2025-03-01'::date, '2025-03-10'::date),
28(3, '15:45:00', 80, 1, '13:15:00', 300.00, 2, 'FL1002', '2025-03-02'::date, NULL),
29(1, '18:00:00', 90, 2, '16:00:00', 280.00, 3, 'FL1003', '2025-03-03'::date, '2025-03-12'::date),
30(4, '20:30:00', 120, 3, '18:00:00', 400.00, 4, 'FL1004', '2025-03-04'::date, NULL),
31(5, '22:15:00', 75, 4, '20:45:00', 350.00, 5, 'FL1005', '2025-03-05'::date, '2025-03-14'::date),
32(3, '11:00:00', 110, 5, '09:00:00', 290.00, 6, 'FL1006', '2025-03-06'::date, NULL),
33(1, '14:00:00', 95, 4, '12:30:00', 320.00, 7, 'FL1007', '2025-03-07'::date, '2025-03-16'::date),
34(5, '17:30:00', 85, 2, '15:45:00', 275.00, 8, 'FL1008', '2025-03-08'::date, NULL),
35(4, '19:45:00', 105, 3, '18:15:00', 390.00, 9, 'FL1009', '2025-03-09'::date, '2025-03-18'::date),
36(2, '23:00:00', 70, 5, '21:30:00', 260.00, 10, 'FL1010', '2025-03-10'::date, NULL);
37
38INSERT INTO booking (booking_date, bookingid, flightid, seat_number, total_cost, userid, payment_status)
39VALUES
40('2025-02-11', 35, 2, 45, 320.00, 2, 'PENDING'),
41('2025-02-11', 34, 1, 36, 320.00, 1, 'PENDING'),
42('2025-02-11', 37, 4, 25, 280.00, 5, 'PENDING'),
43('2025-02-11', 36, 3, 18, 300.00, 2, 'PENDING'),
44('2025-02-11', 38, 5, 25, 400.00, 4, 'PENDING');
45
46INSERT INTO review ("date", rating, reviewid, targetid, userid, review_comment, review_id, target_id)
47VALUES
48('2025-02-11', 5, 2, 2, 5, 'Review1', 2, 2),
49('2025-02-11', 5, 3, 3, 2, 'Review2', 3, 3),
50('2025-02-11', 5, 1, 1, 4, 'Review3', 1, 1);
51
52INSERT INTO payment (amount, bookingid, paymentid, transaction_date, userid, payment_method, payment_status)
53VALUES
54(280.00, 6, 9, '2025-02-11', 4, 'CREDIT', 'COMPLETED'),
55(280.00, 5, 8, '2025-02-11', 5, 'CREDIT', 'COMPLETED'),
56(280.00, 3, 6, '2025-02-11', 2, 'CREDIT', 'COMPLETED'),
57(400.00, 7, 10, '2025-02-11', 1, 'CREDIT', 'COMPLETED'),
58(280.00, 2, 5, '2025-02-11', 5, NULL, 'PENDING'),
59(280.00, 4, 7, '2025-02-11', 2, 'CREDIT', 'COMPLETED'),
60(280.00, 1, 4, '2025-02-13', 4, NULL, 'PENDING');
61
62insert into notification (date_sent, notificationid, userid, message, type)
63values
64('2025-02-12', 1, 1, 'Your flight booking has been confirmed.', 'BOOKING_CONFIRMATION'),
65('2025-02-12', 2, 2, 'Your flight departure has been delayed by 2 hours.', 'FLIGHT_DELAY'),
66('2025-02-12', 3, 3, 'A new destination has been added to your wishlist.', 'GENERAL_UPDATE'),
67('2025-02-12', 4, 4, 'Your support ticket has been updated.', 'GENERAL_UPDATE'),
68('2025-02-12', 5, 5, 'Your flight departure time has changed.', 'FLIGHT_DELAY'),
69('2025-02-12', 6, 1, 'Your booking has been successfully canceled.', 'BOOKING_CONFIRMATION'),
70('2025-02-12', 7, 2, 'A special discount is available for your next trip!', 'GENERAL_UPDATE'),
71('2025-02-12', 8, 3, 'Your refund request has been approved.', 'GENERAL_UPDATE'),
72('2025-02-12', 9, 4, 'A new review has been posted on your favorite destination.', 'GENERAL_UPDATE'),
73('2025-02-12', 10, 5, 'Check-in for your flight is now open.', 'BOOKING_CONFIRMATION');
74
75INSERT INTO wishlist (date_added, targetid, userid, wishlistid, user_id)
76VALUES
77('2025-02-12', 1, 101, 1),
78('2025-02-12', 2, 102, 2),
79('2025-02-12', 3, 103, 3),
80('2025-02-12', 4, 104, 4),
81('2025-02-12', 5, 105, 5),
82('2025-02-12', 6, 106, 6),
83('2025-02-12', 7, 107, 7),
84('2025-02-12', 8, 108, 8),
85('2025-02-12', 9, 109, 9),
86('2025-02-12', 10, 110, 10);
87
88INSERT INTO administrator (adminid, email)
89VALUES
90(1, 'admin');
91
92INSERT INTO supportticket (assigned_to, date_created, date_resolved, ticketid, userid, description, subject, status)
93VALUES
94(1, '2024-02-11', NULL, 3, 1, 'I need a refund for my flight.', 'Refund Request', 'OPEN'),
95(1, '2025-02-11', '2025-02-12', 1, NULL, 'hw3', 'Issue Opened', 'RESOLVED'),
96(1, '2024-02-14', NULL, 2, 2, 'My luggage was lost during transit.', 'Lost Baggage', 'OPEN');
97