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
Step: 1
ANSWER GIVEN THAT The SQL query below SELECT Usersuse...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started