create table syntax

The create table statement:

For example, the create table statement for the titles table in the pubs2 database is:

create table titles 
(title_id tid, 
title varchar(80) not null, 
type char(12), 
pub_id char(4) null, 
price money null, 
advance money null, 
royalty int null, 
total_sales int null, 
notes varchar(200) null,
pubdate datetime,
contract bit not null) 

See the Reference Manual: Commands.

The following sections describe components of table definition: system-supplied datatypes, user-defined datatypes, null types, and IDENTITY columns.

NoteThe on segment_name extension to create table allows you to place your table on an existing segment. segment_name points to a specific database device or a collection of database devices. Before creating a table on a segment, see a system administrator or the database owner for a list of segments that you can use. Certain segments may be allocated to specific tables or indexes for performance reasons, or for other considerations.