Sie sind auf Seite 1von 40

V Purpose of Database Systems

V View of Data
V Data Models
V Data Definition Language
V Data Manipulation Language
V Transaction Management
V Storage Management
V Database Administrator
V Database Users
V Overall System Structure
V Rollection of interrelated data
V Set of programs to access the data
V DBMS contains information about a
particular enterprise
V DBMS provides an environment that is both
O  and O to use.
V Database Applications:
× Banking: 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
V
n the early days, database applications
were built on top of file systems
V Drawbacks of using file systems to store
data:
× Data redundancy and inconsistency
J Multiple file formats, duplication of information in different files
× Difficulty in accessing data
×
ntegrity problems
J
ntegrity constraints (e.g. account balance > 0) become part of
program code
J Hard to add new constraints or change existing ones
V Drawbacks of using file systems (cont.)
× Atomicity of updates
J ½ailures may leave database in an inconsistent state with partial updates
carried out
J E.g. transfer of funds from one account to another should either
complete or not happen at all
× Roncurrent access by multiple users
J Roncurrent accessed needed for performance
J Uncontrolled concurrent accesses can lead to inconsistencies
J E.g. two people reading a balance and updating it at the same time
× Security problems
V Database systems offer solutions to all the
above problems
V Users
V Application programmer
V End-users
V Database Administrator
V Software
V Hardware
V Data
V Roordinates all the activities of the
database system; the database
administrator has a good
understanding of the enterpriseǯs
information resources and needs.
V Database administrator's duties
include:
× Storage structure and access method definition
× Schema and physical organization modification
× Granting user authority to access the database
× Specifying integrity constraints
× Monitoring performance and responding to changes in
requirements
V eduction in data redundancy
V eduction in
nconsistency
V Sharing of data
V Enforcement of standards
V
mprovement in data security
V Maintenance of data integrity
V Better interaction with users
V Efficient system
V Problems Associated with Rentralization
V Rost of Software
V Rost of Hardware
V Romplexity of Backup and ecovery
V Ê    

   

 
  
     
       
   

  
V A data model is a "description" of both a
container for data and a methodology for
storing and retrieving data from that
container
V Hierarchical data model

V Network data model

V elational Model

V Object Oriented Model


V Rollection of  
V Define hierarchically-arranged data
V single table acts as the "root" of the database from
which other tables "branch" out
V Disadvantage
× cannot add a record to a child table until it has already
been incorporated into the parent table
× creates repetition of data within the database
× handle one-to-many relationships well but do not handle
many-to-many relationships well
V solves the problem of data redundancy by
representing relationships in terms of sets
rather than hierarchy
V Hierarchical Model- subset of the network
model
V support many-to-many relationships
V the model was difficult to implement and
maintain
V used by computer programmers rather than
real users
V Rollection of two-dimensional tables
V Table is a collection of records and each
record in a table contains the same fields
V Roncept of how users perceive data
V Organization of data into relational tables is
known as the 
     
V Allows the definition of data structures,
storage and retrieval operations and integrity
constraints
V ½ile Management Systems
V Hierarchical Model
IBM DzI    M 
 Sys (IMS)dz 1966
V Network Model
R  s B O   s DzI
  D  S  (IDS)dz 1965
R O  D  Syss L 

s /D  B s T sk
G  RDASYL/DBTG (1971)
V elational Model
Ô  R  1970
Provided facilities to extract data and share
files, but did not implement any way to
connect records in one file to those in
another. elationships had to be
implemented in application code.
FILE SYSTEM
Program 1 Meta-Data

Program 2 Meta-Data Data

Program 3 Meta-Data

DATABASE
Program 1

Meta-
Program 2 Data Data

Program 3
elationships were implemented by physical
pointers (called Dzsetsdz) which allowed records
to be connected in different files.  O O
databases allow only one parent set;
 ks allow several. These permit
efficient processing but the sets must be
constructed on data entry and cannot be
rearranged later.
elational models implement relationships
with matched data values in related files
(called primary and foreign keys). Any
attributes can be matched. The connection is
established at retrieval so interconnections
can be developed as needed.
p 

p  p  

 
  


Each file can have only one parent. To implement a second ³parent´ (COLLEGE) we have to implement a
shadow copy.
p 

p  p  

 


Each file can have several parents. Both SECTION and COLLEGE are ³parent´ files..
p 

p  p  p  p  


SECTION-KEY SECTION-KEY
STUDENT-KEY INSTRUCTOR-KEY

p  
p  COLLEGE-KEY
COLLEGE-KEY
 


Each file can have several parents. Both SECTION and COLLEGE are ³parent´ files..
V Ô  
× Person, place, thing or event about which we wish
to keep data
V 2 
× property of an entity
V     
× an association among entities (entity records)
V Physical level describes how a record (e.g.,
customer) is stored.
V Logical level: describes data stored in database,
and the relationships among the data.
 customer = 
 
  : string;
s : string;
Oy : integer;
 ;
V View level: application programs hide details of
data types. Views can also hide information
(e.g., salary) for security purposes.
An architecture for a database system
V Similar to types and variables in programming languages
V p
 * 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
× 

 : database design at the physical level
× 

 : database design at the logical level
V

 * the actual content of the database at a particular point in time
× Analogous to the value of a variable
V 
Ê  
 
 * the ability to modify the physical schema
without changing the logical schema
× Applications depend on the logical schema
×
n general, the interfaces between the various levels and components should be well
defined so that changes in some parts do not seriously influence others.
V 2 c ll cti ft ls f r scri i
× ÷ata
× ÷ata r lati s i s
× ÷ata s a tics
× ÷ata c strai ts
V Ô tity-R lati s i ÷l
V Rlati al ÷l
V t r ÷ls:
× w jct-wri t÷ w÷l
× si-str ct r÷ ÷ata w÷ls
× l÷r w÷ls: t wrk w÷l a ÷ irarc ical w÷l
Example of schema in the entity-relationship model
V E- model of real world
× Entities (objects)
J E.g. customers, accounts, bank branch
× elationships between entities
J E.g. Account A-101 is held by customer Johnson
J elationship set  s  associates customers with accounts
V †idely used for database design
× Database design in E- model usually converted to design in the relational
model (coming up next) which is used for storage and processing
Attributes

V Example of tabular data in the relational model


customer- customer- customer- account-
Customer-id
name street city number

192-83-7465 Johnson Alma A-101


Palo Alto
019-28-3746 Smith North A-215
Rye
192-83-7465 Johnson Alma A-201
Palo Alto
321-12-3123 Jones Main A-217
Harrison
019-28-3746 Smith North A-201
Rye
V DDL is used to create, remove and alter the
structure of database object
V The DDL is used for table defination

V DDL compiler generates a set of tables


stored in a  O  y
V Data dictionary contains metadata (i.e.,
data about data)
V Rreate table command
V Alter table command
V Drop table command
V DML command are used to query and
manipulate existing database objects
× DML also known as query language

V SQL is the most widely used query language


V
nsert
V Select
V Update
V Delete
V SQL: widely used non-procedural language
× E.g. find the name of the customer with customer-id 192-83-7465

 Os  Os  
 Os 
  Os  Os  = Ǯ192-83-7465ǯ
× E.g. find the balances of all accounts held by the customer with customer-id
192-83-7465

 OO   O
  s , OO 
   s  Os  = Ǯ192-83-7465ǯ 
 s  OO  = OO  OO 
V Application programs generally access
databases through one of
× Language extensions to allow embedded SQL
× Application program interface (e.g. ODBRJDBR) which allow SQL queries to
be sent to a database
V Users are differentiated by the way they
expect to interact with the system
V Application programmers * interact with
system through DML calls
V Sophisticated users * form requests in a
database query language
V Specialized users * write specialized database
applications that do not fit into the traditional
data processing framework
V Naïve users * invoke one of the permanent
application programs that have been written
V A  s O  is a collection of operations that
performs a single logical function in a
database application
V 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.
V Roncurrency-control manager controls the
interaction among the concurrent
transactions, to ensure the consistency of the
V 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.
V The storage manager is responsible to the
following tasks:
× interaction with the file manager
× efficient storing, retrieving and updating of data
×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´

Das könnte Ihnen auch gefallen