Defining the Tables in bookbiz

Now you are ready to apply these syntax rules to real tables. Following is a CREATE TABLE command for the titles table. If you are using the software on the CD, you don't need to create this table—it's already built. To create a table just like it for practice, use a different table name (make it titles2, for example). Relational databases don't allow multiple tables with the same name and owner.

SQL
create table titles
(title_id char(6) not null,
title varchar(80) not null,
type char(12) null,
pub_id char(4) null,
price numeric(8,2)  null,
advance numeric(10,2) null,
ytd_sales int null,
contract bit not null,
notes varchar(200) null,
pubdate date null)
[table created]

The CREATE TABLE statements for the eight remaining ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth 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.