# Problems 11–14 are based on the following query: SELECT P_CODE, SUM(LINE_UNITS) FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) &gt; (SELECT MAX(LINE_UNITS) FROM LINE); Should you create an index? If so, what would the index column(s) be, and why would you create the index? If not, explain your reasoning.

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

12th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781305627482

Chapter
Section

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

12th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781305627482
Chapter 11, Problem 12P
Textbook Problem
45 views

## Problems 11–14 are based on the following query: SELECT P_CODE, SUM(LINE_UNITS) FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) > (SELECT MAX(LINE_UNITS) FROM LINE); Should you create an index? If so, what would the index column(s) be, and why would you create the index? If not, explain your reasoning.

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.

### Explanation of Solution

Creating an index:

Yes, it is necessary to create an index for the given query.

Column that needs to be indexed:

The column “LINE_UNITS” will be the column that needs to be indexed...

### 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
Draw the top, the front and the right side orthogonal views of the given object and indicate when an object nee...

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

Describe modular design, and explain the two main prototyping methods.

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

Given that P=120lb and Q=130lb, find the rectangular representation of P+Q.

International Edition---engineering Mechanics: Statics, 4th Edition

Database Connection Error While interacting with a web app, an error is displayed informing you that the web ap...

Enhanced Discovering Computers 2017 (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)