mysql CREATE TABLE EMPLOYEE EMP ID INT5 PRIMARY KEY UNIQUE N
mysql> CREATE TABLE EMPLOYEE EMP ID INT(5) PRIMARY KEY UNIQUE NOT NULL, EMP NAME VARCHAR (20) NOT NULL EMP DOBDATE (8) NULL EMP NUM INT (5) NOT NULL, EMP STREET CHAR (30) NULL EMP STATE CHAR (30) NULL, EMP CITY CHAR (30) NULL, EMP COUNTY CHAR (30) NULL, EMP ZIPCODE VARCHAR (10) NOT NULL) ERROR 1064 (42000) You have an error in Your SQL symtax check the manual that corresponds to Your MYSQL server version for the right symtax to use near (5) PR IMARY KEY UNIQUE NOT NULL, EMP NAME VARCHAR (20) NOT NULL, EMP DOBDATE (8) NU\' at line 2
Solution
For Employee table at line 2, you need to give space between the attribute name and it\'s data type. The code at line 2 should be like:
EMP_ID INT(5) PRIMARY KEY UNIQUE NOT NULL
The same syntax applies at line 4 for Employee table and also the data type \'date\' doesn\'t require any size to be mentioned. Correct syntax is EMP_DOB DATE NULL;
For Customer table at line 4,there is no data type like \'IN\'. The correct syntax is: CUS1_NUMBER INT(3) NOT NULL
