Purpose:
You may make a copy of a worksheet and complete this activity, type your answers in any text editor, or simply write on paper(s).
You may work alone or with 3-4 other students in this course.
T(Q) = 2500 = number of tuples in relation Q V(Q,a) = 30 = number of distinct values of attribute a in relation Q V(Q,b) = 500 = number of distinct values of attribute b in relation Q T(R) = 6000 = number of tuples in relation R V(R,a) = 60 = number of distinct values of attribute a in relation R V(R,c) = 20 = number of distinct values of attribute c in relation R V(R,d) = 40 = number of distinct values of attribute d in relation R T(S) = 1000 = number of tuples in relation S V(S,b) = 250 = number of distinct values of attribute b in relation S V(S,d) = 100 = number of distinct values of attribute d in relation S
Estimate the size (number of tuples) of the result of the following query
SELECT * FROM R NATURAL JOIN S WHERE R.a = 22 AND S.b = 90
instructor(ID, name, dept_name, salary) T(instructor) = 13 #of tuples V(dept_name) = 4 #of distinct values department(dept_name, building, budget) T(department) = 5 #of tuples V(dept_name) = 5 #of distinct values
Find the buildings of departments where more than two instructors are working
SELECT D.dept_name, D.building ROM instructor I NATURAL JOIN department D GROUP BY D.dept_name, D.building HAVING COUNT(*) > 2 Assume: each department is located in exactly one building
(-2.5 points) for 24 hours late (submitted after
4-Apr-2024 12pm/noon EST, by 5-Apr-2024 12pm/noon EST)
(-5 points) for 48 hours late (submitted after
5-Apr-2024 12pm/noon EST, by 6-Apr-2024 12pm/noon EST)
(-2.5 points) for 24 hours late (submitted after
6-Apr-2024 12pm/noon EST, by 7-Apr-2024 12pm/noon EST)
(-5 points) for 48 hours late (submitted after
7-Apr-2024 12pm/noon EST, by 8-Apr-2024 12pm/noon EST)