--创建表空间
create tablespace it
--创建数据文件
datafile 'e:\it.dbf'
size 100m
autoextend on
next 10m;
--删除表
drop tablespace it;
--创建用户
create user it
identified by it
default tablespace it;
--授权用户
grant dba to it;
--创建表
create table account(
name varchar2(10),
id number(20)
);
--修改表结构
--添加一列
alter table account add(gender number(1));
--修改列类型
alter table account modify gender char(1);
--修改列名称
alter table account rename column gender to sex;
--删除一列
alter table account drop column sex;
--注意:凡是涉及到增删改,都需要手动commit(不提交即时查询不出来的)
--添加一条记录
insert into account(name ,id) values('keke',s_it.nextval);
commit;
select* from account;
--修改一条记录
update account set name='ll' where id=90;
commit;
--删除表结构
--三种方式,注意特点
--删除表中全部记录
delete from account;
--删除表结构
drop table account;
--先删除表&