|
-- insert mock data |
|
|
|
---- hotels |
|
insert into hotels |
|
(hotel_name, hotel_contact, hotel_address) |
|
values |
|
('The Shophouse', '62988721', '48, Arab St'), |
|
('The Little Red Dot', '62947098', '125, Lavender St'), |
|
('Wink Hostel', '62222940', '8A, Mosque St'); |
|
|
|
select * from hotels; |
|
|
|
---- rooms |
|
insert into rooms |
|
(hotel_id, room_type, room_price) |
|
values |
|
-- Shophouse |
|
(1, '6 Bed Dorm', 30), |
|
(1, '8 Bed Dorm', 24), |
|
(1, '12 Bed Dorm', 22), |
|
(1, 'Suite', 120), |
|
-- Lil Reddot |
|
(2, 'Single Room', 100), |
|
(2, 'Double Room', 150), |
|
(2, 'Giant Room', 230), |
|
-- Wink |
|
(3, 'Pod', 50), |
|
(3, 'Female Pod', 60), |
|
(3, 'Pod with Wifi', 70); |
|
|
|
select * from rooms; |
|
|
|
---- services |
|
insert into services |
|
(hotel_id, service_type, service_price) |
|
values |
|
(1, 'Snooker', 10), |
|
(1, 'Internet', 20), |
|
(1, 'Towel Rental', 15), |
|
(2, 'Conference Room', 100), |
|
(2, 'Massage', 30), |
|
(2, 'Business Center', 20), |
|
(3, 'Towel Rental', 10), |
|
(3, 'Soap', 5); |
|
|
|
select * from services; |
|
|
|
---- customers |
|
insert into customers |
|
(customer_name, customer_ic, customer_gender, customer_contact) |
|
values |
|
('Anonoz', 288990, 'M', '91746417'), |
|
('Howard', 884260, 'M', '94724950'), |
|
('Mildred', 755557, 'F', '35757978'), |
|
('Arthur', 311874, 'M', '23063544'), |
|
('Julia', 057249, 'F', '89479598'), |
|
('Arthur', 623247, 'F', '03923712'), |
|
('Julie', 376216, 'M', '38942905'); |
|
|
|
select * from customers; |
|
|
|
---- bookings |
|
insert into bookings |
|
(room_id, customer_id, booking_date, stay, extra) |
|
values |
|
(1, 6, '2014-12-03', 4, 'Pellentesque at nulla.'), |
|
(2, 4, '2014-12-03', 4, 'Quisque arcu libero, rutrum ac, lobortis vel, dapibus at, diam.'), |
|
(3, 1, '2014-12-01', 5, 'Mauris lacinia sapien quis libero.'), |
|
(4, 2, '2014-12-05', 3, 'Duis bibendum, felis sed interdum venenatis, turpis enim blandit mi, in porttitor pede justo eu massa.'), |
|
(5, 5, '2014-12-03', 5, null), |
|
(6, 2, '2014-12-05', 2, null), |
|
(7, 3, '2014-12-02', 2, 'Ut at dolor quis odio consequat varius.'), |
|
(8, 5, '2014-12-04', 4, null), |
|
(9, 6, '2014-12-02', 2, null), |
|
(10, 3, '2014-12-06', 3, 'Suspendisse potenti.'), |
|
(3, 5, '2014-12-03', 1, 'In hac habitasse platea dictumst.'), |
|
(1, 4, '2014-12-01', 3, 'Praesent blandit.'), |
|
(4, 6, '2014-12-02', 3, null), |
|
(8, 5, '2014-12-06', 4, 'Morbi vestibulum, velit id pretium iaculis, diam erat fermentum justo, nec condimentum neque sapien placerat ante.'), |
|
(6, 1, '2014-12-05', 3, 'Donec ut dolor.'), |
|
(7, 5, '2014-12-02', 2, 'Phasellus in felis.'), |
|
(2, 4, '2014-12-04', 2, null), |
|
(2, 4, '2014-12-05', 3, null), |
|
(9, 4, '2014-12-02', 4, null), |
|
(10, 5, '2014-12-05', 3, null), |
|
(5, 4, '2014-12-05', 1, 'Integer tincidunt ante vel ipsum.'), |
|
(5, 1, '2014-12-04', 6, 'In blandit ultrices enim.'), |
|
(4, 7, '2014-12-03', 5, 'Suspendisse potenti.'), |
|
(3, 5, '2014-12-02', 4, 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.'), |
|
(2, 1, '2014-12-06', 3, 'Aliquam augue quam, sollicitudin vitae, consectetuer eget, rutrum at, lorem.'); |
|
|
|
select * from bookings; |
|
|
|
---- reviews -- please create the trigger below first |
|
insert into reviews |
|
(hotel_id, customer_id, review_title, review_rating, review_comment) |
|
values |
|
(1, 6, 'Morbi porttitor lorem id ligula.', 3, 'Phasellus in felis. Donec semper sapien a libero.'), |
|
(2, 4, 'Nunc nisl.', 4, 'Mauris lacinia sapien quis libero. Nullam sit amet turpis elementum ligula vehicula consequat.'), |
|
(2, 1, 'Sed sagittis.', 5, 'Nunc nisl. Duis bibendum, felis sed interdum venenatis, turpis enim blandit mi, in porttitor pede justo eu massa.'), |
|
(2, 2, 'Nam nulla.', 4, 'Duis mattis egestas metus. Aenean fermentum. Donec ut mauris eget massa tempor convallis.'), |
|
(1, 5, 'Suspendisse potenti.', 2, null), |
|
(3, 2, 'In hac habitasse platea dictumst.', 1, null), |
|
(1, 3, 'Vivamus metus arcu, adipiscing molestie, hendrerit at, vulputate vitae, nisl.', 3, null), |
|
(3, 5, 'Mauris enim leo, rhoncus sed, vestibulum sit amet, cursus id, turpis.', 3, 'Curabitur at ipsum ac tellus semper interdum. Mauris ullamcorper purus sit amet nulla. Quisque arcu libero, rutrum ac, lobortis vel, dapibus at, diam.'), |
|
(2, 6, 'Nullam varius.', 2, null), |
|
(2, 3, 'Sed ante.', 1, null); |
|
|
|
select * from reviews; |
|
select * from hotels; -- check hotel_rating column is updated by trigger |
|
|
|
---- booking_services |
|
insert into booking_services |
|
(booking_id, service_id) |
|
values |
|
(1, (select service_id from services where hotel_id = (select (select hotel_id from rooms where room_id = booking.room_id) from bookings booking where booking_id = 1) order by rand() limit 0, 1)), |
|
(3, (select service_id from services where hotel_id = (select (select hotel_id from rooms where room_id = booking.room_id) from bookings booking where booking_id = 3) order by rand() limit 0, 1)), |
|
(6, (select service_id from services where hotel_id = (select (select hotel_id from rooms where room_id = booking.room_id) from bookings booking where booking_id = 6) order by rand() limit 0, 1)), |
|
(8, (select service_id from services where hotel_id = (select (select hotel_id from rooms where room_id = booking.room_id) from bookings booking where booking_id = 8) order by rand() limit 0, 1)), |
|
(14, (select service_id from services where hotel_id = (select (select hotel_id from rooms where room_id = booking.room_id) from bookings booking where booking_id = 14) order by rand() limit 0, 1)), |
|
(17, (select service_id from services where hotel_id = (select (select hotel_id from rooms where room_id = booking.room_id) from bookings booking where booking_id = 17) order by rand() limit 0, 1)), |
|
(20, (select service_id from services where hotel_id = (select (select hotel_id from rooms where room_id = booking.room_id) from bookings booking where booking_id = 20) order by rand() limit 0, 1)), |
|
(23, (select service_id from services where hotel_id = (select (select hotel_id from rooms where room_id = booking.room_id) from bookings booking where booking_id = 23) order by rand() limit 0, 1)); |
|
|
|
select * from booking_services; -- used rand() function, everyone's db2 may differ |