SQL WORKBENCH: REFERENCES in foreign key command error "REFERENCES" is not valid in this position, expecting( '('
My REFERENCES keeps getting this error in MySQL Workbench. Here is the code
Use my_database;
Create table bands (
id int NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
primary key (id)
);
Create Table albums(
id int Not NUll auto_increment,
name Varchar(255) NOT NULL,
release_year INT,
band_id INT NOT NULL,
primary key (id),
foreign key band_id references bands(id)
);