Database Reference
In-Depth Information
from the user. By comparing the tables and data in Figures 1-3 and 1-4 to the form in Figure 1-9,
we can see that data from the CLASS table appears at the top of the form, while data from the
STUDENT table is presented in a tabular section labeled Class Enrollment Data.
The goal of this form, like that for all data entry forms, is to present the data in a format
that is useful for the users, regardless of the underlying table structure. Behind the form, the
application processes the database in accordance with the users' actions. The application
generates an SQL statement to insert, update, or delete data for any of the tables that underlie
this form.
The second function of application programs is to process user queries. The application
program first generates a query request and sends it to the DBMS. Results are then format-
ted and returned to the user. Applications use SQL statements and pass them to the DBMS
for processing. To give you a taste of SQL, here is a sample SQL statement for processing the
STUDENT table in Figure 1-1:
SELECT
LastName, FirstName, EmailAddress
FROM
STUDENT
WHERE
StudentNumber > 2;
This SQL statement is a query statement, which asks the DBMS to obtain specific data
from a database. In this case, the query asks for the last name, first name, and e-mail address
of all students having a StudentNumber greater than 2. The results of this SQL statement are
shown (as displayed in Microsoft Access 2013) in Figure 1-10. As shown in Figure 1-10, running
this SQL statement will produce the LastName, FirstName, and EmailAddress for students
Harris and Greene.
The third function of an application is to create and process reports. This function is some-
what similar to the second because the application program first queries the DBMS for data
(again using SQL). The application then formats the query results as a report. Figure 1-11 shows a
Figure 1-10
Example SQL
Query results
Figure 1-11
Example report
Search WWH ::




Custom Search