MySQL/Language/Reserved Words

From Wikibooks, open books for an open world
< MySQL‎ | Language
Jump to: navigation, search

Difficult Column Names, Like `DATE` -- use backtick. If using "date" as a column name, enclose it in backticks ` as follows:

 CREATE TABLE IF NOT EXISTS stocks (
   pkey int NOT NULL auto_increment,
   `date` date,
   ticker varchar(5),
   open decimal (9,2),
   high decimal (9,2),
   low decimal (9,2),
   close decimal (9,2),
   volume int,
   timeEnter timestamp(14),
   PRIMARY KEY (pkey)
 );