The Databases Course
Exercise No. 5
More SQL and Design Theory - Theoretical
Due on January 26th by midnight
- Which research project(s) uses the largest number of sites?
- For each whale and each site such that the whale was used in that site more than twice, what is the number of different projects that were involved?
- What is the average age of animals participating in projects? If an animal participates in two projects, or twice in the same project, count it twice for the average.
- Same as (c), but if an animal participates in the same project more than once, count it only once for the average.
- Which animals were used in all the projects that were somehow active in 1994? Hint: This is a division question. Remember how we defined division using the other algebra operators - the 'minus' keyword is probably is quickest solution here as well.
- Show that any query using the 'in' predicate can be rewritten to use 'exists' instead.
- Show that any query using '>=all', '>any', '<>all' and others from this family of operators can be rewritten using the 'exists' predicate as well.
- X ® A1,A2,...,An if and only if for all i=1..n, X ® Ai.
- X1 ® X2, X2 ® X3, ..., Xn ® X1 if and only if for all i,j=1..n, Xi ® Xj.
- Find a non-redundant (= minimal) cover for F. Show, step by step, how the algorithm taught in class finds this minimal cover.
- Let X = { A , C }. Use the table algorithm to find X+F,AA.
- Find all the simple keys of R.