231k views
3 votes
17. Write a SELECT query for the palateE4 database that produces a result grid listing paintName, and a count of the occurrences of each paintName value where the count for each paintName is greater than 2. Sort the result grid in ascending sequence by paintName.

User BobLoblaw
by
4.6k points

1 Answer

0 votes

Answer:

SELECT paintname, COUNT(paintname) as count_paintname

FROM paint

GROUP BY paintname HAVING COUNT(paintname) > 2

ORDER BY paintname

Step-by-step explanation:

The structured query language or SQL statement returns two columns of paintname and the count of the distinct paint names in the paint table with rows of grouped paint names greater than two and in the ascending order of the names.

User Pankaj Mundra
by
4.7k points