zoukankan      html  css  js  c++  java
  • JDBC编程--SQL基础

    ● 现在有一个学生表,一个课程成绩表,请问,怎么找出学生课程的最高分数,谈一谈思路

    无答案

    ● 现在,有一个组合索引(A,B,C),可以有哪几种查询方式?

    考察点:sql语句

    参考回答:

    优: select * from test where a=10 and b>50

    差: select * from test where b = 50

    优: select * from test order by a

    差: select * from test order by b

    差: select * from test order by c

    优: select * from test where a=10 order by a

    优: select * from test where a=10 order by b

    差: select * from test where a=10 order by c

    优: select * from test where a>10 order by a

    差: select * from test where a>10 order by b

    差: select * from test where a>10 order by c

    优: select * from test where a=10 and b=10 order by a

    优: select * from test where a=10 and b=10 order by b

    优: select * from test where a=10 and b=10 order by c

    优: select * from test where a=10 and b=10 order by a

    优: select * from test where a=10 and b>10 order by b

    差: select * from test where a=10 and b>10 order by c

    ● 写SQL:找出每个城市的最新一条记录。

    考察点:sql语句

    参考回答:

    id 城市 人口 信息 创建时间
    1 北京 100 info1 时间戳
    2 北京 100 info2 时间戳
    3 上海 100 info3 时间戳
    4 上海 100 info4 时间戳

  • 相关阅读:
    如何才能成为一个真正的编程高手?
    C#中base 关键字的作用
    线程间值的传递
    C#多线程 线程的启动
    C#接口的作用(经典)
    IEnumerable和IQueryable和Linq的查询
    CSS-定位
    HTML 常用标签
    CSS十大选择器
    前端开发师职业生涯入坑指南
  • 原文地址:https://www.cnblogs.com/sbclmy/p/10834969.html
Copyright © 2011-2022 走看看