Okay, we are about to go into the details of SQL queries, but before that we should say one
last thing about SQL database structures. Specifically,
most databases store their data in terms of data types.
Defining data types allows the database to be more
efficient and helps to protect you against adding bad
data to your tables.
There are several standard data types including
||Contains a string of characters.
Usually, these fields will have a specified maximum length that is defined
when the table is created.
||Contains a number with a specified number
of decimal digits and scale (indicating a power to which the
value should be multiplied) defined at the table creation.
||Similar to NUMERIC except that it is more
||Only accepts integers
||Same as INTEGER except that precision
must be smaller than INT precisions in the same table.
||Contains floating point numbers
||Like FLOAT but with greater precision
It is important to note that not all databases will
implement the entire list and that some will implement their own data types such as
calendar or monetary types. Some fields may also allow a NULL value
in them even if NULL is not exactly the correct type.
Okay, we will explain data types when we actually start using them,
so for now, let's go on to some real examples of doing things with SQL. Let's
log on to a database and start executing queries using SQL.
Table of Contents