Creating Tables
A table is a data structure consisting of an unordered set of rows, each containing a specific number of columns. Conceptually, a database table is like an ordinary table. Much of the power of relational databases comes from defining the relations among the tables. The CREATE TABLE statement has the following general form:
- CREATE TABLE tablename (colname1 characteristics[, colname2 characteristics, …] [, tableconstraint …])
- Characteristics must include a datatype and can also include several other things. See “Creating Domains” on page 6 for a list of column characteristics.
- A tableconstraint can be a CHECK, UNIQUE, FOREIGN KEY, or PRIMARY KEY constraint on one or more columns.
For the full syntax of the CREATE TABLE statement, see the Language Reference Guide.
Advance To:
In the following topics, you create three of the ten tables for the TUTORIAL database: