I wrote the following query for mySQL :
mysql> Create table R_Matrix
(
image_name VARCHAR(25) NOT NULL REFERENCES Images(image_name),
Row INT,
Column INT,
Data INT,
PRIMARY KEY(image_name)
);
Where Images is a table in the same database and image_name is a column in it;
However I got the following error :
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 ‘Column INT, Data INT, PRIMARY KEY(image_name) )’
at line 1
I cannot find anything wrong with the query. What am I doing wrong ?
COLUMNis a reserved keyword. It must be escape using backtick,