Indexing Using the relational table LINEITEM of the sample database TPCHR, for each one of the queries listed below: i. Find all the discount (_discount) of all the items that are shipped (l_shipdate) most recently. Hint. Most recently mean the latest shipment date. ii. iii. iv. V. Find the total number of items shipped by air (l_shipmode) in 1998 (l_shipdate). Find the order number (I_orderkey) and item number (I_linenumber) that have the highest discount (I_discount). Find the total number of items per line status (I_linestatus). List the line status and the total items per line status. Find the order key (l_orderkey), line item number (I_linenumber), line status (linestatus), shipment date (shipdate) and shipment mode (Ishipmode) of all orders with the order number (I_orderkey) 1795718, 1799046, and 1794626. a) Construct an SQL statement that produces the required output specified in the statement. 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. Hint, you may 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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

hey experts, please help me out on this thanks xx

Indexing
Using the relational table LINEITEM of the sample database TPCHR, for each
one of the queries listed below:
i.
ii.
iii.
iv.
v.
Find all the discount (I_discount) of all the items that are shipped
(l_shipdate) most recently. Hint. Most recently mean the latest shipment
date.
Find the total number of items shipped by air (l_shipmode) in 1998
(l_shipdate).
Find the order number (I_orderkey) and item number (I_linenumber) that
have the highest discount (I_discount).
Find the total number of items per line status (I_linestatus). List the line
status and the total items per line status.
Find the order key (l_orderkey), line item number (I_linenumber), line
status (_linestatus), shipment date (l_shipdate) and shipment mode
(l_shipmode) of all orders with the order number (I_orderkey) 1795718,
1799046, and 1794626.
a) Construct an SQL statement that produces the required output specified in the
statement.
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. Hint, you may 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.
Transcribed Image Text:Indexing Using the relational table LINEITEM of the sample database TPCHR, for each one of the queries listed below: i. ii. iii. iv. v. Find all the discount (I_discount) of all the items that are shipped (l_shipdate) most recently. Hint. Most recently mean the latest shipment date. Find the total number of items shipped by air (l_shipmode) in 1998 (l_shipdate). Find the order number (I_orderkey) and item number (I_linenumber) that have the highest discount (I_discount). Find the total number of items per line status (I_linestatus). List the line status and the total items per line status. Find the order key (l_orderkey), line item number (I_linenumber), line status (_linestatus), shipment date (l_shipdate) and shipment mode (l_shipmode) of all orders with the order number (I_orderkey) 1795718, 1799046, and 1794626. a) Construct an SQL statement that produces the required output specified in the statement. 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. Hint, you may 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.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY