human
Schema:
repair (repair_ID, name, Launch_Date, Notes)
machine (Machine_ID, Making_Year, Class, Team, Machine_series, value_points, quality_rank)
technician (technician_id, Name, Team, Starting_Year, Age)
repair_assignment (technician_id, repair_ID, Machine_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
How many repair assignments are there in file?
assistant
SELECT COUNT( * ) FROM repair_assignment;
human
What about in terms of technicians?
assistant
SELECT technician_ID , COUNT( * ) FROM repair_assignment GROUP BY technician_ID;
human
Show me their names instead of ids.
assistant
SELECT T2.Name , COUNT( * ) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name ;