-----------------------------------------------------------------
Type name type Remarks
-----------------------------------------------------------------
Text char (n) Where n represents the field size
Text varchar (N)
Text text
Number [byte] Byte
Number [integer] short
Number [long integer] Long, integer
Number [single precision] single, real
Number [Double Precision] Double, float
Number [automatic number] integer identity)
Number [automatic number] counter
Binary
Currency, money
Remarks memo
Date/time date, time, datetime
Yes/No bit
OLE object oleobject
-----------------------------------------------------
Primary key
Required. Not null.
Default Value: default date ()
-----------------------------------------------------
When using the create table statement, use the following fields to define the type:
Boolean, integer, long, currency, single, double, date, string, and variant (default)
-----------------------------------------------------
Example
Description of Table Name field name type affiliated attributes
--------------------------------------------------------------------------------
Create Table mytable
(M_id integer identity () primary key, // -- auto-incrementing type, primary key
M_class varchar (50) not null default 'aaa', // -- text, non-null, default value 'aaa'
M_int integer not null, // -- long integer, non-null
M_money money not null default 0.00, // -- currency type, non-null, default 0.00
M_memo text, // -- Remark type
M_date date default date (), // -- date type, default: current date
M_boolean bit default Yes, // -- Boolean, yes by default
M_blob oleobject, // -- blob type
M_double double, // -- Double Type
M_float real) // -- single precision type
Bytes -----------------------------------------------------------------------------------
Create an index
Example 1
Create index myindex on mytable (m_class [DESC, ASC], m_int)
Example 2
Create unique index myindex on mytable (m_class) -- create a non-duplicate Index
Note: primary key fields are automatically created as non-duplicate indexes.
Modify attributes
Alter table admin alter column username varchar (200)
Add Column
Alter table admin add userpass varchar (50) null
Delete column
Alter table admin drop column userpass
This content is organized from http://www.940194.cn/ShowData/2008-10/74.html