Oracle 5.0 Reference Manual page 1052

Table of Contents

Advertisement

Note
There can be only one
indexed, and it cannot have a
works properly only if it contains only positive values. Inserting a negative
number is regarded as inserting a very large positive number. This is done to
avoid precision problems when numbers "wrap" over from positive to negative
and also to ensure that you do not accidentally get an
column that contains 0.
For
and
MyISAM
BDB
column key. See
Section 3.6.9, "Using
To make MySQL compatible with some ODBC applications, you can find the
value for the last inserted row with the following query:
SELECT * FROM
tbl_name
For information about
Handling in
InnoDB".
• Character data types (CHAR, VARCHAR, TEXT) can include
to specify the character set and collation for the column. For details, see
Set
Support".
CHARSET
CREATE TABLE t (c CHAR(20) CHARACTER SET utf8 COLLATE utf8_bin);
MySQL 5.0 interprets length specifications in character column definitions in characters. (Versions
before MySQL 4.1 interpreted them in bytes.) Lengths for
The
clause specifies a default value for a column. With one exception, the default
DEFAULT
value must be a constant; it cannot be a function or an expression. This means, for example, that
you cannot set the default for a date column to be the value of a function such as
[918]. The exception is that you can specify
CURRENT_DATE
default for a
TIMESTAMP
TIMESTAMP".
If a column definition includes no explicit
described in
Section 11.1.7, "Data Type Default
and
columns cannot be assigned a default value.
BLOB
TEXT
fails if a date-valued default is not correct according to the
CREATE TABLE
NO_ZERO_IN_DATE
DATE DEFAULT '2010-00-00'
for
'c1'.
• A comment for a column can be specified with the
comment is displayed by the
is normally a synonym for INDEX. The key attribute
KEY
when given in a column definition. This was implemented for compatibility with other database
KEY
systems.
• A
index creates a constraint such that all values in the index must be distinct. An error
UNIQUE
occurs if you try to add a new row with a key value that matches an existing row. This constraint
does not apply to
NULL
index permits multiple
• A
is a unique index where all key columns must be defined as
PRIMARY KEY
not explicitly declared as
CREATE TABLE
AUTO_INCREMENT
tables, you can specify an
AUTO_INCREMENT".
WHERE
auto_col
IS NULL
and AUTO_INCREMENT, see
InnoDB
is a synonym for
CHARACTER
column. See
Section 11.1.5.5, "Automatic Initialization and Updating for
DEFAULT
[538]
SQL mode, even if strict SQL mode is not enabled. For example,
causes
CREATE TABLE
SHOW CREATE TABLE
values except for the
values for columns that can contain NULL.
NULL
NULL, MySQL declares them so implicitly (and silently). A table can
NOT
1032
Syntax
column per table, it must be
value. An
DEFAULT
AUTO_INCREMENT
Section 14.2.3.3,
CHARACTER SET
SET. Example:
and
BINARY
CURRENT_TIMESTAMP
value, MySQL determines the default value as
Values".
to fail with
option, up to 255 characters long. The
COMMENT
and
SHOW FULL COLUMNS
PRIMARY KEY
storage engine. For other engines, a
BDB
column
AUTO_INCREMENT
AUTO_INCREMENT
secondary column in a multiple-
AUTO_INCREMENT
"AUTO_INCREMENT
and
COLLATE
Section 10.1, "Character
are in bytes.
VARBINARY
[926]
NOW()
[918]
as the
Invalid default value
statements.
can also be specified as just
UNIQUE
NULL. If they are
NOT
attributes
or
c1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents