ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
Hello all,
First timer here using MySQL - Studying lessons found in Sams Teach Yourself SQL in 24 hrs. I am trying to create a table for one of the in chapter examples and entered the code directly from the book and keep getting an error.
The following is the error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTER GER(10) NULL, EMP_PAGER INTERGER(10) NULL)' at line 9
This is the code.
mysql> CREATE TABLE EMPLOYEE_TBL
(
EMP_ID CHAR(9) NOT NULL,
EMP_NAME VARCHAR(40) NOT NULL,
EMP_ST_ADDR VARCHAR(20) NOT NULL,
EMP_CITY VARCHAR(15) NOT NULL,
EMP_ST CHAR(2) NOT NULL,
EMP_ZIP INTEGER(5) NOT NULL,
EMP_PHONE INTERGER(10) NULL,
EMP_PAGER INTERGER(10) NULL);
Can anyone tell me what is wrong with line 9 where I first enter just a NULL value?
This is on PG 42 last table on the page.
Thought I had the issue resolved when I noticed that the answers in the back that had null values just dropped the NULL completely so i issued the following code.
mysql> CREATE TABLE EMPLOYEE_TBL
-> (
-> EMP_ID VARCHAR(9) NOT NULL,
-> EMP_NAME VARCHAR(40) NOT NULL,
-> EMP_ST_ADDR VARCHAR(20) NOT NULL,
-> EMP_CITY VARCHAR(15) NOT NULL,
-> EMP_ZIP INTEGER(5) NOT NULL,
-> EMP_PHONE INTERGER (10),
-> EMP_PAGER INTERGER (10)
-> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'INTER
GER (10),
Please help. I cannot figure out where the syntax is incorrect.
Thanks in advance.
Edited 1 time(s). Last edit at 04/12/2014 02:22PM by chris rhoads.