查出“张”姓学生中平均成绩大于75分的学生信息&查询出每门课程的成绩都大于80的学生

查询出“张”姓学生中平均成绩大于75分的学生信息

表名:student_score 
name course score 
张青 语文 72 
王华 数学 72 
张华 英语 81 
张青 物理 67 
李立 化学 98 
张燕 物理 70 
张青 化学 76

select * from student_score where name like ‘张%’ having avg(score) > 75

一个SQL查询出每门课程的成绩都大于80的学生姓名

https://www.cnblogs.com/hongyan5682/p/4816444.html

name   kecheng    fenshu 
张三     语文     81
张三     数学     75
李四     语文     76
李四     数学     90
王五     语文     81
王五     数学     100
王五     英语     90

SELECT S.name
FROM Student S
GROUP BY S.name
Having MIN(S.score)>=80

基础逻辑题

public static void main(String args[]) {
        int a;
        a=2;
        System.out.println(a);
        System.out.println(a++);
        System.out.println(a);
    }

结果: 

2
2
3

Process finished with exit code 0
   public static void main(String args[]) {

        int a=0;
        for (int i = 0; i < 4; i++) {
            if (i==1)continue;
            if (i==2)break;
            a+=i;
        }
        System.out.println(a);

    }

以上,考验的是你对此二关键字的掌握,当continue是跳出此次循环,而当break后,循环结束。

猜你喜欢

转载自blog.csdn.net/qq_43532342/article/details/84953740