Safekipedia

Column (database)

Discoverer · ages 10+Adapted from Wikipedia

In a relational database, a column is a set of data values of one particular type. Each column holds one value for each row in a table. A column can hold text, numbers, or even pointers to files in the computer's operating system. Most columns hold simple types of data, but some database systems allow columns to hold more complex data, such as whole documents, images, or video clips. A column can also be called an attribute.

Each row gives one data value for every column, so the row works as a single structured 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 those columns.

In more formal terms, a row is a tuple that contains one specific value for each column. A row for the company example might look like this: 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 use "field" in place of "column." However, some database experts prefer to use "field" for one specific cell in a row, so they can communicate accurately with other developers. In this way, column names are called field names, and a field is a single storage spot in a record, like a cell, that holds one value. The terms record and field come from practical database use and traditional DBMS systems, which were linked to business terms used in paper databases, such as filing cabinets with a record for each customer. The terms row and column come from the more theoretical study of relational theory.

The term "column" does not apply to every kind of database. For example, key-value stores do not follow the traditional relational database structure, so they do not have columns.

Quiz time!

5 questions about Column (database)

Question 1 of 5

What is a column in a relational database?

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