zoukankan      html  css  js  c++  java
  • SQL面试题1

    1.用一条SQL 语句 查询出每门课都大于80 分的学生姓名

    mysql> select * from students;
    +----------+---------+--------+
    | name     | kecheng | fenshu |
    +----------+---------+--------+
    | zhangsan | yuwen   |     81 |
    | zhangsan | shuxue  |     75 |
    | lisi     | yuwen   |     76 |
    | lisi     | shuxue  |     76 |
    | wangwu   | yuwen   |     81 |
    | wangwu   | shuxue  |    100 |
    | wangwu   | yingyu  |     90 |
    +----------+---------+--------+

    mysql> select distinct name from students where name not in (select distinct name from students where fenshu<=80);
    +--------+
    | name |
    +--------+
    | wangwu |

    mysql> select name from students group by name having min(fenshu)>80;
    +--------+
    | name |
    +--------+
    | wangwu |
    +--------+

     

    2.

  • 相关阅读:
    UVA
    UVA
    UVA
    UVA
    NLP介绍
    新建Springboot项目
    添加ssh密钥
    git 错误合集
    Git入门操作
    Hadoop MapReduce
  • 原文地址:https://www.cnblogs.com/wuxiping2019/p/12114542.html
Copyright © 2011-2022 走看看