方法一:

思路:

category 表与 film_category 表两表联结,查询出 Action 分类的电影,在和 film 表联结,找出属于 Action 分类的所有电影对应的 title,description

代码:

select
    title,
    description
from
    film f,
    (
        select
            film_id
        from
            film_category fy,
            category cy
        where
            fy.category_id = cy.category_id
            and name = 'Action'
    ) tem
where
    f.film_id = tem.film_id

方法二:

思路:使用两次子查询(子查询内嵌套子查询),通过 IN 谓词,film_id,category_id,将三个表层层嵌套查询。

代码:

SELECT
    f.title,
    f.description
FROM
    film f
WHERE
    f.film_id IN (
        SELECT
            fc.film_id
        FROM
            film_category fc
        WHERE
            fc.category_id IN (
                SELECT
                    c.category_id
                FROM
                    category c
                WHERE
                    c.NAME = 'Action'
            )
    )