1) Consider a relation R(A,B) with r tuples, all unique within R, and a relation S(B,C) with s tuples, all unique within S. Let t represent the number of tuples in R natural-join S. What is the value range of t? What is the value of t for R natural-join R (assuming no null values in R)? Explain your answer.
case 1:
Relation R (A,B)
Let R has 2 tuple
A B
1 2
2 2
Relation S (B,C)
Let S has 3 tuple
B C
1 2
1 3
3 4
When we do natural join over R and S ,we get 0 Tuples.
Hence minimum number of tuples =0
case 2:
Relation R (A,B)
Let R has 2 tuple
A B
1 2
2 2
Relation S (B,C)
Let S has 3 tuple
B C
2 2
2 3
2 4
When we do natural join over R and S
A B C
1 2 2
1 2 3
1 2 4
2 2 2
2 2 3
2 2 4
Total 6 tuples (2*3).
Relation R(A,B) with r tuples, all unique within R, and a Relation S(B,C) with s tuples, all unique within S
range of tuple = 0 to r*s
1) Consider a relation R(A,B) with r tuples, all unique within R, and a relation S(B,C)...
Suppose relation R(A, B, C) has the following tuples: and relation S(A, B, C) has the following tuples: Compute the intersection of the relations R and S. which of the following tuples is in the result? (2, 5, 4) (1, 2, 6) (2, 2, 6) (2, 5, 3)
Consider tables R and S below How many tuples are in the natural join of R and S ? B) 4 c) 5 OD) 6 E) 7
Question 1 (5 marks) Consider two relations called Item and Orderltem. Imagine that relation Item has 160,000 tuples and Orderltem has 200,000 tuples. Both relations store 100 tuples per a page. Consider the following SQL statement SELECT * FROM Item INNER JOIN OrderItem ON Item.ItemID-OrderItem. ItemID; We wish to evaluate an equijoin between Orderltem and Item, with an equality condition Item.ltemID Orderltem.ItemID. There are 802 buffer pages available in memory for this operation. Both relations are stored as (unsorted) heap...
Consider the natural join of the relation R(A,B) and S(A,C) on attribute A. Neither relations have any indexes built on them. Assume that R and S have 80,000 and 20,000 blocks, respectively. The cost of a join is the number of its block I/Os accesses. If the algorithms need to sort the relations, they must use two-pass multi-way merge sort. QUESTION: Assume that there are 10 blocks available in the main memory. What is the fastest join algorithm for computing...
Consider the natural join of the relation R(A,B) and S(A,C) on attribute A. Neither relations have any indexes built on them. Assume that R and S have 80,000 and 20,000 blocks, respectively. The cost of a join is the number of its block I/Os accesses. If the algorithms need to sort the relations, they must use two-pass multi-way merge sort. Assume that there are 110,000 blocks available in the main memory. We like to have the output sorted based on...
[1] [30 points] Consider the relation R City, Street, Zip Code), where a tuple (c, s, z) is in R only if city c has a building with street s, and z is the zipcode for that address in that city. It is assumed that the nontrivial functional dependencies are: Street → Zip Code ZipCode → City City, [a] [b] [C] [d] [e] Determine all possible keys for R. Indicate all possible BCNF and 3NF violations. Decompose R as necessary...
Here is an instance of a relation R(A,B,C,D): Please just explain the feedback so I can attempt to solve it on my own! A B C D 1 2 3 4 1 3 3 3 1 3 3 4 1 2 3 3 2 2 4 4 2 4 2 4 2 4 4 4 2 2 2 4 Which of the following multivalued dependencies does this instance of R satisfy? A->> B BD ->> C D ->> AB B->>...
! Exercise 15.4.4: In Example 15.6 we discussed the join of two relations R and S, with 1000 and 500 blocks, respectively, and M = 101. However, we need additional additional disk I/O's if there are so many tuples with a given value that neither relation's tuples could fit in main memory. Calculate the total number of disk I/O's needed if: a) There are only two Y-values, each appearing in half the tuples of R and half the tuples of...
Suppose: Relation S(B,C,D) has the following tuples: 68 79 Which of the following tuples is NOT in the result of the following query: SELECT Sum( BC) ASSUM, Max(D) AS MAX FROM S GROUP BY B; O (2,8,6) O (4,52,9) O (4,24,8) None of the above
Let R(A,B,C,D,E) be a relation with FDs F = {AB-C, CD-E, E-B, CE-A} Consider an instance of this relation that only contains the tuple (1, 1, 2, 2, 3). Which of the following tuples can be inserted into this relation without violating the FD's? (2 points) Select one: O (0, 1, 2, 4,3) (1,1,2,2,4) (1.2.2, 2, 3) o (1,1,3,2,3) All of the above can be inserted. None of the above can be inserted.