select
title
,description
from
(
select
film_id
from
category c
join film_category fc on c.category_id = fc.category_id
where
name = 'Action'
) cfc
join film f
title
,description
from
(
select
film_id
from
category c
join film_category fc on c.category_id = fc.category_id
where
name = 'Action'
) cfc
join film f
on cfc.film_id=f.film_id
本题主要有三点:
1.找到三个表之间的字段名的异同,结合需要查询和输出的目标值,想出表连接的先后顺序(关乎子查询嵌套);
2.子查询注意表要别名;
3.Action属于电影分类名称name;
4.select后面需要返回的值根据查询目标的需要选取,尽量简洁。