RDBMS Unit-1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 34

Course Objective: To acquire basic conceptual

background necessary to design and develop simple


database system,Relational database mode, ER
model and distributed databases, and to write good
queries using a standard query language called SQL.
Course Outcomes:
After completing this course the student must
demonstrate the knowledge and ability to
CO1: Demonstrate the basic elements of a Relational
Database Management System.

CO2: Design entity relationship and convert entity


relationship diagrams into RDBMS.

CO3: Formulate and execute SQL queries on the


data.

CO4: Discuss recovery systems and be familiar with


data warehousing and mining.

CO5: Recognise and identify the functionality of


DDBMS.
UNIT-1
BASIC CONCEPTS
• Data (numbers, chararacters, audio, video, image)
• Information (tables, pictures, graphs )
• Information systems
• Database
• Database System
• DBMS
Evolution of Database System
File Based System

• 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

101 AAA Hyderabad

102 BBB Chennai

103 CCC Mumbai

104 DDD Bangalore

105 EEE Pune


Benefits of Relational Model

• 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

formal language describing how new


relations are created from old ones
useful tool for describing queries
Operations in Relational Algebra

• Union
• Intersection
• Difference
• Select
• Project
• Product
• Joins
• Divide
• Assignment
Entity Relationship(ER) Model

• It is a high-level data model.


• Represents overall logical structure of the daatbase
• This model is used to define the data elements and
relationship for a specified system.
• It develops a conceptual design for the database.
• It also develops a very simple and easy to design view
of data.
• Pictorial representation of ER Model is called as ER
Diagram
Basic Building units of ER Diagram

• Entity(uniquely identified)
{Entity set}
• Attribute(characteristic of an
entity)
• Relationship
Objects

• attributes and actions


• described by its name, object identifier and life span
• has two components(state and behaviour)
• has following properties
 Abstraction
 Encapsulation
 Information hiding
 Inheritance
 Polymorphism
Mapping Cardinalities

• 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

You might also like