Question: Consider a photo-sharing Website, where users can post pictures, as well as comment and rate other users pictures. The schema is: Users(use rid, name) Comment(use
Consider a photo-sharing Website, where users can post pictures, as well as comment and rate other user’s pictures. The schema is:
Users(use rid, name)
Comment(use rid, pictured, score, text)
Picture(pictured, author, img)
The underlined attribute(s) represent the primary key for each relation
The database has the following constraints:
• Comment. use rid is a foreign key to Users. use rid
• Comment. pictured is a foreign key to the Picture. pictured
• Picture. the author is a foreign key to Users. use rid
• Comment. a score is an integer number between 1 and 10
• All attributes are NOT NULL
Write a SQL query that returns all users who have given a score of 8 or higher to 50 pictures or more. For each user, your query should return the user ID and the name
Step by Step Solution
3.48 Rating (158 Votes )
There are 3 Steps involved in it
ANSWER GIVEN THAT The SQL query below SELECT Usersuse... View full answer
Get step-by-step solutions from verified subject matter experts
