天天看點

資料庫相關操作SQL指令

一、資料庫操作

二、表結構修改

1、修改表名

oracle:

alter table table1 rename to table2;

mysql:

rename table table1 to table2;

2、表内添加字段

alter table [表名] add [字段名] 字段屬性 default 預設值;

default 是可選參數

3、修改字段類型

oracle:

alter table [表名] modify [字段名] 字段類型;

三、表内資料操作