RDBMS Unit-1
RDBMS Unit-1
RDBMS Unit-1
• Earlier system
• supported by a conventional operating system
• storage of permanent records on files
• extract and add records
Disadvantages of File Based System
• Data redundancy and inconsistency
• Difficulty in accessing data
• Data isolation
• Concurrent access anamolies
• Security problems
• Integrity problems
• Atomicity problems
DBMS
• Database management system is a software which is
used to manage the database.
• DBMS provides an interface to perform various
operations like database creation, storing data in it,
updating data, creating a table in the database and a lot
more.
• It provides protection and security to the database. In the
case of multiple users, it also maintains data consistency.
Advantages of DBMS over File based system
• program data independence(repository)
• minimal data redundancy
• improved data consistency
• improved data sharing
• enforcement of standards
• improved quality
Architecture of DBMS-2 different views
• Logical or three level architecture (deals with the way
data is stored and presented to users)
• Physical architecture (concerned with software
components that make up a DBMS)
Logical or three level architecture also called as
ANSI/SPARC model
This architecture has three levels:
1. External level
2. Conceptual level
3. Physical level
1. External level
• It is also called view level.
• several users can view their desired data from
this level.
• closest to the user.
• describes the segment of database that is
required.
• hides the rest of the database.
2. Conceptual level
• It is also called logical level or data model.
• The whole design of the database such as relationship
among data, schema of data etc. are described in this
level.
• Database constraints and security are also implemented
in this level of architecture.
• This level is maintained by DBA (database administrator).
• hides the internal details of physical storage.
3. Physical level
• This level is also known as Internal level.
• This level describes how the data is actually stored in the
storage devices.
• This level is also responsible for allocating space to the
data.
• This is the lowest level of the architecture
Need for 3 level architecture
• support multiple user views
• insulation between user programs and data that does not
concern them
Physical DBMS Architecture
The physical architecture defines the software components used to process and enter data,
and how these software components are related and interconnected.
Based on various functions the database system is
partitioned into the following modules:
• DML Pre-compiler
• DDL compiler
• File manager
• Database manager
• Query processor
• DBA
• Data files indices and Data Dictionary
DBA Functions & Role
• Schema Definition
• Data Definition
• Data Manipulation
• Granting authorization for data access
• Routine maintenance
• Security
• Backup and Recovery
• Performance Evaluation
• Integrity checking
Database types: classified according to
1. Number of users
• Single user
• Multi user(work group & enterprise)
2. Location
• Centralised
• Distributed
3. Usage
• Operational
• Data Warehouse
Relational Model
• collection of tables
• represents data and relationships
• has multiple columns
• each column has unique name
• two dimensional table containing rows and columns
CUSTOMER TABLE
Customer no. Customer name Customer Address
• ease of use
• flexibility
• accuracy
Relational Terms
Tuple
Attribute
Domain
Relation
A relation is subject to the folowing rules:
• two dimensional
• attribute
• unique name
• homogeneous
• record
Relational Keys
• Key
• Simple key
• Super key
• Composite key
• Candidate key
Properties of Candidate key
unique
cannot be null
minimal set of attributes
more tha one candidate key
• Primary key
• Foreign key
• Alternate key
• Null value
Relational Constraints
1. Domain constraint
Not null
Default
Check
2. Key constraint
Primary key
Unique key
3. Integrity constraint
Entity integrity
Referential integrity
Operations performed on relations
• Insertion
• Deletion
• Update
Relational Algebra
• Union
• Intersection
• Difference
• Select
• Project
• Product
• Joins
• Divide
• Assignment
Entity Relationship(ER) Model
• Entity(uniquely identified)
{Entity set}
• Attribute(characteristic of an
entity)
• Relationship
Objects
• One-to-one
• One-to-many
• Many-to -one
• Many-to -many
Types of Entities
1.Weak entity(double rectangle box)
2.Strong Entity
Types of Attributes
• Simple
• Composite
• Multi-values(Double ellipse)
• Derived(Dashed ellipse)
Relationship and Degree of Relationship
• Unary(one)
• Binary(two)
• Ternary(three)
• n-ary(four or more)
Features of ER model
• Generalisation
• Specialisation
• Aggregation