MySQL Forums
Forum List  »  Newbie

Error in syntax due to different server version
Posted by: Ryan Lee
Date: April 12, 2022 08:51AM

Hi everyone, I am new to coding and all, is currently dipping my toes in SQL. I created this SQL code but it seems like my syntax is incorrect. Can anybody tell me what is wrong with it?

CREATE TABLE ‘exchange‘ (
-> ‘id‘ int NOT NULL AUTO_INCREMENT,
-> ‘abbrev‘ varchar(32) NOT NULL,
-> ‘name‘ varchar(255) NOT NULL,
-> ‘city‘ varchar(255) NULL,
-> ‘country‘ varchar(255) NULL,
-> ‘currency‘ varchar(64) NULL,
-> ‘timezone_offset‘ time NULL,
-> ‘created_date‘ datetime NOT NULL,
-> ‘last_updated_date‘ datetime NOT NULL,
-> PRIMARY KEY (‘id‘)
-> ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

The error message was:

"Error 1064 (42000) You have an error in your syntax; check the manual that corresponds to your MySQL server version for the right version to use near ''exchange (
'id' int NOT NULL AUTO_INCREMENT,
'abbrev' varchar(32) NOT NULL,
'n' at line 1

Any help is greatly appreciated!

Options: ReplyQuote


Subject
Written By
Posted
Error in syntax due to different server version
April 12, 2022 08:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.