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 'merchandising information table'; Comment on column tb_sell.XSPH is 'ticket sales numbers'; Comment on column tb_sell.SPBH is 'Product Number'; Comment on column tb_sell.SPMC is 'Product Name'; Comment on column tb_sell.SPJM is 'simple commodity code'; Comment on column tb_sell.SPLB is 'Product Category'; Comment on column tb_sell.TXM is '条形码'; Comment on column tb_sell.XSSL is 'sales'; Comment on column tb_sell.SPDJ is 'commodity price'; Comment on column tb_sell.XSSJ is 'selling time';
2. Modify columns
ALTER TABLE statement is used to add an existing table, delete, or modify columns.
ALTER TABLE table_name MODIFY column_name datatype;