Column (database): Difference between revisions
imported>LR.127 Adding local short description: "Data values in computer science", overriding Wikidata description "sequence of values of a particular type, one value for each row in a database table" |
imported>SchlurcherBot m Bot: http → https |
||
| Line 2: | Line 2: | ||
{{more citations needed|date=September 2016}} | {{more citations needed|date=September 2016}} | ||
In a [[relational database]], a '''column''' is a set of [[data]] values of a particular [[datatype|type]], one value for each [[Row (database)|row]] of a [[table (database)|table]].<ref name="ColumnOther">The term "column" also has equivalent applications in other, more generic contexts. See e.g., [[Flat file database]], [[Table (information)]].</ref> A column may contain text values, numbers, or even pointers to files in the operating system.<ref>{{Cite web|title = Columnar databases in a big data environment|url = | In a [[relational database]], a '''column''' is a set of [[data]] values of a particular [[datatype|type]], one value for each [[Row (database)|row]] of a [[table (database)|table]].<ref name="ColumnOther">The term "column" also has equivalent applications in other, more generic contexts. See e.g., [[Flat file database]], [[Table (information)]].</ref> A column may contain text values, numbers, or even pointers to files in the operating system.<ref>{{Cite web|title = Columnar databases in a big data environment|url = https://www.dummies.com/how-to/content/columnar-databases-in-a-big-data-environment.html|website = dummies.com (Big dummies book)|access-date = 2015-11-05}}</ref> Columns typically contain [[Primitive data type|simple types]], though some relational database systems allow columns to contain more complex data types, such as whole documents, images, or even video clips.<ref>{{Cite web|title = What is Database Column? - Definition from Techopedia|url = https://www.techopedia.com/definition/8/database-column|website = Techopedia.com|access-date = 2015-11-05}}</ref>{{better source needed|date=June 2022}} A column can also be called an '''attribute'''. | ||
Each row would provide a data value for each column and would then be understood as a single structured data value. For example, a database that represents company contact information might have the following columns: ID, Company Name, Address Line 1, Address Line 2, City, and Postal Code. More formally, a row is a tuple containing a specific value for each column,<ref>{{Cite news |last=Rosenberg |first=Burton |title=Relational Databases |work=University of Miami |url=https://www.cs.miami.edu/home/burt/learning/Csc598.073/notes/reldb.html |access-date=2021-02-26}}</ref> for example: (1234, 'Big Company Inc.', '123 East Example Street', '456 West Example Drive', 'Big City', 98765). | Each row would provide a data value for each column and would then be understood as a single structured data value. For example, a database that represents company contact information might have the following columns: ID, Company Name, Address Line 1, Address Line 2, City, and Postal Code. More formally, a row is a tuple containing a specific value for each column,<ref>{{Cite news |last=Rosenberg |first=Burton |title=Relational Databases |work=University of Miami |url=https://www.cs.miami.edu/home/burt/learning/Csc598.073/notes/reldb.html |access-date=2021-02-26}}</ref> for example: (1234, 'Big Company Inc.', '123 East Example Street', '456 West Example Drive', 'Big City', 98765). | ||
Latest revision as of 14:14, 24 December 2025
Template:Short description Script error: No such module "Unsubst".
In a relational database, a column is a set of data values of a particular type, one value for each row of a table.[1] A column may contain text values, numbers, or even pointers to files in the operating system.[2] Columns typically contain simple types, though some relational database systems allow columns to contain more complex data types, such as whole documents, images, or even video clips.[3]Template:Better source needed A column can also be called an attribute.
Each row would provide a data value for each column and would then be understood as a single structured data value. For example, a database that represents company contact information might have the following columns: ID, Company Name, Address Line 1, Address Line 2, City, and Postal Code. More formally, a row is a tuple containing a specific value for each column,[4] for example: (1234, 'Big Company Inc.', '123 East Example Street', '456 West Example Drive', 'Big City', 98765).
Field
Script error: No such module "labelled list hatnote". The word 'field' is normally used interchangeably with 'column'.[5] However, database perfectionists tend to favor using 'field' to signify a specific cell of a given row. Script error: No such module "Unsubst". This is to enable accuracy in communicating with other developers. Columns (really column names) being referred to as field names (common for each row/record in the table). Then a field refers to a single storage location in a specific record (like a cell) to store one value (the field value). The terms record and field come from the more practical field of database usage and traditional DBMS system usage (This was linked into business like terms used in manual databases e.g. filing cabinet storage with records for each customer). The terms row and column come from the more theoretical study of relational theory.
Another distinction between the terms 'column' and 'field' is that the term 'column' does not apply to certain databases, for instance key-value stores, that do not conform to the traditional relational database structure.[6]
See also
- Column-oriented DBMS, optimization for column-centric queries
- Column (data store), a similar object used in distributed data stores
- Row (database)
- SQL
- Query language
- Column groups and row groups
References
<templatestyles src="Reflist/styles.css" />
- ↑ The term "column" also has equivalent applications in other, more generic contexts. See e.g., Flat file database, Table (information).
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
Script error: No such module "Check for unknown parameters".
Script error: No such module "Navbox". zh-yue:行 (數據庫)