Professional Documents
Culture Documents
Outlines
Data Models
Chapter 2 Schema, Instances and States
Database System Concepts and Architecture DBMS Architecture and Data Independence
Classification of DBMS
Constructs are used to define the database structure Operations on the data model may include basic
Constructs typically include elements (and their data types) as model operations (e.g. generic insert, delete,
well as groups of elements (e.g. entity, record, table), and
update) and user-defined operations (e.g.
relationships among such groups
compute_student_gpa, update_inventory)
Constraints specify some restrictions on valid data; these
constraints must be enforced at all times
1
5/18/2021
2
5/18/2021
3
5/18/2021
4
5/18/2021
Example: The addition or removal of new entities, attributes, Examples: A change to the internal schema, such as using different
or relationships to the conceptual schema should be possible file organization.
without having to change existing external schemas or having Or storage structures, storage devices, or indexing strategy,
to rewrite existing application programs. should be possible without having to change the conceptual or
external schemas.
5
5/18/2021
6
5/18/2021
7
5/18/2021
Database Programming Language Approach: e.g. ORACLE has Combinations of the above:
PL/SQL, a programming language based on SQL; language • For example, both menus and forms used
incorporates SQL and its data types as integral components extensively in Web database interfaces
8
5/18/2021
The Database System Environment (cont'd.) The Database System Environment (cont'd.)
Interactive query interface-Interface that casual Precompiler extracts DML commands from an
users and persons with occasional need for information application program written in a host
from the database interact.
programming language. These commands are
query compiler that compiles queries into an internal sent to the DML compiler for compilation into
form. Queries are parsed and validated for correctness of
the query syntax, the names of files and data elements,
object code for database access. The rest of the
and so on program is sent to the host language compiler.
Query optimizer concerned with the rearrangement and The object codes for the DML commands and the
possible reordering of operations, elimination of rest of the program are linked, forming a canned
redundancies, and use of correct algorithms and indexes transaction whose executable code includes calls
during execution. to the runtime database processor.
9
5/18/2021
A client program may connect to several DBMSs, Open Database Connectivity (ODBC)
sometimes called the data sources. Provides application programming interface
In general, data sources can be files or other non- (API)
DBMS software that manages data. Allows client-side programs to call the DBMS
Other variations of clients are possible: e.g., in • Both client and server machines must have the
some object DBMSs, more functionality is necessary software installed
transferred to clients including data dictionary JDBC
functions, optimization and recovery across
Allows Java client programs to access one or
multiple servers, etc.
more DBMSs through a standard interface
10
5/18/2021
Classification of Database
Database Models
Management Systems
A specific DBMS has its own specific Data Definition Language,
Based on the data model used but this type of language is too low level to describe the data
requirements of an organization in a way that is readily
Traditional: Relational, Network, Hierarchical. understandable by a variety of users.
Emerging: Object-oriented, Object-relational. We need a higher-level language.
Other classifications Such a higher-level is called data-model.
Single-user (typically used with personal A data model is a collection of tools or concepts for describing
computers) data, the meaning of data, data relationships, and data
vs. multi-user (most DBMSs). constraints.
A model is a representation of real world objects and events and their
Centralized (uses a single computer with one
associations.
database)
The main purpose of Data Model is to represent the data in
vs. distributed (uses multiple computers,
understandable way.
multiple databases)
11
5/18/2021
Network Model
Hierarchical Model… Cont’d
Allows record types to have more that one parent unlike hierarchical
Advantage of Hierarchical Model model
Good for tree type problem (e.g. Family Tree Problem) A network data models sees records as set members
Language is simple; uses constructs like GET, GET UNIQUE, GET Each set has an owner and one or more members
NEXT, GET NEXT WITHIN PARENT etc. Allow no many to many relationship between entities
Like hierarchical model network model is a collection of physically
Disadvantages of Hierarchical Model linked records.
Addition, deletion, and search operations are very difficult. Allow member records to have more than one owner
There is duplication of data.
Navigational and procedural nature of processing
Database is visualized as a linear arrangement of records
Little scope for "query optimization"
12
5/18/2021
This makes sense because the different account types have some
different behaviour e.g. gaining interest in a savings account but
some behaviour the same e.g. lodging or withdrawing cash. This is
the inheritance concept of OO programming.
13
5/18/2021
14