# Problems 27 and 28 are based on the following query: SELECT P_CODE, P_DESCRIPT, P_QOH, P_PRICE, V_CODE FROM PRODUCT WHERE P_QOH &lt; P_MIN AND P_MIN = P_REORDER AND P_REORDER = 50 ORDER BY P_QOH; What indexes would you recommend? Write the commands to create those indexes.

### Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900

Chapter
Section

### Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900
Chapter 11, Problem 28P
Textbook Problem
5 views

## Problems 27 and 28 are based on the following query: SELECT P_CODE, P_DESCRIPT, P_QOH, P_PRICE, V_CODE FROM PRODUCT WHERE P_QOH < P_MIN AND P_MIN = P_REORDER AND P_REORDER = 50 ORDER BY P_QOH; What indexes would you recommend? Write the commands to create those indexes.

Program Plan Intro

Indexes:

• Indexing is a technique that is used in SQL for optimizing the performance.
• Indexes are used when a small set of rows needs to be selected from the table that is large in size.
• The selection of rows is made by specifying conditions.

Rules for using indexes:

The below are the rules how the indexes can be used

• When an indexed column appears within itself in the search criteria of “WHERE” or “HAVING” clause.
• When an indexed column appears within itself in “GROUP BY” or “ORDER BY”clause.
• When the indexed column is applied with functions MAX and MIN.
• When the indexed column’s data sparsity is high.

Syntax for creating INDEX:

The below mentioned is the syntax for creating the index:

CREATE [UNIQUE]INDEXindexname ON tablename(column1 [, column2])

### Explanation of Solution

Index that are recommended:

• The given query uses equality comparison on the columns P_REORDER, P_MIN and P_QOH.
• The indexes that are to be created for the below mentioned attributes:
• Index on the attribute P_REORDER.
• Index on the attribute P_MIN.
• Index on the attribute P_QOH.

Creation of the SQL commands:

The index for the given query is generated with the following names “PRO_MYNDX1”  “PRO_MYNDX2” and “PRO_MYINDX3”...

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started

Find more solutions based on key concepts

Precision Machining Technology (MindTap Course List)

Using MATLAB, create a table that shows the relationship among the units of mass to describe peoples mass in ki...

Engineering Fundamentals: An Introduction to Engineering (MindTap Course List)

What are main steps in the software acquisition process?

Systems Analysis and Design (Shelly Cashman Series) (MindTap Course List)

If your motherboard supports ECC DDR3 memory, can you substitute non-ECC DDR3 memory?

A+ Guide to Hardware (Standalone Book) (MindTap Course List)

What are some examples of internal and external sources that a decision support system might use?

Enhanced Discovering Computers 2017 (Shelly Cashman Series) (MindTap Course List)

Why are arc strikes outside the welding zone considered a problem on pipe?

Welding: Principles and Applications (MindTap Course List)