Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the relational table LINEITEM of the sample database TPCHR, for each one of the queries listed below: i. Find all the discount (l_discount) of

Using the relational table LINEITEM of the sample database TPCHR, for each one of the queries listed below:

  1. i. Find all the discount (l_discount) of all the items that are shipped (l_shipdate) most recently. Hint. Most recently mean the latest shipment date.
  2. ii. Find the total number of items shipped by air (l_shipmode) in 1998 (l_shipdate).
  3. iii. Find the order number (l_orderkey) and item number (l_linenumber) that have the highest discount (l_discount).
  4. iv. Find the total number of items per line status (l_linestatus). List the line status and the total items per line status.
  5. v. Find the order key (l_orderkey), line item number (l_linenumber), line status (l_linestatus), shipment date (l_shipdate) and shipment mode (l_shipmode) of all orders with the order number (l_orderkey) 1795718, 1799046, and 1794626.

  1. b) Find the smallest number of indexes that improve performance of a given collection of SELECT statements of a relational table LINEITEM. The smallest number of indexing means a database system will compute the five queries constructed in (a) using one or more indexes that you have created. you can create an index that can be used to compute more than one queries. Use the explain plan and show plan statements to justify your solutions.

Need help on answer part B.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Networks

Authors: Andrew S. Tanenbaum, David J. Wetherall

5th edition

132126958, 978-0132126953

More Books

Students also viewed these Computer Network questions

Question

Compare and contrast a network-based IPS, and a host-based IPS.

Answered: 1 week ago

Question

What is PKI and why is it important?

Answered: 1 week ago