solidDB Help : Programming : Database concepts : Relational databases : Tables, rows, and columns
  
Tables, rows, and columns
All information is stored in tables. A table is divided into rows and columns. SQL theorists refer to columns as "attributes" and rows as "tuples", but the more familiar terms "columns" and "rows" are used in the documentation. Each database contains 0 or more tables. Most databases contain many tables. For example:
 
ID
NAME
ADDRESS
1
Beethoven
23 Ludwig Lane
2
Dylan
46 Robert Road
3
Nelson
79 Willie Way
This table contains 3 rows of data. The top "row", which has the labels "ID", "NAME", and "ADDRESS" is shown here for the convenience of the reader. The actual table in the database does not have such a row. The table contains 3 columns (ID, NAME, and ADDRESS).
SQL provides commands to create tables, insert rows into tables, update data in tables, delete rows from tables, and query the rows in tables.
Tables in SQL, unlike arrays in programming languages like C, are not homogeneous. In SQL, one column might have one data type (such as INTEGER), while an adjacent column might have a very different data type (such as CHAR(20), which means an array of 20 characters).
A table can have varying numbers of rows. Rows can be inserted and deleted at any time; you do not need to preallocate space for a maximum number of rows. All database servers have a maximum number of rows that they can handle. For example, most database servers that run on 32-bit operating systems have a limit of approximately two billion rows. In most applications, the maximum number of rows is far more than you are likely to need.
Each row (or record) must have at least one value, or combination of values, that is unique. If there are two composers named David Jones in the table, and you need to update the address of only one of them, then you need some way to tell them apart. In some cases, you can find a combination of columns that is unique, even if you can not find any single column that contains unique values. For example, if the NAME column is not sufficient, then perhaps the combination of NAME and ADDRESS is unique. However, without knowing all the data ahead of time, it is difficult to absolutely guarantee that each value will be unique. Most database designers add an "extra" column that has no purpose other than to uniquely and easily identify each record. In the previous table, for example, the ID numbers are unique. Then, when you try to update or delete a record, you can identify it by its unique ID (for example, "... WHERE id = 1") rather than by using another value, such as name, which might not be unique.
For information about using the SQL language to create, update, and query tables, see Getting started with SQL.
Go up to
Relational databases