613 views
0 votes
0 votes
Consider the relations.

$Supplier(\underline{S_{id}}, S_{Name}, S_{rating})$

$Parts(\underline{P_{id}}, P_{name}, P_{color})$

$Catalog(\underline{S_{id},  P_{id}}, cost)$

$ \text{Que: Retrieve $S_{id}$’s supplied atleast 2 parts}$
 

SELECT $C_1.S_{id}$

FROM $\text{Catalog as $C_1$}$

GROUP BY ($C_{1}.S_{id} ,C_{1}.P_{id} $)

HAVING $count(*)  > 1;$

Please verify is this correct querry.

1 Answer

Related questions

1 votes
1 votes
1 answer
2
tusharb asked Mar 27, 2022
687 views
I want to join the two tables of movies and actors and then output only those results that have gender =”F”, can you tell me where I am going wrong?
0 votes
0 votes
0 answers
3
aditi19 asked May 8, 2019
810 views
how to write the query for natural join on three relations in SQL using the NATURAL JOIN clause?
0 votes
0 votes
0 answers
4
kd..... asked Apr 30, 2019
680 views
Here why does the 5th query select * from employees natural join works_on where PID = 'X' AND PID='Y'; is not workingThe queries are The output are