How many staff does each project has? List the project id and the number in an ascending order.
create table project_staff (project_id varchar, PRIMARY KEY (project_id)); create table projects (project_id varchar, PRIMARY KEY (project_id))
select t1.project_id, count(*) from project_staff as t1 join projects as t2 on t1.project_id = t2.project_id group by t1.project_id order by count(*)