Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following SELECT statement: SELECT O ORDERDATE, SUM(L_QUANTITY) FROM LINEITEM JOIN ORDERS ON LINEITEM.L ORDERKEY = ORDERS.O ORDERKEY GROUP BY O ORDERDATE; (1)
Consider the following SELECT statement: SELECT O ORDERDATE, SUM(L_QUANTITY) FROM LINEITEM JOIN ORDERS ON LINEITEM.L ORDERKEY = ORDERS.O ORDERKEY GROUP BY O ORDERDATE; (1) Write SQL statement that denormalizes a relational table LINEITEM. The denormalization supposed to speedup the processing of a new SELECT statement that retrieves the same results as SELECT statement listed above and it uses only a denormalized table LINEITEM. (2 marks) (2) Write SQL statement that reloads data from the relational table ORDERS into the denormalized table LINEITEM created in a step (1). (3 marks) (3) Write a new SELECT statement that retrieves the same results as the original SELECT statement listed above and it uses only a denormalized table LINEITEM. (1 mark) (4) Explain what data redundancies are caused by the denormalization of a relational table LINEITEM and why a new SELECT statement created in a step (4) can be processed faster than the original SELECT statement. (2 marks)
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