Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Modeling and Database Design

Authors: Narayan S. Umanath, Richard W. Scammel

2nd edition

1285085256, 978-1285085258

More Books

Students also viewed these Operating System questions

Question

How are most students funded?

Answered: 1 week ago

Question

Muntiechice

Answered: 1 week ago

Question

What is a multi-valued dependency?

Answered: 1 week ago

Question

Briefly list the steps used in strategic planning.

Answered: 1 week ago