Column (database)
Encyclopedia
In the context of a relational database
Relational database
A relational database is a database that conforms to relational model theory. The software used in a relational database is called a relational database management system . Colloquial use of the term "relational database" may refer to the RDBMS software, or the relational database itself...

 table
Table (database)
In relational databases and flat file databases, a table is a set of data elements that is organized using a model of vertical columns and horizontal rows. A table has a specified number of columns, but can have any number of rows...

, a column is a set of data
Data
The term data refers to qualitative or quantitative attributes of a variable or set of variables. Data are typically the results of measurements and can be the basis of graphs, images, or observations of a set of variables. Data are often viewed as the lowest level of abstraction from which...

 values of a particular simple type, one for each row
Row (database)
In the context of a relational database, a row—also called a record or tuple—represents a single, implicitly structured data item in a table. In simple terms, a database table can be thought of as consisting of rows and columns or fields...

 of the table. The columns provide the structure according to which the rows are composed.

The term field
Field (computer science)
In computer science, data that has several parts can be divided into fields. Relational databases arrange data as sets of database records, also called rows. Each record consists of several fields; the fields of all records form the columns....

is often used interchangeably with column, although many consider it more correct to use field (or field value) to refer specifically to the single item that exists at the intersection between one row and one column.

In relational database
Relational database
A relational database is a database that conforms to relational model theory. The software used in a relational database is called a relational database management system . Colloquial use of the term "relational database" may refer to the RDBMS software, or the relational database itself...

 terminology, column's equivalent is called attribute.

For example, a table that represents companies might have the following columns:
  • ID (integer identifier, unique to each row)
  • Name (text)
  • Address line 1 (text)
  • Address line 2 (text)
  • City (integer identifier, drawn from a separate table of cities, from which any state or country information would be drawn)
  • Postal code (text)
  • Industry (integer identifier, drawn from a separate table of industries)
  • etc.


Each row would provide a data value for each column and would then be understood as a single structured data value, in this case representing a company. More formally, each row can be interpreted as a relvar
Relvar
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 term used by the inventor of the relational model, E. F. Codd, regarding the same concept...

, composed of a set of tuple
Tuple
In mathematics and computer science, a tuple is an ordered list of elements. In set theory, an n-tuple is a sequence of n elements, where n is a positive integer. There is also one 0-tuple, an empty sequence. An n-tuple is defined inductively using the construction of an ordered pair...

s, with each tuple consisting of the two items: the name of the relevant column and the value this row provides for that column.






Column 1 Column 2
Row 1 Row 1, Column 1 Row 1, Column 2
Row 2 Row 2, Column 1 Row 2, Column 2
Row 3 Row 3, Column 1 Row 3, Column 2


Examples of database: MySQL, SQL Server, Access, Oracle, Sybase, DB2.

Coding involved: SQL [Structured Query Language]

See more at SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

.

See also

  • Column-oriented DBMS
    Column-oriented DBMS
    A column-oriented DBMS is a database management system that stores its content by column rather than by row. This has advantages for data warehouses and library catalogues where aggregates are computed over large numbers of similar data items....

     - Optimization for column-centric queries
  • Column (data store)
    Column (data store)
    A column of a distributed data store is a NoSQL object of the lowest level in a keyspace. It is a tuple consisting of three elements:* Unique name: Used to reference the column* Value: The content of the column...

     - A similar object used in distributed data store
    Distributed data store
    A distributed data store is a blurred concept and means either a distributed database where users store their information on a number of nodes, or a network in which a user stores their information on a number of peer network nodes ....

    s
  • Row (database)
    Row (database)
    In the context of a relational database, a row—also called a record or tuple—represents a single, implicitly structured data item in a table. In simple terms, a database table can be thought of as consisting of rows and columns or fields...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK