In adatabase, atable is a collection of related data organized intable format; consisting ofcolumns androws.
Inrelational databases, andflat file databases, atable is a set of data elements (values) using a model of verticalcolumns (identifiable by name) and horizontalrows,thecell being the unit where a row and column intersect.[1] A table has a specified number of columns, but can have any number of rows.[2] Each row is identified by one or more values appearing in a particular column subset. A specific choice of columns which uniquely identify rows is called theprimary key.
"Table" is another term for"relation"; although there is the difference in that a table is usually amultiset (bag) of rows where a relation is aset and does not allow duplicates. Besides the actual data rows, tables generally have associated with them somemetadata, such asconstraints on the table or on the values within particular columns.[dubious –discuss]
The data in a table does not have to be physically stored in the database.Views also function as relational tables, but their data are calculated at query time. External tables (inInformix[3]orOracle,[4][5]for example) can also be thought of as views.
In many systems for computational statistics, such asR andPython'spandas, adata frame ordata table is adata type supporting the table abstraction. Conceptually, it is a list of records orobservations all containing the same fields or columns. The implementation consists of a list ofarrays or vectors, each with a name.
In terms of therelational model of databases, a table can be considered a convenient representation of arelation, but the two are not strictly equivalent. For instance, aSQL table can potentially contain duplicate rows, whereas a true relation cannot contain duplicate rows that we calltuples. 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 anORDER BY clause is specified in theSELECT statement that queries the table.
An equally valid representation of a relation is as ann-dimensionalchart, wheren 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.
In non-relational systems,hierarchical databases, the distant counterpart of a table is a structuredfile, representing the rows of a table in each row of the file and each column in a row. This structure implies that a row can have repeating information, generally in the child data segments. Data are stored in sequence of physical records.
Unlike aspreadsheet, thedatatype of a column is ordinarily defined by theschema describing the table. SomeSQL systems, such asSQLite, are less strict about column datatype definitions.
You use external tables to load and unload data to or from your database. You can also use external tables to query data in text files that are not in an Informix database.
An external table is a table that is NOT stored within the Oracle database. Data is loaded from a file via an access driver (normally ORACLE_LOADER) when the table is accessed. One can think of an external table as a view that allows running SQL queries against files on a filesystem [...].
Oracle 9i introduced external tables [...] read-only from the Oracle database. In Oracle 10g, you can write to external tables.