Table (database): Difference between revisions
restored section |
No edit summary |
||
Line 1: | Line 1: | ||
{{Unreferenced stub|auto=yes|date=December 2009}} |
{{Unreferenced stub|auto=yes|date=December 2009}} |
||
In [[relational database]]s and [[flat file |
In [[relational database]]s and [[flat file fied by their name) and horizontal [[row (database)|rows]]. A table has a specified number of columns, but can have any number of rows. Each row is identified by the values appearing in a particular column subset which has been identified as a [[candidate key]]. |
||
Chuck Noris will break your table if YOU read this:) |
|||
Table is another term for [[relation (database)|relation]]s; although there is the difference in that a table is usually a multi-set (bag) of rows whereas a relation is a set and does not allow duplicates. |
Table is another term for [[relation (database)|relation]]s; although there is the difference in that a table is usually a multi-set (bag) of rows whereas a relation is a set and does not allow duplicates. THIS IS STUPID GET OFF NOWl data rows, tables generally have associated with them some [[Metadata|meta-information]], such as [[Check Constraint|constraints]] on the table or on the values within particular columns. |
||
The data in a table does not have to be physically stored in the database. [[view (database)|Views]] are also relational tables, but their data are calculated at query time. Another example are nicknames, which represent a pointer to a table in another database. |
The data in a table does not have to be physically stored in the database. [[view (database)|Views]] are also relational tables, but their data are calculated at query time. Another example are nicknames, which represent a pointer to a table in another database. |
Revision as of 03:20, 20 April 2010
In relational databases and [[flat file fied by their name) and horizontal rows. A table has a specified number of columns, but can have any number of rows. Each row is identified by the values appearing in a particular column subset which has been identified as a candidate key. Chuck Noris will break your table if YOU read this:) Table is another term for relations; although there is the difference in that a table is usually a multi-set (bag) of rows whereas a relation is a set and does not allow duplicates. THIS IS STUPID GET OFF NOWl data rows, tables generally have associated with them some meta-information, such as constraints on the table or on the values within particular columns.
The data in a table does not have to be physically stored in the database. Views are also relational tables, but their data are calculated at query time. Another example are nicknames, which represent a pointer to a table in another database.
Comparisons with other data structures
In non-relational systems, hierarchical databases, the distant counterpart of a table is a structured file, representing the rows of a table in each record of the file and each column in a record.
Unlike a spreadsheet, the datatype of field is ordinarily defined by the schema describing the table. Some relational systems are less strict about field datatype definitions.
Tables versus relations
In terms of the relational model of databases, a table can be considered a convenient representation of a relation, but the two are not strictly equivalent. For instance, an SQL table can potentially contain duplicate rows, whereas a true relation cannot contain duplicate tuples. Similarly, representation as a table implies a particular ordering to the rows and columns, whereas a relation is explicitly unordered. However, the database system does not guarantee any ordering of the rows unless an ORDER BY
clause is specified in the SELECT statement that queries the table.
An equally valid representations of a relation is as an n-dimensional chart, where n is the number of attributes (a table's columns). For example, a relation with two attributes and three values can be represented as a table with two columns and three rows, or as a two-dimensional graph with three points. The table and graph representations are only equivalent if the ordering of rows is not significant, and the table has no duplicate rows.
See also