Citizendia
Your Ad Here

Database model
Common models

Hierarchical
Network
Relational
Object-relational
Object

Other models

Associative
Concept-oriented
Multi-dimensional
Star schema
XML database

The relational model for database management is a database model based on first-order predicate logic, first formulated and proposed in 1969 by Edgar Codd. A database model is a theory or specification describing how a Database is structured and used Hierarchical model redirects here For the statistics usage see Hierarchical linear modeling. The network model is a Database model conceived as a flexible way of representing objects and their relationships An object-relational database ( ORD) or object-relational database management system ( ORDBMS) is a Database management system (DBMS similar In an object database (also object oriented database) information is represented in the form of objects'' as used in Object-oriented programming. The associative model of data is an alternative Data model for Database systems The concept-oriented data model is a Data model based on on the Concept -oriented paradigm and Formal concept analysis (FCA which is based on Lattice Multidimensional databases are variously (depending on the context data Aggregators which combine data from a multitude of data sources Databases which offer networks The star schema (sometimes referenced as star join schema is the simplest style of Data warehouse schema. An XML database is a Data persistence software system that allows data to be stored in XML format A Computer Database is a structured collection of records or data that is stored in a computer system A database model is a theory or specification describing how a Database is structured and used First-order logic (FOL is a formal Deductive system used in mathematics philosophy linguistics and computer science Year 1969 ( MCMLXIX) was a Common year starting on Wednesday (link will display full calendar of the Gregorian calendar. Edgar Frank "Ted" Codd ( August 23, 1923 – April 18, 2003) was a British computer scientist who while working [1][2][3]

Its core idea is to describe a database as a collection of predicates over a finite set of predicate variables, describing constraints on the possible values and combinations of values. The content of the database at any given time is a finite model (logic) of the database, i. In Mathematics, model theory is the study of (classes of mathematical structures such as groups, Fields graphs or even models e. a set of relations, one per predicate variable, such that all predicates are satisfied. This article sets out the set-theoretic notion of relation For a more elementary point of view see Binary relations and Triadic relations A request for information from the database (a database query) is also a predicate. A Computer Database is a structured collection of records or data that is stored in a computer system

The purpose of the relational model is to provide a declarative method for specifying data and queries: we directly state what information the database contains and what information we want from it, and let the database management system software take care of describing data structures for storing the data and retrieval procedures for getting queries answered. Declarative may refer to Declarative programming Declarative learning Declarative memory Declarative

IBM implementated Codd's ideas with the DB2 database management system; it introduced the SQL data definition and query language. DB2 is one of IBM 's families of Relational database management system (RDBMS (or as IBM now calls it data server software products within IBM's broader Information Other relational database management systems followed, most of them using SQL as well. A table in an SQL database schema corresponds to a predicate variable; the contents of a table to a relation; key constraints, other constraints, and SQL queries correspond to predicates. However, it must be noted that SQL databases, including DB2, deviate from the relational model in many details; Codd fiercely argued against deviations that compromise the original principles.

Contents

The model

The fundamental assumption of the relational model is that all data is represented as mathematical n-ary relations, an n-ary relation being a subset of the Cartesian product of n domains. Debt AIDS Trade in Africa (or DATA) is a Multinational non-government organization founded in January 2002 in London by U2 's This article sets out the set-theoretic notion of relation For a more elementary point of view see Binary relations and Triadic relations Cartesian square redirects here For Cartesian squares in Category theory, see Cartesian square (category theory. In the mathematical model, reasoning about such data is done in two-valued predicate logic, meaning there are two possible evaluations for each proposition: either true or false (and in particular no third value such as unknown, or not applicable, either of which are often associated with the concept of NULL). Reasoning is the cognitive process of looking for Reasons for beliefs conclusions actions or feelings In Mathematical logic, predicate logic is the generic term for symbolic Formal systems like First-order logic, Second-order logic, Many-sorted Evaluation is systematic determination of merit worth and significance of something or someone using criteria against a set of standards In Logic and Philosophy, proposition refers to either (a the content or Meaning of a meaningful Declarative sentence Null is a special marker used in Structured Query Language (SQL to indicate that a data value does not exist in the database Some think two-valued logic is an important part of the relational model, where others think a system that uses a form of three-valued logic can still be considered relational. Logic is the study of the principles of valid demonstration and Inference. A ternary, three-valued or trivalent logic (sometimes abbreviated 3VL) is a term to describe any of several Multi-valued logic systems in which

Data are operated upon by means of a relational calculus or relational algebra, these being equivalent in expressive power. Relational calculus consist of two calculi the Tuple relational calculus and the Domain relational calculus, that are part of the Relational model Relational algebra, an offshoot of First-order logic (and of Algebra of sets) deals with a set of relations closed under Operators In Computer science, the expressive power of a language may refer to what can be said in the language (at all how concisely it can be said

The relational model of data permits the database designer to create a consistent, logical representation of information. Information as a concept has a diversity of meanings from everyday usage to technical settings Consistency is achieved by including declared constraints in the database design, which is usually referred to as the logical schema. The theory includes a process of database normalization whereby a design with certain desirable properties can be selected from a set of logically equivalent alternatives. Database normalization, sometimes referred to as canonical synthesis, is a technique for designing Relational database tables to minimize duplication of The access plans and other implementation and operation details are handled by the DBMS engine, and are not reflected in the logical model. A query plan (or query execution plan) is a set of steps used to access or modify information in a SQL Relational database management system. A database management system ( DBMS) is Computer software designed for the purpose of managing Databases DBMSes may use any of a variety of Data models This contrasts with common practice for SQL DBMSs in which performance tuning often requires changes to the logical model. Performance tuning is the improvement of System Performance. This is typically a computer application but the same methods can be applied to economic markets bureaucracies

The basic relational building block is the domain or data type, usually abbreviated nowadays to type. In Data management and Database analysis a data domain refers to all the unique values which a Data element may contain A data type in Programming languages is an attribute of a datum which tells the computer (and the programmer something about the kind of datum it is A tuple is an unordered set of attribute values. In Mathematics, a tuple is a Sequence (also known as an "ordered list" of values called the components of the tuple An attribute is an ordered pair of attribute name and type name. An attribute value is a specific valid value for the type of the attribute. This can be either a scalar value or a more complex type.

A relation consists of a heading and a body. A heading is a set of attributes. A body (of an n-ary relation) is a set of n-tuples. The heading of the relation is also the heading of each of its tuples.

A relation is defined as a set of n-tuples. In both mathematics and the relational database model, a set is an unordered collection of items, although some DBMSs impose an order to their data. In mathematics, a tuple has an order, and allows for duplication. In Mathematics, a tuple is a Sequence (also known as an "ordered list" of values called the components of the tuple E.F. Codd originally defined tuples using this mathematical definition. Edgar Frank "Ted" Codd ( August 23, 1923 – April 18, 2003) was a British computer scientist who while working [4] Later, it was one of E.F. Codd's great insights that using attribute names instead of an ordering would be so much more convenient (in general) in a computer language based on relations. Edgar Frank "Ted" Codd ( August 23, 1923 – April 18, 2003) was a British computer scientist who while working This insight is still being used today. Though the concept has changed, the name "tuple" has not. An immediate and important consequence of this distinguishing feature is that in the relational model the Cartesian product becomes commutative. Cartesian square redirects here For Cartesian squares in Category theory, see Cartesian square (category theory. In Mathematics, commutativity is the ability to change the order of something without changing the end result

A table is an accepted visual representation of a relation; a tuple is similar to the concept of row, but note that in the database language SQL the columns and the rows of a table are ordered. In Relational databases and Flat file databases a table is a set of data elements (values that is organized using a model of vertical columns (which are In the context of a Relational database, a row —also called a record or tuple —represents a single implicitly structured Data item in a

A relvar is a named variable of some specific relation type, to which at all times some relation of that type is assigned, though the relation may contain zero tuples. In Relational databases a relvar is a term coined by C J Date as an Abbreviation for the concept of "relation variable" which is the actual

The basic principle of the relational model is the Information Principle: all information is represented by data values in relations. A Computer Database is a structured collection of records or data that is stored in a computer system Information as a concept has a diversity of meanings from everyday usage to technical settings In accordance with this Principle, a relational database is a set of relvars and the result of every query is presented as a relation. A relational database is a Database that groups data using common attributes found in the data set

The consistency of a relational database is enforced, not by rules built into the applications that use it, but rather by constraints, declared as part of the logical schema and enforced by the DBMS for all applications. A database management system ( DBMS) is Computer software designed for the purpose of managing Databases DBMSes may use any of a variety of Data models In general, constraints are expressed using relational comparison operators, of which just one, "is subset of" (⊆), is theoretically sufficient. In practice, several useful shorthands are expected to be available, of which the most important are candidate key (really, superkey) and foreign key constraints. In the Relational model, a candidate key of a Relvar (relation variable is a Set of attributes of that relvar such that at all times it holds A superkey is defined in the Relational model of Database organization as a Set of attributes of a relation variable ( Relvar) for which In the context of Relational databases a foreign key is a referential constraint between two tables

Interpretation

To fully appreciate the relational model of data it is essential to understand the intended interpretation of a relation.

The body of a relation is sometimes called its extension. This is because it is to be interpreted as a representation of the extension of some predicate, this being the set of true propositions that can be formed by replacing each free variable in that predicate by a name (a term that designates something). The extension of a predicate a Truth-valued function is the set of Tuples of values that used as arguments satisfy the predicate Sometimes it is inconvenient or impossible to describe a set by listing all of its elements In Logic and Philosophy, proposition refers to either (a the content or Meaning of a meaningful Declarative sentence In Mathematics, and in other disciplines involving Formal languages including Mathematical logic and Computer science, a free variable is a

There is a one-to-one correspondence between the free variables of the predicate and the attribute names of the relation heading. Each tuple of the relation body provides attribute values to instantiate the predicate by substituting each of its free variables. The result is a proposition that is deemed, on account of the appearance of the tuple in the relation body, to be true. Contrariwise, every tuple whose heading conforms to that of the relation but which does not appear in the body is deemed to be false. This assumption is known as the closed world assumption. The closed world assumption is the presumption that what is not currently known to be true is false

For a formal exposition of these ideas, see the section Set Theory Formulation, below.

Application to databases

A type as used in a typical relational database might be the set of integers, the set of character strings, the set of dates, or the two boolean values true and false, and so on. The corresponding type names for these types might be the strings "int", "char", "date", "boolean", etc. It is important to understand, though, that relational theory does not dictate what types are to be supported; indeed, nowadays provisions are expected to be available for user-defined types in addition to the built-in ones provided by the system.

Attribute is the term used in the theory for what is commonly referred to as a column. Similarly, table is commonly used in place of the theoretical term relation (though in SQL the term is by no means synonymous with relation). A table data structure is specified as a list of column definitions, each of which specifies a unique column name and the type of the values that are permitted for that column. An attribute value is the entry in a specific column and row, such as "John Doe" or "35".

A tuple is basically the same thing as a row, except in an SQL DBMS, where the column values in a row are ordered. (Tuples are not ordered; instead, each attribute value is identified solely by the attribute name and never by its ordinal position within the tuple. ) An attribute name might be "name" or "age".

A relation is a table structure definition (a set of column definitions) along with the data appearing in that structure. The structure definition is the heading and the data appearing in it is the body, a set of rows. A database relvar (relation variable) is commonly known as a base table. The heading of its assigned value at any time is as specified in the table declaration and its body is that most recently assigned to it by invoking some update operator (typically, INSERT, UPDATE, or DELETE). The heading and body of the table resulting from evaluation of some query are determined by the definitions of the operators used in the expression of that query. (Note that in SQL the heading is not always a set of column definitions as described above, because it is possible for a column to have no name and also for two or more columns to have the same name. Also, the body is not always a set of rows because in SQL it is possible for the same row to appear more than once in the same body. )

Alternatives to the relational model

Other models are the hierarchical model and network model. Scientific modelling is the process of generating abstract, conceptual, Graphical and or mathematical models. Hierarchical model redirects here For the statistics usage see Hierarchical linear modeling. The network model is a Database model conceived as a flexible way of representing objects and their relationships Some systems using these older architectures are still in use today in data centers with high data volume needs or where existing systems are so complex and abstract it would be cost prohibitive to migrate to systems employing the relational model; also of note are newer object-oriented databases, even though many of them are DBMS-construction kits, rather than proper DBMSs. System (from Latin systēma, in turn from Greek systēma is a set of interacting or interdependent Entities, real or abstract A data center is a facility used to house computer systems and associated components such as telecommunications and storage systems In an object database (also object oriented database) information is represented in the form of objects'' as used in Object-oriented programming. A database management system ( DBMS) is Computer software designed for the purpose of managing Databases DBMSes may use any of a variety of Data models
A recent development is the Object-Relation type-Object model, which is based on the assumption that any fact can be expressed in the form of one or more binary relationships. The model is used in Object Role Modeling (ORM), RDF/Notation 3 (N3) and in Gellish English. Not to be confused with Object-relational mapping. Object Role Modeling (ORM in the field of Software engineering is a method for Notation3, or N3 as it is more commonly known is a shorthand non- XML serialization of Resource Description Framework models designed with human-readability Gellish English is a variant of Gellish and is a Formal language, which means that it is structured and formalised subset of natural English that is computer interpretable

The relational model was the first formal database model. After it was defined, informal models were made to describe hierarchical databases (the hierarchical model) and network databases (the network model). Hierarchical and network databases existed before relational databases, but were only described as models after the relational model was defined, in order to establish a basis for comparison.

History

The relational model was invented by E.F. (Ted) Codd as a general model of data, and subsequently maintained and developed by Chris Date and Hugh Darwen among others. Edgar Frank "Ted" Codd ( August 23, 1923 – April 18, 2003) was a British computer scientist who while working Chris Date (born 1941 is an independent author lecturer researcher and consultant specializing in relational database technology Hugh Darwen, employee of IBM UK from 1967 to 2004 has been involved in the history of the Relational model since the beginning In The Third Manifesto (first published in 1995) Date and Darwen show how the relational model can accommodate certain desired object-oriented features. The Third Manifesto ( 1995) is Christopher J Date 's and Hugh Darwen 's proposal for future Relational database management systems that would avoid Object-oriented programming (OOP is a Programming paradigm that uses " objects " and their interactions to design applications and computer programs

SQL and the relational model

SQL, initially pushed as the standard language for relational databases, deviates from the relational model in several places. Standardization (or standardisation) is the process of developing and agreeing upon technical standards. A relational database is a Database that groups data using common attributes found in the data set The current ISO SQL standard doesn't mention the relational model or use relational terms or concepts. However, it is possible to create a database conforming to the relational model using SQL if one does not use certain SQL features.

The following deviations from the relational model have been noted in SQL. Note that few database servers implement the entire SQL standard and in particular do not allow some of these deviations. Whereas NULL is nearly ubiquitous, for example, allowing duplicate column names within a table or anonymous columns is uncommon.

Duplicate rows
The same row can appear more than once in an SQL table. The same tuple cannot appear more than once in a relation.
Anonymous columns
A column in an SQL table can be unnamed and thus unable to be referenced in expressions. The relational model requires every attribute to be named and referenceable.
Duplicate column names
Two or more columns of the same SQL table can have the same name and therefore cannot be referenced, on account of the obvious ambiguity. The relational model requires every attribute to be referenceable.
Column order significance
The order of columns in an SQL table is defined and significant, one consequence being that SQL's implementations of Cartesian product and union are both noncommutative. The relational model requires there to be no significance to any ordering of the attributes of a relation.
Views without CHECK OPTION
Updates to a view defined without CHECK OPTION can be accepted but the resulting update to the database does not necessarily have the expressed effect on its target. For example, an invocation of INSERT can be accepted but the inserted rows might not all appear in the view, or an invocation of UPDATE can result in rows disappearing from the view. The relational model requires updates to a view to have the same effect as if the view were a base relvar.
Columnless tables unrecognized
SQL requires every table to have at least one column, but there are two relations of degree zero (of cardinality one and zero) and they are needed to represent extensions of predicates that contain no free variables.
NULL
This special mark can appear instead of a value wherever a value can appear in SQL, in particular in place of a column value in some row. The deviation from the relational model arises from the fact that the implementation of this ad hoc concept in SQL involves the use of three-valued logic, under which the comparison of NULL with itself does not yield true but instead yields the third truth value, unknown; similarly the comparison NULL with something other than itself does not yield false but instead yields unknown. Multi-valued logics are logical calculi in which there are more than two Truth values Traditionally logical calculi are two-valued—that is there are only two possible It is because of this behaviour in comparisons that NULL is described as a mark rather than a value. The relational model depends on the law of excluded middle under which anything that is not true is false and anything that is not false is true; it also requires every tuple in a relation body to have a value for every attribute of that relation. This article uses forms of logical notation For a concise description of the symbols used in this notation see Table of logic symbols. This particular deviation is disputed by some if only because E. F. Codd himself eventually advocated the use of special marks and a 4-valued logic, but this was based on his observation that there are two distinct reasons why one might want to use a special mark in place of a value, which led opponents of the use of such logics to discover more distinct reasons and at least as many as 19 have been noted, which would require a 21-valued logic. SQL itself uses NULL for several purposes other than to represent "value unknown". For example, the sum of the empty set is NULL, meaning zero, the average of the empty set is NULL, meaning undefined, and NULL appearing in the result of a LEFT JOIN can mean "no value because there is no matching row in the right-hand operand".
Concepts
SQL uses concepts "table", "column", "row" instead of "relvar", "attribute", "tuple". These are not merely differences in terminology. For example, a "table" may contain duplicate rows, whereas the same tuple cannot appear more than once in a relation.

Implementation

There have been several attempts to produce a true implementation of the relational database model as originally defined by Codd and explained by Date, Darwen and others, but none have been popular successes so far. Edgar Frank "Ted" Codd ( August 23, 1923 – April 18, 2003) was a British computer scientist who while working Chris Date (born 1941 is an independent author lecturer researcher and consultant specializing in relational database technology Hugh Darwen, employee of IBM UK from 1967 to 2004 has been involved in the history of the Relational model since the beginning Rel is one of the more recent attempts to do this. Rel is an Open Source true relational Database management system ( TRDBMS) that implements a significant portion of Chris Date and

Controversies

Codd himself, some years after publication of his 1970 model, proposed a three-valued logic (True, False, Missing or NULL) version of it in order to deal with missing information, and in his The Relational Model for Database Management Version 2 (1990) he went a step further with a four-valued logic (True, False, Missing but Applicable, Missing but Inapplicable) version. But these have never been implemented, presumably because of attending complexity. SQL's NULL construct was intended to be part of a three-valued logic system, but fell short of that due to logical errors in the standard and in its implementations. See the section "SQL standard", above. The relational model for Database management is a Database model based on first-order predicate logic, first formulated and proposed in 1969 by Edgar

Design

Database normalization is usually performed when designing a relational database, to improve the logical consistency of the database design and the transactional performance. Database normalization, sometimes referred to as canonical synthesis, is a technique for designing Relational database tables to minimize duplication of A relational database is a Database that groups data using common attributes found in the data set Database design is the process of producing a detailed Data model of a Database.

There are two commonly used systems of diagramming to aid in the visual representation of the relational model: the entity-relationship diagram (ERD), and the related IDEF diagram used in the IDEF1X method created by the U.S. Air Force based on ERDs. System (from Latin systēma, in turn from Greek systēma is a set of interacting or interdependent Entities, real or abstract Diagramming software consists of Computer programs that are used to produce graphical Diagrams. An entity-relationship model (ERM is an abstract conceptual representation of structured data IDEF ( Integration DEFinition) is a family of Modeling languages in the field of Software engineering.

The tree structure of data may enforce hierarchical model organization, with parent-child relationship table. Hierarchical model redirects here For the statistics usage see Hierarchical linear modeling.

Example database

An idealized, very simple example of a description of some relvars and their attributes:

In this design we have six relvars: Customer, Order, Order Line, Invoice, Invoice Line and Product. Design is used both as a Noun and a Verb. The term is often tied to the various Applied arts and Engineering (See design disciplines In Relational databases a relvar is a term coined by C J Date as an Abbreviation for the concept of "relation variable" which is the actual The bold, underlined attributes are candidate keys. In the Relational model, a candidate key of a Relvar (relation variable is a Set of attributes of that relvar such that at all times it holds The non-bold, underlined attributes are foreign keys. In the context of Relational databases a foreign key is a referential constraint between two tables

Usually one candidate key is arbitrarily chosen to be called the primary key and used in preference over the other candidate keys, which are then called alternate keys. In the Relational model, a candidate key of a Relvar (relation variable is a Set of attributes of that relvar such that at all times it holds In Relational database design a unique key or primary key is a Candidate key to uniquely identify each row in a table. Preference (also called " taste " or "penchant" is a concept used in the Social sciences particularly Economics. You may have meant the Alt key on the keyboard An alternate key (or secondary key) is any Candidate key which is not selected to be the

A candidate key is a unique identifier enforcing that no tuple will be duplicated; this would make the relation into something else, namely a bag, by violating the basic definition of a set. In Computer science, Identifiers ( IDs) are lexical tokens that name entities. In Mathematics, a tuple is a Sequence (also known as an "ordered list" of values called the components of the tuple In Mathematics, a multiset (or bag) is a generalization of a set. Both foreign keys and superkeys (which includes candidate keys) can be composite, that is, can be composed of several attributes. Below is a tabular depiction of a relation of our example Customer relvar; a relation can be thought of as a value that can be attributed to a relvar.

Example: customer relation

Customer ID     Tax ID              Name                 Address                 [More fields. . . . ]
==================================================================================================
1234567890      555-5512222         Munmun               323 Broadway            . . . 
2223344556      555-5523232         Vijeta               1200 Main Street        . . . 
3334445563      555-5533323         Ekta                 871 1st Street          . . . 
4232342432      555-5325523         E.  F.  Codd           123 It Way              . . . 

If we attempted to insert a new customer with the ID 1234567890, this would violate the design of the relvar since Customer ID is a primary key and we already have a customer 1234567890. The DBMS must reject a transaction such as this that would render the database inconsistent by a violation of an integrity constraint. A database management system ( DBMS) is Computer software designed for the purpose of managing Databases DBMSes may use any of a variety of Data models A Computer Database is a structured collection of records or data that is stored in a computer system Infraction as a general term means a violation of a rule or Local ordinance or regulation promise or obligation

Foreign keys are integrity constraints enforcing that the value of the attribute set is drawn from a candidate key in another relation. In the context of Relational databases a foreign key is a referential constraint between two tables In Computer science, a value is a sequence of Bits that is interpreted according to some Data type. In the Relational model, a candidate key of a Relvar (relation variable is a Set of attributes of that relvar such that at all times it holds For example in the Order relation the attribute Customer ID is a foreign key. A join is the operation that draws on information from several relations at once. In its simplest meaning in Mathematics and Logic, an operation is an action or procedure which produces a new value from one or more input values Information as a concept has a diversity of meanings from everyday usage to technical settings By joining relvars from the example above we could query the database for all of the Customers, Orders, and Invoices. If we only wanted the tuples for a specific customer, we would specify this using a restriction condition.

If we wanted to retrieve all of the Orders for Customer 1234567890, we could query the database to return every row in the Order table with Customer ID 1234567890 and join the Order table to the Order Line table based on Order No.

There is a flaw in our database design above. Database design is the process of producing a detailed Data model of a Database. The Invoice relvar contains an Order No attribute. So, each tuple in the Invoice relvar will have one Order No, which implies that there is precisely one Order for each Invoice. But in reality an invoice can be created against many orders, or indeed for no particular order. Reality, in everyday usage means "the state of things as they actually exist" Additionally the Order relvar contains an Invoice No attribute, implying that each Order has a corresponding Invoice. But again this is not always true in the real world. An order is sometimes paid through several invoices, and sometimes paid without an invoice. In other words there can be many Invoices per Order and many Orders per Invoice. This is a many-to-many relationship between Order and Invoice (also called a non-specific relationship). In Systems analysis, a many-to-many relationship refers to a relationship between two Entities (see also Entity-Relationship Model) A and B in which A may To represent this relationship in the database a new relvar should be introduced whose role is to specify the correspondence between Orders and Invoices:

OrderInvoice(Order No,Invoice No)

Now, the Order relvar has a one-to-many relationship to the OrderInvoice table, as does the Invoice relvar. A role (sometimes spelled rôle) or a social role is a set of connected Behaviors Rights and Obligations as conceptualized by actors One-to-many in Communication is the act of Publishing or Broadcasting from one Sender to many Receivers. If we want to retrieve every Invoice for a particular Order, we can query for all orders where Order No in the Order relation equals the Order No in OrderInvoice, and where Invoice No in OrderInvoice equals the Invoice No in Invoice.

Set-theoretic formulation

Basic notions in the relational model are relation names and attribute names. We will represent these as strings such as "Person" and "name" and we will usually use the variables r, s, t, \ldots and a,b,c to range over them. Another basic notion is the set of atomic values that contains values such as numbers and strings.

Our first definition concerns the notion of tuple, which formalizes the notion of row or record in a table:

Tuple
A tuple is a partial function from attribute names to atomic values. In Mathematics, a tuple is a Sequence (also known as an "ordered list" of values called the components of the tuple Domain of a partial function There are two distinct meanings in current mathematical usage for the notion of the domain of a partial function
Header
A header is a finite set of attribute names.
Projection
The projection of a tuple t on a finite set of attributes A is t[A] = \{ (a, v) : (a, v) \in t, a \in A \}. In Mathematics, a set is called finite if there is a Bijection between the set and some set of the form {1 2.

The next definition defines relation which formalizes the contents of a table as it is defined in the relational model.

Relation
A relation is a tuple (H,B) with H, the header, and B, the body, a set of tuples that all have the domain H.

Such a relation closely corresponds to what is usually called the extension of a predicate in first-order logic except that here we identify the places in the predicate with attribute names. First-order logic (FOL is a formal Deductive system used in mathematics philosophy linguistics and computer science Usually in the relational model a database schema is said to consist of a set of relation names, the headers that are associated with these names and the constraints that should hold for every instance of the database schema. A Logical Schema is a Data model of a specific problem domain expressed in terms of a particular data management technology A relational database is a Database that groups data using common attributes found in the data set

Relation universe
A relation universe U over a header H is a non-empty set of relations with header H.
Relation schema
A relation schema (H,C) consists of a header H and a predicate C(R) that is defined for all relations R with header H. A relation satisfies a relation schema (H,C) if it has header H and satisfies C.

Key constraints and functional dependencies

One of the simplest and most important types of relation constraints is the key constraint. It tells us that in every instance of a certain relational schema the tuples can be identified by their values for certain attributes.

Superkey
A superkey is written as a finite set of attribute names.
A superkey K holds in a relation (H,B) if:
  • K \subseteq H and
  • there exist no two distinct tuples t_1, t_2 \in B such that t1[K] = t2[K].
A superkey holds in a relation universe U if it holds in all relations in U.
Theorem: A superkey K holds in a relation universe U over H if and only if K \subseteq H and K \rightarrow H holds in U.
Candidate key
A superkey K holds as a candidate key for a relation universe U if it holds as a superkey for U and there is no proper subset of K that also holds as a superkey for U. In the Relational model, a candidate key of a Relvar (relation variable is a Set of attributes of that relvar such that at all times it holds
Functional dependency
A functional dependency (FD for short) is written as X \rightarrow Y for X,Y finite sets of attribute names. A functional dependency (FD is a constraint between two sets of attributes in a relation from a Database.
A functional dependency X \rightarrow Y holds in a relation (H,B) if:
  • X, Y \subseteq H and
  • \forall tuples t_1, t_2 \in B, t_1[X] = t_2[X]~\Rightarrow~t_1[Y] = t_2[Y]
A functional dependency X \rightarrow Y holds in a relation universe U if it holds in all relations in U.
Trivial functional dependency
A functional dependency is trivial under a header H if it holds in all relation universes over H.
Theorem: An FD X \rightarrow Y is trivial under a header H if and only if Y \subseteq X \subseteq H.
Closure
Armstrong's axioms: The closure of a set of FDs S under a header H, written as S + , is the smallest superset of S such that:
  • Y \subseteq X \subseteq H~\Rightarrow~X \rightarrow Y \in S^+ (reflexivity)
  • X \rightarrow Y \in S^+ \land Y \rightarrow Z \in S^+~\Rightarrow~X \rightarrow Z \in S^+ (transitivity) and
  • X \rightarrow Y \in S^+ \land Z \subseteq H~\Rightarrow~(X \cup Z) \rightarrow (Y \cup Z) \in S^+ (augmentation)
Theorem: Armstrong's axioms are sound and complete; given a header H and a set S of FDs that only contain subsets of H, X \rightarrow Y \in S^+ if and only if X \rightarrow Y holds in all relation universes over H in which all FDs in S hold. Armstrong's axioms are a set of Axioms (or more precisely Inference rules used to infer all the functional dependencies on a Relational database
Completion
The completion of a finite set of attributes X under a finite set of FDs S, written as X + , is the smallest superset of X such that:
  • Y \rightarrow Z \in S \land Y \subseteq X^+~\Rightarrow~Z \subseteq X
The completion of an attribute set can be used to compute if a certain dependency is in the closure of a set of FDs.
Theorem: Given a set S of FDs, X \rightarrow Y \in S^+ if and only if Y \subseteq X^+.
Irreducible cover
An irreducible cover of a set S of FDs is a set T of FDs such that:
  • S + = T +
  • there exists no U \subset T such that S + = U +
  • X \rightarrow Y \in T~\Rightarrow Y is a singleton set and
  • X \rightarrow Y \in T \land Z \subset X~\Rightarrow~Z \rightarrow Y \notin S^+.

Algorithm to derive candidate keys from functional dependencies

      INPUT: a set S of FDs that contain only subsets of a header H
      OUTPUT: the set C of superkeys that hold as candidate keys in
              all relation universes over H in which all FDs in S hold
      begin
        C := ∅;          // found candidate keys
        Q := { H };      // superkeys that contain candidate keys
        while Q <> ∅ do
          let K be some element from Q;
          Q := Q - { K };  
          minimal := true;
          for each X->Y in S do 
            K' := (K - Y) ∪ X;   // derive new superkey
            if K' K then
              minimal := false;
              Q := Q ∪ { K' };
            end if
          end for
          if minimal and there is not a subset of K in C then
            remove all supersets of K from C;
            C := C ∪ { K };
          end if
        end while
      end

See also

References

  1. ^ "Derivability, Redundancy, and Consistency of Relations Stored in Large Data Banks", E. In Computer science, domain relational calculus ( DRC) is a calculus that was introduced by Michel Lacroix and Alain Pirotte as a declarative The life cycle of a relational database is the cycle of development and changes that a database goes through during the course of its life See DBMS for a shorter list of “typical” representative database management systems Query languages are Computer languages used to make queries into Databases and Information systems Broadly query languages can be classified Query languages are Computer languages used to make queries into Databases and Information systems Broadly query languages can be classified An information retrieval query language is a Query language used to make queries into database where the semantics of the query are defined not by a precise rendering of a formal This article sets out the set-theoretic notion of relation For a more elementary point of view see Binary relations and Triadic relations A relational database is a Database that groups data using common attributes found in the data set A Relational database management system (RDBMS is a Database management system (DBMS that is based on the Relational model as introduced by E The Third Manifesto ( 1995) is Christopher J Date 's and Hugh Darwen 's proposal for future Relational database management systems that would avoid Tuple-versioning (also called point-in-time) is a mechanism used in a Relational database management system to store past states of a Relation. F. Codd, IBM Research Report, 1969
  2. ^ "A Relational Model of Data for Large Shared Data Banks", in Communications of the ACM, 1970. Communications of the ACM ( CACM) is the flagship monthly Journal of the Association for Computing Machinery (ACM
  3. ^ White, Colin. In the Beginning: An RDBMS History. Teradata Magazine Online. September 2004 edition. URL: http://www.teradata.com/t/page/127057
  4. ^ Codd, E. F. (1970). "A Relational Model of Data for Large Shared Data Banks". Communications of the ACM 13 (6): 377–387. Communications of the ACM ( CACM) is the flagship monthly Journal of the Association for Computing Machinery (ACM  

External links


© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
Dapyx Software network: MP3 Explorer | Ebook Manager | Zenithic