Data Base System Ch2
Data Base System Ch2
2
Categories of data models
3
Categories of data models
2. Physical (low-level, internal) data models: Provide
concepts that describe details of how data is stored in the
computer. These are usually specified in an ad-hoc manner
through DBMS design and administration manuals
Categories of data models
3. Implementation (representational) data models: Provide
concepts that fall between the above two, balancing user
views with some computer storage details.
Schema vs Instance(State)
Database Schema: The description of a database. Includes
descriptions of the database structure and the constraints that
should hold on the database.
6
Database Schema Vs.
Database State
• Database State: Refers to the content of a
database at a moment in time.
– Initial Database State: Refers to the database
when it is loaded
– Valid State: A state that satisfies the structure and
constraints of the database.
• The database schema changes very
infrequently. The database state changes
every time the database is updated.
Three-Schema Architecture
Proposed to support DBMS characteristics of:
1. Program-data independence.
2. Support of multiple views of the data.
21
DBMS Interfaces
• Stand-alone query language interfaces.
– Example: Entering SQL queries at the DBMS
interactive SQL interface
• Programmer interfaces for embedding DML in
programming languages:
– Like Pre-compiler and Procedure (Subroutine) Call
Approach
• User-friendly interfaces:
– Menu-based, forms-based, graphics-based, etc.
DBMS Interfaces
• Web Browser as an interface
• Parametric interfaces (e.g., bank tellers)
• Speech input and output
• Interfaces for the DBA:
– Creating accounts, granting authorizations
– Setting system parameters
– Changing schemas or access path
Database system environment
24
Classification of DBMSs
• Based on the data model used
– Traditional: Network, Hierarchical.
– Emerging: Object-oriented, Object-relational.
• Other classifications
– Single-user (typically used with personal
computers) vs. multi-user (most DBMSs).
– Centralized (uses a single computer with one
database) vs. distributed (uses multiple
computers, multiple databases)
Example of Network Model Schema
Network Model
• Advantages:
– Network Model is able to model complex
relationships and represents semantics of
add/delete on the relationships.
– Can handle most situations for modeling using
record types and relationship types.
– Language is navigational; uses constructs like
FIND, FIND member, FIND owner, FIND NEXT
within set, GET, etc.
• Programmers can do optimal navigation through the
database.
Network Model
• Disadvantages:
– Navigational and procedural nature of processing
– Database contains a complex array of pointers
that thread through a set of records.
• Little scope for automated “query optimization”
Hierarchical DBMS
• The hierarchical model represents data as
hierarchical tree structures. Each hierarchy
represents a number of related records.
• There is no standard language for the
hierarchical model.
Hierarchical Model
• Advantages:
– Simple to construct and operate
– Corresponds to a number of natural hierarchically organized
domains, e.g., organization (“org”) chart
– Language is simple:
• Uses constructs like GET, GET UNIQUE, GET NEXT, GET NEXT
WITHIN PARENT, etc.
• Disadvantages:
– Navigational and procedural nature of processing
– Database is visualized as a linear arrangement of records
• Little scope for "query optimization"
Object-oriented Data Models
• Several models have been proposed for
implementing in a database system.
• One set comprises models of persistent O-O
Programming Languages such as C++ and Smalltalk.
Object-Relational Models
• Most Recent Trend. Started with Informix Universal
Server.
• Relational systems incorporate concepts from
object databases leading to object-relational.
• Exemplified in the latest versions of Oracle-10i,
DB2, and SQL Server and other DBMSs.
• Standards included in SQL-99 and expected to be
enhanced in future SQL standards.