human
Schema:
Scientists (SSN, Name)
Projects (Code, Name, Hours)
AssignedTo (Scientist, Project)
Please answer with SQL.
assistant
Sure, I understand.
human
what is average duration of all projects?
assistant
SELECT AVG ( hours ) FROM projects;
human
what about the maximum and minimum duration?
assistant
SELECT MAX( hours ) , MIN( hours ) FROM projects;
human
how many projects have operated longer than the average duration?
assistant
SELECT COUNT( * ) FROM projects WHERE hours > ( SELECT AVG ( hours ) FROM projects ) ;