📘 Introduction

In databases, indexing and hashing are techniques used to improve the speed of data retrieval operations. Without indexes, the database must scan every row to find a match, which is slow for large tables.

B-Tree Index: Used for range and equality queries (e.g., searching roll numbers or CGPAs).

B+ Tree Index: A variation of B-Tree that stores data only in leaf nodes, providing faster sequential access.

Hash Index: Used for exact match lookups (e.g., searching by department name).

Query Optimization ensures that the database uses the most efficient way to execute SQL queries — often by choosing the right index.

Step 1: Create Table CREATE TABLE Students ( roll_no INT PRIMARY KEY, name VARCHAR(50), dept VARCHAR(10), cgpa DECIMAL(3,2) );

Step 2: I…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help