CSE 344 Midterm: CSE 344 UW Midterm Solution 11sp

14 views11 pages
31 Jan 2019
School
Course
Professor

Document Summary

100: this exam is a closed book exam, you have 50 minutes; budget time carefully, please read all questions carefully before answering them, some questions are easier, others harder. Plan to answer all questions, do not get stuck on one question: good luck! 1 sql and relational calculus: (40 points) A database with the following schema stores a collection of webpages and the words they contain, and a collection of dictionaries in several languages and the words in those languages: Dictionary(language, word: url represents a webpage, every webpage may contain several words, and every word may occur in several. A language occurs in a webpage if the webpage contains a word in that language. Solution: select y. language from occurs x, dictionary y where x. word = y. word group by y. language having count(*) > 1000. Dictionary(language, word) (b) (10 points) write a sql query that computes, for each webpage, the largest number of words on that page in any language.