Skip to content

Commit c1cee82

Browse files
committed
Indexes
1 parent 32e8be5 commit c1cee82

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mysql-queries.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,14 @@ A view is a virtual table that is a result of a query. They can be extremely use
8989
|Sl.No|Query | Description |
9090
|-----|-----------------|---------------------------------------------------|
9191
| 01. |CREATE VIEW view1 AS SELECT c1, c2 FROM t1 WHERE condition|Create a view, comprising of columns c1 and c2 from a table named t1 where a certain condition has been met.|
92+
93+
94+
#### Indexes
95+
96+
An index is used to speed up the performance of queries by reducing the number of database pages that have to be visited:
97+
98+
|Sl.No|Query | Description |
99+
|-----|------------------------------------|---------------------------------------------------|
100+
| 01. |CREATE INDEX index_nameON t(c1, c2) |Create an index on columns c1 and c2 of the table t |
101+
| 02. |CREATE UNIQUE INDEX index_name ON t(c3, c4) |Create a unique index on columns c3 and c4 of the table t |
102+
| 03. |DROP INDEX index_name |Drop an index |

0 commit comments

Comments
 (0)