COMP 150 - Topic 2
COMP 150 - Topic 2
Introduction
Welcome to topic two. This topic helps you begin to understand the
structure of a Database Management System (DBMS). A highlight of the
significant components of the DBMS is introduced too so that you
understand the scope of the whole process of designing a functional DBMS
Learning Outcomes
Figure 1.0:
Database System Architecture
2.1.1 External Level or View level
It is the users' view of the database. This level describes that part of the
database that is relevant to each user. External level is the one which is
closest to the end users. This level deals with the way in which individual
users view data. Individual users are given different views according to the
user's requirement.
A view involves only those portions of a database which are of concern to
a user. Therefore same database can have different views for different
users. The external view insulates users from the details of the internal and
conceptual levels. External level is also known as the view level. In addition
different views may have different representations of the same data. For
example, one user may view dates in the form (day, month, year), while
another may view dates as (year, month, day).
The conceptual level supports each external view, in that any data available
to a user must be contained in, or derivable from, the conceptual level.
However, this level must not contain any storage dependent details. For
instance, the description of an entity should contain only data types of
attributes (for example, integer, real, character) and their length (such as
the maximum number of digits or characters), but not any storage
considerations, such as the number of bytes occupied. Conceptual level is
also known as the, logical level.
There is only one conceptual schema and one internal schema per
database. The schema also describes the way in which data elements at
one level can be mapped to the corresponding data elements in the next
level.
The data in the database at any particular point in time is called a database
instance. Therefore, many database instances can correspond to the same
database schema. The schema is sometimes called the intension of the
database, while an instance is called an extension (or state) of the
database.
Figure 1.2: Three Level Architecture of a DBMS
The external view would depend upon the user who is accessing the
database. The conceptual level contain the logical view of the whole
database, it represents the data type of each required field. The
internal view represents the physical location of each element on the
disk of the servers well as how many bytes of storage each element needs.
The relational model is at a lower level of abstraction than the E-R model.
Database designs are often carried out in the E-R model, and then
translated to the relational model.
Historically, two other data models, the network data model and the
hierarchical data model, preceded the relational data model. These models
were tied closely to the underlying implementation, and complicated the
task of modeling data. As a result they are little used now, except in old
database code that is still in service in some places.
We specify the storage structure and access methods used by the database
system by a set of statements in a special type of DDL called a data
storage and definition language. These statements define the
implementation details of the database schemas, which are usually hidden
from the users.
The data values stored in the database must satisfy certain consistency
constraints. For example, suppose the balance on an account should not
fall below $100. The DDL provides facilities to specify such constraints. The
database systems check these constraints every time the database is
updated.
Data manipulation is
Declarative DMLs are usually easier to learn and use than are procedural
DMLs. However, since a user does not have to specify how to get the data,
the database system has to figure out an efficient means of accessing data.
The DML component of the SQL language is nonprocedural.
This query in the SQL language finds the name of the customer whose
customer-id is 192-83-7465:
select customer.customer-name
from customer
where customer.customer-id = 192-83-7465
The query specifies that those rows from the table customer where the
customer-id is 192-83-7465 must be retrieved, and the customer-name
attribute of these rows must be displayed.
Queries may involve information from more than one table. For instance,
the following query finds the balance of all accounts owned by the customer
with customerid 192-83-7465.
select account.balance
from depositor, account
where depositor.customer-id = 192-83-7465 and
depositor.account-number = account.account-number
There are a number of database query languages in use, either
commercially or experimentally.
The levels of abstraction apply not only to defining or structuring data, but
also to manipulating data. At the physical level, we must define algorithms
that allow efficient access to data. At higher levels of abstraction, we
emphasize ease of use. The goal is to allow humans to interact efficiently
with the system. The query processor component of the database system
translates DML queries into sequences of actions at the physical level of the
database system.
The two main types of data dictionary exist, integrated and stand alone.
An integrated data dictionary is included with the DBMS. For example, all
relational DBMSs include a built in data dictionary or system catalog that is
frequently accessed and updated by the RDBMS. Other DBMSs especially
older types, do not have a built in data dictionary instead the DBA may use
third party stand alone data dictionary systems.
The data dictionary’s main function is to store the description of all objects
that interact with the database. Integrated data dictionaries tend to limit
their metadata to the data managed by the DBMS. Stand-alone data
dictionary systems are usually more flexible and allow the DBA to describe
and manage all the organization’s data, whether or not they are
computerized. Whatever the data dictionary’s format, its existence provides
database designers and end users with a much improved ability to
communicate. In addition, the data dictionary is the tool that helps the DBA
to resolve data conflicts.
Although, there is no standard format for the information stored in the data
dictionary several features are common. For example, the data dictionary
typically stores descriptions of all:
• Data elements that are define in all tables of all databases. Specifically
the data dictionary stores the name, datatypes, display formats, internal
storage formats, and validation rules. The data dictionary tells where an
element is used, by whom it is used and so on.
• Tables define in all databases. For example, the data dictionary is likely
to store the name of the table creator, the date of creation access
authorizations, the number of columns, and so on.
• Indexes define for each database tables. For each index the DBMS stores
at least the index name the attributes used, the location, specific index
characteristics and the creation date.
• Define databases: who created each database, the date of creation
where the database is located, who the DBA is and so on.
• End users and The Administrators of the data base
• Programs that access the database including screen formats, report
formats application formats, SQL queries and so on.
• Access authorization for all users of all databases.
• Relationships among data elements which elements are involved:
whether the relationship are mandatory or optional, the connectivity and
cardinality and so on.
If the data dictionary can be organized to include data external to the DBMS
itself, it becomes an especially flexible to for more general corporate
resource management. The management of such an extensive data
dictionary, thus, makes it possible to manage the use and allocation of all
of the organization information regardless whether it has its roots in the
database data. This is why some managers consider the data dictionary to
be the key element of the information resource management function. And
this is also why the data dictionary might be described as the information
resource dictionary.
The metadata stored in the data dictionary is often the bases for monitoring
the database use and assignment of access rights to the database users.
The information stored in the database is usually based on the relational
table format, thus, enabling the DBA to query the database with SQL
command. For example, SQL command can be used to extract information
about the users of the specific table or about the access rights of a
particular users.