ORACLE数据库中创建、删除--同义词、视图、索引、序列
时间:2021-07-01 10:21:17
帮助过:5人阅读
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强大多少!真不愧为对象关系型数据库
ORACLE数据库中创建、删除--同义词、视图、索引、序列
标签: