Mar APR May
24
2012 2013 2014
success
fail

About this capture

COLLECTED BY

Organization: Internet Archive

The Internet Archive discovers and captures web pages through many different web crawls. At any given time several distinct crawls are running, some for months, and some every day or longer. View the web archive through the Wayback Machine.

Collection: Wide Crawl started April 2013

Web wide crawl with initial seedlist and crawler configuration from April 2013.
TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20130424053559/http://en.wikipedia.org/wiki/Relational_database
 



Relational database

 

From Wikipedia, the free encyclopedia
 

Jump to: navigation, search  

Arelational database is a database that has a collection of tables of data items, each of which is formally described and organized using the relational model. The term is in contrast to only one table as the database, and in contrast to other models which also have many tables in one database.

In the relational model, each table schema must identify a primary column used for identifying a row called the primary key. Tables can relate by using a foreign key that points to the primary key. The relational model offers various levels of refinement of the table relations called database normalization. (See Normalization below.) The database management system (DBMS) or a relational database is called an RDBMS, and is the software of a relational database.

The relational database was first defined in June 1970 by Edgar Codd, of IBM's San Jose Research Laboratory.[1] Codd's view of what qualifies as an RDBMS is summarized in Codd's 12 rules. A relational database has become the predominant choice in storing data. Other models besides the relational model include the hierarchical database model and the network model.

Contents

[edit] Terminology

Relational database terminology.

Relational database theory uses mathematical terminology, which are roughly equivalent to the SQL database terminology concerning normalization. The table below summarizes some of the most important relational database terms and their SQL database equivalents. It was first introduced in 1970 following the work of E.F.Codd.

A row or tuple is has a relation schema, but an entire database has a relational schema.

SQL Relational database Description
Row Tuple Data set with specific instances in the range of each member
Column name; Column data Attribute name; Attribute value Labeled member in the set of elements common to all data sets; A name, word, number, phrase, etc.
Table Relation; Base relvar Formal data structure
Set of column names Relation scheme; Set of attributes A schema
View; Query result; Result set Derived relvar A data report from the RDBMS in response to a query

[edit] Relations or Tables

Arelation is defined as a set of tuples that have the same attributes. A tuple usually represents an object and information about that object. Objects are typically physical objects or concepts. A relation is usually described as a table, which is organized into rows and columns. All the data referenced by an attribute are in the same domain and conform to the same constraints. The relational model specifies that the tuples of a relation have no specific order and that the tuples, in turn, impose no order on the attributes. Applications access data by specifying queries, which use operations such as select to identify tuples, project to identify attributes, and join to combine relations. Relations can be modified using the insert, delete, and update operators. New tuples can supply explicit values or be derived from a query. Similarly, queries identify tuples for updating or deleting. Tuples by definition are unique. If the tuple contains a candidate or primary key then obviously it is unique, however, a primary key need not be defined for a row or record to be a tuple. The definition of a tuple requires that it be unique. The definition does not require a Primary Key to be defined. The attributes of a tuple may be referred to as a super key.

[edit] Base and derived relations

In a relational database, all data are stored and accessed via relations. Relations that store data are called "base relations", and in implementations are called "tables". Other relations do not store data, but are computed by applying relational operations to other relations. These relations are sometimes called "derived relations". In implementations these are called "views" or "queries". Derived relations are convenient in that they act as a single relation, even though they may grab information from several relations. Also, derived relations can be used as an abstraction layer.

[edit] Domain

A domain describes the set of possible values for a given attribute, and can be considered a constraint on the value of the attribute. Mathematically, attaching a domain to an attribute means that any value for the attribute must be an element of the specified set. The character data value 'ABC', for instance, is not in the integer domain, but the integer value 123 is in the integer domain.

[edit] Constraints

Constraints make it possible to further restrict the domain of an attribute. For instance, a constraint can restrict a given integer attribute to values between 1 and 10. Constraints provide one method of implementing business rules in the database. SQL implements constraint functionality in the form of check constraints. Constraints restrict the data that can be stored in relations. These are usually defined using expressions that result in a boolean value, indicating whether or not the data satisfies the constraint. Constraints can apply to single attributes, to a tuple (restricting combinations of attributes) or to an entire relation. Since every attribute has an associated domain, there are constraints (domain constraints). The two principal rules for the relational model are known as entity integrity and referential integrity.

[edit] Primary keys

A primary key uniquely specifies a tuple within a table. In order for an attribute to be a good primary key it must not repeat. While natural attributes (attributes used to describe the data being entered) are sometimes good primary keys, surrogate keys are often used instead. A surrogate key is an artificial attribute assigned to an object which uniquely identifies it (for instance, in a table of information about students at a school they might all be assigned a student ID in order to differentiate them). The surrogate key has no intrinsic (inherent) meaning, but rather is useful through its ability to uniquely identify a tuple. Another common occurrence, especially in regards to N:M cardinality is the composite key. A composite key is a key made up of two or more attributes within a table that (together) uniquely identify a record. (For example, in a database relating students, teachers, and classes. Classes could be uniquely identified by a composite key of their room number and time slot, since no other class could have exactly the same combination of attributes. In fact, use of a composite key such as this can be a form of data verification, albeit a weak one.)

[edit] Foreign key

A foreign key is a field in a relational table that matches the primary key column of another table. The foreign key can be used to cross-reference tables. Foreign keys need not have unique values in the referencing relation. Foreign keys effectively use the values of attributes in the referenced relation to restrict the domain of one or more attributes in the referencing relation. A foreign key could be described formally as: "For all tuples in the referencing relation projected over the referencing attributes, there must exist a tuple in the referenced relation projected over those same attributes such that the values in each of the referencing attributes match the corresponding values in the referenced attributes."

[edit] Stored procedures

A stored procedure is executable code that is associated with, and generally stored in, the database. Stored procedures usually collect and customize common operations, like inserting a tuple into a relation, gathering statistical information about usage patterns, or encapsulating complex business logic and calculations. Frequently they are used as an application programming interface (API) for security or simplicity. Implementations of stored procedures on SQL RDBMSs often allow developers to take advantage of procedural extensions (often vendor-specific) to the standard declarative SQL syntax. Stored procedures are not part of the relational database model, but all commercial implementations include them.

[edit] Index

An index is one way of providing quicker access to data. Indices can be created on any combination of attributes on a relation. Queries that filter using those attributes can find matching tuples randomly using the index, without having to check each tuple in turn. This is analogous to using the index of a book to go directly to the page on which the information you are looking for is found, so that you do not have to read the entire book to find what you are looking for. Relational databases typically supply multiple indexing techniques, each of which is optimal for some combination of data distribution, relation size, and typical access pattern. Indices are usually implemented via B+ trees, R-trees, and bitmaps. Indices are usually not considered part of the database, as they are considered an implementation detail, though indices are usually maintained by the same group that maintains the other parts of the database. It should be noted that use of efficient indexes on both primary and foreign keys can dramatically improve query performance. This is because B-tree indexes result in query times proportional to log(n) where n is the number of rows in a table and hash indexes result in constant time queries (no size dependency so long as the relevant part of the index fits into memory).

[edit] Relational operations

Queries made against the relational database, and the derived relvars in the database are expressed in a relational calculus or a relational algebra. In his original relational algebra, Codd introduced eight relational operators in two groups of four operators each. The first four operators were based on the traditional mathematical set operations:

The remaining operators proposed by Codd involve special operations specific to relational databases:

Other operators have been introduced or proposed since Codd's introduction of the original eight including relational comparison operators and extensions that offer support for nesting and hierarchical data, among others.

[edit] Normalization

Normalization was first proposed by Codd as an integral part of the relational model. It encompasses a set of procedures designed to eliminate nonsimple domains (non-atomic values) and the redundancy (duplication) of data, which in turn prevents data manipulation anomalies and loss of data integrity. The most common forms of normalization applied to databases are called the normal forms.

[edit] References

  1. ^ Codd, E.F. (1970). "A Relational Model of Data for Large Shared Data Banks". Communications of the ACM 13 (6): 377–387. doi:10.1145/362384.362685. 

Retrieved from "http://en.wikipedia.org/w/index.php?title=Relational_database&oldid=551697241" 

Categories: 
Database management systems
Relational model
Database theory
Types of databases
English inventions
1969 introductions
 

Navigation menu

 

Personal tools



Create account
Log in
 



Namespaces



Article

Talk
 


Variants








Views



Read

Edit

View history
 


Actions












Navigation




Main page

Contents

Featured content

Current events

Random article

Donate to Wikipedia
 



Interaction




Help

About Wikipedia

Community portal

Recent changes

Contact Wikipedia
 



Toolbox




What links here

Related changes

Upload file

Special pages

Permanent link

Page information

Cite this page
 



Print/export




Create a book

Download as PDF

Printable version
 



Languages




العربية



Български

Català

Česky

Deutsch

Ελληνικά

Español

Esperanto

Euskara

فارسی

Français

Gaeilge



Íslenska

עברית

Қазақша

Lietuvių

Magyar

Bahasa Melayu

Nederlands



Norsk bokmål

Português

Русский

Simple English

Slovenčina

Svenska

ி





Українська



Edit links
 





This page was last modified on 22 April 2013 at 21:27.

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. 
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.
 


Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Mobile view
 


Wikimedia Foundation
Powered by MediaWiki