3. Consider the following tables for undergraduate and graduate students. Using
ID: 3914417 • Letter: 3
Question
3. Consider the following tables for undergraduate and graduate students. Using relational algebra, what will be result of the following: (tables show in picture uploaded) a) The number of rows resulting from UGrad - Grad b) The number of columns resulting from UGrad x Grad c) The number of rows resulting from p_sName, GPA (UGrad) d) The number of rows resulting from UGrad È Grad e) The number of rows resulting from UGrad Ç Grad f) The number of columns resulting from p_GPA (UGrad) g) The number of rows resulting from UGrad Grad h) The number of columns resulting from UGrad Ç Grad i) The number of rows resulting from p_GPA (UGrad) j) The number of rows resulting from UGrad x Grad UGrad table SID sName login GPA 101 John jsmith 3.9 102 Mary Mary33 3.65 103 Paul ppp 3.5.5 104 James J132 3.5:5 Grad table SID sName login GPA 106 Ralph star 3.12 102 Mary Mary33 3.65 103 Paul lpaul 3.02 104 Nancy nan 3.10Explanation / Answer
(a) number of rows in UGrad - Grad = 3
which is row with id 101, 103, 104. Since, row with id 102 is common in both. so it is eliminated.
(b) number of columns in UGrad x Grad = columns(UGrad)+columns(Grad) = 4 + 4 =8
(c) number of rows in p_sName,GPA(UGrad) = 4
since, projection operator doesn't affect number of rows.
(d) number of rows in UGrad È Grad = 1 (where È represents natural join.)
because, there is only one row such that UGrad.sID = Grad.sID ^ UGrad.sName = Grad.sName^ UGrad.login = Grad.login ^ UGrad.GPA = Grad.GPA
(e) number of rows in UGrad Ç Grad = 1 where Ç represents intersection operator.
because there is only one row common in UGrad and Grad
(f) number of columns in p_GPA(UGrad) = 1
(g) Operator missing in between UGrad and Grad.
or, if u want to ask number of rows in UGrad or in Grad, then it is 4.
(h) number of columns in UGrad Ç Grad = 4
(i) number of rows in p_GPA (UGrad) = 3
which is ( 3.9, 3.65, 3.55 )
(j) number of rows in UGrad x Grad = nrows(UGrad)*nrows(Grad) = 4 * 4 =16
where x represents cross product.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.