A field
common to both tables is used to create the juncture, or join; here the common field is the index field Title.
Although flat-file databases can be used in many situations, most industrial-strength applications use relational
databases to access information.
In addition to changing the sort order of a table, database information can also be selectively retrieved by
using a filter. A filter is often represented by a WHERE statement, as in ???Show me the books where regional
sales were at least 10,000 and less than 20,000.??? Applying this filter to the BookSales table results in the
following table:
Region Sales Title
East 10,000 JavaScript Bible
East 15,000 Fireworks MX Bible
South 12,000 Fireworks MX Bible
The common language understood by many Web-available databases is Structured Query Language, or SQL.
A SQL statement tells the database precisely what information you??™re looking for and in what form you
want it. Although SQL statements can become quite complex, a relatively simple SQL statement has just
four parts:
n SELECT??”Picks the fields to display
n FROM??”Chooses the tables from which to gather the information
639
Establishing Connections and Recordsets 19
n WHERE??”Describes the filter criteria and/or the joins
n ORDER??”Specifies the sorting criteria
A sample SQL statement translation of the ???Show me the books where regional sales were more than 10,000
but less than 20,000??? example looks like the following:
SELECT Title
FROM BookSales
WHERE (Sales > 10000) AND (Sales < 20000)
ORDER by Sales
Joins between two or more tables are depicted in SQL with an equals sign and are considered part of the filter
in the WHERE statement.
Pages:
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139