Find departments that have duplicate department names.
sql
SELECT name,COUNT(*)FROM departments
GROUPBY name
HAVINGCOUNT(*)>1;
This query groups the records in the "departments" table by the "name" column and filters the results to return only those names that appear more than once.
PromptDB can make mistakes. Please double-check responses.