1,146 views
0 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

Position:
Show:

Related questions

1 1 vote
2 answers 2 answers
1.1k
1.1k views
Rahhul A asked Aug 3, 2023
1,109 views
Consider the below instance of relation : Employee: Emp_ratingEmp_nameEmp_mailEmp_sal1.Surabhism301@[email protected]@dy60000 The maxi...
1 1 vote
1 answers 1 answer
1.6k
1.6k views
tusharb asked Mar 27, 2022
1,635 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 0 votes
0 0 answers
1.7k
1.7k views
aditi19 asked May 8, 2019
1,668 views
how to write the query for natural join on three relations in SQL using the NATURAL JOIN clause?
0 0 votes
0 0 answers
1.8k
1.8k views
kd..... asked Apr 30, 2019
1,807 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