Introduccion a Oracle

Páginas: 7 (1507 palabras) Publicado: 24 de septiembre de 2011
Each direction of the relationship contains:
* A name, for example, taught by or assigned to
* An optionality, either must be or may be
* A degree, either one and only one or one or more
Note: The term cardinality is a synonym for the term degree.
Each source entity {may be | must be} relationship name {one and only one | one or more}destination entity.
Note: The convention is to read clockwise.
Unique Identifiers
A unique identifier (UID) is any combination of attributes or relationships, or both, that serves to distinguish occurrences of an entity. Each entity occurrence must be uniquely identifiable.
* Tag each attribute that is part of the UID with a number symbol: #
* Tag secondary UIDs with anumber sign in parentheses: (#)

Terminology used in a Relational Database
A relational database can contain one or many tables. A table is the basic storage structure of an RDBMS. A table holds all the data necessary about something in the real world—for example, employees, invoices, or customers.
The slide above shows the contents of the EMP table or relation. The numbers indicatethe following:
1. A single row or tuple representing all data required for a particular employee. Each row in a table should be identified by a primary key, which allows no duplicate rows. The order of rows is insignificant; specify the row order when the data is retrieved.
2. A column or attribute containing the employee number, which is also the primary key. The employeenumber identifies a unique employee in the EMP table. A primary key must contain a value.
3. A column that is not a key value. A column represents one kind of data in a table; in the example, the job title of all the employees. Column order is insignificant when storing data; specify the column order when the data is retrieved.
4. A column containing the department number, which isalso a foreign key. A foreign key is a column that defines how tables relate to each other. A foreign key refers to a primary key or a unique key in another table. In the example, DEPTNO uniquely identifies a department in the DEPT table.
5. A field can be found at the intersection of a row and a column. There can be only one value in it.
6. A field may have no value in it. This iscalled a null value. In the EMP table, only employees who have a role of salesman have a value in the COMM (commission) field.
Note: Null values are covered further in subsequent lessons.

Relating Multiple Tables
Each table contains data that describes exactly one entity. For example, the EMP table contains information about employees. Categories of data are listed across the top ofeach table, and individual cases are listed below. Using a table format, you can readily visualize, understand, and use information.
Because data about different entities is stored in different tables, you may need to combine two or more tables to answer a particular question. For example, you may want to know the location of the department where an employee works. In this scenario, you needinformation from the EMP table (which contains data about employees) and the DEPT table (which contains information about departments). An RDBMS enables you to relate the data in one table to the data in another by using the foreign keys. A foreign key is a column or a set of columns that refer to a primary key in the same table or another table.
The ability to relate data in one table to data inanother enables you to organize information in separate manageable units. Employee data can be kept logically distinct from department data by storing it in a separate table.
Guidelines for Primary Keys and Foreign Keys
* No duplicate values are allowed in a primary key.
* Primary keys generally cannot be changed.
* Foreign keys are based on data values and are...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Introduccion a oracle
  • Introduccion al oracle
  • introducción a oracle
  • Introduccion A La Arquitectura Del Rdbms Oracle
  • Introduccion bases de datos oracle
  • Introducción a oracle developer
  • Introducción a Oracle PL/SQL
  • Introduccion Administracion Oracle

Conviértase en miembro formal de Buenas Tareas