Sample CREATE TABLE Statement

This is the CREATE TABLE statement for the titles table in the pubs database. It is part of the pubs script (INSTPUBS.SQL, located in the SQL Server INSTALL directory).

CREATE TABLE titles
(
    title_id        tid
        CONSTRAINT UPKCL_titleidind PRIMARY KEY CLUSTERED,
    title   varchar(80)     NOT NULL,
    type    char(12)        NOT NULL
        DEFAULT ('UNDECIDED'),
    pub_id  char(4) NULL
        REFERENCES publishers(pub_id),
    price   money   NULL,
    advance money   NULL,
    royalty int     NULL,
    ytd_sales       int     NULL,
    notes   varchar(200)    NULL,
    pubdate datetime        NOT NULL
        DEFAULT (GETDATE())