GLA University, Mathura (UP) : Data Models and Database Architecture
GLA University, Mathura (UP) : Data Models and Database Architecture
Module-1
Class-2
Ms. Rupali Khare
B.Tech 2 year
nd
Assistant Professor
4th Sem, Section- M, and N
CEA Department
06/11/2022 1
Course Overview
06/11/2022 2
Class Outline
06/11/2022 3
Topic Objectives:
The student will be able to:
06/11/2022 4
Data, Database, DBMS
Data: Known facts that can be recorded and have an implicit meaning; raw
Database: A highly organized, interrelated, and structured set of data about a
particular enterprise
Controlled by a database management system (DBMS)
DBMS:
A collection of programs that enables users to create and maintain a database
Set of programs to access the data
An environment that is both convenient and efficient to use
A software package/system to facilitate the creation and maintenance of a
computerized database
Database System:
The DBMS software together with the data itself. Sometimes, the applications
are also included.
06/11/2022 5
06/11/2022 6
File System
• File based systems were an early attempt to computerize the manual
system.
• It is also called a traditional based approach in which a decentralized
approach was taken where each department stored and controlled its own
data with the help of a data processing specialist.
• The main role of a data processing specialist was to create the necessary
computer file structures, and also manage the data within structures
• and design some application programs that create reports based on file
data.
06/11/2022 7
• Consider an example of a student's file system.
The student file will contain information
regarding the student (i.e. roll no, student name,
course etc.).
• Similarly, we have a subject file that contains
information about the subject and
• the result file which contains the information
regarding the result.
06/11/2022 8
DBMS
• A database approach is a well-organized
collection of data that are related in a
meaningful way which can be accessed by
different users but stored only once in a
system.
• The various operations performed by the
DBMS system are: Insertion, deletion,
selection, sorting etc.
• In the above figure, duplication of data is
reduced due to centralization of data.
06/11/2022 9
Difference between File system & DBMS
File System Database management System
1. File system is a software that manages 1. DBMS is a software that is used for
and organizes the data files in a computer accessing , creating and managing the
system. databases.
2. The File system provides the details of 2. DBMS gives an abstract view of data that
data representation and storage of data. hides the details.
5.Backup and recovery of data is not efficient, 5. DBMS provides backup and recovery of
because it is not possible to recover the lost data even if it is lost.
data.
06/11/2022 10
File System Database management System
6. Provide less security. 6. DBMS has more security mechanism as
compared to file system.
9.In the file system, concurrent access has 9. DBMS takes care of concurrent access of data
many problems. using some form of locking mechanism.
10. File system is appropriate to handle data 10. DBMS is suitable for medium to large
of a small scale organization or individual organization or multiple users.
user.
06/11/2022 11
Data Models
One fundamental characteristic of the database approach is
that it provides some level of data abstraction.
Data abstraction generally refers to the suppression of
details of data organization and storage,
and the highlighting of the essential features for an improved
understanding of data.
06/11/2022 14
Physical data model
Physical (low-level, internal) data models
Provide concepts that describe details of how data is stored
in the computer.
generally meant for the computer specialists, not for
end users.
06/11/2022 15
Representational data model
Data is represented in the form of tables which is called relation.
Representational or implementation data models are the models used most
frequently in traditional commercial DBMSs (e.g. relational data models used in
many commercial systems).
Representational data models represent data by using record structures and
hence are sometimes called record-based data models.
Examples of representational data model
- Hierarchical model
- Network model
- Relational model
- Object based model
06/11/2022 16
06/11/2022 17
Conceptual (high-level, semantic) data models
-Entities
-Attributes
-Relationships
06/11/2022 19
Entity relationship model
06/11/2022 20
Schema
Database Schema
The description of a database.
Specified during database design and is not expected to
change frequently.
Includes descriptions of the database structure, data types,
and the constraints on the database.
Schema Diagram
An illustrative display of (most aspects of) a database
schema.
06/11/2022 21
Example of a Database Schema
06/11/2022 22
Database State
The actual data stored in a database at a particular moment in
time. This includes the collection of all the data in the database.
Also called database instance (or occurrence or snapshot).
The term instance is also applied to individual database
components, e.g. record instance, table instance, entity instance.
Refers to the content of a database at a moment in time.
Initial Database State
Refers to the database state when it is initially loaded into the
system.
Valid State
A state that satisfies the structure and constraints of the database.
06/11/2022 23
Database Schema vs. Database State
The database schema changes very infrequently.
The database state changes every time the database is
updated.
Schema is also called intension.
State is also called extension.
06/11/2022 24
Example of a database state
06/11/2022 25
MCQs
1.Which of the following is not a level of data abstraction?
a. Physical Level
b. Critical Level
c. Logical Level
d. View Level
2. Which of the following is a Data Model?
a. Entity-Relationship model
b. Relational data model
c. Object-Based data model
d .All of the above
3. Logical design of database is called
a. Database Instance
b. Database Snapshot
c. Database Schema
d. All of the above
06/11/2022 26
MCQs
4.Which of the following is the structure of the Database?
a. Table
b. Schema
c. Relation
d. None of these
5.A logical description of some portion of database that is required by a user to perform task is called as
a. System View
b. User View
c. Logical View
d. Data View
6.Which of the following is the oldest database model?
a. Relational
b. Hierarchical
c. Physical
d. Network
06/11/2022 27
Three-Schema Architecture
The goal of the three-schema architecture is to separate user applications
from the physical database.
Defines DBMS schemas at three levels:
Internal schema at the internal level to describe physical storage
structures and access paths (e.g. indexes).
• Typically uses a physical data model.
Conceptual schema at the conceptual level to describe the structure
and constraints for the whole database for a community of users.
• hides the details of physical storage structures and concentrates on
describing entities, data types, relationships, user operations, and
constraints.
• Uses an implementation data model.
External schemas at the external level to describe the various
user views
• Each external schema describes the part of the database that
a particular user group is interested in and hides the rest of
the database from that user group.
• Usually uses the same data model (representational data
model) as the conceptual schema.
06/11/2022 29
Three-Schema Architecture
Three-Schema Architecture
Three schemas are only descriptions of data; the stored data that actually
exists is at the physical level only.
Each user group refers to its own external schema. Hence, the DBMS must
transform a request specified on an external schema into a request against the
conceptual schema, and then into a request on the internal schema for
processing over the stored database. If the request is a database retrieval, the
data extracted from the stored database must be reformatted to match the
user’s external view.
The processes of transforming requests and results between levels are called
mappings.
Mappings among schema levels are needed to transform requests and data.
Programs refer to an external schema, and are mapped by the DBMS to the
internal schema for execution.
Data extracted from the internal DBMS level is reformatted to match the user’s
external view (e.g. formatting the results of an SQL query for display in a Web
page)
Three-Schema Architecture
06/11/2022 33
Data Independence
Capacity to change the schema at one level of a database system
without having to change the schema at the next higher level.
Logical Data Independence
The capacity to change the conceptual schema without having
to change the external schemas and their associated
application programs.
Physical Data Independence
The capacity to change the internal schema without having to
change the conceptual schema.
For example, the internal schema may be changed when
certain file structures are reorganized or new indexes are
created to improve database performance
Data Independence
When a schema at a lower level is changed, only the mappings
between this schema and higher-level schemas need to be
changed in a DBMS that fully supports data independence.
The higher-level schemas themselves are unchanged.
Hence, the application programs need not be changed since
they refer to the external schemas.
Classification of DBMSs
Based on the data model used
Legacy: Network, Hierarchical
Currently Used: Relational, Object-oriented, Object-relational
Recent Technologies: Key-value storage systems, NOSQL
systems: document based, graph-based DBMSs etc.
Other classifications
Single-user (typically used with personal computers) vs. multi-
user (most DBMSs).
Centralized (uses a single computer with one database) vs.
distributed (multiple computers, multiple DBs)
Record Based Logical Models
Record based logical models are used in describing data at the
logical and view levels.
The three most widely accepted record based data models are:
Hierarchical Model
Network Model
Relational Model
Hierarchical Model
Hierarchical Database model is one of
the oldest database models.
The hierarchical model represents
data as hierarchical tree structures.
Each hierarchy represents a number
of related records.
Information Management System(IMS)
is based on this model.
Network Model
The Network model represents data with a graph.
The main difference of the network model from the hierarchical model, is
its ability to handle many to many (M:N) relations.
Record types are shown as rectangles and set types are shown as labeled
directed arrows.
The network model represents data as record types and also represents a
limited type of 1:N relationship, called a set type. A 1:N, or one-to-many,
relationship relates one instance of a record to many record instances
using some pointer linking mechanism in these models.
Relational Model
Relational model stores data in the form of tables.
Comparisons of Record Based Data Models
Hierarchical model suffers from insertion, updation, deletion and
retrieval anomalies.
Network model does not has any insertion, updation, deletion
and retrieval anomalies. But, it is complex and difficult to
implement.
Relational model again does not has any insertion, updation,
deletion and retrieval anomalies. Again, it is very simple and
easy to implement, that why relational model is very popular
among all these models.
Physical Data Models
Physical data models describe how data is stored in the
computer.
Object-oriented Data Models
Object data model defines a database in terms of objects, their
properties, and their operations.
Objects with the same structure and behavior belong to a class.
The operations of each class are specified in terms of predefined
procedures called methods.
Object-Relational Models
Relational DBMSs have been extending their models to
incorporate object database concepts.
These systems are referred to as object-relational or extended
relational systems.
XML model
The XML (eXtended Markup Language) model has emerged as a
standard for exchanging data over the Web.
XML uses hierarchical tree structures.
It combines database concepts with concepts from document
representation models.
Data is represented as elements with the use of tags, data can be
nested to create complex hierarchical structures.
XML
• <student 1>
<Roll No.>....................</Roll No.>
<Name>....................</Name>
<Class>....................</Class>
<Age>....................</Age>
</student 1>
<student 2>
<Name>....................</Name>
<Class>....................</Class>
<Age>....................</Age>
</student 2>
06/11/2022 46
MCQs
1. The property / properties of a database is / are :
a. It is an integrated collection of logically related records.
b. It consolidates separate files into a common pool of data records.
c. Data stored in a database is independent of the application programs using it.
d. All of the above.
3. In Three-Schema Architecture, the schema which gives details about data types, constraints and entities is classified as
a. internal schema
b .external schema
c. physical schema
d. conceptual schema
4.Which of the following database activities determines the entities, attributes, and relationships of data?
a. Conceptual data modeling
b. Low level data modelling
c. Physical database design and definition
d. Database implementation 47
MCQs
5. A subschema expresses
(A) the logical view. (B) the physical view.
(C) the external view. (D) all of the above.
6. A logical schema
(A) is the entire database. (B) is a standard way of organizing information into accessible
parts.
(C) describes how data is actually stored on disk. (D) both (A) and (C)
8.The way a particular application views the data from the database that the application uses is a
(A) module. (B) relational model.
(C) schema. (D) sub schema.
48
06/11/2022
DBMS Languages
Data Definition Language (DDL)
Data Manipulation Language (DML)
High-Level or Non-procedural Languages: These include the relational language
SQL
• May be used in a standalone way or may be embedded in a programming language
Low Level or Procedural Languages:
• These must be embedded in a programming language
06/11/2022 56