A simple group by
<p><a href="https://i.stack.imgur.com/b7ZkW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b7ZkW.png" alt="enter image description here"></a></p>

<p>The question is that List the SUPPLIER_ID, supplier NAME and the number of products each supplier has provided. List only those that have supplied more than 2 products. [Use PRODUCT and SUPPLIER tables]</p>

<pre><code>SELECT  S.SUPPLIER_ID, S.NAME, COUNT(S.PRODUCT_ID)
FROM PRODUCT P, SUPPLIER S
WHERE P.SUPPLIER_ID = S.SUPPLIER_ID
GROUP BY NAME;

SELECT SUPPLIER_ID,  COUNT(PRODUCT_ID)
FROM SUPPLIER, PRODUCT
WHERE  SUPPLIER.SUPPLIER_ID = PRODUCT.SUPPLIER_ID
GROUP BY NAME;
</code></pre>

<p>I tried the both ways, but they won't work. What are problems? </p>