Professional Documents
Culture Documents
G11-DBMS-11
G11-DBMS-11
A database is a collection of
interrelated data that is typically
stored in a computer system.
Database Management System
(DBMS)
STUDENT
Users/Programmers
Application Programs/Queries
Isolation Atomicity
• A property that defines how or when the • A property which ensures that the
changes made by one operation become transaction is either fully completed or
visible to others. none at all.
DATABASE USERS
• Controlling Redundancy
• Restricting Unauthorized Access
• Providing Persistent Storage for Program Objects
• Providing Storage Structures for Efficient Query Processing
• Providing Backup and Recovery
• Providing Multiple User Interfaces
• Representing Complete Relationships among Data
• Enforcing Integrity Constraints
• Permitting Inferencing and Actions using Rules
DATA MODEL
Categories:
➢ High-level or conceptual data models
➢ Representational or implementation data models
➢ Low-level data models
DATABASE SCHEMA
DEFINITION:
• Description of a database
• Plan or layout or blueprint of the database
• Subset of Metadata
3 LEVELS:
• Internal Level
• Conceptual Level
• External Level
DATA INDEPENDENCE:
➢ Logical Data Independence
➢ Physical Data Independence
DATABASE LANGUAGES
DDL DML
The journey from big mainframe to pc has also evolved the database and its
architecture.
• Classification:
❑ Client-Server Architecture
❑ Distributed Databases
1.Centralized DBMS Architecture
❑ Traditional form, all data, functionality, apps are located on one machine
2.Client-Server Architecture
❑Client interacts server when additional functionality doesn't exits in its own machine.
3.Distributed Database Architecture
❑This model is used to define the data elements and relationship for a specified system.
❑lt develops a conceptual design for the database. It also develops a very simple and easy to
design view of data.
EXAMPLE- Student
id age
Component of ER Diagram -
ER Model
Department
Employee Works for D
➢Weak Entity-
❑An entity that depends on another entity called a weak entity.
❑The weak entity doesn't contain any key attribute of its own. Loan installment
❑For example - id, age, contact number, name, etc. can be attributes of a student.
id Phone_n
o
Student
name age
➢Key Attribute-
❑The key attribute is used to represent the main characteristics of an entity.
❑The key attribute is represented by an oval shape with the text underlined.
Phone_n
id
o
Student
name age
➢Composite Attribute- Name
Multivalued Attribute-
❑An attribute can have more than one value.
Birth date
Name
Student
Age
Roll_no
➢ Relationship-
❑ A relationship is used to describe the relation between
entities.
❑ There are two types one is strong relation and second is weak
relation.
▪When only one instance of an entity is associated with the relationship, then it is
known as one to one relationship.
▪For example, A female can marry to one male and a male can marry to one female.
2.0ne-to-many relationship
❑When only one instance of the entity on the left, and more than one instance of an entity on
the right associates with the relationship then this is known as a one-to-many relationship.
❑For example, Scientist can invent many inventions, but the invention is done by the only
specific scientist.
3.Many-to-one relationship
❑When more than one instance of the entity on the left and only one instance
of an entity on the right associates with the relationship then it is known as a
many-to-one relationship.
❑For example, Student enrolls for only one course, but a course can have many
students.
4.Many-to-many relationship
❑When more than one instance of the entity on the left and more than one instance
of an entity on the right associates with the relationship then it is known as a many-
to-many relationship.
❑For example, Employee can assign by many projects and project can have many
employees.
Introduction to Relational
Database Model?
➢RELATIONAL MODEL
The most popular data model in DBMS is the Relational Model. It is more
scientific a model than others.
1101 Riyan 21 10 A
1102 Nabil 22 9 A
1103 Mehedi 20 11 B
1104 Zihad 23 8 B
1105 Arman 19 12 A
tuple
Table (relation)
Properties of Relational Tables:
❑Values Are Atomic Each Row is Unique.
• Oracle • MongoDB
• Microsoft SQL Server • SQLite
• MySQL • Firebase
• DB2 • MariaBD
• PostgreSQL • Couchbase
SQL (STRUCTURED QUERY LANGUAGE)
2 Robert Britt 18 UK
3 Betty Doe 12 UK
age country
SELECT age, country
FROM CUSTOMERS; 25 USA
WHERE country=‘USA’; 55 USA
Introduction to RDBMS
OPERATORS
Intersection
Division Selection
RDBMS
Cartesian Projection
OPERATORS
Difference Join
Union
UNION
NAME AMMOUNT
Atasi 15000
Apshora 2500
Intersection
Nabil 500
Nabil 500
Atasi 15000
Apshora 2500
Nabil 500
Selection
St_03 85000
St_03 Rysa
St_04 80000
St_04 Fariha
St_06 10000
St_06 Mou tusi
St_04 Fariha
R
STUDENT ID NAME
St_01 Nafisa
R=P-Q St_04 Fariha
St_05 Mou tusi
Cartesian
P Q
A 1 A 10
B 2 B 20
C 3
R
A 1 A 10
A 1 B 20
B 2 A 10
B 2 B 20
R=P*Q C 3 A 10
C 3 B 20
Division
P
A B
A1 B1 Q
B
A1 B2
A2 B1 B1
A3 B1
A4 B2
A5 B1
A5 B2
R
A
A1
R=P/Q
A2
A3
A5
THANK YOU