Answered step by step
Verified Expert Solution
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:
- 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.
- ii. Find the total number of items shipped by air (l_shipmode) in 1998 (l_shipdate).
- iii. Find the order number (l_orderkey) and item number (l_linenumber) that have the highest discount (l_discount).
- iv. Find the total number of items per line status (l_linestatus). List the line status and the total items per line status.
- 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.
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started