What is a database?
The first - and most obvious - question to ask when you take up this subject
is the simplest - 'What is a database?' Certainly, you will have dealt with them,
indirectly, almost daily. Whether you are in a shop in person or whether you are exploring its catalogue on the internet, when you check whether a
product is in stock, it is likely that a database will be used somewhere within the system. Amazon and Facebook, YouTube and iTunes all use databases to
deliver products and services to their users.
The database and its structure may be quite obvious to the user for a library catalogue or an online retailer, but it may also be serving a less direct purpose, allowing the company to keep track of its employees and suppliers, or helping
an advertiser track visitors to web pages across different sites, tailoring their adverts to match a browser's activity
The external level. This incorporates each user's external view of the
database. A user's view consists only of the data needed by that user. Other
data may exist in the database, but the user does not need to be aware of it.
For instance, suppose that the database of a software company includes
information about its employees. The Personnel Department's view of the
employees - the data that is relevant to them - might consist of: name,
address, sex, date of birth, qualifications, department for which the employee
works, current salary, job contract details, and details about previous jobs.
The Personnel Department needs to be able to access this data about any
employee in the company
As a result of this separation of concerns, mappings are needed to allow
navigation between the schemas. Since there are three types of schema, there
are two types of mapping:
•• External/conceptual defines the correspondence between an external
schema and the conceptual schema.
•• Conceptual/internal defines the correspondence between the conceptual
and the internal level.
Figure 2.9 illustrates these ideas with a simple database maintaining
information about a company's employees. Two external views of the
database are considered in this example; one for the Finance Department and
one for the switchboard. The information needed by the Finance Department
uses the full name, age and salary of each employee and is defined by its
corresponding external schema. Each employee must be uniquely identified.
Since two employees might have the same name, a unique identifier, ID, is
The information needed by the switchboard, defined by the respective
schema, only refers to the name, job and telephone number of each
employee. The switchboard needs employees' first and last names to
be separate, so they can be sorted easily. For the switchboard, unique
identification of each employee is less critical, and the job title combined with
the employee's name is used. The assumption that two employees having
the same name will not have the same job title as well is considered safe
Other external views might exist too, and other data might be stored in the
database but we are dealing with a heavily simplified example for the sake of
The conceptual schema, that defines the conceptual level, unites the data
required to support the two views. It specifies the identifier, first and last
name, date of birth, job title, employment date, salary scale and the telephone
number of each employee.
As a final point, the issue of data independence can now be reconsidered. One
of the main advantages provided by the three-level architecture of a database
system is the provision of data independence. There are two types of data
independencePhysical data independence is the immunity of application programs to
changes at the internal/physical level.
Logical data independence is the immunity of application programs to
changes at the conceptual level.
For instance, in the example above, the Employees table can be
implemented using a linked list. If the conceptual/internal mapping is
modified appropriately, and as long as the conceptual schema stays the same,
the application programs (situated above) remain unaffected.
Logical data independence may be more difficult to achieve since application
programs typically rely heavily on the logical structure of data. However,
suppose another view is needed, for the Personnel department, which requires
information about the address and the family status - such as marital status,
dependants and next of kin - for each employee. The conceptual schema can be
extended as necessary, without affecting the other two views
Although we speak of the server as a separate machine, it is becoming
increasingly common for virtual servers to be used by organisations on a
subscription basis. These run on remote servers and may offer advantages,
such as easier upgrades and less in-house maintenance, and disadvantages,
including questions about data security and privacy.
The applications would normally run on different client machines, with each
client machine specified to meet the needs of its application or applications.
For instance, if an application program performs complex graphical processing,
then a more powerful graphical workstation might be required, whereas if
an application only performs simple data entry, then a cheaper, less powerful
machine might be enough. If these needs change, it is only the client machine
that has to be 'modified', making thus the client-server architecture quite