create table europa(ut varchar(100)  ,eurout varchar(100)  ) ;
 
ALTER TABLE europa ADD PRIMARY KEY(ut,eurout);

INSERT INTO europa VALUES
( "M0","E60"),
( "M0","E71"),
( "M0","E75"),
( "M0","E77"),
( "M1","E60"),
( "M1","E65"),
( "M1","E75"),
( "M2","E77"),
( "M3","E71"),
( "M3","E79"),
( "M3","E573"),
( "M3","E579"),
( "M4","E60"),
( "M4","E79"),
( "M5","E66"),
( "M5","E75"),
( "M6","E66"),
( "M6","E73"),
( "M7","E65"),
( "M7","E66"),
( "M7","E71"),
( "M8","E66"),
( "M15","E65"),
( "M15","E75"),
( "M30","E71"),
( "M30","E79"),
( "M31","E71"),
( "M34","E573"),
( "M35","E79"),
( "M35","E573"),
( "M43","E68"),
( "M70","E653"),
( "M80","E66"),
( "M86","E65"),
( "M90","E661");

create table palya(ut varchar(100)  ,kesz int(11)  ,epul int(11)  ,terv int(11)  ) ;
 
ALTER TABLE palya ADD PRIMARY KEY(ut);

INSERT INTO palya VALUES
( "M0",76,0,32),
( "M1",159,0,0),
( "M2",30,0,38),
( "M3",269,0,27),
( "M4",98,27,97),
( "M5",160,0,0),
( "M6",175,19,0),
( "M7",226,0,0),
( "M8",10,0,153),
( "M9",21,0,10),
( "M15",14,0,0),
( "M19",9,0,0),
( "M25",18,0,0),
( "M30",28,56,0),
( "M31",12,0,0),
( "M32",0,0,63),
( "M34",0,0,36),
( "M35",67,0,0),
( "M43",57,0,0),
( "M44",76,14,20),
( "M49",0,0,45),
( "M51",4,0,0),
( "M60",31,0,66),
( "M70",21,0,0),
( "M76",6,3,74),
( "M80",7,21,0),
( "M81",0,0,114),
( "M83",0,36,0),
( "M85",89,6,0),
( "M86",64,0,58),
( "M87",1,0,21),
( "M90",0,0,221),
( "M100",0,0,126);

create table eu_telepules(id int(11)  ,ut varchar(100)  ,nev varchar(100)  ,hatar varchar(100)  ) ;
 
ALTER TABLE eu_telepules ADD INDEX(ut);
ALTER TABLE eu_telepules ADD PRIMARY KEY(id);

INSERT INTO eu_telepules VALUES
( 1,"M32","Abony",null),
( 2,"M4","Abony",null),
( 3,"M8","Abony",null),
( 4,"M100","Albertirsa",null),
( 5,"M4","Albertirsa",null),
( 6,"M7","Balatonfőkajár",null),
( 7,"M8","Balatonfőkajár",null),
( 8,"M60","Barcs","Horvátország"),
( 9,"M44","Békéscsaba",null),
( 10,"M3","Beregdaróc","Ukrajna"),
( 11,"M35","Berettyóújfalu",null),
( 12,"M4","Berettyóújfalu",null),
( 13,"M0","Biatorbágy",null),
( 14,"M1","Biatorbágy",null),
( 15,"M6","Bóly",null),
( 16,"M60","Bóly",null),
( 17,"M90","Bóly",null),
( 18,"M0","Budafok-Tétény",null),
( 19,"M6","Budafok-Tétény",null),
( 20,"M0","Budaörs",null),
( 21,"M1","Budapest",null),
( 22,"M3","Budapest",null),
( 23,"M4","Budapest",null),
( 24,"M5","Budapest",null),
( 25,"M51","Budapest",null),
( 26,"M7","Budapest",null),
( 27,"M43","Csanádpalota","Románia"),
( 28,"M49","Csenger","Románia"),
( 29,"M85","Csorna",null),
( 30,"M86","Csorna",null),
( 31,"M35","Debrecen",null),
( 32,"M0","Dunaharaszti",null),
( 33,"M51","Dunaharaszti",null),
( 34,"M0","Dunakeszi",null),
( 35,"M2","Dunakeszi",null),
( 36,"M6","Dunaújváros",null),
( 37,"M8","Dunaújváros",null),
( 38,"M25","Eger",null),
( 39,"M3","Emőd",null),
( 40,"M30","Emőd",null),
( 41,"M100","Ercsi",null),
( 42,"M6","Ercsi",null),
( 43,"M100","Esztergom","Szlovákia"),
( 44,"M3","Gödöllő",null),
( 45,"M31","Gödöllő",null),
( 46,"M3","Görbeháza",null),
( 47,"M35","Görbeháza",null),
( 48,"M0","Gyál",null),
( 49,"M5","Gyál",null),
( 50,"M1","Győr",null),
( 51,"M19","Győr",null),
( 52,"M83","Győr",null),
( 53,"M85","Győr",null),
( 54,"M1","Hegyeshalom","Ausztria"),
( 55,"M7","Hollád",null),
( 56,"M76","Hollád",null),
( 57,"M90","Hollád",null),
( 58,"M2","Hont",null),
( 59,"M6","Ivándárda","Horvátország"),
( 60,"M25","Kál",null),
( 61,"M3","Kál",null),
( 62,"M32","Kál",null),
( 63,"M90","Kaposvár",null),
( 64,"M5","Kecskemét",null),
( 65,"M8","Kecskemét",null),
( 66,"M76","Keszthely",null),
( 67,"M1","Kisigmánd",null),
( 68,"M81","Kisigmánd",null),
( 69,"M81","Komárom","Szlovákia"),
( 70,"M76","Körmend",null),
( 71,"M80","Körmend",null),
( 72,"M86","Körmend",null),
( 73,"M87","Kőszeg","Ausztria"),
( 74,"M7","Letenye","Horvátország"),
( 75,"M70","Letenye",null),
( 76,"M1","Levél",null),
( 77,"M15","Levél",null),
( 78,"M86","Levél",null),
( 79,"M43","Makó",null),
( 80,"M100","Martonvásár",null),
( 81,"M49","Mátészalka",null),
( 82,"M30","Miskolc",null),
( 83,"M7","Nagykanizsa",null),
( 84,"M4","Nagykereki","Románia"),
( 85,"M44","Nagykőrös",null),
( 86,"M8","Nagykőrös",null),
( 87,"M0","Nagytarcsa",null),
( 88,"M31","Nagytarcsa",null),
( 89,"M9","Nemesnádudvar",null),
( 90,"M3","Nyíregyháza",null),
( 91,"M3","Őr",null),
( 92,"M49","Őr",null),
( 93,"M83","Pápa",null),
( 94,"M2","Parasapuszta","Szlovákia"),
( 95,"M60","Pécs",null),
( 96,"M80","Rábafüzes","Ausztria"),
( 97,"M15","Rajka","Szlovákia"),
( 98,"M2","Rétság",null),
( 99,"M5","Röszke","Szerbia"),
( 100,"M8","Sárbogárd",null),
( 101,"M81","Sárbogárd",null),
( 102,"M7","Siófok",null),
( 103,"M85","Sopron","Ausztria"),
( 104,"M44","Szarvas",null),
( 105,"M43","Szeged",null),
( 106,"M5","Szeged",null),
( 107,"M90","Szeged",null),
( 108,"M7","Székesfehérvár",null),
( 109,"M81","Székesfehérvár",null),
( 110,"M6","Szekszárd",null),
( 111,"M9","Szekszárd",null),
( 112,"M60","Szigetvár",null),
( 113,"M90","Szigetvár",null),
( 114,"M86","Szombathely",null),
( 115,"M87","Szombathely",null),
( 116,"M90","Tompa",null),
( 117,"M70","Tornyiszentmiklós","Szlovénia"),
( 118,"M30","Tornyosnémeti","Szlovákia"),
( 119,"M0","Törökbálint",null),
( 120,"M7","Törökbálint",null),
( 121,"M100","Újhartyán",null),
( 122,"M5","Újhartyán",null),
( 123,"M0","Újpalota",null),
( 124,"M3","Újpalota",null),
( 125,"M0","Üröm",null),
( 126,"M2","Vác",null),
( 127,"M3","Vásárosnamény",null),
( 128,"M34","Vásárosnamény",null),
( 129,"M0","Vecsés",null),
( 130,"M4","Vecsés",null),
( 131,"M34","Záhony","Ukrajna"),
( 132,"M76","Zalaegerszeg",null);

create table vege(id int(11)  ,ut varchar(100)  ,telepid varchar(100)  ) ;

ALTER TABLE vege ADD INDEX(telepid);
ALTER TABLE vege ADD PRIMARY KEY(id);

INSERT INTO vege VALUES
( 1,"M0","13"),
( 2,"M0","20"),
( 3,"M1","21"),
( 4,"M1","54"),
( 5,"M2","34"),
( 6,"M2","94"),
( 7,"M3","22"),
( 8,"M3","10"),
( 9,"M4","23"),
( 10,"M4","84"),
( 11,"M5","24"),
( 12,"M5","99"),
( 13,"M6","19"),
( 14,"M6","59"),
( 15,"M7","26"),
( 16,"M7","74"),
( 17,"M8","6"),
( 18,"M8","3"),
( 19,"M9","111"),
( 20,"M9","89"),
( 21,"M15","77"),
( 22,"M15","97"),
( 23,"M19","51"),
( 24,"M19","51"),
( 25,"M25","60"),
( 26,"M25","38"),
( 27,"M30","40"),
( 28,"M30","118"),
( 29,"M31","88"),
( 30,"M31","45"),
( 31,"M32","1"),
( 32,"M32","62"),
( 33,"M34","128"),
( 34,"M34","131"),
( 35,"M35","47"),
( 36,"M35","11"),
( 37,"M43","105"),
( 38,"M43","27"),
( 39,"M44","85"),
( 40,"M44","9"),
( 41,"M49","92"),
( 42,"M49","28"),
( 43,"M51","25"),
( 44,"M51","33"),
( 45,"M60","16"),
( 46,"M60","8"),
( 47,"M70","75"),
( 48,"M70","117"),
( 49,"M76","56"),
( 50,"M76","70"),
( 51,"M80","96"),
( 52,"M80","71"),
( 53,"M81","69"),
( 54,"M81","101"),
( 55,"M83","52"),
( 56,"M83","93"),
( 57,"M85","53"),
( 58,"M85","103"),
( 59,"M86","72"),
( 60,"M86","78"),
( 61,"M87","115"),
( 62,"M87","73"),
( 63,"M90","57"),
( 64,"M90","107"),
( 65,"M100","43"),
( 66,"M100","4");

ALTER TABLE `europa` ADD CONSTRAINT `europa_181`   FOREIGN KEY (`ut`)     REFERENCES `palya` (`ut`);
ALTER TABLE `eu_telepules` ADD CONSTRAINT `telepules_191`   FOREIGN KEY (`ut`)     REFERENCES `palya` (`ut`);
