Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment, you will have a chance to implement the hash-join algorithm for a DBMS. You can use C, C++, Java or any

In this assignment, you will have a chance to implement the hash-join algorithm for a DBMS. You can use C, C++, Java or any o 

In this assignment, you will have a chance to implement the hash-join algorithm for a DBMS. You can use C, C++, Java or any other high-level programming language to write the program. However, your program should include sufficient comments to make it readable. You need to turn in (1) a brief report/description about your program design and implementation (e.g., high-level program diagram and data/file structures) and program usage; (2) your program source code; (3) proof of compilation (e.g., the screen snapshot of a successful compilation); and (4) sample execution outputs. Please assemble all the above required contents in a single Word or PDF file for your submission. The program specification is given as follows. Let R1(a1; a2; a3) and R2(b1; b2; b3; b4) be two relations with all integer attributes. Tuples in these two relations are sequentially stored in two data files, respectively. Use the hash-join algorithm to implement a join (equijoin) of R1 and R2. Assume that the hash function is f(k) = k mod N, where N is the number of buckets allowed in your hash structure/table. Your program should allow a user to choose the joining attributes from the two relations, i.e., performing Ri R1.a;=R2.b; R2 for any chosen pair of ai and bj , where ai is the i-th attribute in R1 and bj is the j- th attribute in R2. For example, a user may want to perform Ri R1.a2=R2.b3 R2 Your program should display the join result and output the selectivity of the join. You may request a user to interactively input the necessary parameters, such as the data file names for R1 and R2, the number of tuples in each relation, and the joining attributes (e.g., 1 for the 1st attribute, 3 for the 3rd attribute). Use your program to perform several joins for different relation instances of R1 and R2.

Step by Step Solution

3.34 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

Required solution is given below PROGRAM include include include include include using namespace std ... 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

Numerical Analysis

Authors: Richard L. Burden, J. Douglas Faires

9th edition

538733519, 978-1133169338, 1133169333, 978-0538733519

More Books

Students also viewed these Accounting questions

Question

=+a. Verify that Pd(c ) 5 .5.

Answered: 1 week ago