0% found this document useful (0 votes)
141 views

GLA University, Mathura (UP) : Data Models and Database Architecture

The document provides an overview of a class on data models and database architecture. It discusses the following key points in 3 sentences: The class will cover data, databases, database management systems, data models including schema and conceptual, physical and representational models. It will also discuss database state and the differences between file systems and database management systems. The objectives are to understand data, databases and DBMS, data modeling, and the advantages of a DBMS over a file-based system.

Uploaded by

Naman
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
141 views

GLA University, Mathura (UP) : Data Models and Database Architecture

The document provides an overview of a class on data models and database architecture. It discusses the following key points in 3 sentences: The class will cover data, databases, database management systems, data models including schema and conceptual, physical and representational models. It will also discuss database state and the differences between file systems and database management systems. The objectives are to understand data, databases and DBMS, data modeling, and the advantages of a DBMS over a file-based system.

Uploaded by

Naman
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 56

GLA University, Mathura (UP)

Data Models and Database Architecture

Database Management System


(BCSC0003)

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

• Data, Database, Database management system


• Data model
• Schema
• Database state

06/11/2022 3
Topic Objectives:
The student will be able to:

 To understand What is Data, Database, DBMS.


 To familiarize with major advantages of a database
management system.
 To understand the data model of Database system.

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.

• Some fields are duplicated in more than one file,


which leads to data redundancy. So to
overcome this problem, we need to create a
centralized system, i.e. DBMS approach

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.

3. Redundant data can be present in a file 3. In DBMS there is no redundant data.


system because there can be duplicate data.

4.There is no efficient query processing in 4. DBMS contains effcieient query


File system. processing.

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.

7. Less complex 7. Complex


8. The file system does not have a crash 8. DBMS provides a crash recovery mechanism
recovery mechanism. i.e. if the system i.e. DBMS protects the user from the system failure
creashes while entering some data, than the
content of the file will lost.

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 Database Management System 12


06/11/2022 13
 Data Model
 A set of concepts to describe the structure of a database,
and certain constraints that the database should obey.
 Provides the necessary data abstraction.

 Three Category of data models-


- Low level or Physical Data Model
- Representational or Implementational Data Model
- High level or Conceptual Data Model

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

 Provide concepts that are close to the way many users


perceive data.
 Also called entity-based or object-based data models.

-Entities
-Attributes
-Relationships

Example- Entity-Relationship model


06/11/2022 18
Conceptual data model
 Conceptual data models use entities, attributes, and relationships.
 An entity represents a real-world object or concept, such as an
employee or a project.
 An attribute represents some property of interest that further
describes an entity, such as the employee’s name or salary.
 A relationship among two or more entities represents an
association among the entities, for example, a works-on relationship
between an employee and a project.
 Entity-Relationship model—a popular high-level conceptual data
model.

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.

2. In the architecture of a database system external level is the


a. physical level
b. logical level
c. conceptual level
d. view level

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)

7. Architecture of the database can be viewed as


(A) two levels. (B) four levels.
(C) three levels. (D) one level.

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

Data Definition Language (DDL)


 Used by the DBA and database designers to specify the conceptual schema of a
database.
 In many DBMSs, the DDL is also used to define external schemas (views).
DBMS Languages
Data Manipulation Language (DML)
 Used to specify database retrievals and updates
 DML commands can be embedded in a general-purpose programming language
(host language), such as C, C++, or Java.
• A library of functions can also be provided to access the DBMS from a programming
language
 Alternatively, stand-alone DML commands can be applied directly (called a
query language).
Types of DML
High Level or Non-procedural Language
 Are “set”-oriented (can specify and retrieve many records in a single DML
statement) and specify what data to retrieve rather than how to retrieve it.
 Also called declarative languages.
 For example, a query in SQL
Low Level or Procedural Language
 Retrieve data one record-at-a-time.
 Constructs such as looping are needed to retrieve multiple records, along with
positioning pointers.
A high-level DML used in a standalone interactive manner is called a
query language.
DBMS Interfaces
Stand-alone query language interfaces
 Example: Entering SQL queries at the DBMS interactive SQL interface (e.g. SQL
Plus in ORACLE)
Programmer interfaces for embedding DML in programming languages
User-friendly interfaces
 Menu-based, forms-based, graphics-based, etc.
Mobile Interfaces: interfaces allowing users to perform transactions
using mobile apps
DBMS Programming Language Interfaces
Programmer interfaces for embedding DML in a programming
languages:
 Embedded Approach: e.g embedded SQL (for C, C++, etc.), SQLJ (for Java)
 Procedure Call Approach: e.g. JDBC for Java, ODBC for other programming
languages. ODBC is an SQL-based Application Programming Interface (API)
created by Microsoft that is used by Windows software applications to access
databases via SQL. JDBC is an SQL-based API created by Sun Microsystems to
enable Java applications to use SQL for database access.
 Database Programming Language Approach: e.g. ORACLE has PL/SQL, a
programming language based on SQL; language incorporates SQL and its data
types as integral components.
 Scripting Languages: Server-side scripting languages such as PHP and Python
are used to write database programs.
DBMS Interfaces
User-Friendly DBMS Interfaces
 Menu-Based Interfaces for Web Clients or Browsing
 App for mobile devices
 Forms-based, designed for users used to filling in entries on a form.
 Graphical User Interfaces: A GUI typically displays a schema to the user in
diagrammatic form.
• Point and Click, Drag and Drop, etc.
• Specifying a query on a schema diagram
• Natural language: requests in written English
• Keyword-based Database Search
• Combinations of the above:
• For example, both menus and forms used extensively in Web database interfaces
DBMS Interfaces
Interfaces for the DBA
 Creating user accounts, granting authorizations
 Setting system parameters
 Changing schemas or access paths

Interfaces for Parametric Users


 Bank tellers, small set of operation that they perform repeatedly

Thank You

06/11/2022 56

You might also like