Query data
Another difference between a database and a file is the way you
can access them. You can search a file sequentially, looking for particular
values at particular physical locations in each line or record. That
is, you might ask,
What records have the number 1013 in the first field?The following figure shows this type of search.
In contrast, when you query a database, you use the terms that
the model defines. You can query the database with questions such
as,
What orders have been placed for products made by the Shimara Corporation, by customers in New Jersey, with ship dates in the third quarter?The following figure shows this type of query.
In other words, when you access data that is stored in a file, you must state your question in terms of the physical layout of the file. When you query a database, you can ignore the arcane details of computer storage and state your query in terms that reflect the real world, at least to the extent that the data model reflects the real world.
Compose SELECT statements, and Compose advanced SELECT statements, discuss the language you use to make queries.
For information about how to build and implement your data model, see the HCL OneDB™ Database Design and Implementation Guide.