title: Error code 1005, SQL state HY000: Can't create table errno: 150
body: <p>I'm trying to create a table but the script fails as soon as my netbeans errors the first table of DB. </p>
  
  <p>How can this be solved?</p>
  
  <pre><code>CREATE TABLE filmy
  (
      Film_Id int NOT NULL,
      Nazwa varchar(250),
      Adres varchar(250),
      Data_Utworzenia date,
      Komentarz varchar(250),
      Gat_Id int,
      Sub_Id int,
      Aut_Id int,
      User_Id int,
  
      Primary Key (Film_Id),
      CONSTRAINT fk_GatFilmy FOREIGN KEY (Gat_Id) REFERENCES gatunek(Gat_Id),
      CONSTRAINT fk_SubFilmy FOREIGN KEY (Sub_Id) REFERENCES subgatunek(Sub_Id),
      CONSTRAINT fk_AutFilmy FOREIGN KEY (Aut_Id) REFERENCES autor(Aut_Id),
      CONSTRAINT fk_UserFilmy FOREIGN KEY (User_Id) REFERENCES users(User_Id)
  )
  </code></pre>