--  I. 606.
--  Schmidt Marcell
--  Pécs, Koch Valéria Gimn., Ált. Isk., 9. o. t.
--  schmidtmarcell.888@gmail.com

-- 1. Készítsünk új adatbázist szervezo néven.

CREATE DATABASE szervezo;

-- 2. A táblák kialakítása

USE szervezo;

CREATE TABLE szemely (
  id int(11),
  nev varchar(50),
  email varchar(50),
  fizetesimod varchar(50),
  PRIMARY KEY (id)
);

CREATE TABLE eloadas (
  id int(11),
  cim varchar(50),
  jegyar int(11),
  PRIMARY KEY (id)
);

CREATE TABLE rendeles (
  id int(11),
  szinhaz varchar(50),
  datum date,
  eloadasid int(11),
  szemelyid int(11),
  PRIMARY KEY (id),
  FOREIGN KEY (eloadasid) REFERENCES eloadas(id),
  FOREIGN KEY (szemelyid) REFERENCES szemely(id)
);

-- 3. A táblákban helyezzünk el adatokat tetszőleges forrásból.
--    Személy- és színházneveket például az interneten találunk, a többi adatot pedig generálhatjuk.
--    A rekordok száma minimum 50 legyen a szemely, 25 az eloadas és 100 a rendeles táblában.

INSERT INTO szemely (id, nev, email, fizetesimod)
VALUES
  (1, 'Alice Johnson', 'alice.johnson@example.com', 'Credit Card'),
  (2, 'Bob Smith', 'bob.smith@example.com', 'PayPal'),
  (3, 'Charlie Davis', 'charlie.davis@example.com', 'Cash'),
  (4, 'David Miller', 'david.miller@example.com', 'Credit Card'),
  (5, 'Emma Wilson', 'emma.wilson@example.com', 'PayPal'),
  (6, 'Frank White', 'frank.white@example.com', 'Cash'),
  (7, 'Grace Turner', 'grace.turner@example.com', 'Credit Card'),
  (8, 'Henry Brown', 'henry.brown@example.com', 'PayPal'),
  (9, 'Ivy Moore', 'ivy.moore@example.com', 'Cash'),
  (10, 'Jack Robinson', 'jack.robinson@example.com', 'Credit Card'),
  (11, 'Kelly Harris', 'kelly.harris@example.com', 'PayPal'),
  (12, 'Leo Taylor', 'leo.taylor@example.com', 'Cash'),
  (13, 'Mia Davis', 'mia.davis@example.com', 'Credit Card'),
  (14, 'Nathan White', 'nathan.white@example.com', 'PayPal'),
  (15, 'Olivia Miller', 'olivia.miller@example.com', 'Cash'),
  (16, 'Peter Harris', 'peter.harris@example.com', 'Credit Card'),
  (17, 'Quinn Robinson', 'quinn.robinson@example.com', 'PayPal'),
  (18, 'Rachel Wilson', 'rachel.wilson@example.com', 'Cash'),
  (19, 'Samuel Brown', 'samuel.brown@example.com', 'Credit Card'),
  (20, 'Tina Moore', 'tina.moore@example.com', 'PayPal'),
  (21, 'Ulysses Taylor', 'ulysses.taylor@example.com', 'Cash'),
  (22, 'Victoria Harris', 'victoria.harris@example.com', 'Credit Card'),
  (23, 'Walter Davis', 'walter.davis@example.com', 'PayPal'),
  (24, 'Xena White', 'xena.white@example.com', 'Cash'),
  (25, 'Yasmine Robinson', 'yasmine.robinson@example.com', 'Credit Card'),
  (26, 'Zane Wilson', 'zane.wilson@example.com', 'PayPal'),
  (27, 'Amy Brown', 'amy.brown@example.com', 'Cash'),
  (28, 'Brian Moore', 'brian.moore@example.com', 'Credit Card'),
  (29, 'Catherine Taylor', 'catherine.taylor@example.com', 'PayPal'),
  (30, 'David Harris', 'david.harris@example.com', 'Cash'),
  (31, 'Eva Davis', 'eva.davis@example.com', 'Credit Card'),
  (32, 'Frank White', 'frank.white@example.com', 'PayPal'),
  (33, 'Grace Turner', 'grace.turner@example.com', 'Cash'),
  (34, 'Henry Brown', 'henry.brown@example.com', 'Credit Card'),
  (35, 'Ivy Moore', 'ivy.moore@example.com', 'PayPal'),
  (36, 'Jack Robinson', 'jack.robinson@example.com', 'Cash'),
  (37, 'Kelly Harris', 'kelly.harris@example.com', 'Credit Card'),
  (38, 'Leo Taylor', 'leo.taylor@example.com', 'PayPal'),
  (39, 'Mia Davis', 'mia.davis@example.com', 'Cash'),
  (40, 'Nathan White', 'nathan.white@example.com', 'Credit Card'),
  (41, 'Olivia Miller', 'olivia.miller@example.com', 'PayPal'),
  (42, 'Peter Harris', 'peter.harris@example.com', 'Cash'),
  (43, 'Quinn Robinson', 'quinn.robinson@example.com', 'Credit Card'),
  (44, 'Rachel Wilson', 'rachel.wilson@example.com', 'PayPal'),
  (45, 'Samuel Brown', 'samuel.brown@example.com', 'Cash'),
  (46, 'Tina Moore', 'tina.moore@example.com', 'Credit Card'),
  (47, 'Ulysses Taylor', 'ulysses.taylor@example.com', 'PayPal'),
  (48, 'Victoria Harris', 'victoria.harris@example.com', 'Cash'),
  (49, 'Walter Davis', 'walter.davis@example.com', 'Credit Card'),
  (50, 'Xena White', 'xena.white@example.com', 'PayPal'),
  (51, 'Yasmine Robinson', 'yasmine.robinson@example.com', 'Cash'),
  (52, 'Zane Wilson', 'zane.wilson@example.com', 'Credit Card'),
  (53, 'Amy Brown', 'amy.brown@example.com', 'PayPal'),
  (54, 'Brian Moore', 'brian.moore@example.com', 'Cash'),
  (55, 'Catherine Taylor', 'catherine.taylor@example.com', 'Credit Card'),
  (56, 'David Harris', 'david.harris@example.com', 'PayPal'),
  (57, 'Eva Davis', 'eva.davis@example.com', 'Cash'),
  (58, 'Frank White', 'frank.white@example.com', 'Credit Card'),
  (59, 'Grace Turner', 'grace.turner@example.com', 'PayPal'),
  (60, 'Henry Brown', 'henry.brown@example.com', 'Cash'),
  (61, 'Ivy Moore', 'ivy.moore@example.com', 'Credit Card'),
  (62, 'Jack Robinson', 'jack.robinson@example.com', 'PayPal'),
  (63, 'Kelly Harris', 'kelly.harris@example.com', 'Cash'),
  (64, 'Leo Taylor', 'leo.taylor@example.com', 'Credit Card'),
  (65, 'Mia Davis', 'mia.davis@example.com', 'PayPal'),
  (66, 'Nathan White', 'nathan.white@example.com', 'Cash'),
  (67, 'Olivia Miller', 'olivia.miller@example.com', 'Credit Card'),
  (68, 'Peter Harris', 'peter.harris@example.com', 'PayPal'),
  (69, 'Quinn Robinson', 'quinn.robinson@example.com', 'Cash'),
  (70, 'Rachel Wilson', 'rachel.wilson@example.com', 'Credit Card'),
  (71, 'Samuel Brown', 'samuel.brown@example.com', 'PayPal'),
  (72, 'Tina Moore', 'tina.moore@example.com', 'Cash'),
  (73, 'Ulysses Taylor', 'ulysses.taylor@example.com', 'Credit Card'),
  (74, 'Victoria Harris', 'victoria.harris@example.com', 'PayPal');
  
INSERT INTO eloadas (id, cim, jegyar)
VALUES
  (1, 'The Phantom of the Opera', 50),
  (2, 'Les Misérables', 45),
  (3, 'Romeo and Juliet', 40),
  (4, 'Hamlet', 55),
  (5, 'Wicked', 60),
  (6, 'Cats', 50),
  (7, 'The Lion King', 65),
  (8, 'Mamma Mia!', 55),
  (9, 'Rent', 50),
  (10, 'The Nutcracker', 40),
  (11, 'Swan Lake', 45),
  (12, 'A Midsummer Night''s Dream', 40),
  (13, 'The Wizard of Oz', 50),
  (14, 'Chicago', 60),
  (15, 'Beauty and the Beast', 55),
  (16, 'Grease', 50),
  (17, 'West Side Story', 55),
  (18, 'Phantom', 45),
  (19, 'Cinderella', 40),
  (20, 'Aladdin', 60),
  (21, 'The Little Mermaid', 50),
  (22, 'Mary Poppins', 55),
  (23, 'Sweeney Todd', 60),
  (24, 'Into the Woods', 45),
  (25, 'Evita', 50),
  (26, 'Fantomatique', 55),
  (27, 'Matilda', 40),
  (28, 'The Hunchback of Notre-Dame', 60),
  (29, 'Guys and Dolls', 50),
  (30, 'Cabaret', 55),
  (31, 'South Pacific', 40),
  (32, 'My Fair Lady', 45),
  (33, 'Hairspray', 50),
  (34, 'A Chorus Line', 55),
  (35, 'Oklahoma!', 60),
  (36, 'Jersey Boys', 50),
  (37, 'The Book of Mormon', 55),
  (38, 'Kinky Boots', 40),
  (39, 'Jerusalem', 45),
  (40, 'Miss Saigon', 50),
  (41, 'In the Heights', 55),
  (42, 'The Producers', 60),
  (43, 'Avenue Q', 50),
  (44, 'Rent', 55),
  (45, 'Billy Elliot', 40),
  (46, 'Moulin Rouge!', 45),
  (47, 'Sunset Boulevard', 50),
  (48, 'Aida', 55),
  (49, 'The Color Purple', 40),
  (50, 'Kiss Me, Kate', 60);  
  
  
INSERT INTO rendeles (id,szinhaz,datum,eloadasid,szemelyid)
VALUES (1,'Royal Theatre','2023-12-10',43,32),
(2,'Grand Opera House','2023-12-11',21,45),
(3,'City Playhouse','2023-12-12',7,32),
(4,'National Theater','2023-12-13',6,37),
(5,'Metropolitan Arts Center','2023-12-14',15,35),
(6,'Downtown Playhouse','2023-12-15',19,10),
(7,'Royal Theatre','2023-12-16',23,56),
(8,'Grand Opera House','2023-12-17',26,49),
(9,'City Playhouse','2023-12-18',30,43),
(10,'National Theater','2023-12-19',11,10),
(11,'Metropolitan Arts Center','2023-12-20',15,17),
(12,'Downtown Playhouse','2023-12-10',5,35),
(13,'Royal Theatre','2023-12-11',6,53),
(14,'Grand Opera House','2023-12-12',21,31),
(15,'City Playhouse','2023-12-13',45,28),
(16,'National Theater','2023-12-14',20,36),
(17,'Metropolitan Arts Center','2023-12-15',32,16),
(18,'Downtown Playhouse','2023-12-16',8,50),
(19,'Royal Theatre','2023-12-17',43,11),
(20,'Grand Opera House','2023-12-18',8,31),
(21,'City Playhouse','2023-12-19',6,29),
(22,'National Theater','2023-12-20',29,40),
(23,'Metropolitan Arts Center','2023-12-10',13,58),
(24,'Downtown Playhouse','2023-12-11',24,24),
(25,'Royal Theatre','2023-12-12',34,46),
(26,'Grand Opera House','2023-12-13',14,58),
(27,'City Playhouse','2023-12-14',37,40),
(28,'National Theater','2023-12-15',16,50),
(29,'Metropolitan Arts Center','2023-12-16',24,46),
(30,'Downtown Playhouse','2023-12-17',17,26),
(31,'Royal Theatre','2023-12-18',24,44),
(32,'Grand Opera House','2023-12-19',45,20),
(33,'City Playhouse','2023-12-20',27,60),
(34,'National Theater','2023-12-10',20,19),
(35,'Metropolitan Arts Center','2023-12-11',30,13),
(36,'Downtown Playhouse','2023-12-12',29,51),
(37,'Royal Theatre','2023-12-13',24,41),
(38,'Grand Opera House','2023-12-14',6,60),
(39,'City Playhouse','2023-12-15',34,26),
(40,'National Theater','2023-12-16',42,35),
(41,'Metropolitan Arts Center','2023-12-17',19,54),
(42,'Downtown Playhouse','2023-12-18',36,48),
(43,'Royal Theatre','2023-12-19',24,16),
(44,'Grand Opera House','2023-12-20',27,24),
(45,'City Playhouse','2023-12-10',20,48),
(46,'National Theater','2023-12-11',28,57),
(47,'Metropolitan Arts Center','2023-12-12',10,60),
(48,'Downtown Playhouse','2023-12-13',28,57),
(49,'Royal Theatre','2023-12-14',41,49),
(50,'Grand Opera House','2023-12-15',44,46),
(51,'Royal Theatre','2023-12-16',8,56),
(52,'Grand Opera House','2023-12-17',44,47),
(53,'City Playhouse','2023-12-18',33,53),
(54,'National Theater','2023-12-19',24,32),
(55,'Metropolitan Arts Center','2023-12-20',25,21),
(56,'Downtown Playhouse','2023-12-10',11,17),
(57,'Royal Theatre','2023-12-11',45,22),
(58,'Grand Opera House','2023-12-12',37,55),
(59,'City Playhouse','2023-12-13',19,15),
(60,'National Theater','2023-12-14',44,41),
(61,'Metropolitan Arts Center','2023-12-15',39,47),
(62,'Downtown Playhouse','2023-12-16',38,33),
(63,'Royal Theatre','2023-12-17',42,40),
(64,'Grand Opera House','2023-12-18',36,16),
(65,'City Playhouse','2023-12-19',41,13),
(66,'National Theater','2023-12-20',15,44),
(67,'Metropolitan Arts Center','2023-12-10',17,34),
(68,'Downtown Playhouse','2023-12-11',44,46),
(69,'Royal Theatre','2023-12-12',16,45),
(70,'Grand Opera House','2023-12-13',16,57),
(71,'City Playhouse','2023-12-14',13,60),
(72,'National Theater','2023-12-15',6,33),
(73,'Metropolitan Arts Center','2023-12-16',30,42),
(74,'Downtown Playhouse','2023-12-17',15,48),
(75,'Royal Theatre','2023-12-18',39,27),
(76,'Grand Opera House','2023-12-19',31,20),
(77,'City Playhouse','2023-12-20',12,28),
(78,'National Theater','2023-12-10',45,15),
(79,'Metropolitan Arts Center','2023-12-11',19,10),
(80,'Downtown Playhouse','2023-12-12',31,59),
(81,'Royal Theatre','2023-12-13',44,56),
(82,'Grand Opera House','2023-12-14',38,53),
(83,'City Playhouse','2023-12-15',28,50),
(84,'National Theater','2023-12-16',10,28),
(85,'Metropolitan Arts Center','2023-12-17',35,12),
(86,'Downtown Playhouse','2023-12-18',14,35),
(87,'Royal Theatre','2023-12-19',43,43),
(88,'Grand Opera House','2023-12-20',7,20),
(89,'City Playhouse','2023-12-10',28,44),
(90,'National Theater','2023-12-11',12,38),
(91,'Metropolitan Arts Center','2023-12-12',14,26),
(92,'Downtown Playhouse','2023-12-13',5,59),
(93,'Royal Theatre','2023-12-14',29,30),
(94,'Grand Opera House','2023-12-15',34,59),
(95,'City Playhouse','2023-12-16',31,56),
(96,'National Theater','2023-12-17',15,21),
(97,'Metropolitan Arts Center','2023-12-18',31,51),
(98,'Downtown Playhouse','2023-12-19',27,17),
(99,'Royal Theatre','2023-12-20',12,49),
(100,'Grand Opera House','2023-12-10',43,53),
(101,'Royal Theatre','2023-12-11',8,18),
(102,'Grand Opera House','2023-12-12',25,51),
(103,'City Playhouse','2023-12-13',6,41),
(104,'National Theater','2023-12-14',28,29),
(105,'Metropolitan Arts Center','2023-12-15',45,17),
(106,'Downtown Playhouse','2023-12-16',26,19),
(107,'Royal Theatre','2023-12-17',32,15),
(108,'Grand Opera House','2023-12-18',23,19),
(109,'City Playhouse','2023-12-19',5,19),
(110,'National Theater','2023-12-20',44,54),
(111,'Metropolitan Arts Center','2023-12-10',23,27),
(112,'Downtown Playhouse','2023-12-11',38,13),
(113,'Royal Theatre','2023-12-12',36,11),
(114,'Grand Opera House','2023-12-13',24,35),
(115,'City Playhouse','2023-12-14',45,36),
(116,'National Theater','2023-12-15',23,53),
(117,'Metropolitan Arts Center','2023-12-16',20,34),
(118,'Downtown Playhouse','2023-12-17',5,22),
(119,'Royal Theatre','2023-12-18',8,16),
(120,'Grand Opera House','2023-12-19',44,32),
(121,'City Playhouse','2023-12-20',34,43),
(122,'National Theater','2023-12-10',39,47),
(123,'Metropolitan Arts Center','2023-12-11',34,36),
(124,'Downtown Playhouse','2023-12-12',34,53),
(125,'Royal Theatre','2023-12-13',35,31),
(126,'Grand Opera House','2023-12-14',5,17),
(127,'City Playhouse','2023-12-15',27,59),
(128,'National Theater','2023-12-16',24,47),
(129,'Metropolitan Arts Center','2023-12-17',34,60),
(130,'Downtown Playhouse','2023-12-18',29,54),
(131,'Royal Theatre','2023-12-19',15,22),
(132,'Grand Opera House','2023-12-20',28,23),
(133,'City Playhouse','2023-12-10',13,16),
(134,'National Theater','2023-12-11',16,10),
(135,'Metropolitan Arts Center','2023-12-12',39,47),
(136,'Downtown Playhouse','2023-12-13',21,57),
(137,'Royal Theatre','2023-12-14',37,16),
(138,'Grand Opera House','2023-12-15',8,59),
(139,'City Playhouse','2023-12-16',27,19),
(140,'National Theater','2023-12-17',14,52),
(141,'Metropolitan Arts Center','2023-12-18',37,35),
(142,'Downtown Playhouse','2023-12-19',29,49),
(143,'Royal Theatre','2023-12-20',7,27),
(144,'Grand Opera House','2023-12-10',41,12),
(145,'City Playhouse','2023-12-11',29,34),
(146,'National Theater','2023-12-12',37,51),
(147,'Metropolitan Arts Center','2023-12-13',44,28),
(148,'Downtown Playhouse','2023-12-14',15,43),
(149,'Royal Theatre','2023-12-15',33,55),
(150,'Grand Opera House','2023-12-16',41,34),
(151,'Royal Theatre','2023-12-17',34,24),
(152,'Grand Opera House','2023-12-18',22,46),
(153,'City Playhouse','2023-12-19',11,24),
(154,'National Theater','2023-12-20',42,40),
(155,'Metropolitan Arts Center','2023-12-10',16,48),
(156,'Downtown Playhouse','2023-12-11',13,54),
(157,'Royal Theatre','2023-12-12',31,50),
(158,'Grand Opera House','2023-12-13',11,41),
(159,'City Playhouse','2023-12-14',27,60),
(160,'National Theater','2023-12-15',28,14),
(161,'Metropolitan Arts Center','2023-12-16',21,51),
(162,'Downtown Playhouse','2023-12-17',26,17),
(163,'Royal Theatre','2023-12-18',23,47),
(164,'Grand Opera House','2023-12-19',22,40),
(165,'City Playhouse','2023-12-20',14,46),
(166,'National Theater','2023-12-10',42,46),
(167,'Metropolitan Arts Center','2023-12-11',35,33),
(168,'Downtown Playhouse','2023-12-12',26,28),
(169,'Royal Theatre','2023-12-13',41,42),
(170,'Grand Opera House','2023-12-14',11,39),
(171,'City Playhouse','2023-12-15',12,36),
(172,'National Theater','2023-12-16',14,25),
(173,'Metropolitan Arts Center','2023-12-17',13,55),
(174,'Downtown Playhouse','2023-12-18',22,43),
(175,'Royal Theatre','2023-12-19',25,21),
(176,'Grand Opera House','2023-12-20',26,15),
(177,'City Playhouse','2023-12-10',36,40),
(178,'National Theater','2023-12-11',25,53),
(179,'Metropolitan Arts Center','2023-12-12',18,26),
(180,'Downtown Playhouse','2023-12-13',35,36),
(181,'Royal Theatre','2023-12-14',35,12),
(182,'Grand Opera House','2023-12-15',37,14),
(183,'City Playhouse','2023-12-16',14,29),
(184,'National Theater','2023-12-17',21,31),
(185,'Metropolitan Arts Center','2023-12-18',8,12),
(186,'Downtown Playhouse','2023-12-19',29,51),
(187,'Royal Theatre','2023-12-20',28,40),
(188,'Grand Opera House','2023-12-10',5,44),
(189,'City Playhouse','2023-12-11',6,12),
(190,'National Theater','2023-12-12',19,28),
(191,'Metropolitan Arts Center','2023-12-13',23,10),
(192,'Downtown Playhouse','2023-12-14',22,31),
(193,'Royal Theatre','2023-12-15',27,38),
(194,'Grand Opera House','2023-12-16',22,50),
(195,'City Playhouse','2023-12-17',29,47),
(196,'National Theater','2023-12-18',27,15),
(197,'Metropolitan Arts Center','2023-12-19',32,40),
(198,'Downtown Playhouse','2023-12-20',31,10),
(199,'Royal Theatre','2023-12-10',6,15),
(200,'Grand Opera House','2023-12-11',45,34),
(201,'Royal Theatre','2023-12-12',35,31),
(202,'Grand Opera House','2023-12-13',40,30),
(203,'City Playhouse','2023-12-14',44,28),
(204,'National Theater','2023-12-15',33,19),
(205,'Metropolitan Arts Center','2023-12-16',36,10),
(206,'Downtown Playhouse','2023-12-17',18,11),
(207,'Royal Theatre','2023-12-18',23,19),
(208,'Grand Opera House','2023-12-19',20,43),
(209,'City Playhouse','2023-12-20',23,23),
(210,'National Theater','2023-12-10',19,20),
(211,'Metropolitan Arts Center','2023-12-11',42,26),
(212,'Downtown Playhouse','2023-12-12',39,50),
(213,'Royal Theatre','2023-12-13',42,12),
(214,'Grand Opera House','2023-12-14',6,48),
(215,'City Playhouse','2023-12-15',36,58),
(216,'National Theater','2023-12-16',11,39),
(217,'Metropolitan Arts Center','2023-12-17',22,45),
(218,'Downtown Playhouse','2023-12-18',26,30),
(219,'Royal Theatre','2023-12-19',13,35),
(220,'Grand Opera House','2023-12-20',19,59),
(221,'City Playhouse','2023-12-10',6,42),
(222,'National Theater','2023-12-11',5,25),
(223,'Metropolitan Arts Center','2023-12-12',39,58),
(224,'Downtown Playhouse','2023-12-13',21,24),
(225,'Royal Theatre','2023-12-14',22,13),
(226,'Grand Opera House','2023-12-15',34,27),
(227,'City Playhouse','2023-12-16',5,18),
(228,'National Theater','2023-12-17',41,47),
(229,'Metropolitan Arts Center','2023-12-18',33,25),
(230,'Downtown Playhouse','2023-12-19',22,28),
(231,'Royal Theatre','2023-12-20',14,39),
(232,'Grand Opera House','2023-12-10',15,30),
(233,'City Playhouse','2023-12-11',13,10),
(234,'National Theater','2023-12-12',9,12),
(235,'Metropolitan Arts Center','2023-12-13',27,54),
(236,'Downtown Playhouse','2023-12-14',19,52),
(237,'Royal Theatre','2023-12-15',28,43),
(238,'Grand Opera House','2023-12-16',24,40),
(239,'City Playhouse','2023-12-17',42,42),
(240,'National Theater','2023-12-18',26,18),
(241,'Metropolitan Arts Center','2023-12-19',22,55),
(242,'Downtown Playhouse','2023-12-20',18,56),
(243,'Royal Theatre','2023-12-10',42,18),
(244,'Grand Opera House','2023-12-11',36,10),
(245,'City Playhouse','2023-12-12',22,49),
(246,'National Theater','2023-12-13',12,42),
(247,'Metropolitan Arts Center','2023-12-14',33,13),
(248,'Downtown Playhouse','2023-12-15',38,20),
(249,'Royal Theatre','2023-12-16',21,27),
(250,'Grand Opera House','2023-12-17',34,30);
