--oracle 复习体系三
--显示当前登录用户
show user
--查询当前方案下的所有表
select * from tab
--断开数据库连接
disconnect
--table
create table teacher (int number(3,2),username varchar2(50));
--alter table
--添加字段
alter table teacher add (password varchar(20));
--修改字段
alter table teacher modify (id number(5));
--修改字段类型,名字(不能有数据)
alter table teacher modify(id char(29));
--删除字段
alter table teacher drop column password;
--修改表明
rename teacher to xxxx;
drop table teacher;
--insert
insert into teacher (1,'xx');
--插入数据 数据来源与scott.emp(empno,ename)
conn scott/tiger
grant select on emp to tina with grant option;
conn tina/tina
insert into teacher select empno,ename from scott.emp;
select * from teacher
select * from scott.emp;
-- 查询username 为空的
select * from teacher where username is null
--不为空的
select * from teacher where username is not null;
--创建保存点
savepoint a;