Fujitsu J2X0-2273-01EN Server User Manual


 
index definition.
Schema comment definition
A comment consisting of a character string can be specified for the schema. A character string of up to 256 bytes can
be specified. If no comment is necessary, omit the specification. An example follows.
Example:
Specify a comment for the STOCKS schema.
2.6.2 Sequence definition
Define a sequence using the CREATE SEQUENCE statement.
A sequence can be defined to automatically generate unique names within the sequence. The user can use a
sequence to create primary key values.
A sample sequence definition for a stock management database follows. This sequence definition defines a sequence
that belongs to a schema named STOCKS.
Example:
Sample sequence definition
Sequence name
Specify a name to be assigned to a sequence. Specify up to 36 alphanumeric characters for a sequence name, whose
first character must be an alphabetic character. Each sequence name within a schema must be unique. A sequence
with the same sequence name may be defined in another schema.
2.6.3 Table definition
Define a base table using the CREATE TABLE statement.
The table definition defines the following items:
· Table name
· Columns that form the base table
- Column name
- Column data type (such as character, integer or date-and-time type)
- Column constraint (such as a unique constraint or allowing or disallowing NULL values)
- Column comment definition
· Table constraint for the base table
· Table comment definition
A sample base table definition for the inventory management database follows. This table definition defines the
STOCK table that belongs to the schema STOCKS.
Example:
Figure: CREATE TABLE statement that defines the STOCK table shows the CREATE TABLE
32