Previous Topic: Querying the DatabaseNext Topic: DQL Example


SQL Example

You can retrieve the data you want and format it on the terminal screen or print it on a printer. The query that performs these tasks for you might look like this in SQL Mode:

 SELECT LAST_NAME, FIRST_NAME, SOCIAL_SECURITY
 FROM PERSONNEL
 ORDER BY LAST_NAME

SELECT, FROM and ORDER BY are SQL keywords. SELECT tells CA Dataquery what kind of data to find and print. FROM tells the name of the table to search and ORDER BY sorts the rows alphabetically by name. Other keywords are available for creating more complex queries.