1. Create table
create table tb_sell( XSPH varchar(20) NOT NULL, SPBH varchar(20) NOT NULL, SPMC varchar(20) NOT NULL, SPJM varchar(10), SPLB varchar(10), TXM varchar(20), XSSL number(10) NOT NULL, SPDJ number(10,2) NOT NULL, XSSJ date ); Comment on table tb_sell is '商品销售信息表'; Comment on column tb_sell.XSPH is '销售票号'; Comment on column tb_sell.SPBH is '商品编号'; Comment on column tb_sell.SPMC is '商品名称'; Comment on column tb_sell.SPJM is '商品简码'; Comment on column tb_sell.SPLB is '商品类别'; Comment on column tb_sell.TXM is '条形码'; Comment on column tb_sell.XSSL is '销售数量'; Comment on column tb_sell.SPDJ is '商品单价'; Comment on column tb_sell.XSSJ is '销售时间';
2. 修改列
ALTER TABLE 语句用于在已有的表中添加、删除或修改列。
ALTER TABLE table_name MODIFY column_name datatype;