Question

Question: List of products requested by at least two consumers Here are the column Names for...

Question: List of products requested by at least two consumers

Here are the column Names for the three tables.

Consumer Table: Con_ID | Name | City Product Table: Prod_ID Name MU

Requests Table: Con_ID | Prod_ID | Price | Quantity

Tables are called by Tb_Product, Tb_Offers, Tb_Requests

SELECT DISTINCT Tb_Product.Name

FROM Tb_Product, Tb_Consumer, Tb_Reqests .... ive been stuck on this question, not sure where to go from here.

Any help appriciated, thanks.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

NOTE: I created sample table and checked with the below code in sql server managament studio. It is working fine and giving desired ouput.

Still, If you have any doubts please let me know.

SELECT l.name
FROM dbo.Tb_Product l
INNER JOIN(
SELECT Prod_ID, count(Prod_ID) as 'count'
FROM [dbo].[Tb_Requests]
GROUP BY Prod_ID
having count(Prod_ID) >= 2
) r
ON r.Prod_ID = l.Prod_ID

Add a comment
Know the answer?
Add Answer to:
Question: List of products requested by at least two consumers Here are the column Names for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT