In this assignment, you will have a chance to implement the hash-join algorithm for a DBMS....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
Required solution is given below PROGRAM include include include include include using namespace std ... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Assume that a utility function is given by Min(X, Y), as in Exercise 1(c). What is the Slutsky equation that decomposes the change in the demand for X in response to a change in its price? What is...
-
In the Keynesian cross, assume that the consumption function is given by C = 200 + 0.75 (Y T). Planned investment is 100; government purchases and taxes are both 100. a. Graph planned expenditure as...
-
Assume that the investment function is a linear relation. The relation between investment and output is characterized by two parameters, a0 and a1: The parameter a1 is called the propensity to...
-
Which of the environmental policy options discussed in this and previous chapters would you recommend if a hypothetical society were facing the following environmental problems? In each case, briefly...
-
A U.S. company sells a product to a British company with the transaction listed in British pounds. On the date of the sale, the transaction total of $14,500 is billed as 10,000, reflecting an...
-
What is an example of a business model innovation opportunity presented by GPS III or LEO satellites?
-
Jessica Company manufactures bicycles and tricycles. For both products, mate- rials are added at the beginning of the production process, and conversion costs are in- curred uniformly. Jessica...
-
Evaluate Research In Motions keys to success. What did the company do well and, in hindsight, what should it have done differently during its decade of extreme growth?
-
accompanying data represent the miles per gallon of a random sample ee-cylinder, 1.0 liter engine. etermine the quartiles. mpg mpg mpg
-
You have just been hired as a new management trainee by Earrings Unlimited, a distributor of earrings to various retail outlets located in shopping malls across the country. In the past, the company...
-
Present and future value tables of $1 at 9% are presented below. FV $1 PV $1 FVA $1 FVAD $1 PVA $1 PVAD $1 1.09000 0.91743 1.0000 1.0900 0.91743 1.00000 1.18810 0.84168 2.0900 2.2781 1.75911 1.91743...
-
Entries for Bank Reconciliation The following data were accumulated for use in reconciling the bank account of Mathers Co. for July: 1. Cash balance according to the company's records at July 31,...
-
You have a battery marked "6.00 V." When you draw a current of 0.213 A from it, the potential difference between its terminals is 5.09 V. What is the potential difference AV when you draw 0.551 A? AV...
-
You have been given the responsibility for ensuring that your team is up to date with all legislation that affects their day to day practice as a real estate agent. Develop a list of tasks to achieve...
-
Question 10 2.86 pts On the day that Best Buy sold the television, what effect did the sale have on Best Buy's total equity? Your answer should be in dollars. If the effect is positive (negative)...
-
In the United States, coffee consumption averages 4.00 x 10^8 cups per day. If each cup of coffee contains 160 mg caffeine, how many pounds of caffeine are being consumed each day?
-
The following information concerns production in the Baking Department for December. All direct materials are placed in process at the beginning of production. ACCOUNT Work in Process-Baking...
-
The outer loop controls the number of students. Note that the inner loop of this program is always executed exactly three times, once for each day of the long weekend. Modify the code so that the...
-
Use the results of Exercise 16 and Cubic Hermite interpolation to approximate values of y(t), and compare the approximations to the actual values. a. y(0.54) and y(0.94) b. y(1.25) and y(1.93) c....
-
Find the rates of convergence of the following functions as h 0. a. limh0 (sin h)/h = 1 b. limh0 (1 cos h)/h = 0 c. limh0 (sin h h cos h)h = 0 d. limh0 (1 - eh)/h = 1
-
Suppose the n n matrix A has eigenvalues 1, . . . , n ordered by |1| > |2| > |3| |n|, with linearly independent eigenvectors v(1), v(2), . . . , v(n). a. Show that if the Power method is applied...
-
In a computer system, how are accounting records posted? a. master file is updated to a transaction file b. master file is updated to an index file c. transaction file is updated to a master file d....
-
Sarbanes-Oxley legislation calls for sound internal control practices over financial reporting and requires SEC-registered corporations to maintain systems of internal control that meet SOX...
-
An electronic walkthrough of the application's internal logic is called a. a salami logic test. b. an integrated test. c. tracing. d. a logic bomb test.
Study smarter with the SolutionInn App