Sales & Marketing Alignment: How to Synergize for Success
DBMS - Relational Model
1. Presented by – Ovais Bin Imtiaz, MFC(P)
DBMS – Relational Model
2. Presented by – Ovais Bin Imtiaz, MFC(P)
Some Basic Terms
1. Data :- Data are raw facts. The word raw indicates that
the facts are unprocessed and doesn’t have meaning.
It is used as input.
2. Information :- It’s meaningful form of data. Information
is the result of processing raw data to reveal it’s
meaning.
3. Database :- A collection of inter related data is called
database.
• A database is a shared , integrated computer structure
that store a collection of end-user data and metadata.
• A database can be of any size and complexity.
• A database may be generated and maintained
manually or it may be computerized.
3. Presented by – Ovais Bin Imtiaz, MFC(P)
4. Bit :- A single binary digit (0 or 1).
5. Character :- Multiple related bits are combined to form a character.
6. Field :- A character or group of characters that has a specific meaning.
A filed is used to define and store data.
7. Record :- A logically connected set of one or more fields that
describes a person, place, or thing.
8. File :- A collection of related record.
9. Schema :- Description of a database.
10. Instance :- Overall information stored in a database at a particular
moment is called the instance of the database.
4. Presented by – Ovais Bin Imtiaz, MFC(P)
11. DBMS :- A Database Management System is a
collection of programs that manage the database
structure and controls access to the data stored in the
database
Its allows to
• create databases;
• insert , update and delete data;
• sort and query data;
• create form and reports.
Examples of DBMS – Oracle, MySQL, SQLite, DB2 and
MS Access
5. Presented by – Ovais Bin Imtiaz, MFC(P)
Improved Data Sharing
Improved Data security
Minimized data inconsistency
Improved Data Access
Improved decision making
Increased end-user productivity .
Reduce application development time
Role and Advantages of DBMS
6. Presented by – Ovais Bin Imtiaz, MFC(P)
Railway Reservation
Library Management System
Banking
Schools and colleges
Social media sites
Telecommunication
Finance
Online shopping
Applications of DBMS
7. Presented by – Ovais Bin Imtiaz, MFC(P)
What does Database Model mean?
A database model is a type of data model that determines the logical
structure of a database and functionally determines in which manner
data can be stored, organized and manipulated.
A database model :-
shows the logical structure of a database;
describe the relationships between different parts of the data;
serves as blueprint for application developers and database
administrators in creating a database
8. Presented by – Ovais Bin Imtiaz, MFC(P)
STUDENT
ROLL_NO NAME ADDRESS PHONE AGE
1 RAM DELHI 9455123451 18
2 RAMESH GURGAON 9652431543 18
3 SUJIT ROHTAK 9156253131 20
4 SURESH DELHI 9156243131 18
Relational Model was proposed by E.F. Codd in 1970 to model
data in the form of relations or tables.
Relational Model represents how data is stored in Relational
Databases. A relational database stores data in the form of
relations.
Relational Model of DBMS
Example :-
9. Presented by – Ovais Bin Imtiaz, MFC(P)
Codd rules were proposed by E.F. Codd which should be satisfied by relational model.
1. Information Rule: Data stored in Relational model must be a value of some cell of a
table.
2. Guaranteed Access Rule: Every data element must be accessible by table name, its
primary key and name of attribute whose value is to be determined.
3. Systematic Treatment of NULL values: NULL value in database must only
correspond to missing, unknown or not applicable values.
4. Active Online Catalog: Structure of database must be stored in an online catalog
which can be queried by authorized users.
5. Comprehensive Data Sub-language Rule: A database should be accessible by a
language supported for definition, manipulation and transaction management
operation.
6. View Updating Rule: Different views created for various purposes should be
automatically updatable by the system.
7. High level insert, update and delete rule: Relational Model should support insert,
delete, update etc. operations at each level of relations. Also, set operations like
Union, Intersection and minus should be supported.
Codd Rules
10. Presented by – Ovais Bin Imtiaz, MFC(P)
8. Physical data independence: Any modification in the physical location of a
table should not enforce modification at application level.
9. Logical data independence: Any modification in logical or conceptual schema
of a table should not enforce modification at application level. For example,
merging of two tables into one should not affect application accessing it which
is difficult to achieve.
10. Integrity Independence: Integrity constraints modified at database level should
not enforce modification at application level.
11. Distribution Independence: Distribution of data over various locations should
not be visible to end-users.
12. Non-Subversion Rule: Low level access to data should not be able to bypass
integrity rule to change data.
11. Presented by – Ovais Bin Imtiaz, MFC(P)
An anomaly is an irregularity, or something which deviates from the expected
or normal state. When designing databases, we identify three types of
anomalies: Insert, Update and Delete.
Anomalies in Relational Model
STUDENT
ROLL_NO NAME ADDRESS PHONE AGE
BRANCH
_CODE
1 RAM DELHI 9455123451 18 CS
2 RAMESH GURGAON 9652431543 18 CS
3 SUJIT ROHTAK 9156253131 20 ECE
4 SURESH DELHI 9156243131 18 IT
BRANCH
BRANCH_CO
DE BRANCH_NAME
CS
COMPUTER
SCIENCE
IT
INFORMATION
TECHNOLOGY
ECE
ELECTRONICS
AND
COMMUNICATION
ENGINEERING
CV
CIVIL
ENGINEERING
12. Presented by – Ovais Bin Imtiaz, MFC(P)
Insertion Anomaly in Referencing Relation:
Insertion of a student with BRANCH_CODE ‘ME’ in STUDENT relation will result
in error because ‘ME’ is not present in BRANCH_CODE of BRANCH.
Deletion/ Updation Anomaly in Referenced Relation:
If we try to delete tuple from BRANCH having BRANCH_CODE ‘CS’, it will result
in error because ‘CS’ is referenced by BRANCH_CODE of STUDENT, but if we try
to delete the row from BRANCH with BRANCH_CODE CV, it will be deleted as
the value is not been used by referencing relation. It can be handled by
following method:
ON DELETE CASCADE: It will delete the tuples from REFERENCING RELATION
if value used by REFERENCING ATTRIBUTE is deleted from REFERENCED
RELATION. e.g., if we delete a row from BRANCH with BRANCH_CODE ‘CS’, the
rows in STUDENT relation with BRANCH_CODE CS (ROLL_NO 1 and 2 in this
case) will be deleted.
ON UPDATE CASCADE: It will update the REFERENCING ATTRIBUTE in
REFERENCING RELATION if attribute value used by REFERENCING ATTRIBUTE is
updated in REFERENCED RELATION. e.g., if we update a row from BRANCH with
BRANCH_CODE ‘CS’ to ‘CSE’, the rows in STUDENT relation with BRANCH_CODE
CS (ROLL_NO 1 and 2 in this case) will be updated with BRANCH_CODE ‘CSE’.
13. Presented by – Ovais Bin Imtiaz, MFC(P)
1. Super key :- An attribute that uniquely identifies each row in a
table. E.g. :- customer name and customer id.
2. Candidate key :- A minimal super key. A super key that does not
contain a subset of attributes that is itself a super key. E.g. :-
customer id
3. Primary Key :- A candidate key selected to uniquely identify all
other attribute values in any given row. Cannot contain null
entries
4. Unique Key :- A candidate key selected to uniquely identify all
other attribute values in any given row. Can accept unique or
null values
5. Foreign key :- An attribute in one table whose values must
either match the primary key in another table or be null.
Types of Keys in Relational Model
14. Presented by – Ovais Bin Imtiaz, MFC(P)
Advantages of Relational Model
Structural independence: In relational model, changes in the database
structure do not affect the data access.
Conceptual simplicity: Since the relational data model frees the designer from
the physical data storage details, the designers can concentrate on the logical
view of the database.
Design, implementation, maintenance and usage ease: The relational
database model achieves both data independence and structure
independence making the database design, maintenance, administration and
usage much easier than the other models.
Ad hoc query capability: The query language of the relational database models
structured query language or SQL makes ad hoc queries a reality. Using SQL the
users can specify what information they want and leave the details of how to
get the information to the database.
15. Presented by – Ovais Bin Imtiaz, MFC(P)
Disadvantages of Relational Model
Hardware overheads: For making things easier for the users, the relational
database systems need more powerful hardware computers and data storage
devices. So, the RDBMS needs powerful machines to run smoothly.
Ease of design can lead to bad design: The users need not know the complex
details of physical data storage. They need not know how the data is actually
stored to access it. This ease of design and use can lead to the development
and implementation of very poorly designed database management systems.
'Information island' phenomenon: As we have said before, the relational
database systems are easy to implement and use. This will create a situation
where too many people or departments will create their own databases and
applications.