Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

There's an error in my syntax, I don't know where

mysql> CREATE TABLE customer_status(
    status_id INT NOT NULL AUTO_INCREMENT,
    name VARCHAR (50) NOT NULL,
    rank INT NOT NULL,
    PRIMARY KEY(status_id))
    ENGINE=innodb
    CHARSET=latin1
    COLLATE=latin1_general_ci;

SEEMS THAT I CAN’T USE THE WORD RANK

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

RANK is a reserved word in MySQL. You can escape it with the backtick (`) character.

CREATE TABLE customer_status(
status_id INT NOT NULL AUTO_INCREMENT,
name VARCHAR (50) NOT NULL,
`rank` INT NOT NULL,
PRIMARY KEY(status_id))
ENGINE=innodb
CHARSET=latin1
COLLATE=latin1_general_ci;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading