select * from emp;
create synonym emp_ny for emp;
create public synonym pub_emp_ny for employees;--创建公有同义词
DROP SYNONYM EMP_NY;--删除同义词
DROP PUBLIC SYNONYM PUB_EMP_NY;--删除公有同义词
查看已有同义词
SELECT * FROM SYS.ALL_SYNONYMS WHERE table_name=‘DIC_TRIPMODE‘;
CREATE SEQUENCE SEQID
INCREMENT BY 1
START WITH 1001
MAXVALUE 1200
MINVALUE 1
CYCLE
NOCACHE ;
DROP SEQUENCE SEQID;--删除序列
CREATE VIEW EMP_VE AS SELECT * FROM EMP;
CREATE OR REPLACE VIEW EMP_VE AS SELECT * FROM EMP WHERE ADDRESS LIKE ‘%USA%‘ --有条件创建视图
CREATE FORCE VIEW EMPLOYEE_VE AS SELECT * FROM ABC;--创建带错误视图,意为即使表不存在也创建
DROP VIEW EMP_VE;--删除视图
CREATE INDEX employees_empid ON EMPLOYEES(DATEOFJOINING);--标准索引
CREATE INDEX employees_empname ON EMPLOYEES(ENAME,JOB);--组合索引
CREATE INDEX emp_ename ON EMP (ENAME) REVERSE;--反向键索引
CREATE BITMAP INDEX emp_bit_address ON EMP(ADDRESS);--位图索引
CREATE INDEX abc_name ON ABC(LOWER(aname));
DROP INDEX employees_empid;--删除索引
CREATE TABLE place
(
place_id NUMBER(5)PRIMARY KEY,
pName VARCHAR2(20),
Address VARCHAR2(20),
Station VARCHAR2(10)
)ORGANIZATION INDEX;
以上只是一些简单的创建,但从中可以看出ORACLE数据库的功能不知比SQL Server强大多少!真不愧为对象关系型数据库