Question

In: Computer Science

Consider the tables You may assume the corresponding columns have the same domains T1 D E...

Consider the tables You may assume the corresponding columns have the same domains

T1

D E F
10 a 5
15 b 8
15 c 4
25 a 6

T2

A B C
10 b 6
25 c 3
10 b 5

Show the results of each of the following relational algebra expressions in terms of table:

i. T1 ⋈ (D = A) T2

ii. T1⋈ (E=B) T2

iii. T1∪T2

iv. T1–T2

v. π (D,E)(T1) / π (B) (T2)

Solutions

Expert Solution

T1 :

D E F
10 a 5
15 b 8
15 c 4
25 a 6

T2:

A B C
10 b 6
25 c 3
10 b 5



i)
This will return the rows in which column D and A have equal values after doing the cross product

D E F A B C
10 a 5 10 b 6
10 a 5 10 b 5
25 a 6 25 c 3


ii)  
This will return the rows in which column E and B have equal values after doing the cross product.

D E F A B C
15 b 8 10 b 6
15 b 8 10 b 5
15 c 4 25 c 3



iii)
Append the rows of T2 after T1 to get the union of two tables

D E F
10 a 5
15 b 8
15 c 4
25 a 6
10 b 6
25 c 3
10 b 5


iv)
Subtract the rows from T1 that are same in T2

There are no similar rows in both the tables. So T1 - T2 is the same as T1

D E F
10 a 5
15 b 8
15 c 4
25 a 6



v)
In this express there are two terms.
We analyze them separately

gives columns D and E from T1

D E
10 a
15 b
15 c
25 a


gives column B from T2

B
b
c

We have to divide these two tables. Dividing means giving those values of T1(D) which are occurring with every value of T2(B) in T1
In T1, 10 occurs with a not with b and c.
15 occurs with both b and c. So it will be in the output
25 occurs with a.

So, the output of the given expression will be

D
15




Hope this helps
If you have any doubt feel free to comment
Thank You!!


Related Solutions

Consider a market for tables. Assume that all current and potential firms have the same total...
Consider a market for tables. Assume that all current and potential firms have the same total cost function, ?? = 3 + 3? ଶ . In the short run, a firm in the market still has to pay 3 even if ? = 0. In the long run, if a firm chooses to exit, it pays nothing. The market demand curve for this table is given by ?d = 600 − 50P. a. (3 points) Find each firm’s average total...
Consider two planetary orbits with the same energy E.  If the two planets have the same mass,...
Consider two planetary orbits with the same energy E.  If the two planets have the same mass, but orbit A has a smaller angular momentum than orbit B, which of the following is true? A. Orbit B is open.  Orbit A is closed. B. Orbit B has a smaller semimajor axis than orbit A. C. The period of orbit A is greater than that of orbit B. D. Orbit A is more elongated (more eccentric) than B. True or false: Light always...
Consider the cross: A/a; b/b; C/c; D/d; E/e x A/a; B/b; c/c; D/d; e/e a) what...
Consider the cross: A/a; b/b; C/c; D/d; E/e x A/a; B/b; c/c; D/d; e/e a) what proportion of the progeny will phenotypically resemble the first parent? b) what proportion of the progeny will genotypically resemble neither parent?
Polonium-210, a naturally occurring radioisotope, is an α emitter, with t1/2 = 138 d. Assume that...
Polonium-210, a naturally occurring radioisotope, is an α emitter, with t1/2 = 138 d. Assume that a sample of 210^Po with a mass of 0.710 mg was placed in a 230.0 mL flask, which was evacuated, sealed, and allowed to sit undisturbed. What would the pressure be inside the flask (in mmHg) at 20 ∘C after 369 days if all the α particles emitted had become helium atoms? Please answer in mmHg, thank you.
Genes D, E, F, and G are located on the same chromosome. The distances between the...
Genes D, E, F, and G are located on the same chromosome. The distances between the genes are below: Relationship Map Unit Distance G - D 11 G - E 7 G - F 22 E - F 15 D - E 4 What is the order of the genes on the chromosome?
Chemical species A, B, C, D and E are involved in a reaction. They may represent...
Chemical species A, B, C, D and E are involved in a reaction. They may represent reactants, products, intermediates, catalysts or inhibitors. The rate of change in the concentration for each of them is given below: d[A]/dt = -k1[A][B] + k-1[C][B] + k2[C][D] - k-2[A][E] d[B]/dt = 0 d[C]/dt = k1[A][B] - k-1[C][B] - k2[C][D] + k-2[A][E] d[D]/dt = -k2[C][D] + k-2[A][E] d[E]/dt = k2[C][D] - k-2[A][E] a) Write down the elementary steps in the proposed reaction mechanism that are...
I only need D E and F answered I have completed the rest Consider two countries:...
I only need D E and F answered I have completed the rest Consider two countries: Canada (CAN) and Iceland (ICE). Two goods can be produced: gloves (g) and socks (s). Goods are produced only using labour, and the unit labour requirements of the two goods in each country are given in the following table: ??????= 2 ??????= 8 ??????= 3 ??????= 6 Assume that Canada has 3000 units of labour, while Iceland has 1500 units of labour. When setting...
Different companies may have or may choose to have different cost structures for the same product....
Different companies may have or may choose to have different cost structures for the same product. Many companies try to lower total cost regardless of output but, if it were so easy, then it would already have been done. So, consider a change in cost structure which combines a 10 percent increase in fixed cost and a sufficient decrease in marginal cost which does not change BE. a) How large is the required decrease in marginal cost? b) Over what...
you can see the answer a, b, and c. I have a question about d, e,...
you can see the answer a, b, and c. I have a question about d, e, and f only how to solve theses questions Mist (airborne droplets or aerosols) is generated when metal-removing fluids are used in machining operations to cool and lubricate the tool and work-piece. Mist generation is a concern to OSHA, which has recently lowered substantially the workplace standard. The article "Variables Affecting Mist Generation from Metal Removal Fluids" (Lubrication Engr., 2002: 10-17) gave the accompanying data...
Explain why you and your classmates may have a different response to the same exposure to...
Explain why you and your classmates may have a different response to the same exposure to a chemical. Provide a specific example.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT