×
Push yourself because, no one else is going to do it for you.
--Your friends at LectureNotes
Close

Index syntax

  • Database Management System - DBMS
  • Other
  • 3 Views
  • Uploaded 4 months ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

CREATE INDEX Syntax Creates an index on a table. Duplicate values are allowed: CREATE INDEX index_name ON table_name (column_name) Creates a unique index on a table. Duplicate values are not allowed: CREATE UNIQUE INDEX index_name ON table_name (column_name) Database System Concepts - 5th Edition, Oct 5, 2006 7.1 ©Silberschatz, Korth and Sudarshan

Text from page-2

CREATE INDEX Example The SQL statement below creates an index named "PIndex" on the "LastName" column in the "Persons" table: CREATE INDEX Pindex ON Persons (LastName) CREATE INDEX Example The SQL statement below creates an index named "PIndex" on the "LastName" column in the "Persons" table: CREATE INDEX Pindex ON Persons (LastName) Database System Concepts - 5th Edition, Oct 5, 2006 7.2 ©Silberschatz, Korth and Sudarshan

Text from page-3

List All indexes on Table: ▪ SHOW INDEX FROM mytable FROM mydb; ▪ SHOW INDEX FROM mydb.mytable; DROP INDEX Syntax for MySQL: ALTER TABLE table_name DROP INDEX index_name Database System Concepts - 5th Edition, Oct 5, 2006 7.3 ©Silberschatz, Korth and Sudarshan

Text from page-4

Synonym for table Create synonym new_name for old_name Database System Concepts - 5th Edition, Oct 5, 2006 7.4 ©Silberschatz, Korth and Sudarshan

Lecture Notes