|
char(size)
Holds a fixed length string (can contain letters, numbers, and special characters). The fixed size is specified in parenthesis.
varchar(size)
Holds a variable length string (can contain letters, numbers, and special characters). The maximum size is specified in parenthesis.
date(yyyymmdd)
Holds a date
Alter Table
用途:
在已经存在的表中增加后者移除字段
语法:
ALTER TABLE table_name ADD column_name datatype ALTER TABLE table_name DROP COLUMN column_name
注意:某些数据库管理系统不允许移除表中的字段
例:
“Person”表中的原始数据:
LastName
FirstName
Address
Pettersen
Kari
Storgt 20
在Person表中增加一个名为City的字段:
ALTER TABLE Person ADD City varchar(30)
增加后表中数据如下:
LastName
FirstName << 上一页 [21] [22] [23] [24] [25] [26] [27] 下一页 |