Hello I have a table w/the following information.
agent (agent_id, salary, city, country)
I'm trying to make a query that fullfils this request...
'List the number of agents and total salary for agents in each country with at least 6 cities.'
My issue is on how to group the unquie countries and count the number of cities related to the country. I'm not too sure on how to perform the sub query needed, or the group by clause. I'm trying stuff like the following...
select COUNT(agent_id) as numOfAgents, SUM(salary) as Salary, DISTINCT country
from agent
where city = (select COUNT(city) from agent where city > '5')
I know this query doesn't work, and I need to introduce the group by clause somehow.