DBMS_V.0 (1)
DBMS_V.0 (1)
Banking
Airlines
Universities
Telecommunication
Finance
Sales
Manufacturing
Etc.
7 Benefits of DBMS
The amount of data redundancy in stored data can be
reduced.
No more data inconsistencies.
Stored data can be shared by a single user or multiple user.
Standards can be set and followed.
Data integrity can be maintained. Data integrity refers to the
problem of ensuring that database contains only accurate
data.
Data independence can be achieved, i.e. data and
programs that manipulate the data are two different entities.
Security of data can be simply implemented.
8 What is Relational Database
management System (RDBMS)?
A Relational database management system(RDBMS) is a
database management system (DBMS) that is based on
relational model as introduced by Dr. Edgar F. Codd.
Strictly speaking it should also satisfy Codd’s 12 rule, but in
pratice there is no DBMS that satisfy all these rules.
RDBMS stores data in the form of related tables. RDBMS are
powerful because they require few assumptions about
how data is related or How it will be extracted from the
database. As a result, the same database can be viewed
in many different ways.
9 RDBMS……
Today, popular commercial RDBMS for large databases include Oracle,
Microsoft SQL server, Sybase and IBM DB2.
The most commonly used free RDBMS are MySQL and PostgreSQL.
10 Dr. E. F. Codd’s Rules
for RDBMS
Dr. E.F. Codd was an IBM researcher who
first developed the relational data model in
1970. In 1985 Dr. E.F. Codd published a list of
12 rules that define an ideal relational
database and has provided a guide line for
the design of all relational database
systems.
Dr. Codd has used the term guideline
because till date no commercial relational
database system fully conforms to all 12
rules.
11 Rule 1: The Information Rule
16
17 Rule No. 7: High-level Insert, Update,
and Delete
Data can be retrieved from a relational database in sets constructed of data
from multiple rows and /or multiple tables. This rules states that insert, update
and delete operations should be supported for any retrievable set rather than
just for a single row in a single table.
Rule no. 8: Physical Data Independence 18
Hierarchical Model
35 Network Model
This is an extension of the Hierarchical model. In this model data is
organized more like a graph, and are allowed to have more than one
parent node.
In this database model data is more related as more relationships are
established in this database model.
Also, as the data is more related, hence accessing the data is also easier
and fast. This database model was used to map many-to-many data
relationships.
36
37 Entity-relationship Model
In this database model, relationships are created by dividing object of
interest into entity and its characteristics into attributes.
Different entities are related using relationships.
E-R Models are defined to represent the relationships into pictorial form to
make it easier for different stakeholders to understand.
Relational Model
39
40 Database Languages
A database system provides a data definition language to specify the
database schema and a data manipulation language to express database
queries and updates.
In practice, the data definition and data manipulation languages are not
two separate languages; instead they simply form parts of a single
database language, such as the widely used SQL language.
41 DDL vs DML
42 SQL Statements
43 SQL Statements and their description
44 Database users and Administrators
A primary goal of a database system is to retrieve information from and
store new information in the database.
People who work with a database can be categorized as database users
or database administrators.
There are four different types of database-system users, differentiated by
the way they expect to interact with the system.
Different types of user interfaces have been designed for the different types
of users.
Naïve Users.
Application programmers.
Sophisticated User.
Specialized user.
45 Database Administrator
One of the main reasons for using DBMSs is to have central control of both
the data and the programs that access those data.
A person who has such central control over the system is called a database
administrator (DBA). The functions of a DBA include:
Schema definition: The DBA creates the original database schema by
executing a set of data definition statements in the DDL.
Storage structure and access-method definition.
Schema and physical-organization modification. The DBA carries out
changes to the schema and physical organization to reflect the changing
needs of the organization, or to alter the physical organization to improve
performance.
46 Granting of authorization for data access: By granting different types of
authorization, the database administrator can regulate which parts of the
database various users can access.
The authorization information is kept in a special system structure that the
database system consults whenever someone attempts to access the data
in the system.
Routine maintenance: Examples of the database administrator’s routine
maintenance activities are:
Periodically backing up the database, either onto tapes or onto remote servers,
to prevent loss of data in case of disasters such as flooding.
Ensuring that enough free disk space is available for normal operations, and
upgrading disk space as required.
Monitoring jobs running on the database and ensuring that performance is not
degraded by very expensive tasks submitted by some users.
Data Dictionary 47
It helps you to identifies the entities which exist in a system and the
relationships between those entities
54 Why use ER Diagrams?
Provide a preview of how all your tables should connect, what fields are
going to be on each table .
ER diagrams are translatable into relational tables which allows you to build
databases quickly.
Examples of entities:
Person: Employee, Student, Patient
Place: Store, Building
Object: Machine, product, and Car
Event: Sale, Registration, Renewal
Concept: Account, Course
74 Entity set:
An entity set is a group of similar kind of entities. It may contain entities with
attribute sharing similar values. Entities are represented by their properties,
which also called attributes. All attributes have their separate values. For
example, a student entity may have a name, age, class, as attributes.
75
76
77
78
79 Key in DBMS
Super Key
Primary Key
Candidate Key
Alternate Key
Foreign Key
Compound Key
Composite Key
82 What is the Super key?
All the keys which are not primary key are called
an alternate key. It is a candidate key which is
currently not the primary key. However, A table
may have single or multiple choices for the
primary key.
86
StudID, Roll No, Email are qualified to become a primary key. But since StudID
is the primary key, Roll No, Email becomes the alternative key.
87 What is a Candidate Key?
A super key with no repeated attribute is called candidate key.
The Primary key should be selected from the candidate keys. Every table must
have at least a single candidate key.