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)
 );