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
) ;

最新文章

  1. iOS逆向工程之Hopper+LLDB调试第三方App
  2. JS 中如何判断 undefined 和 null
  3. jade 渲染js片段
  4. java中类名.class、实例.getclass()区别
  5. Mac nginx PCRE install ngnix
  6. glance was not installed properly
  7. Python对文件的操作(转)
  8. mysql常用操作 mysql备份与恢复
  9. jquery插件autocomplete
  10. HDU 1134 卡特兰数 大数乘法除法
  11. 远程连接到vultr vps的mysql服务器
  12. 腾讯云安装openvz,高速搭建測试环境
  13. Little Sub and Mr.Potato's Math Problem-构造
  14. BundleConfig某js文件 全部打包
  15. linux内核中的PTP clock是什么?
  16. Android面试题(1)
  17. Yii2 使用 faker 生成假数据(转)
  18. 【Python】Java程序员学习Python(五)— 函数的定义和使用
  19. 我对git的快速使用和理解
  20. set 续1

热门文章

  1. 【POJ 3140】 Contestants Division(树型dp)
  2. 点滴积累【other】---存储过程修改表的所有字段(sql)
  3. redis源码学习_整数集合
  4. hMailServer之允许用户自己修改密码
  5. js 旋转控件 jQueryRotate
  6. html 基本标签 ---短语
  7. scala读写文件
  8. shell变量/环境变量和set/env/export用法_转
  9. windows config yii framework
  10. Xampp + Zend Studio + xDebug 环境搭建 (Mac,Windows都适用)