CSE 344 Final: CSE 344 UW 14 Winter Final Solution

31 views13 pages
31 Jan 2019
School
Course
Professor

Document Summary

Question 1. (21 points, 7 each) sql. We have a small database with information about people and events. Where: person contains information about all people in the database. Each person has a unique integer id (pid), which is the key: event is a list of all events. Each event has a unique integer event id (eid), which is the key. The attribute going has the value 1 if the person will attend the event and is 0 if not. Attributes pid and eid are foreign keys referencing person and event respectively. Write sql queries that return the information described below. Grading note: in many cases there are other possible queries that produce the requested answers. From invited i, event e. From event e, invited i. Having count(i. pid) >= all (select count(i2. pid) From invited i2, event e2. Two events overlap if one starts while the other is in progress.