0% found this document useful (0 votes)
52 views

SQL Create Index Statement

The SQL CREATE INDEX statement is used to create indexes in database tables. Indexes allow data to be found more quickly without reading the entire table. The CREATE INDEX syntax can be used to create regular indexes or unique indexes that do not allow duplicate values. Indexes are created on specific columns to speed up searches and queries on those columns.

Uploaded by

mateigeorgescu80
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

SQL Create Index Statement

The SQL CREATE INDEX statement is used to create indexes in database tables. Indexes allow data to be found more quickly without reading the entire table. The CREATE INDEX syntax can be used to create regular indexes or unique indexes that do not allow duplicate values. Indexes are created on specific columns to speed up searches and queries on those columns.

Uploaded by

mateigeorgescu80
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL CREATE INDEX Statement

http://www.w3schools.com/sql/sql_create_index.asp

THE WORLD'S LARGEST WEB DEVELOPER SITE

SQL CREATE INDEX Statement


Previous

Next Chapter

The CREATE INDEX statement is used to create indexes in tables.


Indexes allow the database application to find data fast; without reading the whole table.

Indexes
An index can be created in a table to find data more quickly and efficiently.
The users cannot see the indexes, they are just used to speed up searches/queries.
Note: Updating a table with indexes takes more time than updating a table without (because the indexes also need an update). So you should only create indexes on columns (and tables) that will
be frequently searched against.

SQL CREATE INDEX Syntax


Creates an index on a table. Duplicate values are allowed:

CREATE INDEX index_name


ON table_name (column_name)

SQL CREATE UNIQUE INDEX Syntax

W3SCHOOLS EXAMS
HTML, CSS, JavaScript, PHP, jQuery, Bootstrap and
XML Certifications

Creates a unique index on a table. Duplicate values are not allowed:

CREATE UNIQUE INDEX index_name


ON table_name (column_name)

COLOR PICKER

Note: The syntax for creating indexes varies amongst different databases. Therefore: Check the syntax for creating indexes in your database.

CREATE INDEX Example

LEARN MORE:

The SQL statement below creates an index named "PIndex" on the "LastName" column in the "Persons" table:

Color Converter
Google Maps
Animated Buttons
Modal Boxes
Modal Images

CREATE INDEX PIndex


ON Persons (LastName)

Tooltips
Loaders

If you want to create an index on a combination of columns, you can list the column names within the parentheses, separated by commas:

JS Animations
Progress Bars
Dropdowns

CREATE INDEX PIndex


ON Persons (LastName, FirstName)

Slideshow
Side Navigation

Previous

Next Chapter

HTML Includes
Color Palettes

SHARE THIS PAGE

1 of 2

4/12/2016 4:28 PM

SQL CREATE INDEX Statement

HTML

http://www.w3schools.com/sql/sql_create_index.asp

CSS

JAVASCRIPT

SQL

PHP

BOOTSTRAP

JQUERY

ANGULAR

XML

TUTORIALS

REFERENCES

EXAMPLES

FORUM

SQL Tutorial
SQL HOME
SQL Intro
SQL Syntax
SQL Select
SQL Distinct

REPORT ERROR
PRINT PAGE
FORUM
ABOUT

SQL Where
SQL And & Or
SQL Order By
SQL Insert Into
SQL Update
SQL Delete
SQL Injection
SQL Select Top
SQL Like
SQL Wildcards

Top 10 Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
SQL Tutorial
PHP Tutorial
jQuery Tutorial
Angular Tutorial
XML Tutorial

SQL In
SQL Between
SQL Aliases
SQL Joins
SQL Inner Join
SQL Left Join
SQL Right Join
SQL Full Join
SQL Union

Top 10 References
HTML Reference
CSS Reference
JavaScript Reference
W3.CSS Reference
Browser Statistics
PHP Reference
HTML Colors
HTML Character Sets
jQuery Reference
AngularJS Reference

SQL Select Into


SQL Insert Into Select
SQL Create DB
SQL Create Table
SQL Constraints
SQL Not Null
SQL Unique
SQL Primary Key
SQL Foreign Key

Top 10 Examples
HTML Examples
CSS Examples
JavaScript Examples
W3.CSS Examples
HTML DOM Examples
PHP Examples
jQuery Examples
ASP Examples
XML Examples
SVG Examples

SQL Check
SQL Default
SQL Create Index
SQL Drop
SQL Alter
SQL Auto Increment

Web Certificates
HTML Certificate
HTML5 Certificate
CSS Certificate
JavaScript Certificate
jQuery Certificate

SQL Views

PHP Certificate
Bootstrap Certificate

SQL Dates

XML Certificate

SQL Null Values


SQL Null Functions
SQL Data Types
SQL DB Data Types

SQL Functions
SQL Functions
SQL Avg()
SQL Count()
SQL First()
SQL Last()
SQL Max()
SQL Min()
SQL Sum()
2 of 2

4/12/2016 4:28 PM

You might also like