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. 一个来自红帽的Java垃圾回收算法,试图把停顿时间降到10毫秒以下 原创 2017-01-10 薛命灯

    转自 微信聊聊架构 GC... 早在三年前,Red Hat就启动了Shenandoah项目.Shenandoah是一种新的Java虚拟机GC算法,目标是利用现代多核CPU的优势,减少大堆内存在GC方面 ...

  2. SQL Server 保存不了修改后的表的解决方法

    客户端报错(配图): 出现问题环境:在新建一个表之后,又想添加一个字段保存表,提示错误. 解决方案:在SQL Server 2008R2 中 对于对于重新保存新建表系统默认设置为“阻止”,在对应设置解 ...

  3. Entity Framework "There is already an open DataReader associated with this 的解决办法

    解决办法: 1,修改连接串,加上MultipleActiveResultSets=true 2, 一次性先把数据读出来 var contacts = from c in db.Contact sele ...

  4. 大型站点技术架构PDF阅读笔记(一):

    1.数据库读写分离: 2.系统吞吐量和系统并发数以及系统响应时间之间的关系: 3.系统负载的概念: 4.反向代理的概念: 5.使用缓存来读取数据: 6.利用cookie来记录session: 利用co ...

  5. DirectShow中写push模式的source filter流程 + 源码(内附具体凝视)

    尽管网上已有非常多关于DirectShow写source filter的资料.只是非常多刚開始学的朋友总说讲的不是非常清楚(可能当中作者省略了很多他觉得简 单的过程).读者总希望看到象第一步怎么做,第 ...

  6. google_gflags使用

    gflags是google开源的一个解析命令行参数的工具. 最简单的demo #include <iostream> #include <gflags/gflags.h> us ...

  7. docker jupyter

    151  curl -sSL https://get.docker.com/|sh 152  sudo usermode -aG docker ubuntu 153  sudo usermod -aG ...

  8. love2d教程34--thread模块

    love的thread是一个单独的lua运行环境,与主线程平行.因此可以用线程来处理 处理复杂的计算,不过由于隔离,线程不能访问主线程的变量和方法,而且进程 间通信也受限.   可以在线程里共享lov ...

  9. linux TZ格式

    man tzset可以很清楚了解时区设置格式,共3种: The first format is used when there is no daylight saving time in the lo ...

  10. storm 错误汇总

    https://blog.csdn.net/xiaolang85/article/details/38492277