0

create table Rendezveny( azonosito int not null, megnevezes varchar(30) not null, szemelyszam int not null, IRSZ int not null, utca varchar(30) not null, hazszam int not null, kezdes datetime not null, befezes datetime not null, constraint Rendezveny_PK primary key (azonosito)

);

create table Varosok(

VarosIRSZ int not null, varos varchar (20) not null, constraint Varosok_PK primary key (VarosIRSZ), constraint Varosok_FK foreign key (VarosIRSZ) references Rendezveny(IRSZ)

  • You reference the IRSZ column, but that's not a primary key of the Rendezveny table. Your foreign key must reference the primary key or unique key. See https://stackoverflow.com/questions/1457305/mysql-creating-tables-with-foreign-keys-giving-errno-150 for a good checklist for foreign keys. – Bill Karwin Jul 30 '18 at 18:20
  • Please check the linked question to get the actual error message. Feel free to report back if it doesn't make sense to you. – Álvaro González Jul 30 '18 at 18:21

0 Answers0