- SQL - Discussion
- SQL - Useful Resources
- SQL - Useful Functions
- SQL - Quick Guide
- SQL - Questions and Answers
- SQL - Datatype Functions
- SQL - Conversion Functions
- SQL - JSON Functions
- SQL - Cursor Functions
- SQL - Logical Functions
- SQL - Statistical Functions
- SQL - Text & Image Functions
- SQL - Numeric Functions
- SQL - Aggregate Functions
- SQL - String Functions
- SQL - Date Functions
- SQL - Database Tuning
- SQL - IN vs EXISTS
- SQL - Group By vs Order By
- SQL - Common Table Expression
- SQL - Cursors
- SQL - Date & Time
- SQL - Auto Increment
- SQL - Using Sequences
- SQL - Handling Duplicates
- SQL - Sub Queries
- SQL - Transactions
- SQL - NULL Values
- SQL - Stored Procedures
- SQL - Default Constraint
- SQL - Check Constraint
- SQL - Null Functions
- SQL - Min & Max
- SQL - Hosting
- SQL - Injection
- SQL - Comments
- SQL - Wildcards
- SQL - Non-Clustered Index
- SQL - Clustered Index
- SQL - Unique Index
- SQL - Primary Key
- - 工会诉Join
- SQL - Inner Join
- SQL - Using Joins
- SQL - Aliases
- SQL - EXCEPT Operator
- SQL - INTERSECT Operator
- SQL - UNION vs UNION ALL
- SQL - UNION Operator
- SQL - BETWEEN Operator
- SQL - NOT NULL
- SQL - IS NOT NULL
- SQL - IS NULL
- SQL - NOT EQUAL
- SQL - NOT Operator
- SQL - CASE
- SQL - EXISTS Operator
- SQL - ANY, ALL Operators
- SQL - IN Operator
- SQL - LIKE Operator
- SQL - BOOLEAN (BIT) Operator
- SQL - AND & OR
- SQL - Having Clause
- SQL - Group By Clause
- SQL - Order By Clause
- SQL - Distinct Clause
- SQL - Top Clause
- SQL - Where Clause
- SQL - Rename Views
- SQL - Drop Views
- SQL - Update Views
- SQL - Create Views
- SQL - Sorting Results
- SQL - Delete Query
- SQL - Update Query
- SQL - Insert Into Select
- SQL - Select Into
- SQL - Select Query
- SQL - Insert Query
- SQL - Constraints
- SQL - Delete Table
- SQL - Drop Table
- SQL - Alter Tables
- SQL - Temporary Tables
- SQL - Clone Tables
- SQL - Truncate Table
- SQL - Rename Table
- SQL - Show Tables
- SQL - Create Table
- SQL - Backup Database
- SQL - Show Database
- SQL - Rename Database
- SQL - Select Database
- SQL - Drop Database
- SQL - Create Database
- SQL - Expressions
- SQL - Operators
- SQL - Data Types
- SQL - Syntax
- SQL - Databases
- SQL - RDBMS Concepts
- SQL - Overview
- SQL - Home
5. 图瓦卢
- 页: 1
- 页: 1
- 结构-创建指数
- 页: 1
- 页: 1
- 页: 1
- SQL - Foreign Key
- 文 件
- ∗ E/CN.6/2009/1。
- 页: 1
- 页: 1
- 文 件
- 页: 1
- 页: 1
- 文 件
- 页: 1
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
SQL - Show indexes
SHOW INDEX是检索表格中确定的指数信息的基本指令。 然而,“SHOW INDEX”指挥系统只设在MySQL RDBMS,在QL服务器上不是有效的指挥。
在服务器中,系统存储程序“sp_helpindex”用于检索表格中确定的索引信息。 表格中载有每个指数的详细资料,包括姓名、类型和栏目。
If you are trying to use the “SHOW INDEX” command in SQL database management systems such as Microsoft SQL Server Management Studio (MSSMS), you will get the result as an error message because the command is not recognized by the SQL Server engine.
Syntax
以下是sp_helpindex。 储存在库克的系统
sp_helpindex [ @objname = ] name
这里,[@objname =] 姓名具体说明检索索引信息的表格名称。
在执行上述存储程序之后,它退回了包含以下信息的一套结果:
index_name is the names of the columns that are included in index.
index_description is the brief description of the index such as the type of index (pke clustered or non-clustered).
index_keys is the keys that are included in the index.
Example
Let us create a table with the name CUSTOMERS in the SQL database using the CREATE statement as shown in the query below −
SQL> CREATE TABLE CUSTOMERS ( ID INT NOT NULL, NAME VARCHAR (20) NOT NULL, AGE INT NOT NULL, ADDRESS CHAR (25), SALARY DECIMAL (20, 2), PRIMARY KEY (ID) );
Let us insert some values into the above created table using the following query −
SQL> INSERT INTO CUSTOMERS (ID, NAME, AGE, ADDRESS, SALARY) VALUES (1, Ramesh , 32 , Ahmedabad , 2000); INSERT INTO CUSTOMERS (ID, NAME, AGE, ADDRESS, SALARY) VALUES (2, Khilan , 25 , Delhi , 1500); INSERT INTO CUSTOMERS (ID, NAME, AGE, ADDRESS, SALARY) VALUES (3, kaushik , 23 , Kota , 2000); INSERT INTO CUSTOMERS (ID, NAME, AGE, ADDRESS, SALARY) VALUES (4, Chaitap , 25 , Mumbai , 6500); INSERT INTO CUSTOMERS (ID, NAME, AGE, ADDRESS, SALARY) VALUES (5, Hardik , 27 , Bhopal , 8500); INSERT INTO CUSTOMERS (ID, NAME, AGE, ADDRESS, SALARY) VALUES (6, Komal , 22 , MP , 9000); INSERT INTO CUSTOMERS (ID, NAME, AGE, ADDRESS, SALARY) VALUES (7, Muffy , 24 , Indore , 5500);
表格一经编制,让我们利用以下问询,在CUSTOMERS表中为“NAME”一栏编制索引。
SQL> CREATE INDEX INDEX_NAME on CUSTOMERS(NAME);
现在,让我们利用“sp_helpindex”所储存的系统,列出在消费物价指数表中建立的所有指数,如下所示:
SQL> EXEC sys.sp_helpindex @objname = N CUSTOMERS ;
Output
在执行上述询问时,产出如下:
+----------------------------------+---------------------+------------------+ | index_name | index_description | index_keys | +----------------------------------+---------------------+------------------+ | INDEX_NAME | nonclustered | NAME | | | located on PRIMARY | | | PK__CUSTOMER__ 3214EC27755869D9 | clustered, unique, | ID | | | primary key located | | | | on PRIMARY | | +----------------------------------+---------------------+------------------+Advertisements