SlideShare a Scribd company logo
Ashis Talukder, MIS, DU
Lecture on
DATABASE
Ashis Talukder
Lecturer, MIS
University Of Dhaka
Ashis Talukder, MIS, DU
Introduction
Traditional File Management
DBM
Purpose of Database Systems
View of Data
Data Models
Data Definition Language
Data Manipulation Language
Database Administrator
Database Users
Overall System Structure
Ashis Talukder, MIS, DU
Database
 Data may be logically organized
into characters, fields, records,
files & databases.
Ashis Talukder, MIS, DU
Database OrganizationDatabase Organization
Bit:
− Smallest unit of data
− binary digit (0,1/ On, Off & Y, N)
− Most basic unit of physical storage
Byte:
− Group of bits that represents a single
alphabetic, numeric or other symbols
− Also called charcter
ORGANIZING DATA IN A TRADITIONAL FILE
ENVIRONMENT
Ashis Talukder, MIS, DU
Database OrganizationDatabase Organization
Field:
− Next higher level of data
− Consists of group of bytes or a complete
number which represent DETUM or FACT
− Example: Name, account number, roll,
balance
Record:
− Group of interrelated fields
− Example: (11, Mina, 82) (roll, name, marks)
ORGANIZING DATA IN A TRADITIONAL FILE
ENVIRONMENT
Ashis Talukder, MIS, DU
Database OrganizationDatabase Organization
File/Table:
− Group of records of same type
− Example: customer table, account table
ORGANIZING DATA IN A TRADITIONAL FILE
ENVIRONMENT
Ashis Talukder, MIS, DU
Database OrganizationDatabase Organization
Database:
− Integrated ca
− Example: customer table, account table
ORGANIZING DATA IN A TRADITIONAL FILE
ENVIRONMENT
Ashis Talukder, MIS, DU
The Data Hierarchy
Ashis Talukder, MIS, DU
Data Hierarchy
Ashis Talukder, MIS, DU
Traditional File Processing
Ashis Talukder, MIS, DU
Database Management System (DBMS)
 Collection of interrelated data
 Set of programs to access the data
 DBMS contains information about a particular enterprise
 Goal of the DBMS is to provides a way to store and retrieve
database information that is both convenient and efficient.
 Database Applications:
 Banking: Customer Information, loans, and all transactions
 Airlines: reservations, schedules
 Universities: registration, grades
 Sales: customers, products, purchases
 Manufacturing: production, inventory, orders, supply chain
 Human resources: employee records, salaries, tax deductions
 Databases touch all aspects of our lives
Ashis Talukder, MIS, DU
Purpose of Database System
 In the early days, database applications were built on top of file
systems
 Drawbacks of using file systems to store data:
 Data redundancy and inconsistency
 Multiple file formats, duplication of information in different files
 Difficulty in accessing data
 Need to write a new program to carry out each new task
 Data isolation — multiple files and formats
 Integrity problems
 Integrity constraints (e.g. account balance > 0) become part of
program code
 Hard to add new constraints or change existing ones
Ashis Talukder, MIS, DU
Purpose of Database Systems (Cont.)
 Drawbacks of using file systems (cont.)
 Atomicity of updates
 Failures may leave database in an inconsistent state with
partial updates carried out
 E.g. transfer of funds from one account to another should
either complete or not happen at all
 Concurrent access by multiple users
 Concurrent accessed needed for performance
 Uncontrolled concurrent accesses can lead to
inconsistencies
 E.g. two people reading a balance and updating it at the same time
 Security problems
 Database systems offer solutions to all the above
problems
Ashis Talukder, MIS, DU
Some Commercial Database Management Systems
 Microsoft Access
 FoxPro
 dBase
 Oracle – Oracle 8i, Oracle9i, Oracle 10g
Microsoft SQL Server
IBM DB2/DB2UDB
Informix
Sybase
MySQL
Ingress
Postgre SQL
Ashis Talukder, MIS, DU
Levels of Abstraction
 Physical level describes how a record (e.g.,
customer) is stored.
 Logical level: describes data stored in database, and
the relationships among the data.
type customer = record
name : string;
street : string;
city : integer;
end;
 View level: application programs hide details of data
types. Views can also hide information (e.g., salary)
for security purposes.
Ashis Talukder, MIS, DU
Data Abstraction
Ashis Talukder, MIS, DU
Instances and Schemas
 Similar to types and variables in programming languages
 Schema – the logical structure of the database
 e.g., the database consists of information about a set of customers and accounts
and the relationship between them)
 Analogous to type information of a variable in a program
 Physical schema: database design at the physical level
 Logical schema: database design at the logical level
 Instance – the actual content of the database at a particular point in time
 Analogous to the value of a variable
 Physical Data Independence – the ability to modify the physical schema without
changing the logical schema
 Applications depend on the logical schema
 In general, the interfaces between the various levels and components should be
well defined so that changes in some parts do not seriously influence others.
Ashis Talukder, MIS, DU
Data Models
 A collection of tools for describing
 data
 data relationships
 data semantics
 data constraints
 Entity-Relationship model
 Relational model
 Other models:
 object-oriented model
 semi-structured data models
 Older models: network model and hierarchical
model
Ashis Talukder, MIS, DU
Entity-Relationship Model
Ashis Talukder, MIS, DU
Entity Relationship Model (Cont.)
 E-R model of real world
 Entities (objects)
 E.g. customers, accounts, bank branch
 Relationships between entities
 E.g. Account A-101 is held by customer Johnson
 Relationship set depositor associates customers
with accounts
 Widely used for database design
 Database design in E-R model usually converted
to design in the relational model (coming up
next) which is used for storage and processing
Ashis Talukder, MIS, DU
customer-
name
Customer-id
customer-
street
customer-
city
account-
number
Johnson
Smith
Johnson
Jones
Smith
192-83-7465
019-28-3746
192-83-7465
321-12-3123
019-28-3746
Alma
North
Alma
Main
North
Palo Alto
Rye
Palo Alto
Harrison
Rye
A-101
A-215
A-201
A-217
A-201
Attributes
Relational Database Model
Ashis Talukder, MIS, DU
A Sample Relational Database
Ashis Talukder, MIS, DU
Database Language
 A database system provides a
data-definition language to
specify the database schema
and a data-manipulation
language to express database
queries and update.
Ashis Talukder, MIS, DU
Data Definition Language (DDL)
 Specification notation for defining the database schema
 E.g.
create table account (
account-number char(10),
balance integer)
 DDL is also used to specify additional properties of the data.
 Example : Alter/DROP/TRUNCATE/ comment/ Grant/ Revoke
 The storage structure and access methods used by the database system by a
set of statements in a special type of DDL called a data storage and
definition language
 DDL compiler generates a set of tables stored in a data dictionary
 Data dictionary contains metadata (i.e., data about data)
 Database schema
 Data storage and definition language
 language in which the storage structure and access methods used
by the database system are specified
 Usually an extension of the data definition language
Ashis Talukder, MIS, DU
DDL ……………. Cont.
 The data values stored in the database must satisfy certain consistency
constraints.
 Domain Constraints : A domain of possible values must be associated
with every attribute ( i.e. Char type, integer type, date/time etc)
 Referential Integrity : There are cases where we wish to ensure that a
value that appear in one relation for a given set of attribute also appears
for a certain set of attributes in another relation.
 Assertions: An assertion is any condition that the database must always
satisfy. i.e Account Balance >=$100
 Authorization : differentiate among the user as far as the type of
access they are permitted on various data values in the database.
 Read authorization
 Insert authorization
 Update authorization
 Delete authorization.
Ashis Talukder, MIS, DU
Database Languages
The output of the DDL is placed in the data dictionary, which
contains metadata- that is, data about data.
1. relation-metadata (relation-name, no-of-attributes, storage-
organization, location)
2. attribute-metadata (attribute-name, relation-name, domain-
type, position, length)
3. user-metadata (user-name, encrypted-password, group)
4. index-metadata (index-name, relation-name, index-type, index-
attributes)
5. view-metadata (view-name, definition)
Ashis Talukder, MIS, DU
Data Manipulation Language (DML)
 Language for accessing and manipulating
the data organized by the appropriate data
model
 DML also known as query language
 Two classes of languages
 Procedural – user specifies what data is required
and how to get those data
 Nonprocedural – user specifies what data is
required without specifying how to get those
data
 SQL is the most widely used query language
Ashis Talukder, MIS, DU
SQL
 SQL: widely used non-procedural language
 E.g. find the name of the customer with customer-id 192-83-7465
select customer.customer-name
from customer
where customer.customer-id = ‘192-83-7465’
 E.g. find the balances of all accounts held by the customer with
customer-id 192-83-7465
select account.balance
from depositor, account
where depositor.customer-id = ‘192-83-7465’ and
depositor.account-number = account.account-
number
 Application programs generally access databases through one of
 Language extensions to allow embedded SQL
 Application program interface (e.g. ODBC/JDBC) which allow SQL
queries to be sent to a database
Ashis Talukder, MIS, DU
An Un-normalized Relation for ORDER
Ashis Talukder, MIS, DU
Normalized Tables Created from ORDER
Ashis Talukder, MIS, DU
Database Users
Users are differentiated by the way they expect to
interact with the system. Four different types:
1. Naive users – are unsophisticated users who interact
with the system by invoking one of the permanent
application programs that have been written previously.
E.g. people accessing database over the web, bank
tellers, clerical staff
2. Application programmers – are computer
professionals who write application programs. Application
programmers can choose from many tools to develop
user interface.
Ashis Talukder, MIS, DU
Database Users
 3. Sophisticated users – interact with the system without
writing programs. Instead, they form their requests in a
database query language. Analysts who submits queries to
explore data in the database.
e.g., analyst looking at sales data (OLAP – Online analytical
processing), data mining – finds certain kinds of patterns in
data.
 4. Specialized users – are sophisticated users who write
specialized database applications that do not fit into the
traditional data processing framework.
e.g., computer-aided design systems, knowledge-base and
expert systems and environment-modeling systems – uses
complex data types.
Ashis Talukder, MIS, DU
Database Administrator
(DBA)
 Coordinates all the activities of the database system; the
database administrator has a good understanding of the
enterprise’s information resources and needs. DBA has
central control of both data and the programs that
access that data.
 The functions of Database administrator (DBA) include:
 Schema definition
 Storage structure and access method definition
 Schema and physical-organization modification
 Granting of authorization for data access
Ashis Talukder, MIS, DU
Transaction Management
 A transaction is a collection of operations
that performs a single logical function in a
database application
e.g., deposit, withdrawal, transfer
between accounts
A – Atomicity, C – Consistency,
I – Isolation, D - Durability
Ashis Talukder, MIS, DU
Transaction Management
 Transaction-management
component ensures that the
database remains in a consistent
(correct) state despite system failures
(e.g., power failures and operating
system crashes) and transaction
failures
e.g., system crash cannot wipe out
“committed” transactions
Ashis Talukder, MIS, DU
Storage Manager
 A storage manager is a program module that provides the interface
between the low-level data stored in the database and the application
programs and queries submitted to the system. The storage manager
translates the various DML statements into low-level file system thus
 The storage manager is responsible for
Efficient storage, retrieval and updating of data in the database.
The storage manager components include :
 Authorization & Integrity manager: test for satisfaction of integrity
constraints and checks the authority of user to access data.
 Transaction manager: which ensure that the database remains in a
consistent despite of power failure.
 File Manager: Which manages the allocation of space on disk storage & the
data structures used to represent information stored on disk.
 Buffer Manager : Which is responsible for fetching data from disk storage into
main memory, and deciding what data to cache in main memory.
Ashis Talukder, MIS, DU
Storage Manager
The storage manager stores:
 Data files (relations): which stores the database
itself.
 Data dictionary : Which stores metadata about
structure of the database, in particular the
schema of the database. (sometimes called
catalog)
 Indices : which can provide fast access to data
Items. Like Index of a text book.
Ashis Talukder, MIS, DU
The Query Processor
 Components include:
1. DDL interpreter : Which Interprets DDL
statements and records the definitions in the
dictionary.
2. DML compiler : Which translates DML statements
in a query language into an evaluation plan
consisting of low level instruction that the query
evaluation engine understand.
3. Query evaluation engine : Which execute low-
level instructions generated by the DML compiler.
Ashis Talukder, MIS, DU
Database Administrator
 Coordinates all the activities of the database system; the database
administrator has a good understanding of the enterprise’s
information resources and needs.
 Database administrator's duties include:
 Schema definition
 Storage structure and access method definition
 Schema and physical organization modification
 Granting user authority to access the database
 Specifying integrity constraints
 Acting as liaison with users
 Monitoring performance and responding to changes in
requirements
Ashis Talukder, MIS, DU
Overall System Structure
Ashis Talukder, MIS, DU
Application Architectures
Two-tier architecture: E.g. client programs using ODBC/JDBC to
communicate with a database
Three-tier architecture: E.g. web-based applications, and
applications built using “middleware”
Ashis Talukder, MIS, DU
Centralized database:
• Used by single central processor or multiple processors in
client/server network
• There are advantages and disadvantages to having all
corporate data in one location.
• Security is higher in central environments, risks lower.
• If data demands are highly decentralized, then a
decentralized design is less costly, and more flexible.
Distributing DatabasesDistributing Databases
Ashis Talukder, MIS, DU
• Databases can be decentralized either by
partitioning or by replicating
• Partitioned database: Database is divided into
segments or regions. For example, a customer
database can be divided into Eastern customers and
Western customers, and two separate databases
maintained in the two regions.
CREATING A DATABASE ENVIRONMENT
Distributed database:
Ashis Talukder, MIS, DU
• Duplicated database: The database is completely
duplicated at two or more locations. The separate
databases are synchronized in off hours on a batch
basis.
• Regardless of which method is chosen, data
administrators and business managers need to
understand how the data in different databases will
be coordinated and how business processes might
be effected by the decentralization.
CREATING A DATABASE ENVIRONMENT
Ashis Talukder, MIS, DU
• The quality of decision making in a firm is directly
related to the quality of data in its databases.
• Data Quality Audit: Structured survey of the accuracy
and level of completeness of the data in an
information system
• Data Cleansing: Consists of activities for detecting
and correcting data in a database or file that are
incorrect, incomplete, improperly formatted, or
redundant
CREATING A DATABASE ENVIRONMENT
Ensuring Data Quality:
Ashis Talukder, MIS, DU
Online Analytical Processing (OLAP):
• Multidimensional data analysis
• Supports manipulation and analysis of large
volumes of data from multiple
dimensions/perspectives
DATABASE TRENDS
Multidimensional Data AnalysisMultidimensional Data Analysis
Ashis Talukder, MIS, DU
Multidimensional Data Model
DATABASE TRENDS
Ashis Talukder, MIS, DU
Data warehouse: A Data warehouse is a database
that stores current & historical data of potential interest
to manager throughout the company
• Supports reporting and query tools
• Stores current and historical data
• Consolidates data for management analysis and decision
making
DATABASE TRENDS
Data Warehousing and Data MiningData Warehousing and Data Mining
Ashis Talukder, MIS, DU
Components of a Data Warehouse
DATABASE TRENDS
Ashis Talukder, MIS, DU
Data mart:
• Subset of data warehouse
• Contains summarized or highly focused portion of
data for a specified function or group of users
DATABASE TRENDS
Data mining:
• Tools for analyzing large pools of data
• Find hidden patterns and infer rules to predict
trends
Ashis Talukder, MIS, DU
Benefits of Data Warehouses:
• Improved and easy accessibility to information
• Ability to model and remodel the data
DATABASE TRENDS

More Related Content

PPT
Dbms
PPT
INTRODUCTION TO DATABASE
PPT
Unit 01 dbms
PPTX
Database Concepts and Components
PPTX
Data base management system
PPT
Database system concepts
PPTX
PPT
Lecture 01 introduction to database
Dbms
INTRODUCTION TO DATABASE
Unit 01 dbms
Database Concepts and Components
Data base management system
Database system concepts
Lecture 01 introduction to database

What's hot (19)

PPT
Assignment on dbms
PPT
27 fcs157al2
PPTX
Dbms and sqlpptx
POTX
PPTX
Database management systems
PPT
TID Chapter 10 Introduction To Database
DOCX
DBMS FOR STUDENTS MUST DOWNLOAD AND READ
PPTX
Basic Concept of Database
PPTX
Computer lecture (1) m.nasir
PPT
PPT demo
DOCX
Database
PPTX
Introduction to databases
PPT
11 Database Concepts
PPT
Database an introduction
PDF
PDF
Database Management System
PPTX
introduction to database
PDF
Intro to Database Design
Assignment on dbms
27 fcs157al2
Dbms and sqlpptx
Database management systems
TID Chapter 10 Introduction To Database
DBMS FOR STUDENTS MUST DOWNLOAD AND READ
Basic Concept of Database
Computer lecture (1) m.nasir
PPT demo
Database
Introduction to databases
11 Database Concepts
Database an introduction
Database Management System
introduction to database
Intro to Database Design
Ad

Viewers also liked (14)

PDF
Management information system Unit 1
PPTX
Lec monitor
PPTX
Lecture 1 mis
PPT
Ch01
PPTX
Management information system
PPTX
Ch02 mis-imp-concepts
PDF
Lecture 11 bmbs management information system qs
PPTX
Introduction to Programming and QBasic Tutorial
PPTX
Qbasic tutorial
PPT
Laudon mis12 ppt01
PPT
MIS Chapter 1
PPT
Mis lecture ppt
PDF
Management Information System (Full Notes)
Management information system Unit 1
Lec monitor
Lecture 1 mis
Ch01
Management information system
Ch02 mis-imp-concepts
Lecture 11 bmbs management information system qs
Introduction to Programming and QBasic Tutorial
Qbasic tutorial
Laudon mis12 ppt01
MIS Chapter 1
Mis lecture ppt
Management Information System (Full Notes)
Ad

Similar to Lect 30 dbms_fundamentals (20)

PPTX
Introduction to Database
PDF
database introductoin optimization1-app6891.pdf
PDF
M.sc. engg (ict) admission guide database management system 4
PPT
a presenation on various dtabase languages
PPTX
PDF
LectDBS_1.pdf
PPTX
Unit-1 DBMS24.pptxruzruxtidtixift8ffticiycyoc
PDF
1_DBMS_Introduction.pdf
PPTX
DBMS introduction and functionality of of dbms
PPTX
LEARNING OBJECTIVES education relational.pptx
PDF
Lect_2_dbms_its_rnvironment_and_components
PPTX
Database Management System, Lecture-1
PPT
21UCAC 41 Database Management System.ppt
PPTX
Chp-1.pptx
PPT
dbms intro
PDF
Database Systems - Lecture Week 1
PPTX
Lecture 1 to 3intro to normalization in database
PDF
Unit 1 DBMS
PPTX
DIGITAL CONTENT for the help of students.pptx
Introduction to Database
database introductoin optimization1-app6891.pdf
M.sc. engg (ict) admission guide database management system 4
a presenation on various dtabase languages
LectDBS_1.pdf
Unit-1 DBMS24.pptxruzruxtidtixift8ffticiycyoc
1_DBMS_Introduction.pdf
DBMS introduction and functionality of of dbms
LEARNING OBJECTIVES education relational.pptx
Lect_2_dbms_its_rnvironment_and_components
Database Management System, Lecture-1
21UCAC 41 Database Management System.ppt
Chp-1.pptx
dbms intro
Database Systems - Lecture Week 1
Lecture 1 to 3intro to normalization in database
Unit 1 DBMS
DIGITAL CONTENT for the help of students.pptx

More from Protik Roy (20)

PPT
Technology in education
PPTX
Qualitative research
PPTX
Historical research
PPTX
Fundamental research
PPTX
Experimental research
PPTX
Appplied research
PPTX
Action research
PPTX
Nature of phylosophy in education presentation
PPTX
Virus
PPTX
Software
PPTX
Presentation on virus
PPTX
Net 02 03_lan
PPTX
Lec 8 alu_cu
PPTX
Lec 6 memory
PPTX
Lec 5 output unit
PPTX
Lec 5 input unit
PPT
Lec 5 input unit
PPTX
Lec 4 oraganization
PPTX
Lec 3 classification
PPTX
Lec 2 introduction_generation
Technology in education
Qualitative research
Historical research
Fundamental research
Experimental research
Appplied research
Action research
Nature of phylosophy in education presentation
Virus
Software
Presentation on virus
Net 02 03_lan
Lec 8 alu_cu
Lec 6 memory
Lec 5 output unit
Lec 5 input unit
Lec 5 input unit
Lec 4 oraganization
Lec 3 classification
Lec 2 introduction_generation

Recently uploaded (20)

PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Computing-Curriculum for Schools in Ghana
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Lesson notes of climatology university.
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Classroom Observation Tools for Teachers
PDF
RMMM.pdf make it easy to upload and study
PPTX
Institutional Correction lecture only . . .
PPTX
Pharma ospi slides which help in ospi learning
PDF
01-Introduction-to-Information-Management.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Cell Structure & Organelles in detailed.
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Computing-Curriculum for Schools in Ghana
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Lesson notes of climatology university.
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Microbial diseases, their pathogenesis and prophylaxis
O5-L3 Freight Transport Ops (International) V1.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Classroom Observation Tools for Teachers
RMMM.pdf make it easy to upload and study
Institutional Correction lecture only . . .
Pharma ospi slides which help in ospi learning
01-Introduction-to-Information-Management.pdf

Lect 30 dbms_fundamentals

  • 1. Ashis Talukder, MIS, DU Lecture on DATABASE Ashis Talukder Lecturer, MIS University Of Dhaka
  • 2. Ashis Talukder, MIS, DU Introduction Traditional File Management DBM Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Database Administrator Database Users Overall System Structure
  • 3. Ashis Talukder, MIS, DU Database  Data may be logically organized into characters, fields, records, files & databases.
  • 4. Ashis Talukder, MIS, DU Database OrganizationDatabase Organization Bit: − Smallest unit of data − binary digit (0,1/ On, Off & Y, N) − Most basic unit of physical storage Byte: − Group of bits that represents a single alphabetic, numeric or other symbols − Also called charcter ORGANIZING DATA IN A TRADITIONAL FILE ENVIRONMENT
  • 5. Ashis Talukder, MIS, DU Database OrganizationDatabase Organization Field: − Next higher level of data − Consists of group of bytes or a complete number which represent DETUM or FACT − Example: Name, account number, roll, balance Record: − Group of interrelated fields − Example: (11, Mina, 82) (roll, name, marks) ORGANIZING DATA IN A TRADITIONAL FILE ENVIRONMENT
  • 6. Ashis Talukder, MIS, DU Database OrganizationDatabase Organization File/Table: − Group of records of same type − Example: customer table, account table ORGANIZING DATA IN A TRADITIONAL FILE ENVIRONMENT
  • 7. Ashis Talukder, MIS, DU Database OrganizationDatabase Organization Database: − Integrated ca − Example: customer table, account table ORGANIZING DATA IN A TRADITIONAL FILE ENVIRONMENT
  • 8. Ashis Talukder, MIS, DU The Data Hierarchy
  • 9. Ashis Talukder, MIS, DU Data Hierarchy
  • 10. Ashis Talukder, MIS, DU Traditional File Processing
  • 11. Ashis Talukder, MIS, DU Database Management System (DBMS)  Collection of interrelated data  Set of programs to access the data  DBMS contains information about a particular enterprise  Goal of the DBMS is to provides a way to store and retrieve database information that is both convenient and efficient.  Database Applications:  Banking: Customer Information, loans, and all transactions  Airlines: reservations, schedules  Universities: registration, grades  Sales: customers, products, purchases  Manufacturing: production, inventory, orders, supply chain  Human resources: employee records, salaries, tax deductions  Databases touch all aspects of our lives
  • 12. Ashis Talukder, MIS, DU Purpose of Database System  In the early days, database applications were built on top of file systems  Drawbacks of using file systems to store data:  Data redundancy and inconsistency  Multiple file formats, duplication of information in different files  Difficulty in accessing data  Need to write a new program to carry out each new task  Data isolation — multiple files and formats  Integrity problems  Integrity constraints (e.g. account balance > 0) become part of program code  Hard to add new constraints or change existing ones
  • 13. Ashis Talukder, MIS, DU Purpose of Database Systems (Cont.)  Drawbacks of using file systems (cont.)  Atomicity of updates  Failures may leave database in an inconsistent state with partial updates carried out  E.g. transfer of funds from one account to another should either complete or not happen at all  Concurrent access by multiple users  Concurrent accessed needed for performance  Uncontrolled concurrent accesses can lead to inconsistencies  E.g. two people reading a balance and updating it at the same time  Security problems  Database systems offer solutions to all the above problems
  • 14. Ashis Talukder, MIS, DU Some Commercial Database Management Systems  Microsoft Access  FoxPro  dBase  Oracle – Oracle 8i, Oracle9i, Oracle 10g Microsoft SQL Server IBM DB2/DB2UDB Informix Sybase MySQL Ingress Postgre SQL
  • 15. Ashis Talukder, MIS, DU Levels of Abstraction  Physical level describes how a record (e.g., customer) is stored.  Logical level: describes data stored in database, and the relationships among the data. type customer = record name : string; street : string; city : integer; end;  View level: application programs hide details of data types. Views can also hide information (e.g., salary) for security purposes.
  • 16. Ashis Talukder, MIS, DU Data Abstraction
  • 17. Ashis Talukder, MIS, DU Instances and Schemas  Similar to types and variables in programming languages  Schema – the logical structure of the database  e.g., the database consists of information about a set of customers and accounts and the relationship between them)  Analogous to type information of a variable in a program  Physical schema: database design at the physical level  Logical schema: database design at the logical level  Instance – the actual content of the database at a particular point in time  Analogous to the value of a variable  Physical Data Independence – the ability to modify the physical schema without changing the logical schema  Applications depend on the logical schema  In general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others.
  • 18. Ashis Talukder, MIS, DU Data Models  A collection of tools for describing  data  data relationships  data semantics  data constraints  Entity-Relationship model  Relational model  Other models:  object-oriented model  semi-structured data models  Older models: network model and hierarchical model
  • 19. Ashis Talukder, MIS, DU Entity-Relationship Model
  • 20. Ashis Talukder, MIS, DU Entity Relationship Model (Cont.)  E-R model of real world  Entities (objects)  E.g. customers, accounts, bank branch  Relationships between entities  E.g. Account A-101 is held by customer Johnson  Relationship set depositor associates customers with accounts  Widely used for database design  Database design in E-R model usually converted to design in the relational model (coming up next) which is used for storage and processing
  • 21. Ashis Talukder, MIS, DU customer- name Customer-id customer- street customer- city account- number Johnson Smith Johnson Jones Smith 192-83-7465 019-28-3746 192-83-7465 321-12-3123 019-28-3746 Alma North Alma Main North Palo Alto Rye Palo Alto Harrison Rye A-101 A-215 A-201 A-217 A-201 Attributes Relational Database Model
  • 22. Ashis Talukder, MIS, DU A Sample Relational Database
  • 23. Ashis Talukder, MIS, DU Database Language  A database system provides a data-definition language to specify the database schema and a data-manipulation language to express database queries and update.
  • 24. Ashis Talukder, MIS, DU Data Definition Language (DDL)  Specification notation for defining the database schema  E.g. create table account ( account-number char(10), balance integer)  DDL is also used to specify additional properties of the data.  Example : Alter/DROP/TRUNCATE/ comment/ Grant/ Revoke  The storage structure and access methods used by the database system by a set of statements in a special type of DDL called a data storage and definition language  DDL compiler generates a set of tables stored in a data dictionary  Data dictionary contains metadata (i.e., data about data)  Database schema  Data storage and definition language  language in which the storage structure and access methods used by the database system are specified  Usually an extension of the data definition language
  • 25. Ashis Talukder, MIS, DU DDL ……………. Cont.  The data values stored in the database must satisfy certain consistency constraints.  Domain Constraints : A domain of possible values must be associated with every attribute ( i.e. Char type, integer type, date/time etc)  Referential Integrity : There are cases where we wish to ensure that a value that appear in one relation for a given set of attribute also appears for a certain set of attributes in another relation.  Assertions: An assertion is any condition that the database must always satisfy. i.e Account Balance >=$100  Authorization : differentiate among the user as far as the type of access they are permitted on various data values in the database.  Read authorization  Insert authorization  Update authorization  Delete authorization.
  • 26. Ashis Talukder, MIS, DU Database Languages The output of the DDL is placed in the data dictionary, which contains metadata- that is, data about data. 1. relation-metadata (relation-name, no-of-attributes, storage- organization, location) 2. attribute-metadata (attribute-name, relation-name, domain- type, position, length) 3. user-metadata (user-name, encrypted-password, group) 4. index-metadata (index-name, relation-name, index-type, index- attributes) 5. view-metadata (view-name, definition)
  • 27. Ashis Talukder, MIS, DU Data Manipulation Language (DML)  Language for accessing and manipulating the data organized by the appropriate data model  DML also known as query language  Two classes of languages  Procedural – user specifies what data is required and how to get those data  Nonprocedural – user specifies what data is required without specifying how to get those data  SQL is the most widely used query language
  • 28. Ashis Talukder, MIS, DU SQL  SQL: widely used non-procedural language  E.g. find the name of the customer with customer-id 192-83-7465 select customer.customer-name from customer where customer.customer-id = ‘192-83-7465’  E.g. find the balances of all accounts held by the customer with customer-id 192-83-7465 select account.balance from depositor, account where depositor.customer-id = ‘192-83-7465’ and depositor.account-number = account.account- number  Application programs generally access databases through one of  Language extensions to allow embedded SQL  Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to a database
  • 29. Ashis Talukder, MIS, DU An Un-normalized Relation for ORDER
  • 30. Ashis Talukder, MIS, DU Normalized Tables Created from ORDER
  • 31. Ashis Talukder, MIS, DU Database Users Users are differentiated by the way they expect to interact with the system. Four different types: 1. Naive users – are unsophisticated users who interact with the system by invoking one of the permanent application programs that have been written previously. E.g. people accessing database over the web, bank tellers, clerical staff 2. Application programmers – are computer professionals who write application programs. Application programmers can choose from many tools to develop user interface.
  • 32. Ashis Talukder, MIS, DU Database Users  3. Sophisticated users – interact with the system without writing programs. Instead, they form their requests in a database query language. Analysts who submits queries to explore data in the database. e.g., analyst looking at sales data (OLAP – Online analytical processing), data mining – finds certain kinds of patterns in data.  4. Specialized users – are sophisticated users who write specialized database applications that do not fit into the traditional data processing framework. e.g., computer-aided design systems, knowledge-base and expert systems and environment-modeling systems – uses complex data types.
  • 33. Ashis Talukder, MIS, DU Database Administrator (DBA)  Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprise’s information resources and needs. DBA has central control of both data and the programs that access that data.  The functions of Database administrator (DBA) include:  Schema definition  Storage structure and access method definition  Schema and physical-organization modification  Granting of authorization for data access
  • 34. Ashis Talukder, MIS, DU Transaction Management  A transaction is a collection of operations that performs a single logical function in a database application e.g., deposit, withdrawal, transfer between accounts A – Atomicity, C – Consistency, I – Isolation, D - Durability
  • 35. Ashis Talukder, MIS, DU Transaction Management  Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures e.g., system crash cannot wipe out “committed” transactions
  • 36. Ashis Talukder, MIS, DU Storage Manager  A storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. The storage manager translates the various DML statements into low-level file system thus  The storage manager is responsible for Efficient storage, retrieval and updating of data in the database. The storage manager components include :  Authorization & Integrity manager: test for satisfaction of integrity constraints and checks the authority of user to access data.  Transaction manager: which ensure that the database remains in a consistent despite of power failure.  File Manager: Which manages the allocation of space on disk storage & the data structures used to represent information stored on disk.  Buffer Manager : Which is responsible for fetching data from disk storage into main memory, and deciding what data to cache in main memory.
  • 37. Ashis Talukder, MIS, DU Storage Manager The storage manager stores:  Data files (relations): which stores the database itself.  Data dictionary : Which stores metadata about structure of the database, in particular the schema of the database. (sometimes called catalog)  Indices : which can provide fast access to data Items. Like Index of a text book.
  • 38. Ashis Talukder, MIS, DU The Query Processor  Components include: 1. DDL interpreter : Which Interprets DDL statements and records the definitions in the dictionary. 2. DML compiler : Which translates DML statements in a query language into an evaluation plan consisting of low level instruction that the query evaluation engine understand. 3. Query evaluation engine : Which execute low- level instructions generated by the DML compiler.
  • 39. Ashis Talukder, MIS, DU Database Administrator  Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprise’s information resources and needs.  Database administrator's duties include:  Schema definition  Storage structure and access method definition  Schema and physical organization modification  Granting user authority to access the database  Specifying integrity constraints  Acting as liaison with users  Monitoring performance and responding to changes in requirements
  • 40. Ashis Talukder, MIS, DU Overall System Structure
  • 41. Ashis Talukder, MIS, DU Application Architectures Two-tier architecture: E.g. client programs using ODBC/JDBC to communicate with a database Three-tier architecture: E.g. web-based applications, and applications built using “middleware”
  • 42. Ashis Talukder, MIS, DU Centralized database: • Used by single central processor or multiple processors in client/server network • There are advantages and disadvantages to having all corporate data in one location. • Security is higher in central environments, risks lower. • If data demands are highly decentralized, then a decentralized design is less costly, and more flexible. Distributing DatabasesDistributing Databases
  • 43. Ashis Talukder, MIS, DU • Databases can be decentralized either by partitioning or by replicating • Partitioned database: Database is divided into segments or regions. For example, a customer database can be divided into Eastern customers and Western customers, and two separate databases maintained in the two regions. CREATING A DATABASE ENVIRONMENT Distributed database:
  • 44. Ashis Talukder, MIS, DU • Duplicated database: The database is completely duplicated at two or more locations. The separate databases are synchronized in off hours on a batch basis. • Regardless of which method is chosen, data administrators and business managers need to understand how the data in different databases will be coordinated and how business processes might be effected by the decentralization. CREATING A DATABASE ENVIRONMENT
  • 45. Ashis Talukder, MIS, DU • The quality of decision making in a firm is directly related to the quality of data in its databases. • Data Quality Audit: Structured survey of the accuracy and level of completeness of the data in an information system • Data Cleansing: Consists of activities for detecting and correcting data in a database or file that are incorrect, incomplete, improperly formatted, or redundant CREATING A DATABASE ENVIRONMENT Ensuring Data Quality:
  • 46. Ashis Talukder, MIS, DU Online Analytical Processing (OLAP): • Multidimensional data analysis • Supports manipulation and analysis of large volumes of data from multiple dimensions/perspectives DATABASE TRENDS Multidimensional Data AnalysisMultidimensional Data Analysis
  • 47. Ashis Talukder, MIS, DU Multidimensional Data Model DATABASE TRENDS
  • 48. Ashis Talukder, MIS, DU Data warehouse: A Data warehouse is a database that stores current & historical data of potential interest to manager throughout the company • Supports reporting and query tools • Stores current and historical data • Consolidates data for management analysis and decision making DATABASE TRENDS Data Warehousing and Data MiningData Warehousing and Data Mining
  • 49. Ashis Talukder, MIS, DU Components of a Data Warehouse DATABASE TRENDS
  • 50. Ashis Talukder, MIS, DU Data mart: • Subset of data warehouse • Contains summarized or highly focused portion of data for a specified function or group of users DATABASE TRENDS Data mining: • Tools for analyzing large pools of data • Find hidden patterns and infer rules to predict trends
  • 51. Ashis Talukder, MIS, DU Benefits of Data Warehouses: • Improved and easy accessibility to information • Ability to model and remodel the data DATABASE TRENDS