SlideShare a Scribd company logo
File Structures(Part 2)
BY:SURBHI SAROHA
Syllabus
• Secondary key Retrieval:
• Inverted and multiuser files
• Indexing Using Tree Structures:
• B-trees
• B+trees
Secondary key Retrieval
• Secondary Key is the key that has not been selected to be the primary key.
However, it is considered a candidate key for the primary key.
• Therefore, a candidate key not selected as a primary key is called secondary
key.
• Candidate key is an attribute or set of attributes that you can consider as a
Primary key.
• Note: Secondary Key is not a Foreign Key.
Example
Student_ID Student_Enr
oll
Student_Na
me
Student_Age Student_
Email
096 9122717 Manish 25 aaa@gmai
l.com
055 9122655 Manan 23 abc@gmai
l.com
067 9122699 Shreyas 28 pqr@gmai
l.com
Example
Let us see an example −
Cont….
• Above, Student_ID, Student_Enroll and Student_Email are the candidate keys.
• They are considered candidate keys since they can uniquely identify the student
record.
• Select any one of the candidate key as the primary key. Rest of the two keys would
be Secondary Key.
• Let’s say you selected Student_ID as primary key,
therefore Student_Enroll and Student_Email will be Secondary Key (candidates
of primary key).
Inverted and multiuser files
• A database consist of a huge amount of data. The data is grouped within a table in RDBMS,
and each table have related records. A user can see that the data is stored in form of tables,
but in acutal this huge amount of data is stored in physical memory in form of files.
• File – A file is named collection of related information that is recorded on secondary
storage such as magnetic disks, magnetic tables and optical disks.
• What is File Organization?
File Organization refers to the logical relationships among various records that constitute
the file, particularly with respect to the means of identification and access to any specific
record. In simple terms, Storing the files in certain order is called file Organization. File
Structure refers to the format of the label and data blocks and of any logical control
record.
Cont….
• Types of File Organizations –
• Various methods have been introduced to Organize files. These particular methods have
advantages and disadvantages on the basis of access or selection . Thus it is all upon the
programmer to decide the best suited file Organization method according to his requirements.
Some types of File Organizations are :
• Sequential File Organization
• Heap File Organization
• Hash File Organization
• B+ Tree File Organization
• Clustered File Organization
Indexing Using Tree Structures:
• B-trees
• B-Tree is a self-balancing search tree. In most of the other self-balancing search trees
(like AVL and Red-Black Trees), it is assumed that everything is in main memory. To understand
the use of B-Trees, we must think of the huge amount of data that cannot fit in main memory.
When the number of keys is high, the data is read from disk in the form of blocks. Disk access
time is very high compared to the main memory access time. The main idea of using B-Trees is
to reduce the number of disk accesses. Most of the tree operations (search, insert, delete, max,
min, ..etc ) require O(h) disk accesses where h is the height of the tree. B-tree is a fat tree. The
height of B-Trees is kept low by putting maximum possible keys in a B-Tree node. Generally, the
B-Tree node size is kept equal to the disk block size. Since the height of the B-tree is low so total
disk accesses for most of the operations are reduced significantly compared to balanced Binary
Search Trees like AVL Tree, Red-Black Tree, ..etc.
Time Complexity of B-Tree:
• Sr. No. Algorithm Time Complexity
• 1. Search O(log n)
• 2. Insert O(log n)
• 3. Delete O(log n)
Properties of B-Tree:
• All leaves are at the same level.
• A B-Tree is defined by the term minimum degree ‘t’. The value of t depends upon disk block size.
• Every node except root must contain at least (ceiling)([t-1]/2) keys. The root may contain minimum 1 key.
• All nodes (including root) may contain at most t – 1 keys.
• Number of children of a node is equal to the number of keys in it plus 1.
• All keys of a node are sorted in increasing order. The child between two keys k1 and k2 contains all keys in
the range from k1 and k2.
• B-Tree grows and shrinks from the root which is unlike Binary Search Tree. Binary Search Trees grow
downward and also shrink from downward.
• Like other balanced Binary Search Trees, time complexity to search, insert and delete is O(log n).
B+trees
• The B+ tree is a balanced binary search tree. It follows a multi-level index
format.
• In the B+ tree, leaf nodes denote actual data pointers. B+ tree ensures that
all leaf nodes remain at the same height.
• In the B+ tree, the leaf nodes are linked using a link list. Therefore, a B+
tree can support random access as well as sequential access.
Structure of B+ Tree
• In the B+ tree, every leaf node is at equal distance from the root node. The
B+ tree is of the order n where n is fixed for every B+ tree.
• It contains an internal node and leaf node.
Cont…
Internal node
• An internal node of the B+ tree can contain at least n/2 record pointers except the root
node.
• At most, an internal node of the tree contains n pointers.
• Leaf node
• The leaf node of the B+ tree can contain at least n/2 record pointers and n/2 key values.
• At most, a leaf node contains n record pointer and n key values.
• Every leaf node of the B+ tree contains one block pointer P to point to next leaf node.
•
Thank you

More Related Content

What's hot (20)

PPTX
Dbms database models
sanjeev kumar suman
 
PPT
Data models
Usman Tariq
 
PPT
File organization 1
Rupali Rana
 
PPTX
Database user and administrator.pptx
Anusha sivakumar
 
PPT
File organisation
Mukund Trivedi
 
PPT
Advanced Database Management System_Introduction Slide.ppt
BikalAdhikari4
 
PPTX
DBMS
SHIKHA GAUTAM
 
PPT
File organisation
Samuel Igbanogu
 
PPTX
Segmentation in operating systems
Dr. Jasmine Beulah Gnanadurai
 
PDF
10 File System
Dr. Loganathan R
 
PPTX
1.4 data independence
BHARATH KUMAR
 
PPTX
Distributed DBMS - Unit 3 - Distributed DBMS Architecture
Gyanmanjari Institute Of Technology
 
PPTX
Directory structure
sangrampatil81
 
PPTX
Database architecture
VENNILAV6
 
PPTX
Disk structure
sangrampatil81
 
PPT
Week 3 Classification of Database Management Systems & Data Modeling
oudesign
 
PPT
Database administration and security
Dhani Ahmad
 
PPT
File organization and indexing
raveena sharma
 
PPTX
Components and Advantages of DBMS
Shubham Joon
 
PDF
Users of dbms
Preet Hanspal
 
Dbms database models
sanjeev kumar suman
 
Data models
Usman Tariq
 
File organization 1
Rupali Rana
 
Database user and administrator.pptx
Anusha sivakumar
 
File organisation
Mukund Trivedi
 
Advanced Database Management System_Introduction Slide.ppt
BikalAdhikari4
 
File organisation
Samuel Igbanogu
 
Segmentation in operating systems
Dr. Jasmine Beulah Gnanadurai
 
10 File System
Dr. Loganathan R
 
1.4 data independence
BHARATH KUMAR
 
Distributed DBMS - Unit 3 - Distributed DBMS Architecture
Gyanmanjari Institute Of Technology
 
Directory structure
sangrampatil81
 
Database architecture
VENNILAV6
 
Disk structure
sangrampatil81
 
Week 3 Classification of Database Management Systems & Data Modeling
oudesign
 
Database administration and security
Dhani Ahmad
 
File organization and indexing
raveena sharma
 
Components and Advantages of DBMS
Shubham Joon
 
Users of dbms
Preet Hanspal
 

Similar to File Structures(Part 2) (20)

PPTX
B+ tree
ramya marichamy
 
PDF
DOC-20240804-WA0006..pdforaclesqlindexing
storage2ndyr
 
PDF
DOC-20240804-WA0006..pdforaclesqlindexing
storage2ndyr
 
PPTX
BPlus_Tree_Presentation_for_DBMS_Indexing.pptx
fakeid17861
 
PPTX
chapter 6.1.pptx
Tekle12
 
PPT
Tree-structured indexes lectures for student.ppt
abduganiyevbekzod011
 
PPT
Indexing and Hashing
sathish sak
 
PPTX
Tree Introduction.pptx
RahulAI
 
PPT
9910559 jjjgjgjfs lke lwmerfml lew we.ppt
abduganiyevbekzod011
 
PPTX
Database Management System-Module-IV(part-1).pptx
AiswaryaMohan31
 
PDF
B Trees and B+ Trees Data structures in Computer Sciences
Tanmay Kataria
 
PPTX
DATA-STRUCTURES.pptx
RuchiNagar3
 
PPTX
B+tree Data structures presentation
Muhammad Bilal Khan
 
PPTX
File Organization in database management.pptx
ubaidullah75790
 
PDF
A41001011
ijceronline
 
PPT
Mba admission in india
Edhole.com
 
PPTX
Data structures
MADHAVASAIYENDUVA
 
PPTX
BASIC TREE AND TYPES OF DI CONCEPTS.pptx
tpvvsreenivasarao
 
PDF
INTRODUCTION TO DATA STRUCTURES AND ALGORITHMS
workspaceabhishekmah
 
PDF
INTRODUCTION TO DATA STRUCTURES AND ALGORITHM
workspaceabhishekmah
 
DOC-20240804-WA0006..pdforaclesqlindexing
storage2ndyr
 
DOC-20240804-WA0006..pdforaclesqlindexing
storage2ndyr
 
BPlus_Tree_Presentation_for_DBMS_Indexing.pptx
fakeid17861
 
chapter 6.1.pptx
Tekle12
 
Tree-structured indexes lectures for student.ppt
abduganiyevbekzod011
 
Indexing and Hashing
sathish sak
 
Tree Introduction.pptx
RahulAI
 
9910559 jjjgjgjfs lke lwmerfml lew we.ppt
abduganiyevbekzod011
 
Database Management System-Module-IV(part-1).pptx
AiswaryaMohan31
 
B Trees and B+ Trees Data structures in Computer Sciences
Tanmay Kataria
 
DATA-STRUCTURES.pptx
RuchiNagar3
 
B+tree Data structures presentation
Muhammad Bilal Khan
 
File Organization in database management.pptx
ubaidullah75790
 
A41001011
ijceronline
 
Mba admission in india
Edhole.com
 
Data structures
MADHAVASAIYENDUVA
 
BASIC TREE AND TYPES OF DI CONCEPTS.pptx
tpvvsreenivasarao
 
INTRODUCTION TO DATA STRUCTURES AND ALGORITHMS
workspaceabhishekmah
 
INTRODUCTION TO DATA STRUCTURES AND ALGORITHM
workspaceabhishekmah
 
Ad

More from Dr. SURBHI SAROHA (20)

PPTX
Deep learning(UNIT 3) BY Ms SURBHI SAROHA
Dr. SURBHI SAROHA
 
PPTX
MOBILE COMPUTING UNIT 2 by surbhi saroha
Dr. SURBHI SAROHA
 
PPTX
Mobile Computing UNIT 1 by surbhi saroha
Dr. SURBHI SAROHA
 
PPTX
DEEP LEARNING (UNIT 2 ) by surbhi saroha
Dr. SURBHI SAROHA
 
PPTX
Introduction to Deep Leaning(UNIT 1).pptx
Dr. SURBHI SAROHA
 
PPTX
Cloud Computing (Infrastructure as a Service)UNIT 2
Dr. SURBHI SAROHA
 
PPTX
Management Information System(Unit 2).pptx
Dr. SURBHI SAROHA
 
PPTX
Searching in Data Structure(Linear search and Binary search)
Dr. SURBHI SAROHA
 
PPTX
Management Information System(UNIT 1).pptx
Dr. SURBHI SAROHA
 
PPTX
Introduction to Cloud Computing(UNIT 1).pptx
Dr. SURBHI SAROHA
 
PPTX
JAVA (UNIT 5)
Dr. SURBHI SAROHA
 
PPTX
DBMS (UNIT 5)
Dr. SURBHI SAROHA
 
PPTX
DBMS UNIT 4
Dr. SURBHI SAROHA
 
PPTX
JAVA(UNIT 4)
Dr. SURBHI SAROHA
 
PPTX
OOPs & C++(UNIT 5)
Dr. SURBHI SAROHA
 
PPTX
OOPS & C++(UNIT 4)
Dr. SURBHI SAROHA
 
PPTX
DBMS UNIT 3
Dr. SURBHI SAROHA
 
PPTX
JAVA (UNIT 3)
Dr. SURBHI SAROHA
 
PPTX
Keys in dbms(UNIT 2)
Dr. SURBHI SAROHA
 
PPTX
DBMS (UNIT 2)
Dr. SURBHI SAROHA
 
Deep learning(UNIT 3) BY Ms SURBHI SAROHA
Dr. SURBHI SAROHA
 
MOBILE COMPUTING UNIT 2 by surbhi saroha
Dr. SURBHI SAROHA
 
Mobile Computing UNIT 1 by surbhi saroha
Dr. SURBHI SAROHA
 
DEEP LEARNING (UNIT 2 ) by surbhi saroha
Dr. SURBHI SAROHA
 
Introduction to Deep Leaning(UNIT 1).pptx
Dr. SURBHI SAROHA
 
Cloud Computing (Infrastructure as a Service)UNIT 2
Dr. SURBHI SAROHA
 
Management Information System(Unit 2).pptx
Dr. SURBHI SAROHA
 
Searching in Data Structure(Linear search and Binary search)
Dr. SURBHI SAROHA
 
Management Information System(UNIT 1).pptx
Dr. SURBHI SAROHA
 
Introduction to Cloud Computing(UNIT 1).pptx
Dr. SURBHI SAROHA
 
JAVA (UNIT 5)
Dr. SURBHI SAROHA
 
DBMS (UNIT 5)
Dr. SURBHI SAROHA
 
DBMS UNIT 4
Dr. SURBHI SAROHA
 
JAVA(UNIT 4)
Dr. SURBHI SAROHA
 
OOPs & C++(UNIT 5)
Dr. SURBHI SAROHA
 
OOPS & C++(UNIT 4)
Dr. SURBHI SAROHA
 
DBMS UNIT 3
Dr. SURBHI SAROHA
 
JAVA (UNIT 3)
Dr. SURBHI SAROHA
 
Keys in dbms(UNIT 2)
Dr. SURBHI SAROHA
 
DBMS (UNIT 2)
Dr. SURBHI SAROHA
 
Ad

Recently uploaded (20)

PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PDF
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
PPTX
K-Circle-Weekly-Quiz12121212-May2025.pptx
Pankaj Rodey
 
PPTX
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
PPTX
Translation_ Definition, Scope & Historical Development.pptx
DhatriParmar
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Applied-Statistics-1.pptx hardiba zalaaa
hardizala899
 
PDF
Tips for Writing the Research Title with Examples
Thelma Villaflores
 
PPTX
YSPH VMOC Special Report - Measles Outbreak Southwest US 7-20-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
PDF
EXCRETION-STRUCTURE OF NEPHRON,URINE FORMATION
raviralanaresh2
 
PPTX
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
PPTX
Cybersecurity: How to Protect your Digital World from Hackers
vaidikpanda4
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
The Future of Artificial Intelligence Opportunities and Risks Ahead
vaghelajayendra784
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
K-Circle-Weekly-Quiz12121212-May2025.pptx
Pankaj Rodey
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
Translation_ Definition, Scope & Historical Development.pptx
DhatriParmar
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Applied-Statistics-1.pptx hardiba zalaaa
hardizala899
 
Tips for Writing the Research Title with Examples
Thelma Villaflores
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 7-20-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
EXCRETION-STRUCTURE OF NEPHRON,URINE FORMATION
raviralanaresh2
 
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
Cybersecurity: How to Protect your Digital World from Hackers
vaidikpanda4
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
The Future of Artificial Intelligence Opportunities and Risks Ahead
vaghelajayendra784
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 

File Structures(Part 2)

  • 2. Syllabus • Secondary key Retrieval: • Inverted and multiuser files • Indexing Using Tree Structures: • B-trees • B+trees
  • 3. Secondary key Retrieval • Secondary Key is the key that has not been selected to be the primary key. However, it is considered a candidate key for the primary key. • Therefore, a candidate key not selected as a primary key is called secondary key. • Candidate key is an attribute or set of attributes that you can consider as a Primary key. • Note: Secondary Key is not a Foreign Key.
  • 4. Example Student_ID Student_Enr oll Student_Na me Student_Age Student_ Email 096 9122717 Manish 25 aaa@gmai l.com 055 9122655 Manan 23 abc@gmai l.com 067 9122699 Shreyas 28 pqr@gmai l.com Example Let us see an example −
  • 5. Cont…. • Above, Student_ID, Student_Enroll and Student_Email are the candidate keys. • They are considered candidate keys since they can uniquely identify the student record. • Select any one of the candidate key as the primary key. Rest of the two keys would be Secondary Key. • Let’s say you selected Student_ID as primary key, therefore Student_Enroll and Student_Email will be Secondary Key (candidates of primary key).
  • 6. Inverted and multiuser files • A database consist of a huge amount of data. The data is grouped within a table in RDBMS, and each table have related records. A user can see that the data is stored in form of tables, but in acutal this huge amount of data is stored in physical memory in form of files. • File – A file is named collection of related information that is recorded on secondary storage such as magnetic disks, magnetic tables and optical disks. • What is File Organization? File Organization refers to the logical relationships among various records that constitute the file, particularly with respect to the means of identification and access to any specific record. In simple terms, Storing the files in certain order is called file Organization. File Structure refers to the format of the label and data blocks and of any logical control record.
  • 7. Cont…. • Types of File Organizations – • Various methods have been introduced to Organize files. These particular methods have advantages and disadvantages on the basis of access or selection . Thus it is all upon the programmer to decide the best suited file Organization method according to his requirements. Some types of File Organizations are : • Sequential File Organization • Heap File Organization • Hash File Organization • B+ Tree File Organization • Clustered File Organization
  • 8. Indexing Using Tree Structures: • B-trees • B-Tree is a self-balancing search tree. In most of the other self-balancing search trees (like AVL and Red-Black Trees), it is assumed that everything is in main memory. To understand the use of B-Trees, we must think of the huge amount of data that cannot fit in main memory. When the number of keys is high, the data is read from disk in the form of blocks. Disk access time is very high compared to the main memory access time. The main idea of using B-Trees is to reduce the number of disk accesses. Most of the tree operations (search, insert, delete, max, min, ..etc ) require O(h) disk accesses where h is the height of the tree. B-tree is a fat tree. The height of B-Trees is kept low by putting maximum possible keys in a B-Tree node. Generally, the B-Tree node size is kept equal to the disk block size. Since the height of the B-tree is low so total disk accesses for most of the operations are reduced significantly compared to balanced Binary Search Trees like AVL Tree, Red-Black Tree, ..etc.
  • 9. Time Complexity of B-Tree: • Sr. No. Algorithm Time Complexity • 1. Search O(log n) • 2. Insert O(log n) • 3. Delete O(log n)
  • 10. Properties of B-Tree: • All leaves are at the same level. • A B-Tree is defined by the term minimum degree ‘t’. The value of t depends upon disk block size. • Every node except root must contain at least (ceiling)([t-1]/2) keys. The root may contain minimum 1 key. • All nodes (including root) may contain at most t – 1 keys. • Number of children of a node is equal to the number of keys in it plus 1. • All keys of a node are sorted in increasing order. The child between two keys k1 and k2 contains all keys in the range from k1 and k2. • B-Tree grows and shrinks from the root which is unlike Binary Search Tree. Binary Search Trees grow downward and also shrink from downward. • Like other balanced Binary Search Trees, time complexity to search, insert and delete is O(log n).
  • 11. B+trees • The B+ tree is a balanced binary search tree. It follows a multi-level index format. • In the B+ tree, leaf nodes denote actual data pointers. B+ tree ensures that all leaf nodes remain at the same height. • In the B+ tree, the leaf nodes are linked using a link list. Therefore, a B+ tree can support random access as well as sequential access.
  • 12. Structure of B+ Tree • In the B+ tree, every leaf node is at equal distance from the root node. The B+ tree is of the order n where n is fixed for every B+ tree. • It contains an internal node and leaf node.
  • 14. Internal node • An internal node of the B+ tree can contain at least n/2 record pointers except the root node. • At most, an internal node of the tree contains n pointers. • Leaf node • The leaf node of the B+ tree can contain at least n/2 record pointers and n/2 key values. • At most, a leaf node contains n record pointer and n key values. • Every leaf node of the B+ tree contains one block pointer P to point to next leaf node. •