Safekipedia

Column (database)

Adventurer · ages 7–10Adapted from Wikipedia

In a relational database, a column is a set of data values that all have the same type. Each column holds one value for each row in a table. A column can hold text, numbers, or even pointers to files on the computer. Most columns hold simple types of data. Some database systems let columns hold bigger things, such as whole documents, pictures, or video clips. A column can also be called an attribute.

Each row gives one value for every column. This means a row works like a single organized piece of information. For example, a database that stores company contact details might have columns for an ID, a Company Name, two Address Lines, a City, and a Postal Code. Each row would then hold one company's details.

In more formal terms, a row is a tuple. It contains one specific value for each column. A row for the company example might have a number for the ID, the name "Big Company Inc.", two address lines, the city "Big City", and a postal code.

Field

Further information: Field (computer science)

People often say "field" when they mean "column." However, some database experts use "field" to mean one specific cell in a row. This helps them talk clearly with other developers. In this way, column names are called field names. A field is a single storage spot in a record, like a cell, that holds one value. The words record and field come from everyday database use and older DBMS systems. Those systems were linked to paper databases, such as filing cabinets with a record for each customer. The words row and column come from the more theoretical study of relational theory.

The word "column" does not fit every kind of database. For example, key-value stores do not use the traditional relational database structure, so they do not have columns.

Quiz time!

4 questions about Column (database)

Question 1 of 4

What do all the values in one column have in common?

This article is a child-friendly adaptation of the Wikipedia article on Column (database), available under CC BY-SA 4.0.