Appendix D. CREATE TABLE Statements for Book Examples

This appendix is very useful. The CREATE TABLE statements used in the examples are listed. You can use these statements to create your own tables in MySQL for performing hands-on exercises.

EMPLOYEE_TBL

CREATE TABLE EMPLOYEE_TBL
(
EMP_ID              VARCHAR(9)       NOT NULL,
LAST_NAME           VARCHAR(15)      NOT NULL,
FIRST_NAME          VARCHAR(15)      NOT NULL,
MIDDLE_NAME         VARCHAR(15),
ADDRESS             VARCHAR(30)      NOT NULL,
CITY                VARCHAR(15)      NOT NULL,
STATE               CHAR(2)          NOT NULL,
ZIP                 INTEGER(5)       NOT NULL,
PHONE               CHAR(10),
PAGER               CHAR(10),
CONSTRAINT EMP_PK PRIMARY KEY (EMP_ID)
);

EMPLOYEE_PAY_TBL

CREATE TABLE EMPLOYEE_PAY_TBL ( EMP_ID VARCHAR(9) NOT NULL primary key, POSITION VARCHAR(15) NOT NULL, DATE_HIRE DATE, PAY_RATE DECIMAL(4,2), DATE_LAST_RAISE ...

Get Sams Teach Yourself SQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.