SlideShare a Scribd company logo
1
Chapter 2
Database System Architecture
Contents
 You will learn or know the following topic
Data Model
Relational data model
Basic terminology of RDM
The 3 schema architecture
 Types of data independency
 The basic criteria of DBMS classification
About distributed and centralized DBMS
2
Cont.….
A data model :- is a collection of concepts that
can be used to describe the structure of database.
Structure of the database means the data types, the
constraints and the relationships for the description
or storage of data respective.
The other definition of data model is the way of
representation of data/information in the database.
3
What is Data Model ?
• Relational data model is the primary data model, which is used widely
around the world for data storage and processing.
• This model is simple and it has all the properties and capabilities required to process
data with storage efficiency.
– Can define more flexible and complex relationship
– Viewed as a collection of tables called “Relations” equivalent to collection of
record types
– Relation: Two dimensional table
• Terminology/concepts of relational data model:- Is the study of terms
and their use. Terms are words and compound words or multi-word expressions that
in specific contexts are given specific meanings—these may deviate from the
meanings the same words have in other contexts and in everyday language Schema.
4
Database System Concepts and Architecture/RDM
Cont.…
Alternative terminologies
Relation Table File
Tuple Row Record
Attribute Column Field
5
6
• Tables
• Tuples
• Relational instances
• Relational schema
• Relation key
• Attribute domain
• Tables − In relational data model, relations are saved in the format
of Tables. This format stores the relation among entities.
• A table has rows and columns, where rows represents records and
columns represent the attributes.
• Tuple − A single row of a table, which contains a single record for
that relation is called a tuple.
Cont….
Relation instance(state) − A finite set of tuples in the
relational database system represents relation instance.
Relation instances do not have duplicate tuples
• is the collection of data in the database at a particular point of
time.
• Also called Snap-shot or database State.
• State of database is changed any time when we add, delete or
update an item.
Valid state: the state that satisfies the structure and constraints
specified in the schema and is enforced by DBMS
7
Cont.…
Relation schema − A relation schema describes the relation
name (table name), attributes, and their names.
Student( Sid , Name , Age , Gpa…..)
• is the description of a database which is specified during
database design.
• Database schema is specifies name of relation and the
collection of the attributes (specifically the Name of
attributes).
• refer to a description of database (or intention)
• specified during database design
• should not be changed unless during maintenance
8
Cont.…
Schema diagram:- An illustrative display of (most
aspects of) a database schema.
• convention to display some aspect of a schema
visually.
– eg student
9
10
Cont.….
• Attribute domain − Every attribute has some pre-defined value
scope, known as attribute domain.
The domain of an attribute A, denoted by Dom(A), is the set of
values that the attribute can take.
– A domain is usually represented by a type. E.g.,
• SID char(4)
• Name varchar(30) --- character string of variable length
up to 30
• Age number --- a number
Relation key − Each row has one or more attributes, known as
relation key, which can identify the row in the relation (table)
uniquely.
11
There are many types of keys, however, quite possibly the two most
important are the primary key and the foreign key.
 The primary key is what uniquely identifies each entity.
 The foreign key is a primary key of one table that also sits in another
table.
Ultimately, the use of foreign keys is the heart of the relational database
model.
This linkage that the foreign key provides is what allows tables to pull
data from each other and link data together.
 Degree
The degree is the number of attributes in a table.
From below fig there degree is 5.
12
13
Use Table above to answer questions 1-4.
1. What is the possible domain for field SAge?
2. How many records/states are shown?
3. How many attributes are shown?
4. Construct schema diagram?
Schema Construct:
A component of the schema or an object within the schema, e.g.,
STUDENT, COURSE.
Distinction//deference
The database schema changes very infrequently.
(e.g., adding, deleting, renaming attributes and deleting a table
schema) but it is infrequent
The database state changes every time the database is updated.
(e.g., inserting or deleting a tuple, and changing an attribute value
in a tuple) & it is frequent
Schema is also called intension.
State is also called extension.
14
A schema may have different states at different times.
Properties of Relational Tables:
1. Data is presented as a collection of relations.
2. Each relation is depicted as a table.
3. Columns are attributes that belong to the entity modeled by the
table
(ex. In a student table, you could have name, address, student ID,
major, etc.).
4 Each row ("tuple") represents a single entity
(ex. In a student table, John Smith, 14 Oak St, 9002342, Accounting,
would represent one student entity).
5. Every table has a set of attributes that taken together as a "key"
(technically, a "super key") uniquely identifies each entity (Ex. In the
student table, “student ID” would uniquely identify each student – no
two students would have the same student ID).
Every relation has some conditions that must hold for it to be a valid
relation. These conditions are called Relational Integrity Constraints.
There are three main integrity constraints −
1. Key constraints
2. Domain constraints
3. Referential integrity constraints
Key constraints
• There must be at least one minimal subset of attributes in the relation,
which can identify a tuple uniquely. This minimal subset of attributes
is called key for that relation. If there are more than one such minimal
subsets, these are called candidate keys.
Key constraints force that −
• In a relation with a key attribute, no two tuples can have identical
values for key attributes. 15
Constraints of Relational data model
• A key attribute can not have NULL values.
• Key constraints are also referred to as Entity Constraints.
2 Domain Constraints
Attributes have specific values in real-world scenario. For example,
age can only be a positive integer. The same constraints have been
tried to employ on the attributes of a relation.
Every attribute is bound to have a specific range of values. For
example, age cannot be less than zero and telephone numbers cannot
contain a digit outside 0-9.
Sid varchar(35)
16
Cont.….
• Referential integrity constraints work on the concept
of Foreign Keys. A foreign key is a key attribute of a
relation that can be referred in other relation.
• Referential Integrity Constraint: No relation can
contain unmatched foreign key values.
• Using foreign keys in a relation to reference primary
keys of other relations is the only way in the
relational data model to establish relationships among
different relations.
17
Referential integrity Constraints
 Three-schema architecture is an idea in relational database
design that breaks a database down into three different categories
according to its use and structure, and to the roles played by
system administrators, designers and end users.
 The goal of the three-schema architecture, illustrated in Figure2.2,
is to separate the user applications and the physical database.
 In this architecture, schemas can be defined at the Following three
levels
18
Three-Schema Architecture
19`
Cont..
1.The internal level has an internal schema is also known as
physical level, which describes the physical storage structure of the
database.
• Physical storage and performance
• Specific to a DBMS (e.g., MySQL, SQL Server)
• The internal schema uses a physical data model and Describes the
complete details of data storage and access paths for the database
 It is the lowest level of data abstraction that deals with the
physical representation of the database on the computer .
 The database users and the application programmers are not
aware of storage by word or byte details; however, the DBA may
be aware of certain details of the physical organization of the data.
2.The conceptual level (logical level)has a conceptual schema,
which describes the structure of the whole database for a community
of users.
 The conceptual schema hide the details of physical
storage structure and concentrates on describing
entities, data types, relationships, user operations, and
constraints.
 The conceptual view is the overall view of
the database and it includes all the information that is
going to be represented in the database.
 It describes what data is stored in the database, the
relationships among the data and complete view of the
user’s requirements without any concern for
the physical implementation.
20
Cont.….
21
3. The external or view level includes a number of external
schemas or user views.
 It is the highest level of abstraction
 In general, most of the users and application programs do
not require the entire data stored in the database
 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.
 As in the previous case, each external schema is
typically implemented using are presentational data
model, possibly based on an external schema design in
a high level data model
Cont.….
Cont.…
22
Cont.…
23
24
A database system normally contains a lot of data in addition to users’
data. For example, it stores data about data, known as metadata, to
locate and retrieve data easily.
Metadata summarizes basic information about data, which can make
finding and working with particular instances of data easier. For
example, author, date created and date modified and file size ..
• The three-schema architecture can be used to further explain the
concept of data independence, which can be defined the capacity to
change the schema at one level of a Database system with out
having to change the schema at the next higher level.
1. Logical Data Independence:
• The capacity to change the conceptual schema without having to
change the external schemas and their associated application
programs. 24
Data independence
25
Cont.…..
• We may change the conceptual schema to expand the database(by
adding a record type or data item), to change constraints, or to
reduce the database(by removing a record type or data item).
• include addition or deletion of fresh entities, attributes or
relationships and should be possible without having alteration to
existing external schemas.
For example, if a new data item, say Edition is added to the BOOK
file Not affected for
select elmasre fundamental database from Book (view 1)
select Elma213(edition) fundamental database from Book(view 2)
the 2 out put is elmasre book because of these edition is express
elmasre
25
Cont.…
2. Physical Data Independence:
– The capacity to change the internal schema without having to
change the conceptual schema and external schema.
– Changes to the internal schema may be needed because some
physical files had to be reorganized-for example, by creating
additional access structures-to improve the performance of
retrieval or update. If the same hardware storage of encoding,
exact location of data on disk, merging of records, so on this are
hidden from user
26
• Data as before remains in the database, we should not have to
change the conceptual schema. Alteration in the internal(physical)
schema might include.
 Using new storage devices.
 Using different data structures.
 Switching from one access method to another.
 Using different file organizations or storage structures.
 Modifying indexes.
27
Cont.…
28
Cont.…
Fig. Logical and Physical Data independence
29
1. 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
– For example, the SQL relational language
– Are “set”-oriented and specify what data to retrieve rather than how to
retrieve it.
– Also called declarative languages.
 Low Level or Procedural Languages:
• These must be embedded in a programming language
• Procedural DML: user specifies what data is required and how to get the
data. It is called also record at a time. Besides it uses programming language in
order to specify how to retrieve data.
• Non-Procedural DML: user specifies what data is required but not how it
is to be retrieved. It is also called set at a time or set oriented.
DBMS Languages
Cont..
– Retrieve data one record-at-a-time;
– Constructs such as looping are needed to retrieve multiple records, along with
positioning pointers.
2. Data definition language
In some DBMSs, separate storage definition language (SDL) and view
definition language (VDL) are used to define internal and
external schemas.
storage definition language (SDL) :-used to specify the internal
schema. is typically realized via DBMS commands provided to the DBA and
database designers
View definition language (VDL):- to specify user views and their mappings to
the conceptual schema, but in most DBMSs the DDL is used to define both
conceptual and external schemas.
30
Cont.…
• Naïve and parametric usually are user-friendly interfaces for
interacting with the database; these can also be used by end user.
 Forms-Based Interfaces. A forms-based interface displays a form
to each user.
 Users can fill out all of the form entries to insert new data, or
they fill out only certain entries, in which case the DBMS will
retrieve matching data for the remaining entries.
31
DBMS interfaces
32
Cont.….
Graphical User Interfaces. A graphical interface (GUI) typically
displays a schema to the user in diagrammatic form. The user can then specify a
query by manipulating the diagram.
• In many cases, GUIs utilize both menus and forms. Most GUIs use a pointing device, such
as a mouse , to pick certain parts of the displayed schema diagram. Creating
table and database diagrammatically.
Natural Language Interfaces. These interfaces accept requests
written in English or some other language and attempt to "understand“ them. A
natural language interface Usually has it s own“ schema ,“ which is similar to
the database conceptual schema , as well as a dictionary of important words. The
natural language interface refers to the words in its schema, as well as to the set
of standard words in its dictionary, to interpret the request.
 eg. Create table emp
33
Database system utility
Database system utility:-most DBMS have database Utilities that
help the DBA in managing the database system.
– A loading utility is used to load existing data files-such as text
files or sequential files-into the database .
– Backing up :-The backup copy can be used to restore the database
in case of catastrophic failure Backing up the database periodically
on tape.
– Reorganizing database file structures. This utility can be used to
reorganize a database file into a different file organization to
improve performance.
– Report creation utilities.
– Performance monitoring utilities.
– Other functions, such as sorting, user monitoring, data
compression, etc.
34
Cont.…
• Data dictionary / repository:
– Used to store schema descriptions and other information such as
design decisions, application program descriptions, user
information, usage standards, etc.
– is a collection of descriptions of the data objects or items in
a data model for the benefit of programmers and others who need
to refer to them. A first step in analyzing a system of objects with
which users interact is to identify each object and its relationship
to other objects.
– Active data dictionary is accessed by DBMS software and
users/DBA.
– Passive data dictionary is accessed by users/DBA only.
35
Classification of DBMS
• Several criteria are normally used to classify DBMSs.
The first is the data model(relational data model, object
oriented data model, hierarchical and network data
models)
The 2nd number of users supported by the system.
 (Single-user systems support only one user at a time and
are mostly used with Personal computers.
 Multiuser systems, which include the majority of DBMSs,
support multiple users concurrently.)
36
Cont.…
The 3rd number of sites over which the database is
distributed (DBMS is centralized if the data is stored at a
single computer site. A centralized DBMS can Support
multiple users, but the DBMS and the database them selves
reside totally at a single computer site.)Decentralized
means reverse of above.?
• Logical two-tier client server architecture
37
Specialized Servers with Specialized functions
Print server
File server
DBMS server
Web server
Email server
Clients can access the specialized servers as needed
38
A single database maintained in one location.Managed by a
database administrator. (usually )Access via a communications
network.
LAN
WAN
Advantages
Increased reliability and availability
Modular (incremental) growth
Lower communication costs
Disadvantages
Software cost and complexity
Processing overheads
Eg banks
Airline reservation systems
Clients
 Provide appropriate interfaces through a client software
module to access and utilize the various server resources.
 Clients may be diskless machines or PCs or Workstations
with disks with only the client software installed.
 Connected to the servers via some form of a network.
 (LAN: local area network, wireless network, etc.)
39
40
DBMS server
 Provides database query and transaction services to the
clients
 Relational DBMS servers are often called SQL servers,
query servers, or transaction servers
 Applications running on clients utilize an Application
Program Interface (API) to access server databases via
standard interface such as:
 ODBC: Open Database Connectivity standard
 Client and server must install appropriate client module
and server module software for ODBC
41
Distributed DBMs
(uses multiple computers, multiple databases
A single logical database that is spread physically across computers in
multiple locations that are connected by a data communications link.
• Most processing is local
• Need for local ownership of data
• Data sharing require
Note that users think they are working with a single corporate database
Advantages
Minimize communications
Costs
Local control
Disadvantages
Complex software
Difficult to database design
difficult to Handling failure
Three Tier Client-Server Architecture
 Common for Web applications
 Intermediate Layer called Application Server or Web Server:
 Stores the web connectivity software and the business logic part
of the application used to access the corresponding data from the
database server
 Acts like a medium for sending partially processed data between
the database server and the client.
 Three-tier Architecture Can increase Security:
 Database server only accessible via middle tier
 Clients cannot directly access database server
42
Fig logical 3 tire client server architecture
Client application server /web server DB server
43
GUI/
interface
Application
program/web
page
Database
management
system
44
An application program (sometimes shortened
to application) is any program designed to perform a specific
function directly for the user or, in some cases, for another
application program.
Examples
of application programs include word processors; database
programs; Web browsers; development tools; drawing, paint,
and image editing programs; and communication programs.
summery
 Data Models and Their Categories
 Schemas, Instances, and States
 Three-Schema Architecture
 Data Independence
 DBMS Languages and Interfaces
 Database System Utilities and Tools
 Centralized and Client-Server Architectures
 Classification of DBMSs
45

More Related Content

PPTX
Relation Model Database Pertemuan k.pptx
PPTX
Relational model
PPTX
Introduction to database
PPTX
Fundamentals of database system - Relational data model and relational datab...
PPT
Data model
PPTX
Data resource management
PPTX
Download different material from slide share
PPT
Database Technology Teaching Material For Learn
Relation Model Database Pertemuan k.pptx
Relational model
Introduction to database
Fundamentals of database system - Relational data model and relational datab...
Data model
Data resource management
Download different material from slide share
Database Technology Teaching Material For Learn

Similar to Chapter 2 Database System Architecture.pdf (20)

PDF
Unit-2.pdf
PPT
Dbms relational model
PDF
4_RelationalDataModelAndRelationalMapping.pdf
PPTX
DBMS: Week 04 - Relational Model in a Database
PPT
Dbms Lec Uog 02
PPTX
The relational data model part[1]
PDF
Chapter 2 Relational Data Model-part1
PDF
Database_Concepts_Final.pptx.pdf for class 12
PPTX
Module 2 2022 scheme BCS403 database management system
PPT
DBMS-Week-2about hardware and software.PPT
PPTX
database management system chapter three
PPTX
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
PPTX
Relational Model and Relational Algebra.pptx
PDF
2. Chapter Two.pdf
PPT
Dbms ii mca-ch4-relational model-2013
PPTX
Dbms relational data model and sql queries
PPT
ER Digramms by Harshal wagh
PDF
Database Concepts & SQL(1).pdf
PPTX
Database Concepts.pptx
PPT
Unit 1
Unit-2.pdf
Dbms relational model
4_RelationalDataModelAndRelationalMapping.pdf
DBMS: Week 04 - Relational Model in a Database
Dbms Lec Uog 02
The relational data model part[1]
Chapter 2 Relational Data Model-part1
Database_Concepts_Final.pptx.pdf for class 12
Module 2 2022 scheme BCS403 database management system
DBMS-Week-2about hardware and software.PPT
database management system chapter three
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
Relational Model and Relational Algebra.pptx
2. Chapter Two.pdf
Dbms ii mca-ch4-relational model-2013
Dbms relational data model and sql queries
ER Digramms by Harshal wagh
Database Concepts & SQL(1).pdf
Database Concepts.pptx
Unit 1
Ad

More from Getnet Tigabie Askale -(GM) (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
Chapter 1 Introduction to Computer Vision and Image Processing .pdf
PPTX
Fundamentals of Database management system Lab Manual.pptx
PDF
Chapter 5 and 6 instructions and program control instructions.pdf
PPTX
Chapter 2 and 3 8086,8088 architecture and HW specification.pptx
PDF
Chapter 7 Interrupts in microprocessor and assembly language.pdf
PPTX
Chapter 4 addressing mode in microprocessor.pptx
PDF
chapter 1-part 1 introduction o microprocessor.pdf
PPT
Chapter 1-part 2 introduction to microprocessor.ppt
PPTX
CH2 Mobile Computing in wireless communication.pptx
PPTX
CH4 Wireless Local Area Networks in wireless communication.pptx
PPTX
CH3 Wireless Network Principle in wireless Communication.pptx
PPTX
CH1 Introduction to wireless communication and Mobile Computing.pptx
PPTX
CH5 Cellular Networks in wireless communication.pptx
PPTX
CH6 Mobile Network Layer in wireless communication.pptx
PDF
Chapter 4 FD and normalization edited.pdf
PDF
Chapter 3 Database Modeling short slide.pdf
PDF
Chapter 5 record storage and primary file organization.pdf
PDF
chapter 6 Relational Algebra and calculus.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Chapter 2 Digital Image Fundamentals.pdf
Chapter 1 Introduction to Computer Vision and Image Processing .pdf
Fundamentals of Database management system Lab Manual.pptx
Chapter 5 and 6 instructions and program control instructions.pdf
Chapter 2 and 3 8086,8088 architecture and HW specification.pptx
Chapter 7 Interrupts in microprocessor and assembly language.pdf
Chapter 4 addressing mode in microprocessor.pptx
chapter 1-part 1 introduction o microprocessor.pdf
Chapter 1-part 2 introduction to microprocessor.ppt
CH2 Mobile Computing in wireless communication.pptx
CH4 Wireless Local Area Networks in wireless communication.pptx
CH3 Wireless Network Principle in wireless Communication.pptx
CH1 Introduction to wireless communication and Mobile Computing.pptx
CH5 Cellular Networks in wireless communication.pptx
CH6 Mobile Network Layer in wireless communication.pptx
Chapter 4 FD and normalization edited.pdf
Chapter 3 Database Modeling short slide.pdf
Chapter 5 record storage and primary file organization.pdf
chapter 6 Relational Algebra and calculus.pdf
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Encapsulation_ Review paper, used for researhc scholars
Understanding_Digital_Forensics_Presentation.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Reach Out and Touch Someone: Haptics and Empathic Computing
Review of recent advances in non-invasive hemoglobin estimation
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Machine learning based COVID-19 study performance prediction
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Monthly Chronicles - July 2025
Per capita expenditure prediction using model stacking based on satellite ima...
Empathic Computing: Creating Shared Understanding
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

Chapter 2 Database System Architecture.pdf

  • 2. Contents  You will learn or know the following topic Data Model Relational data model Basic terminology of RDM The 3 schema architecture  Types of data independency  The basic criteria of DBMS classification About distributed and centralized DBMS 2
  • 3. Cont.…. A data model :- is a collection of concepts that can be used to describe the structure of database. Structure of the database means the data types, the constraints and the relationships for the description or storage of data respective. The other definition of data model is the way of representation of data/information in the database. 3 What is Data Model ?
  • 4. • Relational data model is the primary data model, which is used widely around the world for data storage and processing. • This model is simple and it has all the properties and capabilities required to process data with storage efficiency. – Can define more flexible and complex relationship – Viewed as a collection of tables called “Relations” equivalent to collection of record types – Relation: Two dimensional table • Terminology/concepts of relational data model:- Is the study of terms and their use. Terms are words and compound words or multi-word expressions that in specific contexts are given specific meanings—these may deviate from the meanings the same words have in other contexts and in everyday language Schema. 4 Database System Concepts and Architecture/RDM
  • 5. Cont.… Alternative terminologies Relation Table File Tuple Row Record Attribute Column Field 5
  • 6. 6 • Tables • Tuples • Relational instances • Relational schema • Relation key • Attribute domain • Tables − In relational data model, relations are saved in the format of Tables. This format stores the relation among entities. • A table has rows and columns, where rows represents records and columns represent the attributes. • Tuple − A single row of a table, which contains a single record for that relation is called a tuple.
  • 7. Cont…. Relation instance(state) − A finite set of tuples in the relational database system represents relation instance. Relation instances do not have duplicate tuples • is the collection of data in the database at a particular point of time. • Also called Snap-shot or database State. • State of database is changed any time when we add, delete or update an item. Valid state: the state that satisfies the structure and constraints specified in the schema and is enforced by DBMS 7
  • 8. Cont.… Relation schema − A relation schema describes the relation name (table name), attributes, and their names. Student( Sid , Name , Age , Gpa…..) • is the description of a database which is specified during database design. • Database schema is specifies name of relation and the collection of the attributes (specifically the Name of attributes). • refer to a description of database (or intention) • specified during database design • should not be changed unless during maintenance 8
  • 9. Cont.… Schema diagram:- An illustrative display of (most aspects of) a database schema. • convention to display some aspect of a schema visually. – eg student 9
  • 10. 10 Cont.…. • Attribute domain − Every attribute has some pre-defined value scope, known as attribute domain. The domain of an attribute A, denoted by Dom(A), is the set of values that the attribute can take. – A domain is usually represented by a type. E.g., • SID char(4) • Name varchar(30) --- character string of variable length up to 30 • Age number --- a number Relation key − Each row has one or more attributes, known as relation key, which can identify the row in the relation (table) uniquely.
  • 11. 11 There are many types of keys, however, quite possibly the two most important are the primary key and the foreign key.  The primary key is what uniquely identifies each entity.  The foreign key is a primary key of one table that also sits in another table. Ultimately, the use of foreign keys is the heart of the relational database model. This linkage that the foreign key provides is what allows tables to pull data from each other and link data together.  Degree The degree is the number of attributes in a table. From below fig there degree is 5.
  • 12. 12
  • 13. 13 Use Table above to answer questions 1-4. 1. What is the possible domain for field SAge? 2. How many records/states are shown? 3. How many attributes are shown? 4. Construct schema diagram? Schema Construct: A component of the schema or an object within the schema, e.g., STUDENT, COURSE. Distinction//deference The database schema changes very infrequently. (e.g., adding, deleting, renaming attributes and deleting a table schema) but it is infrequent The database state changes every time the database is updated. (e.g., inserting or deleting a tuple, and changing an attribute value in a tuple) & it is frequent Schema is also called intension. State is also called extension.
  • 14. 14 A schema may have different states at different times. Properties of Relational Tables: 1. Data is presented as a collection of relations. 2. Each relation is depicted as a table. 3. Columns are attributes that belong to the entity modeled by the table (ex. In a student table, you could have name, address, student ID, major, etc.). 4 Each row ("tuple") represents a single entity (ex. In a student table, John Smith, 14 Oak St, 9002342, Accounting, would represent one student entity). 5. Every table has a set of attributes that taken together as a "key" (technically, a "super key") uniquely identifies each entity (Ex. In the student table, “student ID” would uniquely identify each student – no two students would have the same student ID).
  • 15. Every relation has some conditions that must hold for it to be a valid relation. These conditions are called Relational Integrity Constraints. There are three main integrity constraints − 1. Key constraints 2. Domain constraints 3. Referential integrity constraints Key constraints • There must be at least one minimal subset of attributes in the relation, which can identify a tuple uniquely. This minimal subset of attributes is called key for that relation. If there are more than one such minimal subsets, these are called candidate keys. Key constraints force that − • In a relation with a key attribute, no two tuples can have identical values for key attributes. 15 Constraints of Relational data model
  • 16. • A key attribute can not have NULL values. • Key constraints are also referred to as Entity Constraints. 2 Domain Constraints Attributes have specific values in real-world scenario. For example, age can only be a positive integer. The same constraints have been tried to employ on the attributes of a relation. Every attribute is bound to have a specific range of values. For example, age cannot be less than zero and telephone numbers cannot contain a digit outside 0-9. Sid varchar(35) 16 Cont.….
  • 17. • Referential integrity constraints work on the concept of Foreign Keys. A foreign key is a key attribute of a relation that can be referred in other relation. • Referential Integrity Constraint: No relation can contain unmatched foreign key values. • Using foreign keys in a relation to reference primary keys of other relations is the only way in the relational data model to establish relationships among different relations. 17 Referential integrity Constraints
  • 18.  Three-schema architecture is an idea in relational database design that breaks a database down into three different categories according to its use and structure, and to the roles played by system administrators, designers and end users.  The goal of the three-schema architecture, illustrated in Figure2.2, is to separate the user applications and the physical database.  In this architecture, schemas can be defined at the Following three levels 18 Three-Schema Architecture
  • 19. 19` Cont.. 1.The internal level has an internal schema is also known as physical level, which describes the physical storage structure of the database. • Physical storage and performance • Specific to a DBMS (e.g., MySQL, SQL Server) • The internal schema uses a physical data model and Describes the complete details of data storage and access paths for the database  It is the lowest level of data abstraction that deals with the physical representation of the database on the computer .  The database users and the application programmers are not aware of storage by word or byte details; however, the DBA may be aware of certain details of the physical organization of the data. 2.The conceptual level (logical level)has a conceptual schema, which describes the structure of the whole database for a community of users.
  • 20.  The conceptual schema hide the details of physical storage structure and concentrates on describing entities, data types, relationships, user operations, and constraints.  The conceptual view is the overall view of the database and it includes all the information that is going to be represented in the database.  It describes what data is stored in the database, the relationships among the data and complete view of the user’s requirements without any concern for the physical implementation. 20 Cont.….
  • 21. 21 3. The external or view level includes a number of external schemas or user views.  It is the highest level of abstraction  In general, most of the users and application programs do not require the entire data stored in the database  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.  As in the previous case, each external schema is typically implemented using are presentational data model, possibly based on an external schema design in a high level data model Cont.….
  • 24. 24 A database system normally contains a lot of data in addition to users’ data. For example, it stores data about data, known as metadata, to locate and retrieve data easily. Metadata summarizes basic information about data, which can make finding and working with particular instances of data easier. For example, author, date created and date modified and file size .. • The three-schema architecture can be used to further explain the concept of data independence, which can be defined the capacity to change the schema at one level of a Database system with out having to change the schema at the next higher level. 1. Logical Data Independence: • The capacity to change the conceptual schema without having to change the external schemas and their associated application programs. 24 Data independence
  • 25. 25 Cont.….. • We may change the conceptual schema to expand the database(by adding a record type or data item), to change constraints, or to reduce the database(by removing a record type or data item). • include addition or deletion of fresh entities, attributes or relationships and should be possible without having alteration to existing external schemas. For example, if a new data item, say Edition is added to the BOOK file Not affected for select elmasre fundamental database from Book (view 1) select Elma213(edition) fundamental database from Book(view 2) the 2 out put is elmasre book because of these edition is express elmasre 25
  • 26. Cont.… 2. Physical Data Independence: – The capacity to change the internal schema without having to change the conceptual schema and external schema. – Changes to the internal schema may be needed because some physical files had to be reorganized-for example, by creating additional access structures-to improve the performance of retrieval or update. If the same hardware storage of encoding, exact location of data on disk, merging of records, so on this are hidden from user 26
  • 27. • Data as before remains in the database, we should not have to change the conceptual schema. Alteration in the internal(physical) schema might include.  Using new storage devices.  Using different data structures.  Switching from one access method to another.  Using different file organizations or storage structures.  Modifying indexes. 27 Cont.…
  • 28. 28 Cont.… Fig. Logical and Physical Data independence
  • 29. 29 1. 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 – For example, the SQL relational language – Are “set”-oriented and specify what data to retrieve rather than how to retrieve it. – Also called declarative languages.  Low Level or Procedural Languages: • These must be embedded in a programming language • Procedural DML: user specifies what data is required and how to get the data. It is called also record at a time. Besides it uses programming language in order to specify how to retrieve data. • Non-Procedural DML: user specifies what data is required but not how it is to be retrieved. It is also called set at a time or set oriented. DBMS Languages
  • 30. Cont.. – Retrieve data one record-at-a-time; – Constructs such as looping are needed to retrieve multiple records, along with positioning pointers. 2. Data definition language In some DBMSs, separate storage definition language (SDL) and view definition language (VDL) are used to define internal and external schemas. storage definition language (SDL) :-used to specify the internal schema. is typically realized via DBMS commands provided to the DBA and database designers View definition language (VDL):- to specify user views and their mappings to the conceptual schema, but in most DBMSs the DDL is used to define both conceptual and external schemas. 30
  • 31. Cont.… • Naïve and parametric usually are user-friendly interfaces for interacting with the database; these can also be used by end user.  Forms-Based Interfaces. A forms-based interface displays a form to each user.  Users can fill out all of the form entries to insert new data, or they fill out only certain entries, in which case the DBMS will retrieve matching data for the remaining entries. 31 DBMS interfaces
  • 32. 32 Cont.…. Graphical User Interfaces. A graphical interface (GUI) typically displays a schema to the user in diagrammatic form. The user can then specify a query by manipulating the diagram. • In many cases, GUIs utilize both menus and forms. Most GUIs use a pointing device, such as a mouse , to pick certain parts of the displayed schema diagram. Creating table and database diagrammatically. Natural Language Interfaces. These interfaces accept requests written in English or some other language and attempt to "understand“ them. A natural language interface Usually has it s own“ schema ,“ which is similar to the database conceptual schema , as well as a dictionary of important words. The natural language interface refers to the words in its schema, as well as to the set of standard words in its dictionary, to interpret the request.  eg. Create table emp
  • 33. 33 Database system utility Database system utility:-most DBMS have database Utilities that help the DBA in managing the database system. – A loading utility is used to load existing data files-such as text files or sequential files-into the database . – Backing up :-The backup copy can be used to restore the database in case of catastrophic failure Backing up the database periodically on tape. – Reorganizing database file structures. This utility can be used to reorganize a database file into a different file organization to improve performance. – Report creation utilities. – Performance monitoring utilities. – Other functions, such as sorting, user monitoring, data compression, etc.
  • 34. 34 Cont.… • Data dictionary / repository: – Used to store schema descriptions and other information such as design decisions, application program descriptions, user information, usage standards, etc. – is a collection of descriptions of the data objects or items in a data model for the benefit of programmers and others who need to refer to them. A first step in analyzing a system of objects with which users interact is to identify each object and its relationship to other objects. – Active data dictionary is accessed by DBMS software and users/DBA. – Passive data dictionary is accessed by users/DBA only.
  • 35. 35 Classification of DBMS • Several criteria are normally used to classify DBMSs. The first is the data model(relational data model, object oriented data model, hierarchical and network data models) The 2nd number of users supported by the system.  (Single-user systems support only one user at a time and are mostly used with Personal computers.  Multiuser systems, which include the majority of DBMSs, support multiple users concurrently.)
  • 36. 36 Cont.… The 3rd number of sites over which the database is distributed (DBMS is centralized if the data is stored at a single computer site. A centralized DBMS can Support multiple users, but the DBMS and the database them selves reside totally at a single computer site.)Decentralized means reverse of above.? • Logical two-tier client server architecture
  • 37. 37 Specialized Servers with Specialized functions Print server File server DBMS server Web server Email server Clients can access the specialized servers as needed
  • 38. 38 A single database maintained in one location.Managed by a database administrator. (usually )Access via a communications network. LAN WAN Advantages Increased reliability and availability Modular (incremental) growth Lower communication costs Disadvantages Software cost and complexity Processing overheads Eg banks Airline reservation systems
  • 39. Clients  Provide appropriate interfaces through a client software module to access and utilize the various server resources.  Clients may be diskless machines or PCs or Workstations with disks with only the client software installed.  Connected to the servers via some form of a network.  (LAN: local area network, wireless network, etc.) 39
  • 40. 40 DBMS server  Provides database query and transaction services to the clients  Relational DBMS servers are often called SQL servers, query servers, or transaction servers  Applications running on clients utilize an Application Program Interface (API) to access server databases via standard interface such as:  ODBC: Open Database Connectivity standard  Client and server must install appropriate client module and server module software for ODBC
  • 41. 41 Distributed DBMs (uses multiple computers, multiple databases A single logical database that is spread physically across computers in multiple locations that are connected by a data communications link. • Most processing is local • Need for local ownership of data • Data sharing require Note that users think they are working with a single corporate database Advantages Minimize communications Costs Local control Disadvantages Complex software Difficult to database design difficult to Handling failure
  • 42. Three Tier Client-Server Architecture  Common for Web applications  Intermediate Layer called Application Server or Web Server:  Stores the web connectivity software and the business logic part of the application used to access the corresponding data from the database server  Acts like a medium for sending partially processed data between the database server and the client.  Three-tier Architecture Can increase Security:  Database server only accessible via middle tier  Clients cannot directly access database server 42
  • 43. Fig logical 3 tire client server architecture Client application server /web server DB server 43 GUI/ interface Application program/web page Database management system
  • 44. 44 An application program (sometimes shortened to application) is any program designed to perform a specific function directly for the user or, in some cases, for another application program. Examples of application programs include word processors; database programs; Web browsers; development tools; drawing, paint, and image editing programs; and communication programs.
  • 45. summery  Data Models and Their Categories  Schemas, Instances, and States  Three-Schema Architecture  Data Independence  DBMS Languages and Interfaces  Database System Utilities and Tools  Centralized and Client-Server Architectures  Classification of DBMSs 45