Dbms
Dbms
What is a Database?
A structured collection of related data
An filing cabinet, an address book, a
telephone directory, a timetable, etc.
In Access, your Database is your collection
of related tables
A database is a storage space for content /
information (data)
But what is data? And where is it now?
Data is factual information about objects and concepts,
such as:
Measurements, statistics
You can find it in:
Filing cabinets, spreadsheets, folders, ledgers, lists, colleagues’
memories, piles of papers on your desk
Data vs. Information
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
In Short,
A Database Management System (DBMS) is a set of computer programs that
controls the creation, maintenance, and the use of a database.
It allows organizations to place control of database development in the hands of
database administrators (DBAs) and other specialists.
A DBMS is a system software package that helps the use of integrated collection of
data records and files known as databases.
It allows different user application programs to easily access the same database.
DBMSs may use any of a variety of database models, such as the network model
or relational model.
In large systems, a DBMS allows users and other software to store and retrieve data
in a structured way.
Instead of having to write computer programs to extract information, user can ask
simple questions in a query language.
Thus, many DBMS packages provide Fourth-generation programming language
(4GLs) and other application development features.
It helps to specify the logical organization for a database and access and use the
information within a database. It provides facilities for controlling data access,
enforcing data integrity, managing concurrency, and restoring the database from
backups. A DBMS also provides the ability to logically present database information
to users.
Levels of Data 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.
View of Data
An architecture for a database system
DBMS Languages
Data Definition Language (DDL): Used by the DBA and database
designers to specify the conceptual schema of a database. In many
DBMSs, the DDL is also used to define internal and external schemas
(views). In some DBMSs, separate storage definition language (SDL)
and view definition language (VDL) are used to define internal and
external schemas.
DDL Compiler
-Procedural DML:
• Also called record-at-a-time (record-oriented) or low-level DML
• Must be embedded in a programming language.
• Searches for and retrieves individual database records and uses looping
and other constructs of the host programming language to retrieve multiple
records.
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
Relational Model
Attributes
Example of tabular data in the relational model
customer- customer- customer- account-
Customer-
name street city number
id
192-83-7465 Johnson Alma Palo Alto A-101
019-28-3746 Smith North Rye A-215
192-83-7465 Johnson Alma Palo Alto A-201
321-12-3123 Jones Main Harrison A-217
019-28-3746 Smith North Rye A-201
A Sample Relational Database
Categories of data models
Conceptual (high-level, semantic) data models:
Provide concepts that are close to the way many
users perceive data. (Also called entity-based or
object-based data models.)
Physical (low-level, internal) data models:
Provide concepts that describe details of how data
is stored in the computer.
Implementation (representational) data
models: Provide concepts that fall between the
above two, balancing user views with some
computer storage details.
Slide 2-21
History of Data Models
Relational Model: proposed in 1970 by E.F. Codd (IBM),
first commercial system in 1981-82. Now in several
commercial products (DB2, ORACLE, SQL Server,
SYBASE, INFORMIX).
Network Model: the first one to be implemented by
Honeywell in 1964-65 (IDS System). Adopted heavily due
to the support by CODASYL (CODASYL - DBTG report of
1971). Later implemented in a large variety of systems -
IDMS (Cullinet - now CA), DMS 1100 (Unisys), IMAGE
(H.P.), VAX -DBMS (Digital Equipment Corp.).
Hierarchical Data Model: implemented in a joint effort by
IBM and North American Rockwell around 1965. Resulted
in the IMS family of systems. The most popular model.
Other system based on this model: System 2k (SAS inc.)
Slide 2-22
History of Data Models
Object-oriented Data Model(s): several models have been
proposed for implementing in a database system. One set
comprises models of persistent O-O Programming
Languages such as C++ (e.g., in OBJECTSTORE or
VERSANT), and Smalltalk (e.g., in GEMSTONE).
Additionally, systems like O2, ORION (at MCC - then
ITASCA), IRIS (at H.P.- used in Open OODB).
Object-Relational Models: Most Recent Trend. Started
with Informix Universal Server. Exemplified in the latest
versions of Oracle-10i, DB2, and SQL Server etc. systems.
Slide 2-23
Hierarchical Model
• ADVANTAGES:
• Hierarchical Model is simple to construct and operate on
• Corresponds to a number of natural hierarchically organized
domains - e.g., assemblies in manufacturing, personnel
organization in companies
• 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"
Slide 2-24
Network
• ADVANTAGES:
Model
• 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.
• 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”
Slide 2-25
Data Independence By adding or removing a record type or
data item to
· expand the database
· reduce the database
ogical Data Independence: The capacity to change the conceptual schema without
aving to change the external schemas and their application programs.
hysical Data Independence: The capacity to change the internal schema without
aving to change the conceptual schema.
storage
transaction buffer manager manager
manager
File manager
File-server
Client-server
Teleprocessing
Traditional architecture.
Disadvantages include:
Significant network traffic.
Copy of DBMS on each workstation.
Concurrency, recovery and integrity control more complex.
File-Server Architecture
Client-Server
Server holds the database and the DBMS.
Objectives:
extensibility of data;
integrity of data;
controlled access to data.
IRDS services interface