human
Schema:
Scientists (SSN, Name)
Projects (Code, Name, Hours)
AssignedTo (Scientist, Project)
Please answer with SQL.
assistant
Sure, I understand.
human
find the names of all projects.
assistant
SELECT name FROM projects;
human
how many scientists were assigned to each of them?
assistant
SELECT T1.name , COUNT( * ) FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project;
human
which one has the most scientists?
assistant
SELECT T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT( * ) DESC LIMIT 1 ;