Organization of the records is as a collection of trees, rather than arbitrary graphs.
Figure ?? shows a sample hierarchical database that is the equivalent of the relational database of Figure
??.
Lowery Maple Queens Hodges Sidehill Brooklyn
Shiver North Bronx
900 55
556 100000 647 105366
647 105366 801 10533
Figure 1.5: A sample hierarchical database
1.4. INSTANCES AND SCHEMES 7
The relational model does not use pointers or links, but relates records by the values they contain. This allows
a formal mathematical foundation to be de ned.
1.3.3 Physical Data Models
1. Are used to describe data at the lowest level.
2. Very few models, e.g.
Unifying model.
Frame memory.
3. We will not cover physical models.
1.4 Instances and Schemes
1. Databases change over time.
2. The information in a database at a particular point in time is called an instance of the database.
3. The overall design of the database is called the database scheme.
4. Analogy with programming languages:
Data type de nition { scheme
Value of a variable { instance
5. There are several schemes, corresponding to levels of abstraction:
Physical scheme
Conceptual scheme
Subscheme (can be many)
1.5 Data Independence
1. The ability to modify a scheme de nition in one level without a ecting a scheme de nition in a higher level
is called data independence.
2. There are two kinds:
Physical data independence
{ The ability to modify the physical scheme without causing application programs to be rewritten
{ Modi cations at this level are usually to improve performance
Logical data independence
{ The ability to modify the conceptual scheme without causing application programs to be rewritten
{ Usually done when logical structure of database is altered
3. Logical data independence is harder to achieve as the application programs are usually heavily dependent on
the logical structure of the data. An analogy is made to abstract data types in programming languages.
1.6 Data De nition Language (DDL)
1. Used to specify a database scheme as a set of de nitions expressed in a DDL
2. DDL statements are compiled, resulting in a set of tables stored in a special le called a data dictionary
or data directory.
8 CHAPTER 1. INTRODUCTION
3. The data directory contains metadata (data about data)
4. The storage structure and access methods used by the database system are speci ed by a set of de nitions
in a special type of DDL called a data storage and de nition language
5. basic idea: hide implementation details of the database schemes from the users
1.7 Data Manipulation Language (DML)
1. Data Manipulation is:
retrieval of information from the database
insertion of new information into the database
deletion of information in the database
modi cation of information in the database
2. A DML is a language which enables users to access and manipulate data.
The goal is to provide e cient human interaction with the system.
3. There are two types of DML:
procedural: the user speci es what data is needed and how to get it
nonprocedural: the user only speci es what data is needed
{ Easier for user
{ May not generate code as e cient as that produced by procedural languages
4. A query language is a portion of a DML involving information retrieval only. The terms DML and query
language are often used synonymously.
1.8 Database Manager
1. The database manager is a program module which provides the interface between the low-level data
stored in the database and the application programs and queries submitted to the system.
2. Databases typically require lots of storage space (gigabytes). This must be stored on disks. Data is moved
between disk and main memory (MM) as needed.
3. The goal of the database system is to simplify and facilitate access to data. Performance is important.
Views provide simpli cation.
4. So the database manager module is responsible for
Interaction with the le manager: Storing raw data on disk using the le system usually provided by
a conventional operating system. The database manager must translate DML statements into low-level
le system commands (for storing, retrieving and updating data in the database).
Integrity enforcement: Checking that updates in the database do not violate consistency constraints
(e.g. no bank account balance below $25)
Security enforcement: Ensuring that users only have access to information they are permitted to see
Backup and recovery: Detecting failures due to power failure, disk crash, software errors, etc., and
restoring the database to its state before the failure
Concurrency control: Preserving data consistency when there are concurrent users.
5. Some small database systems may miss some of these features, resulting in simpler database managers. (For
example, no concurrency is required on a PC running MS-DOS.) These features are necessary on larger
systems.
1.9. DATABASE ADMINISTRATOR 9
1.9 Database Administrator