0
CREATE TABLE references ( hamsterId MEDIUMINT(9), id MEDIUMINT(9), complete BINARY(1));

i keep running error messages ive tried many possiblities and have not answers help would be appriciated thank you!Also is BINARY(1) correct for allowing only a 1 or 0 allowance. By the way this is the error message :

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references ( hamsterId MEDIUMINT(9), id MEDIUMINT(9), complete BINARY(1))' at line 1

Kai Hayati
  • 59
  • 1
  • 2
  • `references` is a [MySQL reserved keyword](https://dev.mysql.com/doc/refman/5.7/en/keywords.html). To use it as a table or column identifier, you must enclose it in backticks as `CREATE TABLE \`references\`...` – Michael Berkowski Jun 12 '16 at 12:19

1 Answers1

1

use backtics for reserved name REFERENCES is a reversed word for mysql see https://dev.mysql.com/doc/refman/5.7/en/keywords.html

 CREATE TABLE `references` ( hamsterId MEDIUMINT(9), id MEDIUMINT(9), complete BINARY(1));
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107