#274 Aggregating Employees by City
The following table is given:
DROP TABLE IF EXISTS employee;
CREATE TABLE IF NOT EXISTS employee (
name VARCHAR(30) PRIMARY KEY,
city VARCHAR(50)
);
INSERT INTO employee VALUES
('Ivanov', 'Moscow'),
('Petrov', 'Moscow'),
('Sidorov', 'Voronezh');
It is necessary to:
- Display a unique list of cities.
- Display the number of employees in each city.
- Display only cities where the number of employees is greater than 1.
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor