Professional Documents
Culture Documents
Components of A Database System
Components of A Database System
Components of A Database System
Database
Database Management Database
user
application System (DBMS)
•Create database
•Create and process forms
•Create tables
•Create and transmit queries
•Create supporting structures
•Create and process reports
•Read and update database
•Execute application logic
•Maintain db structures
•Control application
•Enforce rules
•Control concurrency
•Provide security
•Perform backup and recovery
What is Data Model
A set of concepts that can be used to describe
the structure of a database: the data types,
relationships, constraints, semantics and
operational behaviour.
or
A way of explaining the logical layout of the
data and the relationship of various parts to
each other and the whole
Types of data model
• Many models exist
– some are better suited for certain data
– some are easier for humans to work with
• Relational model
– easy enough for people to understand,
– easy for computer to manage efficiently
• The Entity Relationship Model
What is data abstraction?
• DBMS provides an abstract view of the
data to hide the complexity
Data Abstraction
View Level
View 1 View 2 …. View n
•Different users see different part of the database
Logical Level
•what data are stored & how they are related
•used by database administrators
Physical Level
•how the data are actually stored
•the concern of the database system
Abstraction Levels
Conceptual level (real word level, View
Level):
• The meaning of data
• How things are related
• What are rules in the real world that
should be respected in the database
Abstraction Levels
Structural level (logical level):
• How the programmer or the direct user of
the database sees the database
• Structures of data
• Operations on data
• Different users may have different views of
data
• Programming languages may also have
their own views of data
Abstraction Levels
Physical level:
• How is the data technically stored
• What kind of files distribution
• Structures to support fast retrieval of data
(indexes)
Illustration of Abstraction Levels
Entity relational model (ER)
• It is a logical db model, which has a logical
representation of data for an enterprise.
• It has become a widely accepted data
model.
• It is easily converted to other data models
• set of rules to transform to relational model
• easier for humans to work with
• graphical representation
Relational data model
• In 1970, Dr E.F.Codd described a new kind of
model Relational model where data are kept in
tables or relations.
Advantages:
• Simplicity
– It frees designer from the actual physical data storage details
• Structural independence
– Changes in the db structure do not affect the data access.
• Reduced retrieval time
• Interactive access more feasible
• DB2, Oracle, Informix, Sybase, MS SQL Server,
etc.
The Relational Model of Data
The basis :
• Database is considered as a collection of
relations (tables)
• Few simple and well defined concepts
• Good theoretical basis
• Easy to comprehend using tabular
representation
What is a Table?
• Tables are the core of your database, and
contain all the raw information. No other part
of the database can function without tables.
• Some databases store all the information in
one table. These are known as flat-file
databases.
• More commonly, databases store the
information in more than one table. These
are known as relational databases.
Relation presented as a table
Relation presented as table
Some definitions
Entity:
Any item about which information is stored.
e.g student, car, book etc
Entity set:
a collection of the entities of the same type.
e.g all students of an institute, employees of
a company.
In other words, a record describes the entity
and, a file describes an entity set.
More….
Attribute: Entity set Attributes
it is a property or
InventoryMod-no,
characteristic (field) of
name,
an entity
description,
e.g name, id no, salary unit price
• Values in all fields are
Employee Emp-no,
attributes. name,
fname,
salary
Relational Model Concepts
• The basic component of the relational model is a table
(or relation)
• Data in a database is represented as a collection of
table (each table has a unique name)
• Each table has a set of attributes (columns)
• Each column has a unique name.
• A row in a table represents a relationship among the
set of values (called a tuple or record) i.e a tuple
represents an instance of the entity set.
• All members of the entity set have the same attributes.
Theory – Tabular Presentation
,file,
entity set
, record
,field
Domain (of attribute):
The set of permitted values
– It is usually specified by name, data type, format &
constrained range of value
e.g in table Car, the mod-no attribute could only take
an integer value
key:
A key is one or more columns of a relation the is used to identify a row.
– a key can be unique or unique.
Domain
values text text integer
Primary key
Table Design
• Each table, that might be used as a
master in a relationship with another table
(detail table), should have a field that is a
unique numeric identifier for each record.
• There should be a unique field or
combination of fields (composite key) that,
when taken together, identify a unique
record in the table
Primary Key
• The records in a table are unique
• A record may be uniquely identified by its
contents
• Usually we don’t need the whole record for
the identification, only some attribute values
• A Primary key is an attribute (or attribute
combination) that has a unique value (or
value combination) in each row of a relation
Primary Key