create index emp_deptno_index on emp(deptno)
pctfree 25
tablespace users;
create bitmap index emp_salary_bmp
on employees(salary)
tablespace users;
connect scott/1qaz2wsx
create index emp_job_reverse
on emp(job) reverse
tablespace users;
create index emp_job_fun
on emp(lower(job));
alter index emp_deptno_index
coalesce deallocate unused;
alter index emp_deptno_index rebuild;
 drop index emp_job_fun
connect system/1qaz2wsx
select index_name,index_type
from dba_indexes
where owner = 'HR';
column column_name for a30
select column_name ,column_length
from user_ind_columns
where index_name = 'EMP_DEPTNO_INDEX';
select tablespace_name,segment_type,bytes
from user_segments
where segment_name = 'EMP_DEPTNO_INDEX';
connect scott/1qaz2wsx
select column_expression
from user_ind_expressions
where index_name = 'EMP_JOB_FUN';
connect scott/1qaz2wsx
create or replace view emp_view as
select empno,ename,job,deptno
from emp
where deptno = 20;
create or replace view emp_view_readonly as
select * from dept
where deptno != 88
with read only;
create or replace view emp_view_complex as
select deptno 部门编号,max(sal) 最高工资,min(sal) 最低工资,avg(sal) 平均工资
from emp
group by deptno;
create or replace view emp_view_union as
select d.dname,d.loc,e.empno,e.ename
from emp e,dept d
where e.deptno = d.deptno and d.deptno = 20;
create public synonym public_dept for scott.dept;
create  synonym  private_dept for dept;
create sequence empno_seq
maxvalue 99999
start with 9000
increment by 100
cache 50;
alter sequence empno_seq
maxvalue 100000
increment by 200
cache 100
--创建表
create table tb_10_1(
stuno number(10) not null, --学号
stuname varchar2(8), --姓名
sex char(2), --性别
age int
); ---创建索引
create index tb_10_1_index on tb_10_1(sex)
pctfree 25
tablespace users;
--创建表
create table tb_10_2(
id number(10) not null, --编号
stuname varchar2(8), --姓名
sex char(2), --性别
age int
); --创建序列
create sequence id_seq
maxvalue 10000
start with 1
increment by 3
cache 50; --测试
insert into tb_10_2(id,stuname,sex,age)
values(id_seq.nextval,'东方','男',30);

吴裕雄--天生自然ORACLE数据库学习笔记:其它数据对象的更多相关文章

  1. 吴裕雄--天生自然ORACLE数据库学习笔记:数据导出与导入

    create directory dump_dir as 'd:\dump'; grant read,write on directory dump_dir to scott; --在cmd下 exp ...

  2. 吴裕雄--天生自然ORACLE数据库学习笔记:数据表对象

    create table students( stuno ) not null, --学号 stuname ), --姓名 sex ), --性别 age int, --年龄 departno ) n ...

  3. 吴裕雄--天生自然ORACLE数据库学习笔记:过程、函数、触发器和包

    create procedure pro_insertDept is begin ,'市场拓展部','JILIN'); --插入数据记录 commit; --提交数据 dbms_output.put_ ...

  4. 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle数据备份与恢复

    run{ allocate channel ch_1 device type disk format = 'd:\oraclebf\%u_%c.bak'; backup tablespace syst ...

  5. 吴裕雄--天生自然ORACLE数据库学习笔记:PL/SQL编程

    set serveroutput on declare a ; b ; c number; begin c:=(a+b)/(a-b); dbms_output.put_line(c); excepti ...

  6. 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle 11g的闪回技术

    alter system set db_recovery_file_dest_size=4g scope=both; connect system/1qaz2wsx as sysdba; archiv ...

  7. 吴裕雄--天生自然ORACLE数据库学习笔记:优化SQL语句

    create or replace procedure trun_table(table_deleted in varchar2) as --创建一个存储过程,传入一个表示表名称的参数,实现清空指定的 ...

  8. 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle系统调优

    --修改 alter system set large_pool_size=64m; --显示 show parameter large_pool_size; select sum(getmisses ...

  9. 吴裕雄--天生自然ORACLE数据库学习笔记:用户管理与权限分配

    create user mr identified by mrsoft default tablespace users temporary tablespace temp; create user ...

  10. 吴裕雄--天生自然ORACLE数据库学习笔记:表分区与索引分区

    create table ware_retail_part --创建一个描述商品零售的数据表 ( id integer primary key,--销售编号 retail_date date,--销售 ...

随机推荐

  1. .net core 框架调用顺序

    API -> AppSrv -> IRepository -> Repository ->

  2. 从游击队到正规军(三):基于Go的马蜂窝旅游网分布式IM系统技术实践

    本文由马蜂窝技术团队电商交易基础平台研发工程师"Anti Walker"原创分享. 一.引言 即时通讯(IM)功能对于电商平台来说非常重要,特别是旅游电商. 从商品复杂性来看,一个 ...

  3. JavaScript - let和var区别

    前提 ES5只有函数作用域和全局作用域,var属于ES5.let属于ES6,新增块级作用域.目的是可以写更安全的代码. The let statement declares a block scope ...

  4. 【强烈推荐,超详细,实操零失误】node.js安装 + npm安装教程 + Vue开发环境搭建

    node.js安装 + npm安装教程 + Vue开发环境搭建 [强烈推荐,超详细,实操零失误] 原博客园地址:https://www.cnblogs.com/goldlong/p/8027997.h ...

  5. TensorFlow卷积神经网络实现手写数字识别以及可视化

    边学习边笔记 https://www.cnblogs.com/felixwang2/p/9190602.html # https://www.cnblogs.com/felixwang2/p/9190 ...

  6. 【C语言】创建一个函数,并调用比较三个数的大小

    #include <stdio.h> int max(int x,int y,int z) { if(x>=y) if(x>=z) return x; else return ...

  7. java实现二维码的生成和解析:QRCode、zxing 两种方式

    第一种:QRCode.jar,使用QRCode生成和解析二维码 1.导入jar包  2.代码 (1)QRCodeUtil .java import com.swetake.util.Qrcode; i ...

  8. 健壮的I/O(RIO)

    在上篇Unix系统级I/O中,我们介绍了有关在Unix环境下读取和写入文件的函数read和write,也提到了标准I/O在进行网络I/O时的局限性.但是在某些地方,直接使用read和write往往会出 ...

  9. vscode 提示 Running save participants 无法保存文件

    今天vscode提示一直在running save participants...中,无法保存文件 control + shift + p打开面板后,输入Reload with extensions ...

  10. python:字符串类型

    字符串概念 字符串:由单个字符组成的一个序列, 字符串是一个不可变的类型 形式: 非原始字符串: 单引号:单引号包起来的一段字符就是字符串 双引号:和单引号一样 三引号:三引号包括的字符串可以换行,保 ...