Creating the Sample Tables

The following scripts can be used to create the five sample tables. Please note that these scripts have been designed for maximum compatibility among as many different DBMS' as possible. Because of this, the scripts are neither optimized nor complete. Each script is followed by notes that describe some changes or additions you may need (or want) to make.

Caution Please read the bulleted notes that appear after each script before actually executing it.

The Vendors Table

 CREATE TABLE Vendors ( vend_id CHAR(10) NOT NULL, vend_name CHAR(50) NOT NULL, vend_address CHAR(50) , vend_city CHAR(50) , vend_state CHAR(5) , vend_zip ...

Get Sams Teach Yourself SQL in 10 Minutes, Second Edition 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.