zoukankan      html  css  js  c++  java
  • SQL练习题27:你能使用子查询的方式找出属于Action分类的所有电影对应的title,description吗

    题目:

    你能使用子查询的方式找出属于Action分类的所有电影对应的title,description吗

    输入如:

    INSERT INTO film VALUES(1,'ACADEMY DINOSAUR','A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies');
    INSERT INTO film VALUES(2,'ACE GOLDFINGER','A Astounding Epistle of a Database Administrator And a Explorer who must Find a Car in Ancient China');
    INSERT INTO film VALUES(3,'ADAPTATION HOLES','A Astounding Reflection of a Lumberjack And a Car who must Sink a Lumberjack in A Baloon Factory');

    INSERT INTO category VALUES(1,'Action','2006-02-14 20:46:27');
    INSERT INTO category VALUES(2,'Animation','2006-02-14 20:46:27');
    INSERT INTO category VALUES(3,'Children','2006-02-14 20:46:27');
    INSERT INTO category VALUES(4,'Classics','2006-02-14 20:46:27');
    INSERT INTO category VALUES(5,'Comedy','2006-02-14 20:46:27');
    INSERT INTO category VALUES(6,'Documentary','2006-02-14 20:46:27');

    INSERT INTO film_category VALUES(1,1,'2006-02-14 21:07:09');
    INSERT INTO film_category VALUES(2,1,'2006-02-14 21:07:09');
    INSERT INTO film_category VALUES(3,6,'2006-02-14 21:07:09');

    程序:

    SELECT a.title, a.description
    FROM film AS a, category AS b, film_category AS c
    WHERE a.film_id = c.film_id
    AND c.category_id = b.category_id
    AND b.name = 'Action'
    
  • 相关阅读:
    core文件生成总结
    php 5.2 版本isset()方法小坑
    gdb调试memcached
    mysql的sql优化案例
    php对mongo操作问题
    memcache锁
    php的session实现
    linux指令tips
    php拦截器(魔术方法)
    Nginx源码研究八:nginx监听socket实现流程
  • 原文地址:https://www.cnblogs.com/zhuozige/p/13813708.html
Copyright © 2011-2022 走看看