select * from emp;
增删改表字段
增
alter table emp add note varchar2(100);
删
alter table emp drop (flag);
改
alter table emp modify (note varchar2(1));
alter table emp rename column note to flag1
建表
create table EMP
(
empno NUMBER(4) not null,
ename VARCHAR2(10),
job VARCHAR2(9),
mgr NUMBER(4),
hiredate DATE,
sal NUMBER(7,2),
comm NUMBER(7,2),
deptno NUMBER(2)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K -- 初始大小
next 1M -- 扩张大小
minextents 1
maxextents unlimited
);
赋权
grant select, insert, update, delete on SCOOT.EMP to zhou;
grant给表赋权限:
1、grant 权限 on 表 to 用户。
grant select/update on table to username;
例如:
grant select on table_name to user_name;
2、grant 给存储过程赋权限:
grant execute on 过程、包、方法 to user
grant execute on package/function/procedure to username;
例如:
授权某个触发器到数据库其它用户
grant execute on func_name to username;
3、grant 用户序列授权
grant select on sequence_name to username;
4、一次把权限给完(过程、包、方法):
grant execute any procedure to username;
给其创建触发器权限:
grant create trigger to username;