Chapter One
Chapter One
Chapter one
Introduction to Database System
Thus the DB course is about:
1. Manual Approach
In the manual approach, data storage and retrieval follows the primitive and traditional
way of information handling where cards and papers are used for the purpose. The data
storage and retrieval will be performed using human labour.
Files for as many event and objects as the organization has are used to store
information.
Each of the files containing various kinds of information is labelled and stored in
one or more cabinets.
The cabinets could be kept in safe places for security purpose based on the
sensitivity of the information contained in it.
Insertion and retrieval is done by searching first for the right cabinet then for the
right the file then the information.
One could have an indexing system to facilitate access to the data
Prone to error
Difficult to update, retrieve, integrate
You have the data but it is difficult to compile the information
Limited to small size information
Cross referencing is difficult
2. Computerized Approach
An alternative approach of data handling is a computerized way of dealing with the
information. In this approach every information or data is stored in the computer
unlike manual approach. That means in order to perform any activity we use
computer during computerized approach like storage and retrieval processing. The
computerized approach could also be divided into two based on where the data
resides in the system.
i. Traditional File Base Approach
Data Dictionary:
Due to the fact that a database is a self-describing system, this tool, Data
Dictionary, is used to store and organize information about the data stored in
the database.
Data Control Language:
Database is a shared resource that demands control of data access and usage.
Data Control Languages are languages that will helps to control the overall
operation of database.
Like DDL and DML, DCL has their own commands to control the overall
operation of DB. These commands are: grant and revoke commands which
are used by database administrator (DBA).
The database administrator should have the facility to control the overall
operation of the system. This DBA has the power to give privileges to
different users to access the database at different level or particular object
within the database and to store or remove database transactions by using the
above commands.
The DBMS is software package that helps to design, manage, and use data using the
database approach. Taking a DBMS as a system, one can describe it with respect to its
environment or other systems interacting with the DBMS. The DBMS environment has
five components. To design and use a database, there should be the interaction or
integration of Hardware, Software, Data, Procedure and People.
1. Hardware: are components that one can touch and feel. These components are
comprised of various types of personal computers, mainframe or any server
computers to be used in multi-user system, network infrastructure, and other
peripherals required in the system.
3. Data: since the goal of any database system is to have better control of the data
and making data useful, Data is the most important component to the user of the
database. There are two categories of data in any database system: that is
Operational and Metadata. Operational data is the data actually stored in the
system to be used by the user. Metadata is the data that is used to store
information about the database itself.
The structure of the data in the database is called the schema, which is composed
of the Entities, Properties of entities, and relationship between entities.
4. Procedure: this is the rules and regulations on how to design and use a database.
It includes procedures like how to log on to the DBMS, how to use facilities, how
to start and stop transaction, how to make backup, how to treat hardware and
software failure, how to change the structure of the database.
5. People (user): this component is composed of the people in the organization that
are responsible or play a role in designing, implementing, managing,
administering and using the resources in the database. These users can be
classified as “Actors on the Scene” and “Workers behind the Scene”.
Actors on the Scene:
Data Administrator
Database Administrator
Database Designer
End Users
2. Analysis: that concentrates more on fact finding about the problem or the
opportunity. Feasibility analysis, requirement determination and structuring, and
selection of best design method are also performed at this phase.
3. Design: in database designing more emphasis is given to this phase. The phase is
further divided into three sub-phases.
a. Conceptual Design: concise description of the data, data type,
relationship between data and constraints on the data.
There is no implementation or physical detail consideration.
Used to elicit and structure all information requirements
b. Logical Design: a higher level conceptual abstraction with selected
specific data model to implement the data structure.
It is particular DBMS independent and with no other physical
considerations.
c. Physical Design: physical implementation of the upper level design of the
database with respect to internal storage and file structure of the database
for the selected DBMS.
To develop all technology and organizational specification.
4. Implementation: the deployment and testing of the designed database for use.
Generally data model can be categorized into three: Conceptual Data Model, physical
data model and representational data model.
1. Conceptual data model is providing concepts that are close to the way many
users perceive data. These concepts are entities, attribute and relationships in
order to represent data. For example: ER model is a popular high level
conceptual data model.
2. Physical data model is providing concepts that describe the details of how data is
stored in the computer. Concepts provided by this model are used by database
specialist, not for typical end users. Example: Unifying model
3. Representational (Implementation) data model is provides concepts that easily
understand by end users. This model hides details of data storage but can be
implemented on a computer system in a direct way. This data model can be
categorized into five. Such as:
i. Hierarchical Data Model
ii. Network Data Model
iii. Relational Data Model
iv. Object Data Model
v. Object Relation Data Model
i. Hierarchical Model
The simplest data model
Record type is referred to as node or segment
The top node is the root node
Nodes are arranged in a hierarchical structure as sort of upside-down tree
A parent node can have more than one child node
A child node can only have one parent node
The relationship between parent and child is one-to-many
Relation is established by creating physical link between stored records
(each is stored with a predefined access path to other records)
To add new record type or relationship, the database must be redefined
and then stored in a new form.
Department
Employee Job
Department Job
Employee
Activity
Time Card
Alternative terminologies
Relation Table File
Tuple Row Record
Attribute Column Field
Schemas
Schema describes how data is to be structured, defined at setup/Design time (also
called "metadata")
Other definition of Schema is the structure of data (entities, attribute and
relationship) in the database.
Since it is used during the database development phase, there is rare tendency of
changing the schema unless there is a need for system maintenance which
demands change to the definition of a relation.
Database Schema (Intension): is the description of a database which is specified
during database design. Database schema is specifies name of relation and the
collection of the attributes (specifically the Name of attributes).
refer to a description of database (or intention)
specified during database design
should not be changed unless during maintenance
Schema Diagrams
convention to display some aspect of a schema visually
Schema Construct
refers to each object in the schema (e.g. STUDENT)
E.g.: STUNEDT (FName,LName,Id,Year,Dept,Sex)
Instances
Instance: is the collection of data in the database at a particular point of time.
Also called Snap-shot or database State.
State of database is changed any time when we add, delete or update an
item.
Valid state: the state that satisfies the structure and constraints specified in
the schema and is enforced by DBMS
Since Instance is actual data of database at some point in time, changes rapidly
To define a new database, we specify its database schema to the DBMS (database
is empty)
database is initialized when we first load it with data
Database Architecture
Database architectures have three levels: External level, conceptual level and internal
level.
External Level: Users' view of the database. It is describes that part of the database that
is relevant to a particular user. Different users have their own customized view of the
database independent of other users.
Conceptual Level: Community view of the database. It is describes that what data is
store in database and relationships among the data.
Internal Level: Physical representation of the database on the computer. Describes how
the data is stored in the database.
The following example can be taken as an illustration for the difference between the three
levels in the database Architecture. Where:
The first level is concerned about the group of users and their respective
data requirement independent of the other.
The second level is describing the whole content of the database where
one piece of information will be represented once.
The third level is the implementation part. That means to implement
conceptual level into computer by used query language.
Conceptual schema: at the conceptual level to describe the structure and constraints for
the whole database for a community of users. It uses a representational data model.
This data model is implemented based on a conceptual schema design in high level
data model (conceptual data model).
External schema: at the external level to describe the various user views. Usually uses
the same data model as the conceptual level. This data model is implemented based
on a conceptual schema design in high level data model (conceptual data model).
Data Independence
Logical Data Independence:
Refers to immunity of external schemas to changes in conceptual schema.
Conceptual schema changes e.g. addition/removal of entities should not require
changes to external schema or rewrites of application programs.
The capacity to change the conceptual schema without having to change the
external schemas and their application programs.
Database Languages
Data Definition Language (DDL)
Allows DBA or DBD to describe and name entities, attributes and
relationships required for the application.
Specification notation for defining the database schema
2. Non-Procedural DML: user specifies what data is required but not how it is
to be retrieved. It is also called set at a time or set oriented.