I have read Database system concepts, 6th edition, Silberschatz. I\'m going to implement the university database system shown in chapter 2 on OS X
foreign key (dept_name) references department
This syntax is not valid for MySQL. It should instead be:
foreign key (dept_name) references department(dept_name)
MySQL requires dept_name to be used twice. Once to define the foreign column, and once to define the primary column.
13.1.17.2. Using FOREIGN KEY Constraints
... [the] essential syntax for a foreign key constraint definition in a
CREATE TABLEorALTER TABLEstatement looks like this:[CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name, ...) REFERENCES tbl_name (index_col_name, ...) [ON DELETE reference_option] [ON UPDATE reference_option] reference_option: RESTRICT | CASCADE | SET NULL | NO ACTION