CSE 344 Midterm: CSE 344 UW Midterm Solution 12wi

21 views13 pages
31 Jan 2019
School
Course
Professor

Document Summary

Please write your answers in the space provided. Consider a photo sharing website, where users can post pictures, as well as comment and rate other user"s pictures. For each user, your query should return the user. Solution: select x. uid, x. name from users x, comment y where x. uid = y. uid and y. score >= 8 group by x. uid, x. name having count(*) >= 50. Picture(pid, author, img) (b) (10 points) a picture is considered highly rated if it received at least one score of. 10, from a user other than its author. A cautious user is a user who commented only on highly rated pictures. (a user who did not comment at all is also cautious. ) Write a sql query that nds all cautious users. Your query should return a list of uid, name pairs. Solution: select x. uid, x. name from users x where x. uid not in (select y. uid.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents