Relational database
Encyclopedia
|
| Tutorials | Encyclopedia | Dictionary | Directory |
|
Relational database
A relational database is a database that conforms to the relational model, and refers to a database's data and schema (the database's structure of how those data are arranged). The term "relational database" is sometimes informally used to refer to a relational database management system, which is the software that is used to create and use a relational database. The term relational database was originally defined and coined by Edgar Codd at IBM Almaden Research Center in 1970.[1]
ContentsStrictly, a relational database is a collection of relations (frequently called tables). Other items are frequently considered part of the database, as they help to organize and structure the data, in addition to forcing the database to conform to a set of requirements. TerminologyRelational database theory uses a different set of mathematical-based terms, which are equivalent, or roughly equivalent, to SQL database terminology. The table below summarizes some of the most important relational database terms and their SQL database equivalents.
Relations or tables
A relation 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. 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 though they may grab information from several relations, they act as a single relation. Also, derived relations can be used as an abstraction layer. DomainA domain describes the set of possible values for a given attribute. Because a domain constrains the attribute's values and name, it can be considered constraints. Mathematically, attaching a domain to an attribute means that "all values for this attribute must be an element of the specified set." The character data value 'ABC', for instance, is not in the integer domain. The integer value 123, satisfies the domain constraint. ConstraintsConstraints allow you 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. Constraints are not formally part of the relational model, but because of the integral role that they play in organizing data, they are usually discussed together with relational concepts. Foreign keysA foreign key is a reference to a key in another relation, meaning that the referencing tuple has, as one of its attributes, the values of a key in the referenced tuple. 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." Stored proceduresA 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 DBMSs 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. IndicesAn 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. Relational databases typically supply multiple indexing techniques, each of which is optimal for some combination of data distribution, relation size, and typical access pattern. 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. Relational operationsQueries 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, Dr. 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 Dr. Codd involve special operations specific to relational databases:
Other operators have been introduced or proposed since Dr. Codd's introduction of the original eight including relational comparison operators and extensions that offer support for nesting and hierarchical data, among others. NormalizationNormalization was first proposed by Dr. Codd as an integral part of the relational model. It encompasses a set of best practices designed to eliminate the 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. Normalization trades reducing redundancy for increased information entropy. Normalization is criticised because it increases complexity and processing overhead required to join multiple tables representing what are conceptually a single item. Relational database management systemsRelational databases, as implemented in relational database management systems, have become the overwhelming choice for the storage of the tabular information that supports the world economy, including financial records, manufacturing and logistical information, personnel data and much more. Relational databases replaced hierarchical databases and network databases. More recently, relational databases have been challenged by Object Databases, which were introduced in an attempt to address the object-relational impedance mismatch in relational database, and XML databases. The three leading relational database vendors are Oracle, Microsoft, and IBM. The leading open source implementations are MySQL and PostgreSQL. References
bn:?????????? ??????? cs:Rela?ní databáze de:Relationale Datenbank es:Modelo relacional eo:Rilata datumbazo fa:?????????? ???????? ??????? fr:Base de données relationnelle ko:??? ?????? is:Venslagagnagrunnur he:??? ?????? ???? lt:Reliacin? duomen? baz? hu:Relációs adatbázis nl:Relationele database ja:???????? no:Relasjonsdatabase pl:Model relacyjny pt:Banco de dados relacional ru:??????????? ???? ?????? simple:Relational database sv:Relationsdatabas ta:??????????? ?????????? te:???????? ???????? zh:????? Source: Wikipedia | The above article is available under the GNU FDL. | Edit this article
|
|
top
©2008-2009 TutorGig.com. All Rights Reserved. Privacy Statement