Relational Database Management Systems
Relational Database Management Systems
Lecture 2
Objectives
BE ABLE TO IDENTIFY: Components of a DBMS How to store data in a database Data Models Three Schema Architecture Transaction Processing
System Catalog
designs
Data
Hardware
Single PC A single mainframe Server-client Model
Data
Operational data Metadata System catalogue
SLIIT-2007
First Year
Data Models
Data Model: A set of concepts to describe the structure of a database and certain constraints that the database should obey
Many forms of data models Makes data abstraction possible Hides details of physical data storage from the user
Example
Implementation (representational) data models: Emphasizes on how the data is represented in the database or how the data structures are implemented to represent what is modeled (eg. Relational or OO models)
Hierarchical Model
Represents a hierarchy with the whole at the root and the components forms the child nodes in turn Thus, all the components or the nodes, taken together form the whole
Hierarchical Model
Network Model
Resembles the hierarchical model with a provision for a record to have more than one parent
An owner record is equivalent to a parent, and a member record s equivalent to a child in the hierarchical model The difference is that a record can appear as a member in more than one set
Network Model
Relational Model
Relational DBMS are so called because the data they can manipulate are stored as relations Relational database system devised by Codd in 1970 An attempt to devise a standard model with a sound mathematical basis Most successful database model Most use the query language SQL Examples include: Oracle, Microsoft Access, FoxPro, MySql, SQLServer etc
Relational Model
Relational database system devised by Codd in 1970 An attempt to devise a standard model with a sound mathematical basis Most successful database model Most use the query language SQL Examples include: Oracle, Microsoft Access, FoxPro, MySql, SQLServer etc
Relations
Can be represented as tables in which rows represent tuples and columns represents attributes A relation may be described by its name and the related attributes Eg (Employee (Emp_no, Emp_ name, Age, Start_date, Address. )
STAFF relation
StaffNo SL21 SG37 SG14 Name John White Ann Beech David Ford
Work In
Exists
Has Has
Has
An Instance
Name
Smith Brown StudentNumber 17 8
Class
1 2
Major
CS CS
CourseNumber CS 1310
CreditHouse 4
Department CS
4 3
3
CS MATH
CS
Three-Schema Architecture
Internal schema (one)
describes physical storage structures access paths, indexes used Typically uses a physical data model
Mappings among schema levels are needed to transform requests and data. Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution data independence
Mappings among schema levels are needed to transform requests and data. Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution.
First Year
SLIIT-2006
35
First Year
SLIIT-2006
37
Data Independence
In a DBMS that fully supports data independence,
When a schema at a lower level is changed .
Only the mappings between this schema and higher-level schema(s) need to be changed. The higher-level schemas themselves are unchanged.
The application programs need not be changed since they refer to the external schemas.
DBMS Languages
DML DDL
Database Architectures
Centralized DBMS: combines everything into single system includingDBMS software, hardware, application programs and user interface processing software.
Clients
Provide appropriate interfaces and a client-version of the system to access and utilize the server resources. Clients maybe diskless machines or PCs or Workstations with disks with only the client software installed. Connected to the servers via some form of a network. (LAN: local area network, wireless network, etc.)
DBMS Server
Provides database query and transaction services to the clients. Some times called query and transaction servers.
Classification of DBMSs
Based on the data model used:
Traditional: Relational, Network, Hierarchical. Emerging: Object-oriented, Object-relational.
Other classifications:
Single-user (typically used with micro- computers) vs. multi-user (most DBMSs). Centralized (uses a single computer with one database) vs. distributed (uses multiple computers, multiple databases)
Classification of DBMSs
Distributed Database Systems come to be known as client server based database systems because they do not support a totally distributed environment, but rather a set of database servers supporting a set of clients.
First Year
SLIIT-2007
52
First Year
SLIIT-2007
54
Summary
Discussed the:
Different data models Relational data model Three schema architecture