Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews DB Oracle Interviews:Concepts and ArchitectureData AccessDatabase ArchitectureDatabase ManagementDatabase Security OracleDistributed ProcessingFlexfieldForms ReportsGeneral OracleMemory ManagementMTO-SAP Financial AccountingOCIOracle AOLOracle AROracle Backup RecoveryOracle D2KOracle DatabaseOracle Database DeveloperOracle DB OptimizationOracle DBAOracle DeveloperOracle ETLOracle Forms 3.0Oracle Forms 4.0Oracle GLOracle PL-SQLOracle RMANOracle ScenariosOracle SecurityOracle SQLOracle System ArchitectureOracle Technology Network (OTN)Programmatic ConstructsRAC (Real Application Clusters)SQL Plus
Copyright © 2018. All Rights Reserved
Oracle Database Interview Question:
How To See the Table Columns Used in an Index?
Submitted by: AdministratorYou can a list of indexes in your schema from the USER_INDEXES view, but it will not give you the columns used in each index in the USER_INDEXES view. If you want to see the columns used in an index, you can use the USER_IND_COLUMNS view. Here is an example script for you:
SELECT index_name, table_name, column_name
FROM USER_IND_COLUMNS WHERE table_name = 'EMPLOYEES';
<pre>INDEX_NAME TABLE_NAME COLUMN_NAME
-------------------- ---------------- ----------------
EMP_EMAIL_UK EMPLOYEES EMAIL
EMP_EMP_ID_PK EMPLOYEES EMPLOYEE_ID
EMP_DEPARTMENT_IX EMPLOYEES DEPARTMENT_ID
EMP_JOB_IX EMPLOYEES JOB_ID
EMP_MANAGER_IX EMPLOYEES MANAGER_ID
EMP_NAME_IX EMPLOYEES LAST_NAME
EMP_NAME_IX EMPLOYEES FIRST_NAME</pre>
Submitted by: Administrator
SELECT index_name, table_name, column_name
FROM USER_IND_COLUMNS WHERE table_name = 'EMPLOYEES';
<pre>INDEX_NAME TABLE_NAME COLUMN_NAME
-------------------- ---------------- ----------------
EMP_EMAIL_UK EMPLOYEES EMAIL
EMP_EMP_ID_PK EMPLOYEES EMPLOYEE_ID
EMP_DEPARTMENT_IX EMPLOYEES DEPARTMENT_ID
EMP_JOB_IX EMPLOYEES JOB_ID
EMP_MANAGER_IX EMPLOYEES MANAGER_ID
EMP_NAME_IX EMPLOYEES LAST_NAME
EMP_NAME_IX EMPLOYEES FIRST_NAME</pre>
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.