–如果用户存在 则删除级联删除整个用户
–建用户
create user scott identified by 123456 default tablespace System;
–授权
grant connect,resource to scott;
grant create any sequence to scott;
grant create any table to scott;
grant delete any table to scott;
grant insert any table to scott;
grant select any table to scott;
grant unlimited tablespace to scott;
grant execute any procedure to scott;
grant update any table to scott;
grant create any view to scott;
–建表雇员表
CREATE TABLE EMP
(
EMPNO CHAR(4),
ENAME VARCHAR2(20),
JOB VARCHAR2(20),
MGR VARCHAR2(20),
HIREDATE DATE,
SAL NUMBER(10,2),
COMM NUMBER(10,2),
DEPARTMENT CHAR(2)
);
–插入一条数据
INSERT INTO EMP VALUES(‘7369’,’smith’,’clerk’,’7902’,’1980/12/17’,800,0,20);
–修改oracle默认的日期格式
alter session set nls_date_format = ‘yyyy-mm-dd hh24:mi:ss’;
–查询数据 <