-1
CREATE TABLE files 
(file_id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
 path VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, 
 branch INT(5) NOT NULL,
 sem INT(5) NOT NULL,
 subject INT(5) NOT NULL, 
 uploader_id INT(11), 
 FOREIGN KEY (uploader_id) REFERENCES users(user_id) );
Ocaso Protal
  • 19,362
  • 8
  • 76
  • 83
  • Does this answer your question? [MySQL: Can't create table (errno: 150)](https://stackoverflow.com/questions/4061293/mysql-cant-create-table-errno-150) Or just search for _errno 150_ here on SO. There are a ton of duplicate questions for this error. – Ocaso Protal Apr 11 '22 at 05:51
  • Can we see the users table? – LBS Apr 11 '22 at 12:52

1 Answers1

0

Because user_id and uploader_id column data types are not same

i.e. user_id is BIGINT(20) and uploder_id is INT(11) then there is an error for incorrectly formed error

maybe it will helpful