0

Trying to create a table with sql but getting error of "A symbol name was expected! A reserved keyword can not be used as a column name without backquotes".

Unexpected beginning (near email).

Unrecognized statement (near LIKE).

These are the 3 errors i get

CREATE TABLE customer (
    custId INT NOT NULL ,
    first VARCHAR( 30 ) NOT NULL ,
    last VARCHAR( 30 ) NOT NULL ,
    email VARCHAR( 50 ) NOT NULL,
    CONSTRAINT custId_pk PRIMARY KEY (custId),
    CONSTRAINT email_unq UNIQUE(email),
    CONSTRAINT email_ck CHECK (email LIKE '%@%.%')
) ENGINE = InnoDB;
GMB
  • 216,147
  • 25
  • 84
  • 135
  • Does this answer your question? [Syntax error due to using a reserved word as a table or column name in MySQL](https://stackoverflow.com/questions/23446377/syntax-error-due-to-using-a-reserved-word-as-a-table-or-column-name-in-mysql) – Jax297 Mar 29 '20 at 21:29
  • the error itself says enough, please see reserved words here : https://dev.mysql.com/doc/refman/5.7/en/keywords.html – Jax297 Mar 29 '20 at 21:30

0 Answers0