DB - Lec - 3 and 4
DB - Lec - 3 and 4
Schema Constructs
A DB State/Instance
9
Schema versus DB state
Important to distinguish between DB schema and state:
– When we define a new database, specify its database schema
only to the DBMs
The corresponding database state is the empty state
– Initial state of database when database is first Populated or
loaded with initial data
Every time when a basic operation is applied we get another
database state
At any point in time database has a current state
– DBMS ensures that every state of database is Valid State
Schema only change when requirement change called schema
evolution, E.g. we may decide another data item needed to be
stored for each record
Database Design/Model
Database Design / Model
– The database design/model stores the structure of the data and the
links/relationships between data that should be stored to meet the users’
requirements.
– Database design is stored in the database schema, which is in turn stored
in the data dictionary.
Database Modeling
– The process of creating the logical structure of the database is called
database modeling.
– If the database is not designed properly the implementation of the
system can not be done properly.
– Generally the design of the database is represented graphically because
it provides an ease in design and adds flexibility for the understanding of
the system easily.
Types of Data Models
Therefore, there are following four data models used for
understanding the structure of the database:
Types of Data Models
Relational Data Model:
This type of model designs the data in the form of rows and columns
within a table. Thus, a relational model uses tables for
representing data and in-between relationships. Tables are also
called relations.
Entity Relationship Data Model:
An ER model is the logical representation of data as objects and
relationships among them. These objects are known as entities,
and relationship is an association among these entities. It was
widely used in database designing.
A set of attributes describe the entities. For example, student_name,
student_id describes the 'student' entity. A set of the same type of
entities is known as an 'Entity set', and the set of the same type of
relationships is known as 'relationship set'.
Types of Data Models
Object Oriented Data Model:
An extension of the ER model with notions of functions,
encapsulation, and object identity, as well. This model supports a
rich type system that includes structured and collection types
USER 1
... USER 2
EXTERNAL
EXTERNAL VIEW 1 EXTERNAL VIEW 2
LEVEL
External/conceptual mapping
CONCEPTUAL CONCEPTUAL
LEVEL SCHEMA
Conceptual/internal mapping
STORED DATABASE
17
Three Schema: Example
Employee Data Conceptual Model Workers
External First Name: Fatima Name: F. Abdullah
Level/View Last Name: Abdullah Age: 34 Y, 10 d
DOB: 12th Sept. 1980 Department: Sales
Ext/conceptual mapping External Layer
Representational Model
Name DOB Dependent Dep. Id
Conceptual
Fatima Abdullah 12-08-1980 5 D019
Level/View
Ahmad Ali 10-03-1990 0 D012
Conceptual/int mapping Internal Layer
Internal/Physical Model
Internal RH Fatima Abdullah 12081980 5 D019 RH Ahmad Ali…
Level/View
OS Layer
100011001111000011100001110000111000011100101010…
Data Independance
Data Independence
– The data independence achieved as a result of the three level
architecture proves to be very useful.
– The database and data applications independent of each other we can
easily make changes to any of the components of the system
– The Change not effecting the functionality and operation of other
interrelated components
Single User
Multi User
– Teleprocessing
– File Servers
– Client Servers
Basic Client/Server Architectures