Note that a semicolon is the last character in the previous statement. Also,
brackets indicate portions that are optional. Most SQL implementations
have some character that terminates a statement or submits a statement to
the database server. Oracle, Microsoft SQL Server, and MySQL use the semi-
colon. Although Transact-SQL, Microsoft SQL Server's ANSI SQL version, has
no such requirement, it is considered best practice to use it. This book uses
the semicolon.
Create a table called EMPLOYEE_TBL in the following example using the syntax
for MySQL:
CREATE TABLE EMPLOYEE_TBL
(EMP_ID CHAR (9)
EMP_NAME VARCHAR (40)
EMP_ST_ADDR WARCHAR (20)
EMP_CITY VARCHAR (15)
EMP_ST CHAR (2)
EMP_ZIP INTEGER (5)
EMP_PHONE INTEGER (10)
EMP_PAGER INTEGER (10)
NOT
NOT
NOT
NOT
NOT
NOT
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
The following code would be the compatible code for both Microsoft SQL
Server and Oracle: