Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following relation and query: Relation: B(bid, accNo), accNo is a key. A(accNo, code, balance), accNo is a key. Query: SELECT B.bid, Sum(A.balance) FROM

image text in transcribed

Consider the following relation and query: Relation: B(bid, accNo), accNo is a key. A(accNo, code, balance), accNo is a key. Query: SELECT B.bid, Sum(A.balance) FROM B, A WHERE B.accNo=A.accNo GROUP by B.bid This query computes the sum of the balances at each branch. Assume that there a clustered B+ tree index on B.bid and a hash index on A.accNo. 1.) Discuss/Explain the plans of evaluating the query with lowest I/O cost. 2.) If A and B have A and (B| pages, and each page has 100 records, what is the I/O cost? (Hint: use index to reduce the cost of join and sorting cost for aggregation). Explain steps and show you work. Consider the following relation and query: Relation: B(bid, accNo), accNo is a key. A(accNo, code, balance), accNo is a key. Query: SELECT B.bid, Sum(A.balance) FROM B, A WHERE B.accNo=A.accNo GROUP by B.bid This query computes the sum of the balances at each branch. Assume that there a clustered B+ tree index on B.bid and a hash index on A.accNo. 1.) Discuss/Explain the plans of evaluating the query with lowest I/O cost. 2.) If A and B have A and (B| pages, and each page has 100 records, what is the I/O cost? (Hint: use index to reduce the cost of join and sorting cost for aggregation). Explain steps and show you work

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

Step: 3

blur-text-image

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago