334 lines
9.9 KiB
SQL
334 lines
9.9 KiB
SQL
-- Szobák
|
|
CREATE TABLE szobak (
|
|
`id` int(11) NOT NULL,
|
|
`emelet` int(2) NOT NULL,
|
|
`szobaszam` int(8) NOT NULL UNIQUE,
|
|
`ferohelyek` int(3) NOT NULL,
|
|
`ar` decimal(10,2) DEFAULT NULL,
|
|
`megjegyzes` varchar(255) DEFAULT NULL
|
|
);
|
|
|
|
ALTER TABLE szobak
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
INSERT INTO `szobak` (`id`, `emelet`, `szobaszam`, `ferohelyek`, `ar`, `megjegyzes`) VALUES
|
|
(1, 0, 1, 2, 20000, 'mozgáskorlátozott-barát'),
|
|
(2, 0, 2, 2, 20000, 'mozgáskorlátozott-barát'),
|
|
(3, 0, 3, 2, 20000, null),
|
|
(4, 0, 4, 2, 35000, 'luxus lakosztály'),
|
|
(5, 0, 5, 4, 20000, null),
|
|
(6, 0, 6, 4, 20000, null),
|
|
(7, 0, 7, 4, 40000, null),
|
|
(8, 0, 8, 4, 40000, null),
|
|
(9, 0, 9, 4, 40000, null),
|
|
(10, 0, 10, 4, 40000, null),
|
|
(11, 0, 11, 4, 40000, 'mozgáskorlátozott-barát'),
|
|
(12, 0, 12, 4, 55000, 'luxus lakosztály'),
|
|
(13, 1, 101, 2, 20000, null),
|
|
(14, 1, 102, 2, 20000, null),
|
|
(15, 1, 103, 2, 20000, null),
|
|
(16, 1, 104, 2, 25000, 'luxus lakosztály'),
|
|
(17, 1, 105, 2, 25000, 'luxus lakosztály'),
|
|
(18, 1, 106, 2, 27500, 'luxus lakosztály panorámás kilátás'),
|
|
(19, 1, 107, 4, 57500, 'luxus lakosztály panorámás kilátás'),
|
|
(20, 1, 108, 4, 40000, null),
|
|
(21, 1, 109, 4, 40000, null),
|
|
(22, 1, 110, 6, 60000, null),
|
|
(23, 1, 111, 6, 60000, 'pótágyazható'),
|
|
(24, 1, 112, 6, 60000, 'pótágyazható'),
|
|
(25, 2, 201, 2, 20000, null),
|
|
(26, 2, 202, 2, 20000, null),
|
|
(27, 2, 203, 2, 20000, null),
|
|
(28, 2, 204, 2, 20000, null),
|
|
(29, 2, 206, 2, 22000, 'panorámás kilátás'),
|
|
(30, 2, 207, 2, 22000, 'panorámás kilátás'),
|
|
(31, 2, 208, 2, 22000, 'panorámás kilátás'),
|
|
(32, 2, 209, 4, 40000, null),
|
|
(33, 2, 210, 4, 40000, null),
|
|
(34, 2, 211, 4, 40000, null),
|
|
(35, 2, 212, 4, 55000, 'luxus lakosztály'),
|
|
(36, 2, 213, 6, 60000, null),
|
|
(37, 2, 214, 6, 60000, 'pótágyazható'),
|
|
(38, 2, 215, 6, 80000, 'luxus lakosztály panorámás kilátás');
|
|
|
|
ALTER TABLE `szobak`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;
|
|
|
|
-- Vendégek
|
|
CREATE TABLE vendegek (
|
|
`id` int(11) NOT NULL,
|
|
`nev` varchar(255) not null,
|
|
`eletkor` int(4) NOT NULL
|
|
);
|
|
|
|
ALTER TABLE vendegek
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
INSERT INTO `vendegek` (`id`, `nev`, `eletkor`) VALUES
|
|
(1, 'Kovács András', 23),
|
|
(2, 'Botond Attila', 40),
|
|
(3, 'Kiss Balázs', 29),
|
|
(4, 'Pálmai Nóra', 26),
|
|
(5, 'Németh Péter', 62),
|
|
(6, 'Falusi Krisztina', 19),
|
|
(7, 'Kiss Károly', 62),
|
|
(8, 'Tököli Ferenc', 60),
|
|
(9, 'Török Éva', 42),
|
|
(10, 'Kisnánai Józsefné', 35),
|
|
(11,'Cukorhegyi Márk', 35),
|
|
(12, 'Soós András', 26),
|
|
(13, 'John Edward', 41),
|
|
(14, 'Malik András', 60),
|
|
(15, 'Kovácsné Zentai Illdikó', 55),
|
|
(16, 'Maróthi Béla', 31),
|
|
(17, 'Orosz Szilárd', 39),
|
|
(18, 'Kocsis Zoltánné Erika', 42),
|
|
(19, 'Alföldi Zoltán', 40),
|
|
(20, 'Zente Ferenc', 29),
|
|
(21, 'Nagy Gáspár', 46),
|
|
(22, 'Lelkes Bálint', 34),
|
|
(23, 'Mérész Dániel', 55),
|
|
(24, 'Pardavi Balázs', 38),
|
|
(25, 'Szedmák Bálint', 31),
|
|
(26, 'Fűtő Ildikó', 40),
|
|
(27, 'Nefelejts Sándor', 45),
|
|
(28, 'Kővári Ferenc', 43),
|
|
(29, 'Csalami Krisztián', 49),
|
|
(30, 'Lugosi Béla', 50),
|
|
(31, 'Kovács András Bendegúz', 40),
|
|
(32, 'Nagy-Bandó Andrea', 40),
|
|
(33, 'Csóró Csanád', 38);
|
|
|
|
ALTER TABLE `vendegek`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
|
|
|
|
|
|
-- Foglalások
|
|
CREATE TABLE foglalasok (
|
|
`id` int(11) NOT NULL,
|
|
`szobaId` int(11) NOT NULL,
|
|
`vendegId` int(11) NOT NULL,
|
|
`napok` int(4) NOT NULL,
|
|
`datum` datetime NOT NULL
|
|
);
|
|
|
|
ALTER TABLE foglalasok
|
|
ADD PRIMARY KEY (`id`),
|
|
ADD KEY `szobaId` (`szobaId`),
|
|
ADD KEY `vendegId` (`vendegId`);
|
|
|
|
ALTER TABLE foglalasok
|
|
ADD CONSTRAINT FK_szobak_szobaId FOREIGN KEY (szobaId)
|
|
REFERENCES szobak (id);
|
|
|
|
ALTER TABLE foglalasok
|
|
ADD CONSTRAINT FK_vendegek_vendegId FOREIGN KEY (vendegId)
|
|
REFERENCES vendegek (id);
|
|
|
|
INSERT INTO `foglalasok` (`id`, `szobaId`, `vendegId`, `napok`, `datum`) VALUES
|
|
(1, 19, 10, 2, '2020-08-29'),
|
|
(2, 26, 26, 10, '2020-07-26'),
|
|
(3, 9, 15, 10, '2020-11-17'),
|
|
(4, 26, 12, 8, '2020-02-19'),
|
|
(5, 3, 6, 6, '2020-11-01'),
|
|
(6, 36, 16, 6, '2020-01-23'),
|
|
(7, 11, 18, 4, '2020-12-13'),
|
|
(8, 8, 30, 1, '2020-08-07'),
|
|
(9, 14, 20, 2, '2020-06-29'),
|
|
(10, 7, 10, 4, '2020-05-04'),
|
|
(11, 20, 30, 4, '2020-01-30'),
|
|
(12, 15, 15, 1, '2020-12-09'),
|
|
(13, 20, 21, 1, '2020-12-23'),
|
|
(14, 9, 4, 9, '2020-07-08'),
|
|
(15, 22, 11, 1, '2020-04-10'),
|
|
(16, 21, 24, 1, '2020-01-02'),
|
|
(17, 35, 31, 9, '2020-01-25'),
|
|
(18, 21, 15, 8, '2020-09-21'),
|
|
(19, 23, 2, 8, '2020-12-30'),
|
|
(20, 32, 24, 5, '2020-03-18'),
|
|
(21, 32, 12, 1, '2020-09-22'),
|
|
(22, 37, 10, 10, '2020-05-05'),
|
|
(23, 3, 25, 7, '2020-09-23'),
|
|
(24, 27, 8, 10, '2020-08-23'),
|
|
(25, 6, 30, 3, '2020-12-11'),
|
|
(26, 7, 3, 5, '2020-08-17'),
|
|
(27, 14, 3, 5, '2020-03-26'),
|
|
(28, 14, 11, 3, '2020-04-15'),
|
|
(29, 28, 17, 5, '2020-09-27'),
|
|
(30, 7, 18, 9, '2020-11-30'),
|
|
(31, 22, 6, 8, '2020-06-19'),
|
|
(32, 14, 1, 9, '2020-06-05'),
|
|
(33, 28, 30, 4, '2020-04-23'),
|
|
(34, 15, 10, 3, '2020-04-05'),
|
|
(35, 19, 29, 9, '2020-04-24'),
|
|
(36, 17, 11, 8, '2020-06-11'),
|
|
(37, 34, 18, 1, '2020-04-04'),
|
|
(38, 19, 13, 10, '2020-10-07'),
|
|
(39, 36, 27, 4, '2020-10-25'),
|
|
(40, 3, 12, 8, '2020-06-09'),
|
|
(41, 7, 7, 8, '2020-07-17'),
|
|
(42, 25, 10, 4, '2020-02-09'),
|
|
(43, 5, 16, 2, '2020-09-10'),
|
|
(44, 25, 8, 8, '2020-09-24'),
|
|
(45, 4, 15, 5, '2020-11-01'),
|
|
(46, 38, 20, 10, '2020-03-09'),
|
|
(47, 10, 2, 10, '2020-05-29'),
|
|
(48, 22, 12, 8, '2020-09-15'),
|
|
(49, 30, 22, 1, '2020-11-17'),
|
|
(50, 3, 5, 5, '2020-12-07'),
|
|
(51, 14, 25, 2, '2020-08-26'),
|
|
(52, 36, 11, 8, '2020-06-12'),
|
|
(53, 26, 14, 1, '2020-08-27'),
|
|
(54, 38, 28, 5, '2020-11-04'),
|
|
(55, 19, 18, 3, '2020-01-02'),
|
|
(56, 29, 9, 1, '2020-06-04'),
|
|
(57, 26, 4, 7, '2020-04-17'),
|
|
(58, 33, 4, 5, '2020-02-21'),
|
|
(59, 17, 24, 8, '2020-06-19'),
|
|
(60, 7, 7, 10, '2020-06-25'),
|
|
(61, 25, 17, 1, '2020-11-23'),
|
|
(62, 25, 4, 9, '2020-05-15'),
|
|
(63, 22, 19, 8, '2020-05-30'),
|
|
(64, 24, 28, 2, '2020-03-14'),
|
|
(65, 34, 7, 1, '2020-12-28'),
|
|
(66, 23, 30, 10, '2020-05-18'),
|
|
(67, 12, 23, 2, '2020-03-21'),
|
|
(68, 26, 29, 8, '2020-06-06'),
|
|
(69, 14, 14, 9, '2020-06-09'),
|
|
(70, 4, 14, 6, '2020-03-01'),
|
|
(71, 37, 10, 9, '2020-10-13'),
|
|
(72, 29, 5, 1, '2020-12-19'),
|
|
(73, 37, 16, 3, '2020-05-23'),
|
|
(74, 29, 25, 6, '2020-04-02'),
|
|
(75, 26, 24, 2, '2020-05-14'),
|
|
(76, 32, 18, 6, '2020-11-19'),
|
|
(77, 5, 20, 5, '2020-03-24'),
|
|
(78, 26, 26, 3, '2020-01-09'),
|
|
(79, 8, 30, 8, '2020-03-07'),
|
|
(80, 4, 26, 5, '2020-05-24'),
|
|
(81, 16, 4, 1, '2020-02-08'),
|
|
(82, 21, 17, 3, '2020-03-29'),
|
|
(83, 8, 10, 7, '2020-04-17'),
|
|
(84, 10, 32, 9, '2020-02-13'),
|
|
(85, 9, 22, 4, '2020-11-04'),
|
|
(86, 10, 3, 1, '2020-08-30'),
|
|
(87, 5, 3, 2, '2020-12-28'),
|
|
(88, 23, 18, 7, '2020-04-07'),
|
|
(89, 9, 32, 9, '2020-03-16'),
|
|
(90, 13, 10, 4, '2020-10-13'),
|
|
(91, 4, 21, 4, '2020-04-23'),
|
|
(92, 20, 11, 1, '2020-06-08'),
|
|
(93, 23, 1, 5, '2020-01-02'),
|
|
(94, 11, 11, 4, '2020-09-28'),
|
|
(95, 11, 19, 7, '2020-12-06'),
|
|
(96, 31, 25, 8, '2020-12-15'),
|
|
(97, 10, 7, 9, '2020-10-20'),
|
|
(98, 27, 28, 1, '2020-02-25'),
|
|
(99, 34, 28, 7, '2020-04-30'),
|
|
(100, 38, 3, 6, '2020-03-21'),
|
|
(101, 15, 14, 4, '2020-09-02'),
|
|
(102, 33, 6, 4, '2020-12-26'),
|
|
(103, 17, 2, 4, '2020-03-06'),
|
|
(104, 25, 7, 10, '2020-07-05'),
|
|
(105, 31, 8, 10, '2020-04-27'),
|
|
(106, 14, 32, 4, '2020-09-03'),
|
|
(107, 3, 17, 4, '2020-10-21'),
|
|
(108, 33, 4, 2, '2020-06-09'),
|
|
(109, 2, 28, 9, '2020-03-01'),
|
|
(110, 8, 1, 8, '2020-02-08'),
|
|
(111, 23, 16, 4, '2020-11-08'),
|
|
(112, 38, 31, 5, '2020-02-04'),
|
|
(113, 30, 19, 9, '2020-06-03'),
|
|
(114, 4, 26, 6, '2020-05-02'),
|
|
(115, 29, 20, 6, '2020-07-16'),
|
|
(116, 37, 32, 9, '2020-08-08'),
|
|
(117, 24, 6, 9, '2020-08-28'),
|
|
(118, 10, 31, 5, '2020-10-09'),
|
|
(119, 7, 29, 10, '2020-10-20'),
|
|
(120, 24, 1, 2, '2020-08-17'),
|
|
(121, 31, 8, 9, '2020-01-22'),
|
|
(122, 16, 29, 5, '2020-08-08'),
|
|
(123, 8, 15, 9, '2020-12-01'),
|
|
(124, 32, 20, 8, '2020-04-26'),
|
|
(125, 8, 22, 10, '2020-08-15'),
|
|
(126, 6, 23, 2, '2020-02-08'),
|
|
(127, 36, 21, 5, '2020-11-20'),
|
|
(128, 18, 23, 10, '2020-05-19'),
|
|
(129, 22, 4, 2, '2020-10-17'),
|
|
(130, 17, 25, 5, '2020-03-22'),
|
|
(131, 29, 10, 7, '2020-02-08'),
|
|
(132, 34, 21, 7, '2020-07-30'),
|
|
(133, 34, 24, 10, '2020-03-10'),
|
|
(134, 24, 32, 1, '2020-08-12'),
|
|
(135, 19, 21, 4, '2020-10-07'),
|
|
(136, 5, 27, 2, '2020-01-09'),
|
|
(137, 38, 13, 6, '2020-01-18'),
|
|
(138, 33, 7, 2, '2020-10-13'),
|
|
(139, 20, 27, 3, '2020-05-25'),
|
|
(140, 1, 26, 4, '2020-02-28'),
|
|
(141, 17, 16, 2, '2020-01-02'),
|
|
(142, 1, 26, 9, '2020-11-04'),
|
|
(143, 15, 14, 3, '2020-06-29'),
|
|
(144, 38, 20, 5, '2020-06-27'),
|
|
(145, 11, 30, 10, '2020-06-13'),
|
|
(146, 37, 15, 6, '2020-09-27'),
|
|
(147, 15, 6, 1, '2020-06-24'),
|
|
(148, 35, 6, 2, '2020-11-06'),
|
|
(149, 12, 1, 5, '2020-12-22'),
|
|
(150, 20, 9, 2, '2020-11-12'),
|
|
(151, 3, 11, 9, '2020-08-04'),
|
|
(152, 22, 22, 1, '2020-06-21'),
|
|
(153, 38, 32, 3, '2020-09-15'),
|
|
(154, 13, 7, 5, '2020-09-21'),
|
|
(155, 27, 26, 8, '2020-05-10'),
|
|
(156, 3, 29, 5, '2020-09-04'),
|
|
(157, 29, 2, 8, '2020-04-08'),
|
|
(158, 31, 6, 4, '2020-04-29'),
|
|
(159, 21, 25, 5, '2020-05-05'),
|
|
(160, 7, 3, 2, '2020-02-05'),
|
|
(161, 22, 16, 8, '2020-10-01'),
|
|
(162, 32, 27, 3, '2020-04-29'),
|
|
(163, 22, 19, 4, '2020-12-01'),
|
|
(164, 26, 9, 1, '2020-12-15'),
|
|
(165, 19, 4, 10, '2020-09-29'),
|
|
(166, 2, 24, 10, '2020-07-06'),
|
|
(167, 14, 14, 10, '2020-08-15'),
|
|
(168, 1, 9, 7, '2020-11-13'),
|
|
(169, 1, 31, 9, '2020-09-07'),
|
|
(170, 31, 15, 3, '2020-07-04'),
|
|
(171, 33, 8, 6, '2020-01-03'),
|
|
(172, 15, 23, 7, '2020-11-26'),
|
|
(173, 15, 4, 8, '2020-01-09'),
|
|
(174, 14, 16, 5, '2020-05-21'),
|
|
(175, 17, 16, 1, '2020-05-27'),
|
|
(176, 38, 31, 10, '2020-11-20'),
|
|
(177, 38, 25, 5, '2020-12-02'),
|
|
(178, 20, 5, 10, '2020-08-04'),
|
|
(179, 28, 18, 2, '2020-04-22'),
|
|
(180, 15, 28, 8, '2020-04-10'),
|
|
(181, 36, 24, 9, '2020-04-07'),
|
|
(182, 21, 2, 6, '2020-11-12'),
|
|
(183, 4, 27, 10, '2020-04-13'),
|
|
(184, 1, 14, 10, '2020-12-06'),
|
|
(185, 38, 27, 5, '2020-04-16'),
|
|
(186, 34, 17, 6, '2020-01-31'),
|
|
(187, 2, 9, 6, '2020-09-15'),
|
|
(188, 24, 11, 6, '2020-09-09'),
|
|
(189, 7, 17, 6, '2020-07-08'),
|
|
(190, 4, 29, 9, '2020-10-18'),
|
|
(191, 6, 1, 9, '2020-05-21'),
|
|
(192, 33, 16, 1, '2020-10-08'),
|
|
(193, 30, 10, 1, '2020-05-18'),
|
|
(194, 35, 9, 2, '2020-10-20'),
|
|
(195, 12, 31, 10, '2020-08-29'),
|
|
(196, 20, 8, 4, '2020-12-04'),
|
|
(197, 8, 5, 4, '2020-05-13'),
|
|
(198, 7, 14, 7, '2020-04-11'),
|
|
(199, 12, 33, 1, '2020-03-07');
|
|
|
|
ALTER TABLE `foglalasok`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=200;
|
|
|
|
|
|
|