Data Abstraction

ASMShafi 1,250 views 4 slides Jan 06, 2020
Slide 1
Slide 1 of 4
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4

About This Presentation

Database Management System


Slide Content

Data Abstraction

Database systems are made-up of complex data structures. To ease the user interaction with database,
the developers hide internal irrelevant details from users. This process of hiding irrelevant details from user
is called data abstraction. We have three levels of abstraction:

1. Physical level: The lowest level of abstraction describes how data are actually stored. It describes
complex low-level data structures in detail.

2. Logical level: The next higher level of abstraction describes what data stored in database, and what
relationships exist among those data.

3. View level: Highest level of data abstraction. This level describes the user interaction with database
system.




Figure 1: Three level of data abstraction

Example: Let’s say we are storing customer information in a customer table. At physical level these
records can be described as blocks of storage (bytes, gigabytes, terabytes etc.) in memory. These details
are often hidden from the programmers.
At the logical level these records can be described as fields and attributes along with their data types, their
relationship among each other can be logically implemented. The programmers generally work at this level
because they are aware of such things about database systems.
At view level, user just interact with system with the help of GUI and enter the details at the screen, they
are not aware of how the data is stored and what data is stored; such details are hidden from them.

Instances and Schemas

A database schema is the skeleton structure that represents the logical view of the entire database. It
defines how the data is organized and how the relations among them are associated. It formulates all the
constraints that are to be applied on the data.

A database schema can be divided broadly into two categories −
 Physical Database Schema − This schema pertains to the actual storage of data and its form of
storage like files, indices, etc. It defines how the data will be stored in a secondary storage.
 Logical Database Schema − This schema defines all the logical constraints that need to be
applied on the data stored. It defines tables, views, and integrity constraints.


Instances: Databases change over time as information is inserted and deleted. The collection of
information stored in the database at a particular moment is called an instance of the database.

In simple words, it is the snapshot of the database taken at a particular moment. Instance can also be called
as the database state or current set of occurrence due the fact that it is information that is present at the
current state.

Physical Data Independence – The ability to modify the physical schema without changing the logical
schema is called physical data independence.



1.3.3 Data Models

A data model is a collection of conceptual tools for describing data, data relationship, data semantics and
consistency constraints. A data model provides a way to describe the design of a database at the physical,
logical and view level.

Data models can be classified in four different categories:

1. Relational Model: This is a lower level model. It uses a collection of tables to represent both data and
relationships among those data.

 Each table has multiple columns, and each column has a unique name.

 The relational model is an example of a record-based model.

 The relational model is the most widely used data model and a vast majority of current database
systems are based on the relational model.

2. Entity-Relationship Model: This is a higher-level data model. It is based on a perception of a real world
that consists of a collection of basic objects, called entities and the relationship among these objects.
ER Model is based on −
 Entities and their attributes.
 Relationships among entities.
These concepts are explained below.

 Entity − An entity in an ER Model is a real-world entity having properties called attributes.
Every attribute is defined by its set of values called domain. For example, in a school database,
a student is considered as an entity. Student has various attributes like name, age, class, etc.
 Relationship − The logical association among entities is called relationship. Relationships are
mapped with entities in various ways. Mapping cardinalities define the number of association
between two entities.
Mapping cardinalities −
 one to one
 one to many
 many to one
 many to many
3. Object-based data model:

i) Object-oriented data model: It can be seen as extending of E-R model with notions of encapsulation,
methods (functions) and object identity.
ii) Object-relation data model: Combines the features of object-oriented data model and relational data

model.

4. Semi-structured data model: Permits the specification of data where individual data items of the same
type may have different sets of attributes. The extensible markup language (XML) is widely used to
represent semi-structured data.




A. S. M. Shafi
Lecturer
Department of Computer Science and Engineering
Khwaja Yunus Ali University
Enaytpur, Sirajgonj-6751, Bangladesh