【star star list】 id name There are N many stars, self-increase ID 【sing song list】 id name star_id N many songs 【movie movie Table】 id name star_id N多电影
Query how many songs and movies each star has in total name cout_sing count_movie
select a.name,count(b.id) as singnum,count(c.id) as movienum from star as a left join sing as b on a.id=b.star_id left join movie as c on c.star_id=a.id group by b.id,c.id.
select conut(tb1.id) as singnum
from star as tb3
left join sing as tb1 on tb1.starid=tb3.id
where tb3.id=somenoe
select a.name,count(b.id) as singnum,count(c.id) as movienum
from star as a
left join sing as b on a.id=b.star_id left join movie as c on c.star_id=a.id group by b.id,c.id.