CSE 344 Midterm: CSE 344 UW 13 Spring Midterm Solution

40 views6 pages
31 Jan 2019
School
Course
Professor

Document Summary

Question 1. (42 points) sql queries and indexes. We have a database that stores information about a simplified twitter application. Each of these is assigned a unique tweet id (tid) and is stored in the tweet table. Finally, a user can follow other users and that information is recorded in the follow table. Follow. uid is a foreign key that references user. uid. Follow. followsuid is a foreign key that references user. uid. The queries you write must be proper sql that would be accepted by sql server and any other sql implementation. From user u, tweet t, post p. Where u. uid = p. uid and t. tid = p. tid and length(t. content) >= 100. Having count(*) > 5; (continued next page) Follow(uid, followsuid) (b) (16 points) an active user is one who is following more than 50 users. Write a sql query that retrieves the names of users who are being followed by one or more active users. Here are two possible solutions:

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