For each condition, ask: is it about one row, or about a group? A condition on one row goes in WHERE. A condition on an aggregate goes in HAVING.
- Run the query in the editor and read the error. Fix it: show each
countryand its number of customers, only where that number is more than 1. - Show each
department_idand the number of its employees who earn more than 60000. Keep only the departments where that number is 2 or more. - Show each
customer_idand the number of their orders with the statusdeliveredorshipped. Keep only the customers with 2 or more of those orders. Sort: most orders first, then by customer_id.