Chapter 2 Database_System Part I
Chapter 2 Database_System Part I
1
Chapter 2 Topics
• Database System Concepts and Architecture
• Data Models, Schemas and Instances
• Three-Schema Architecture and Data Independence
• Database Languages and Interfaces
• The Database System Environment
• Centralized and Client/Server Architectures for DBMSs
• Classification of Database Management Systems
• Functions of DBMS
2
Data Models
Data models define how the logical structure of a database
is modeled.
Data Models are fundamental entities to introduce
abstraction in a DBMS.
Data models define how data is connected to each other and
how they are processed and stored inside the system.
3
conts..
• Data Model: a set of concepts to describe the structure
of a database, and certain constraints that the database
should obey.
• A data model is a description of the way that data is
stored in a database.
• Data model helps to understand the relationship
between entities and to create the most effective
structure to hold data.
• Data Model is a collection of tools or concepts for
describing
– Data
– Data relationships
– Data semantics
– Data constraints
• The main purpose of Data Model is to represent the data
in an understandable way. 4
Categories of database models include:
– 1. Record-based
– 2. Object-based
– 3. Physical
5
1. Record-based Data Models
• Consist of a number of fixed format records. Each record type
defines a fixed number of fields, Each field is typically of a fixed
length. The following are examples of this database
model category.
– Hierarchical Database Model
– Network Database Model
– Relational Database Model
6
Hierarchical model
• In hierarchical model, data is organized into a tree like
many children.
• The main drawback of this model is that, it can have only one
7
Example of Hierarchical Model
• Lets say we have few students and few courses and a
course can be assigned to a single student only,
8
Example of Hierarchical Model (Cont..)
9
Hierarchical model (Cont..)
• The simplest database model
11
Disadvantages
Complex implementation – detailed knowledge of the
physical data storage characteristics is required by the
designers and programmers
13
Network Model
• Network Model is same as hierarchical model except that
it has graph-like structure rather than a tree-based
structure.
• Unlike hierarchical model, this model allows each record to
have more than one parent record.
• The Network Database Model to allow multiple records to
be linked to the same owner file creating a many-to-many
relationship rather than a one-to-many.
• Represents complex data relationships more effectively than
the hierarchical model
14
Network Model (Cont..)
• Like hierarchical model network model is a collection of
physically linked records.
• Owner
• Member
16
Example of Network Data Model
52
17
Advantages
• Conceptual simplicity
• Data independence
19
Relational Model
• Stores information or data in the form of tables rows and
columns.
• A row of the table is called tuple equivalent to record.
• A column of a table is called attribute equivalent to fields.
• Data value is the value of the Attribute.
• Records are related by the data stored jointly in the fields of
records in two tables or files.
• The related tables contain information that creates the
relation.
20
Relational Model (Cont..)
21
Advantages
• Structural independence – changes in the relational data
structure do not affect the DBMS’s data access in any way
• Improved conceptual simplicity by concentrating on the
logical view
• Easier database design, implementation, management, and
use
• Ad hoc query capability - SQL
• Powerful database management system
22
Disadvantages
23
2. Object Oriented Model
• Modeled both data and their relationships in a single
structure known as an object
24
Object Oriented Model (Cont..)
• Object: abstraction of a real-world entity.
25
Advantages
• -Adds semantic content
• -Visual presentation includes semantic content
• -Database integrity
• -Both structural and data independence
Disadvantages
• -Slow pace of OODM standards development
• -Complex navigational data access
• --High system overhead slows transactions
• -Lack of market penetration
26
Object relational
• An Object relational model is a combination of a Object
oriented database model and a Relational database model.
28
Schemas versus Instances
• Database Schema: The description of the database. It rarely
changes.
29
Example
Schema
30
Instance
31
Architecture of DBMS
• The Database Management System (DBMS) architecture
shows how data in the database is viewed by the users.
• It is not concerned about how the data are handled and
processed by the DBMS.
32
The Three-Level ANSI-SPARC Architecture
33
• This architecture contains three layers of database management
system, which are as follows −
• External level
• Conceptual level
• Internal level
34
ANSI-SPARC Three-Level Architecture
How the
user is
viewing the
data
What data is stored
35
ANSI-SPARC Three-Level Architecture
types, but also specifies what indices exist, how stored fields are
39
Schemas, Mappings, and Instances
41
Data Independence
• Logical Data Independence
– Refers to protection 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.
42
Data Independence
schemas.
43
Data Independence and the ANSI-SPARC Three-Level
Architecture
44
Database Languages and Interfaces
• Data Definition Language (DDL)
– Allows the DBA or user to describe and name entities, attributes,
and relationships required for the application together with any
associated integrity and security constraints.
– DDL is a descriptive language for defining and constructing the
database.
– Allows users to specify the data types and structures and the
constraints on the data to be stored in the DB.
– DDL compiler generates the meta-data (describes objects in
database and make it easier for manipulation) that is stored in the
data dictionary.
45
• The DDL used to define and change the conceptual schema
of the database
48
DCL-Data Control Language
• GRANT-Used to give access privileges to a database
• REVOKE-Use to take back permission from the user.
TCL – Transaction control Language
• TCL Commands:
– Commit;-used to save the transaction on the database
49
Database system Environment
What is a Database Environment?
• A database environment is a collective system of
components that comprise and regulates the
group of data, management, and use of data, which
consist of :
– Hardware
– Software
– People
– Procedures
– Data
50
Hardware
• It identifies all the system’s physical devices.
• The database system’s main and most easily
identified hardware component is the computer,
which might be a microprocessor, a
minicomputer, or a mainframe computer.
• It also include peripherals like keyboard, mice,
modems, printers, etc.
51
Software
• Software refers to the collection of programs used
by the computers within the database system.
53
People
System Administrator: supervise the database system’s general
operations.
Database Administrator: manage the DBMS’s use and ensure that the
database is functioning properly.
Database Designers: design the database structure.
System Analysts and Programmers: design and implement the
application programs.
End Users: are the people who use the application programs to run
the organization’s daily operations. E.g. sales clerks, supervisors,
managers, and directors are all classified as end users
54
Procedures
• Procedures are the instructions and rules that govern the design
and use of the database system.
• Procedure are a critical, although occasionally forgotten, component
of the system.
• Procedures play a very important role in a company, because they
enforce the standards by which business is conducted within the
organization and with customers.
• These also are used to ensure that there is an organized way to
monitor and audit both the data and information.
55
Data
• The word “data” covers the collection of facts stored in the
database.
56
NEXT Topic
DBMS Functions
57