Database Reference
In-Depth Information
Each column in a database has an associated datatype. A datatype defines what
type of data the column can contain. For example, if the column is to contain
a number (perhaps the number of items in an order), the datatype would be a
numeric datatype. If the column were to contain dates, text, notes, currency
amounts, and so on, the appropriate datatype would be used to specify this.
New Term
Datatype A type of allowed data. Every table column has an associated datatype that
restricts (or allows) specific data in that column.
Datatypes restrict the type of data that can be stored in a column (for example,
preventing the entry of alphabetical characters into a numeric field). Datatypes
also help sort data correctly, and play an important role in optimizing disk
usage. As such, special attention must be given to picking the right datatype
when tables are created.
Rows
Data in a table is stored in rows; each record saved is stored in its own row.
Again, envisioning a table as a spreadsheet style grid, the vertical columns in
the grid are the table columns, and the horizontal rows are the table rows.
For example, a customers table might store one customer per row. The num-
ber of rows in the table is the number of records in it.
New Term
Row A record in a table.
Note
Records or Rows? You might hear users refer to database records when referring to
rows . For the most part, the two terms are used interchangeably, but row is technically
the correct term.
NULL
Data is stored in rows and columns, and the exact data that may be stored
is based on the defined datatype. Columns may also be defined to accept no
value, meaning no data at all. In SQL, the term NULL is used to mean no value .
If a column is defined to allow NULL , then data can be omitted from that col-
umn when a row is inserted or updated. You will be seeing lots more of NULL
as you work through the lessons in this topic.
 
 
 
Search WWH ::




Custom Search