3. Database Overview
ī´Database
ī´What, Why, How
ī´Evolution of Database
ī´File System
ī´Data Models
ī´Hierarchical
ī´Network
ī´Relational
ī´Entity-Relationship
ī´Object-Oriented
ī´Web Database
4. Database: What
ī´ Database
ī´ is collection of related data and its metadata organized in a structured
format
ī´ for optimized information management
ī´ Database Management System (DBMS)
ī´ is a software that enables easy creation, access, and modification of
databases
ī´ for efficient and effective database management
ī´ Database System
ī´ is an integrated system of hardware, software, people, procedures, and
data
ī´ that define and regulate the collection, storage, management, and use
of data within a database environment
5. Database Management System
Database Systems: Design, Implementation, & Management: Rob & Coronel
- manages interaction between end users and database
6. Database: Why
ī´ Purpose of Database
ī´Optimizes data management
ī´Transforms data into information
ī´ Importance of Database Design
ī´Defines the databaseâs expected use
ī´Avoid data redundancy & ensure data integrity
ī´Poorly designed database generates errors
ī´ Functions of DBMS/Database System
ī´Stores data and related data entry forms, report
definitions, etc.
ī´Hides the complexities of relational database model
from the user
ī´Enforces data integrity
ī´Implements data security management
7. Database: How
ī´ Planning & Analysis
ī´Assess
ī´Goal of the organization
ī´Database environment
ī´ existing hardware, software, raw data, data processing procedures
ī´Identify
ī´Database needs
ī´ what database can do to further the goal of the organization
ī´User needs and characteristics
ī´ who the users are, what they want to do, how they envision doing it
ī´Database system requirements
ī´ what the database system should do to satisfy the database and user
needs
ī´ Design
ī´From conceptual design to a detailed system specification
ī´ Implementation
ī´Create the database
ī´ Maintenance
ī´Troubleshoot, update, streamline the database
8. Business Rules
ī´What
ī´ Brief, precise, and unambiguous descriptions of operations in an
organization
ī´Why
ī´ Enhance understanding & facilitate communication
ī´ Promote creation of an accurate data model
ī´How (sources)
ī´ Interviews
ī´ Written documentation
ī´ Observation
9. Database: Data Models
ī´ Importance
ī´ Abstraction of complex real-word data structures in relative simple
(graphical) representations
ī´ Facilitate interaction among the designer, the applications programmer,
and the end user
ī´ Basic Building Blocks
ī´ Entity
ī´ thing about which data are to be collected and stored
ī´ Attribute
ī´ a characteristic of an entity
ī´ Relationship
ī´ describes an association among entities
ī´ Constraint
ī´ restrictions placed on the data
10. Hierarchical Database
ī´ Background
ī´ Developed to manage large amount of data for complex manufacturing
projects
ī´ e.g., Information Management System (IMS)
ī´ IBM-Rockwell joint venture
ī´ clustered related data together
ī´ hierarchically associated data clusters using pointers
ī´ Hierarchical Database Model
ī´ Assumes data relationships are hierarchical
ī´ One-to-Many (1:M) relationships
ī´ Each parent can have many children
ī´ Each child has only one parent
ī´ Logically represented by an upside down tree
12. Hierarchical Database: Pros
& Cons
ī´ Advantages
ī´ Conceptual simplicity
ī´ groups of data could be related to each other
ī´ related data could be viewed together
ī´ Centralization of data
ī´ reduced redundancy and promoted consistency
ī´ Disadvantages
ī´ Limited representation of data relationships
ī´ did not allow Many-to-Many (M:N) relations
ī´ Complex implementation
ī´ required in-depth knowledge of physical data storage
ī´ Structural Dependence
ī´ data access requires physical storage path
ī´ Lack of Standards
ī´ limited portability
13. 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
14. Structure of a DBMS
âĸ A typical DBMS has a
layered architecture.
âĸ The figure does not
show the concurrency
control and recovery
components.
âĸ Each database system
has its own variations.
Query Optimization
and Execution
Relational Operators
Files and Access Methods
Buffer Management
Disk Space Management
DB
These layers
must consider
concurrency
control and
recovery
16. Use of a Database Management System in
Design and Application
Design
Analysis
Design
Verification
Evaluation Synthesis Release
Manufacturing
Planning
Production
Control
Project
Management
APPLICATION
DBMS
Database Management
System
Graphic Interface Language InterfaceINTERFACE
Preliminary-
design
Analysis
Models
Detailed
Design
Design
Release
Control
Fabrication
Assembly
Info
Test /
Inspection
Database Manufacturing
17. Advantages of a DBMS
ī´ Data independence
ī´ Efficient data access
ī´ Data integrity & security
ī´ Data administration
ī´ Concurrent access, crash recovery
ī´ Reduced application development time
ī´ So why not use them always?
ī´ Expensive/complicated to set up & maintain
ī´ This cost & complexity must be offset by need
ī´ General-purpose, not suited for special-purpose tasks (e.g. text
search!)
18. Levels of Abstraction
âĸ Views describe how
users see the data.
âĸ Conceptual schema
defines logical
structure
âĸ Physical schema
describes the files and
indexes used.
âĸ (sometimes called the
ANSI/SPARC model)
Physical Schema
Conceptual Schema
View 1 View 2 View 3
DB
19. Reports and Their Anatomy
âĸ Columnar report vs. Tabular report
âĸ Report header & footer
âĸ Page header & footer
âĸ Group header & footer
âĸ Detail section
âĸ Report Wizard
26. Example: A Simple Query
Processing
Query in SQLīŧ
SELECT CUSTOMER. NAME
FROM CUSTOMER, INVOICE
WHERE REGION = 'N.Y.' AND
AMOUNT > 10000 AND
CUTOMER.C#=INVOICE.C
Internal Form :
ī(īŗ(S SP)
Operator :
SCAN C using region index, create C
SCAN I using amount index, create I
SORT C?and I?on C#
JOIN C?and I?on C#
EXTRACT name field
Calls to Access Methodīŧ
OPEN SCAN on C with region index
GET next tuple
.
.
.
Calls to file systemīŧ
GET10th to 25th bytes from
block #6 of file #5
Language Processor
Optimizer
Operator Processor
Access Method
File System
database
Language
Processor
Access
Method
e.g.B-tree; Index;
Hashing
DBMS
30. Super key
ī´ A super key is a set of one or more attributes which taken
collectively.
ī´ It allow us to identify uniquely an entity instance in the entity set like
program and course code.
ī´ An entity type, its defining attributes and super key (underlined)
31. Primary key
âĸ A candidate key chosen by the database
âĸ designer to act as key is the primary key.
âĸ candidate keys, in that case the database
âĸ Designer has to designate one of them as a primary key,
33. One-To-Many Relationship
âĸ In the one-to-many relationship a loan is associated with at
most one customer via borrower, a customer is associated with
several (including 0) loans via borrower
34. Many-To-One Relationships
âĸ In a many-to-one relationship a loan is associated with several
(including 0) customers via borrower, a customer is associated
with at most one loan via borrower
35. Many-To-Many Relationship
âĸ A customer is associated with several (possibly 0) loans via
borrower
âĸ A loan is associated with several (possibly 0) customers via
borrower