Oracle Schema Objects

Overview of Tables

A table is the basic unit of data organization in an Oracle database.

表是Oracle数据库中的数据组织的基本单位。

A table describes an entity, which is something of significance about which information must be recorded.

一个表描述了一个实体,其相关重要信息必须被记录。

A table is either permanent or temporary.

表要么是永久的,要么是临时的。

Relational tables

关系表

Relational tables have simple columns and are the most common table type.

关系表具有简单的列,是最常见的表类型。

可以创建如下关系表:

堆组织表

heap-organized table

A heap-organized table does not store rows in any particular order. The CREATE TABLE statement creates a heap-organized table by default.

它不会以任何特定顺序存储行

索引组织表

index-organized table

An index-organized table orders rows according to the primary key values. For some applications, index-organized tables enhance performance and use disk space more efficiently.

它按主键值对行进行排序。 对于某些应用程序,索引组织表可以增强性能并更有效地使用的磁盘空间

外部表

external table

An external table is a read-only table whose metadata is stored in the database but whose data in stored outside the database.是一个只读表,它的元数据存储在数据库中,但其数据存储在数据库外

Object tables

对象表

The columns correspond to the top-level attributes of an object type.

列对应于对象类型的顶层属性。

Columns and Rows

行和列

A table definition includes a table name and set of columns.

表的定义包括表名称和列集。

1、A column identifies an attribute of the entity described by the table.

列标识由表所描述的实体的一个属性。

virtual column

虚拟列

  • A table can contain a virtual column, which unlike a nonvirtual column does not consume disk space.

表可以包含虚拟的列,与非虚拟列不一样,虚拟列不占用磁盘空间。

  • The database derives the values in a virtual column on demand by computing a set of user-specified expressions or functions.

数据库通过计算一组用户指定的表达式或函数,按需派生出虚拟的列值。

  • For example, the virtual column income could be a function of the salary and commission_pct columns.

例如虚拟列 income 可能是 salary 列和 commission_pct 列的一个函数。

2、 A row is a collection of column information corresponding to a record in a table.

行是对应于表中某条记录的列信息的集合。

create a table

创建表

1、In general, you give each column a column name, a data type, and a width when you create a table.

一般地,当创建一个表时,给每列一个列名称、数据类型、宽度。

2、CREATE TABLE Statements

CREATE TABLE employees
( employee_id NUMBER(6)
, first_name VARCHAR2(20)
, last_name VARCHAR2(25)
CONSTRAINT emp_last_name_nn NOT NULL
, email VARCHAR2(25)
CONSTRAINT emp_email_nn NOT NULL
, phone_number VARCHAR2(20)
, hire_date DATE
CONSTRAINT emp_hire_date_nn NOT NULL
, job_id VARCHAR2(10)
CONSTRAINT emp_job_nn NOT NULL
, salary NUMBER(8,2)
, commission_pct NUMBER(2,2)
, manager_id NUMBER(6)
, department_id NUMBER(4)
, CONSTRAINT emp_salary_min
CHECK (salary > 0)
, CONSTRAINT emp_email_uk
UNIQUE (email)
) ;

3、ALTER TABLE Statements

ALTER TABLE employees
ADD ( CONSTRAINT emp_emp_id_pk
PRIMARY KEY (employee_id)
, CONSTRAINT emp_dept_fk
FOREIGN KEY (department_id)
REFERENCES departments
, CONSTRAINT emp_job_fk
FOREIGN KEY (job_id)
REFERENCES jobs (job_id)
, CONSTRAINT emp_manager_fk
FOREIGN KEY (manager_id)
REFERENCES employees
) ;

Oracle Schema Objects——Tables——Overview of Tables的更多相关文章

  1. Oracle Schema Objects——Tables——Oracle Data Types

    Oracle Schema Objects Oracle Data Types 数据类型 Data Type Description NUMBER(P,S) Number value having a ...

  2. Oracle Schema Objects——Tables——TableStorage

    Oracle Schema Objects Table Storage Oracle数据库如何保存表数据? Oracle Database uses a data segment in a table ...

  3. Oracle Schema Objects——Tables——TableType

    Oracle Schema Objects Object Tables object type An Oracle object type is a user-defined type with a ...

  4. Oracle Schema Objects——Tables——Table Compression

    Oracle Schema Objects Table Compression 表压缩 The database can use table compression to reduce the amo ...

  5. Oracle Schema Objects(Schema Object Storage And Type)

    One characteristic of an RDBMS is the independence of physical data storage from logical data struct ...

  6. Oracle Schema Objects——伪列ROWID Pseudocolumn(ROWNUM、ROWID)

    Oracle Schema Objects Oracle Schema Objects——Tables——Oracle Data Types Oracle伪列 在Oracle数据库之中为了实现完整的关 ...

  7. Oracle Schema Objects——PARTITION

    Oracle Schema Objects 表分区 表- - 分区( partition )TABLE PARTITION 一段时间给出一个分区,这样方便数据的管理. 可以按照范围range分区,列表 ...

  8. Oracle Schema Objects——Index

    索引主要的作用是查询优化. Oracle Schema Objects 查看执行计划的权限:查看执行计划plustrace:set autotrace trace exp stat(SP2-0618. ...

  9. Oracle Schema Objects——Synonyms

    Oracle Schema Objects 同义词 同义词 = 表的别名. 现在假如说有一张数据表的名称是“USER1.student”,而现在又为这张数据表起了一个“USER1”的名字,以后就可以直 ...

随机推荐

  1. AsyncTask的原理和缺点

    番外tips: 特别喜欢一句话.假设你想了解一个人.那你从他出生開始了解吧.相同的道理,想要了解AsyncTask,就从它的源代码開始吧. 进入主题前,在说一下,开发中已经非常少使用AsyncTask ...

  2. memcache概念浅谈及名称混乱之区分

    关于memcache这个现在应用广泛的组件,大大提高的网站的响应速度,也方便了程序开发缓存的应用.但是目前针对memcache,网上的资料 大同小异,尤其基于LAMP的网站居多,php/pcel又有两 ...

  3. Real-Time SQL Monitoring using DBMS_SQLTUNE

    Real-Time SQL Monitoring reports are available from three locations: Enterprise Manager - Click the ...

  4. 实例探索Class文件

    class文件是指以.class为文件后缀的Java虚拟机可装载文件.无论该class文件是在linux上进行编译的,还是在windows环境下编译的,无论虚拟机是在何种平台下实现和运行的,class ...

  5. 李洪强iOS经典面试题32-简单介绍 ARC 以及 ARC 实现的原理

    李洪强iOS经典面试题32-简单介绍 ARC 以及 ARC 实现的原理 问题 简单介绍 ARC 以及 ARC 实现的原理. 考查点 ARC 是苹果在 WWDC 2011 提出来的技术,因此很多新入行的 ...

  6. iOS直播-播放基于RTMP协议的视频

    iOS直播-播放基于RTMP协议的视频 流媒体协议介绍 1. 伪流媒体: 渐进式下载 : 边下边存, 文件会保存 使用http协议,也能够实现视频播放, 也能快进快退等, 体验上跟流媒体很像. 优酷, ...

  7. (转)Python开发规范

    转自:https://www.jianshu.com/p/d414e90dc953 Python风格规范 本项目包含了部分Google风格规范和PEP8规范,仅用作内部培训学习 Python风格规范 ...

  8. Ubuntu 14.04 下FTP服务器的搭建

    FTP服务器的搭建,我要实现的需求是: 不允许匿名访问,因为我的机器不想让谁都能登录上来,随便获取文件, 需要锁定一个目录,因为在家里,我需要给媳妇下载一些电影 韩剧之类的东西,媳妇会来我机器下载,但 ...

  9. 如何有效地提升JavaScript 水平?

    lyuehh 努力学习中.. 9 人赞同 简单的介绍一下, 不一定准确, 大家一起进步... (单词大小写什么的别计较....) 学习js主要是一下几个方面, js语言本身的知识, 和浏览器相关的知识 ...

  10. linux学习笔记16--命令find

    find是linux系统中用的比较多的一个命令,而且功能强大,特别是对各种查找方式的不确定位置的文件的查找. Linux下find命令在目录结构中搜索文件,并执行指定的操作.Linux下find命令提 ...