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. html5-canvas绘图操作方法

    <script>function draw(){    var c=document.getElementById("mycanvas");    c.width=50 ...

  2. 点滴积累【other】---存储过程修改表的所有字段(sql)

    USE [QG_Mis24] GO /****** Object: StoredProcedure [dbo].[p_set] Script Date: 07/11/2013 17:05:38 *** ...

  3. Oracle之函数concat、lpad

    一.引言 程序测试需要生成大量的测试数据,且测试数据有主键,主键自增,于是决定用存储过程来实现,经过半天的查资料终于完成了,记录之,学习之 二.存储过程 格式: CREATE PROCEDURE re ...

  4. c++11 thread (目前我使用的ZThread库)

    目前为止(2014-11-30),GCC其实已经基本上完全支持C++11的所有功能了,事实上从GCC4.7之后,就支持了-std=c++11选项,在4.7版本之前,也开始支持-std=c++0x的选项 ...

  5. HTML5坦克大战(2)绘制坦克复习

    html代码: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head&g ...

  6. VMware网络连接失败解决方法

    假如你碰到了VMware 网络被断开,明明已经分配了适配器,客户端却显示网络断开没有连接. 一. 可用恢复默认的方法重置所有网卡及服务. 如图片操作: 进主工具首页.点击: 虚拟网络编辑器 然后点击下 ...

  7. mysql information_schema 数据库简介:

    .CHARACTER_SETS 表 CREATE TEMPORARY TABLE `CHARACTER_SETS` ( `CHARACTER_SET_NAME` varchar() NOT NULL ...

  8. 【iOS与EV3混合机器人编程系列之四】iOS_WiFi_EV3_Library 剖析之中的一个:WiFi UDP和TCP

    在上一篇文章中.我们通过编写EV3 Port Viewer项目实现了iOS监測EV3的实时端口数据. 程序最核心的部分就是我们的开源码库iOS_WiFi_EV3_Library. 那么,在本文中,我们 ...

  9. thinkphp5 No input file specified.

    .htaccess文件中的 RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] 在默认情况下会导致No input file specified. 修改成 Rewri ...

  10. PHP输出javascript,alert中文乱码解决办法

    echo '<html><head><meta http-equiv="Content-Type" content="text/html; ...