打印本文 打印本文 关闭窗口 关闭窗口
SQL的详细语法介绍——对于学习数据库最基础知识一
作者:武汉SEO闵涛  文章来源:敏韬网  点击数28386  更新时间:2007/11/14 12:56:02  文章录入:mintao  责任编辑:mintao

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]  下一页

打印本文 打印本文 关闭窗口 关闭窗口