Oracle----数据表操作

创建表

##首先连接到对应的用户下,如果已经是对应的用户则忽略
conn gary/gary as sysdba;

##创建表
create table t1(id int not null,name varchar(8) not null,tel int not null);

修改表

##修改表名
rename t1 to tb1;
##增加字段
alter table tb1 add sex char(4);
##修改字段名
alter table tb1 rename column tel to tell;
##删除字段
alter table tb1 drop column sex;##修改字段类型alter table tb1 modify sex int;##

 删除表

##删除表中的所有数据,速度比delete快很多,截断表
truncate table 表名 

delete from table 条件
#删除表
drop table 表名 
原文地址:https://www.cnblogs.com/yanxiaoge/p/13224103.html