SlideShare a Scribd company logo
* Property of STI
Page 1 of 6
Indexes
F0004
What is an Index?
 An index is a data structure used in
database systems to perform faster
lookup.
 Indexes can greatly improve the
performance of searches on the
indexed column or columns.
 Example:
SELECT companyname
FROM supplier
WHERE supplierid = 'NBS'
1 _________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________ * Property of STI
Page 3 of 6
Indexes
F0004
CREATE INDEX
 The syntax is shown below:
CREATE [UNIQUE] INDEX
<indexname> ON <table
name>(<column list>)
 This syntax creates an index on the
values of the attribute in <column
list> from table <table name>.
 Example:
CREATE UNIQUE INDEX
supplierindex ON
suppliers(supplierid);
3 __________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
* Property of STI
Page 2 of 6
Indexes
F0004
When to Create an Index?
 Factors that can be considered to
determine if you should create an
index are as follows:
 Keys and unique columns
 Frequency of search
 Size of table
 Number of updates
 Space considerations
 Data distribution
2 _________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________ * Property of STI
Page 4 of 6
Indexes
F0004
DROP INDEX
 The syntax is shown below:
DROP INDEX <index name>
 This syntax removes an index
specified by the <index name>.
 Example:
DROP INDEX supplierindex;
4 __________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
* Property of STI
Page 5 of 6
Indexes
F0004
Composite Index
 A composite index is an index that
can contain one, two, or more
columns. The syntax is shown
below:
CREATE [UNIQUE] INDEX
<indexname> ON <table
name>(<column1>,
<column1>, …<columnN>)
 Example:
CREATE INDEX name
ON student (stud_lname,
stud_fname)
5 _________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
* Property of STI
Page 6 of 6
Indexes
F0004
Composite Index
 In creating composite index, the
order of columns should be the
same as the order of the columns
in the table.
 Composite indexes are useful for
searching on all columns in the
index or on the first columns only.
 Example:
CREATE INDEX fname_lname
ON student stud_fname,
stud_lname;
CREATE INDEX lname_fname
ON student stud_lname,
stud_fname;
6 _________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________

More Related Content

PPTX
Inna temple ,india
PDF
01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION
PDF
03 ohp slide handout 1
PPTX
LUGARES IMPORTANTES
PDF
02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES
PDF
07 ohp slides 1 - INDEXES
PPT
Common table expressions
PPT
Review of theory of database
Inna temple ,india
01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION
03 ohp slide handout 1
LUGARES IMPORTANTES
02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES
07 ohp slides 1 - INDEXES
Common table expressions
Review of theory of database

Similar to 07 ohp slide handout 1 - INDEXES (20)

PPTX
Oracle Index
PPTX
Lecture 17 (Week 11) - MYSQL INDEXES.pptx
PDF
MySQL INDEXES
PPTX
Sql server ___________session_17(indexes)
PPTX
Index the obvious and not so obvious
PPTX
Database indexing techniques
PPT
Database management systems for software
PPS
07 qmds2005 session10
PPTX
V25 sql index
PPTX
Database_Indexing_AND ITTS TYPES PRESENTATION
PPTX
presentation is on database for sql and stored procedures
PPTX
Index and types of Index used in Oracle.pptx
PDF
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
PPT
Indexing
ODP
Database index by Reema Gajjar
PPT
Module08
PPT
Module08
PDF
3 indexes
PDF
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
PDF
Introduction to Databases - query optimizations for MySQL
Oracle Index
Lecture 17 (Week 11) - MYSQL INDEXES.pptx
MySQL INDEXES
Sql server ___________session_17(indexes)
Index the obvious and not so obvious
Database indexing techniques
Database management systems for software
07 qmds2005 session10
V25 sql index
Database_Indexing_AND ITTS TYPES PRESENTATION
presentation is on database for sql and stored procedures
Index and types of Index used in Oracle.pptx
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
Indexing
Database index by Reema Gajjar
Module08
Module08
3 indexes
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
Introduction to Databases - query optimizations for MySQL
Ad

More from Anne Lee (20)

PDF
Week 17 slides 1 7 multidimensional, parallel, and distributed database
PDF
Data mining
PDF
Data warehousing
PDF
Database backup and recovery
PDF
Database monitoring and performance management
PDF
transportation and assignment models
PDF
Database Security Slide Handout
PDF
Database Security Handout
PDF
Database Security - IG
PDF
03 laboratory exercise 1 - WORKING WITH CTE
DOCX
Indexes - INSTRUCTOR'S GUIDE
PDF
Wk 16 ses 43 45 makrong kasanayan sa pagsusulat
PDF
Wk 15 ses 40 42 makrong kasanayan sa pagbabasa
PDF
Wk 13 ses 35 37 makrong kasanayan sa pagsasalita
PDF
Wk 12 ses 32 34 makrong kasanayan sa pakikinig
PDF
Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1
PPSX
07 lcd slides 1 - DEADLOCKS POWERPOINT
PPSX
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
PPSX
05 lcd slides 1 - CPU SCHEDULING (Powerpoint)
PDF
05 lcd slide handout 1 - CPU SCHEDULING
Week 17 slides 1 7 multidimensional, parallel, and distributed database
Data mining
Data warehousing
Database backup and recovery
Database monitoring and performance management
transportation and assignment models
Database Security Slide Handout
Database Security Handout
Database Security - IG
03 laboratory exercise 1 - WORKING WITH CTE
Indexes - INSTRUCTOR'S GUIDE
Wk 16 ses 43 45 makrong kasanayan sa pagsusulat
Wk 15 ses 40 42 makrong kasanayan sa pagbabasa
Wk 13 ses 35 37 makrong kasanayan sa pagsasalita
Wk 12 ses 32 34 makrong kasanayan sa pakikinig
Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1
07 lcd slides 1 - DEADLOCKS POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
05 lcd slides 1 - CPU SCHEDULING (Powerpoint)
05 lcd slide handout 1 - CPU SCHEDULING
Ad

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PDF
Nekopoi APK 2025 free lastest update
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPT
Introduction Database Management System for Course Database
PDF
medical staffing services at VALiNTRY
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
System and Network Administration Chapter 2
PPTX
Online Work Permit System for Fast Permit Processing
PDF
System and Network Administraation Chapter 3
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Introduction to Artificial Intelligence
L1 - Introduction to python Backend.pptx
Nekopoi APK 2025 free lastest update
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Which alternative to Crystal Reports is best for small or large businesses.pdf
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Introduction Database Management System for Course Database
medical staffing services at VALiNTRY
ISO 45001 Occupational Health and Safety Management System
2025 Textile ERP Trends: SAP, Odoo & Oracle
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
How to Choose the Right IT Partner for Your Business in Malaysia
System and Network Administration Chapter 2
Online Work Permit System for Fast Permit Processing
System and Network Administraation Chapter 3
Upgrade and Innovation Strategies for SAP ERP Customers
VVF-Customer-Presentation2025-Ver1.9.pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Introduction to Artificial Intelligence

07 ohp slide handout 1 - INDEXES

  • 1. * Property of STI Page 1 of 6 Indexes F0004 What is an Index?  An index is a data structure used in database systems to perform faster lookup.  Indexes can greatly improve the performance of searches on the indexed column or columns.  Example: SELECT companyname FROM supplier WHERE supplierid = 'NBS' 1 _________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ * Property of STI Page 3 of 6 Indexes F0004 CREATE INDEX  The syntax is shown below: CREATE [UNIQUE] INDEX <indexname> ON <table name>(<column list>)  This syntax creates an index on the values of the attribute in <column list> from table <table name>.  Example: CREATE UNIQUE INDEX supplierindex ON suppliers(supplierid); 3 __________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ * Property of STI Page 2 of 6 Indexes F0004 When to Create an Index?  Factors that can be considered to determine if you should create an index are as follows:  Keys and unique columns  Frequency of search  Size of table  Number of updates  Space considerations  Data distribution 2 _________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ * Property of STI Page 4 of 6 Indexes F0004 DROP INDEX  The syntax is shown below: DROP INDEX <index name>  This syntax removes an index specified by the <index name>.  Example: DROP INDEX supplierindex; 4 __________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________
  • 2. * Property of STI Page 5 of 6 Indexes F0004 Composite Index  A composite index is an index that can contain one, two, or more columns. The syntax is shown below: CREATE [UNIQUE] INDEX <indexname> ON <table name>(<column1>, <column1>, …<columnN>)  Example: CREATE INDEX name ON student (stud_lname, stud_fname) 5 _________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ * Property of STI Page 6 of 6 Indexes F0004 Composite Index  In creating composite index, the order of columns should be the same as the order of the columns in the table.  Composite indexes are useful for searching on all columns in the index or on the first columns only.  Example: CREATE INDEX fname_lname ON student stud_fname, stud_lname; CREATE INDEX lname_fname ON student stud_lname, stud_fname; 6 _________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________