We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
A natural join is effectively combining two columns using the common data that they have.
In the question, we have:
R(A:C)
A:C3,316,412,33,1527,1
and S(B, C, D)
B:C:D50,1,61,55,84,3,9
We are told that the first number is 27 from A, therefore B, C, and D (or X, Y, and Z) are going to be the rows which correspond to that 27 in A. From R(A, C) this gives us a C of 1. And using S(B, C, D), a C of 1 gives us a B of 50 and a D of 6. Therefore the answer is:
(A, B, C, D) = (27, 50, 1, 6).
Regarding the input format, it needs to be entered as above on separate lines!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Databases - Natural Joins
You are viewing a single comment's thread. Return to all comments →
The answer is:
A natural join is effectively combining two columns using the common data that they have.
In the question, we have:
R(A:C)
and S(B, C, D)
We are told that the first number is 27 from A, therefore B, C, and D (or X, Y, and Z) are going to be the rows which correspond to that 27 in A. From R(A, C) this gives us a C of 1. And using S(B, C, D), a C of 1 gives us a B of 50 and a D of 6. Therefore the answer is:
(A, B, C, D) = (27, 50, 1, 6).
Regarding the input format, it needs to be entered as above on separate lines!