Question: Using sql and the 2 tables below for questions b - l: Relation assignment _ r has attributes ( A , B , C ,

Using sql and the 2 tables below for questions b-l:
Relation assignment_r has attributes (A, B, C, D), the domains of (char(1), int, varchar(5), float) respectively.
i. Attribute B is the primary key for this relation
ii. Relation assignment_r has the following tuples as values
(a,10,hello,10.5)
(b,1,hi,12)
(x,2,g479,1102.3)
(c,101,geog1,11)
(y,123,g,12.5)
Relation assignment_s has attributes (B, D, E), the domains of (int, float, char(1)) respectively.
i. Attribute B is the primary key for this relation
ii. Relation assignment_s has the following tuples as values
(100,10.5,s)
(1,12,z)
(2,1.3,g)
(103,1.1,y)
(10,12,s)
b. Calculate the average value of attribute D in relation assignment_s.
c. Sum the values of attribute B in relation assignment_r for rows if the value of attribute D is either 11 or 12.
d. Change the value of attribute C in relation assignment_r to geog if attribute A has value s or y.
e. Delete tuple from assignment_r if value of attribute D is 12.5.
f. Perform natural join of relations assignment_r and assignment_s and explain your result.
g. Perform inner join of relations assignment_r and assignment_s on attribute B and explain your result. How is this result similar or different than natural join?
h. Perform inner join of relations assignment_r and assignment_s on attribute B and D and explain your result. How is this result similar or different than natural join?
i. Perform inner join of relations assignment_r and assignment_s by making assignment_r.A equal to assignment_s.E and explain your result.
j. Perform left join of relations assignment_r and assignment_s on attribute B and explain your result.
k. Perform right join of relations assignment_r and assignment_s on attribute B and explain your result.
l. Perform full outer join of relations assignment_r and assignment_s on attribute B and explain your result.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!