I am getting an error when i am trying to create a table in mysql command line as shown in the imageenter image description here
I was trying to create a table and got a syntax error 1064 stating I have an error in the syntax.
I am getting an error when i am trying to create a table in mysql command line as shown in the imageenter image description here
I was trying to create a table and got a syntax error 1064 stating I have an error in the syntax.
2
Answers
There is an error in your SQL syntax. The CREATE statement does not contain a comma after the table name.
CREATE TABLE favorite_food(
person_id SMALLIT UNSIGNED,
food VARCHAR(20),
PRIMARY KEY (person_id,food),
FOREIGN KEY(person_id) REFERENCES person (person_id));