• 2021-04-14
    1)根据表查询平均成绩大于等于60分的同学的学生编号和学生姓名和平均成绩
    2)根据表查询在SC表存在成绩的学生信息
    实验数据:
    学生表:
    createtableStudent(
    Sidvarchar(6),
    Snamevarchar(10),
    Sagedatetime,
    Ssexvarchar(10));
    insertintoStudentvalues('01','赵雷','1990-01-01','男');
    insertintoStudentvalues('02','钱电','1990-12-21','男');
    insertintoStudentvalues('03','孙风','1990-05-20','男');
    insertintoStudentvalues('04','李云','1990-08-06','男');
    insertintoStudentvalues('05','周梅','1991-12-01','女');
    insertintoStudentvalues('06','吴兰','1992-03-01','女');
    insertintoStudentvalues('07','郑竹','1989-07-01','女');
    insertintoStudentvalues('08','王菊','1990-01-20','女')
    成绩表
    createtableSC(
    Sidvarchar(10),
    Cidvarchar(10),
    scoredecimal(18,1));
    insertintoSCvalues('01','01',80);
    insertintoSCvalues('01','02',90);
    insertintoSCvalues('01','03',99);
    insertintoSCvalues('02','01',70);
    insertintoSCvalues('02','02',60);
    insertintoSCvalues('02','03',80);
    insertintoSCvalues('03','01',80);
    insertintoSCvalues('03','02',80);
    insertintoSCvalues('03','03',80);
    insertintoSCvalues('04','01',50);
    insertintoSCvalues('04','02',30);
    insertintoSCvalues('04','03',20);
    insertintoSCvalues('05','01',76);
    insertintoSCvalues('05','02',87);
    insertintoSCvalues('06','01',31);
    insertintoSCvalues('06','03',34);
    insertintoSCvalues('07','02',89);
    insertintoSCvalues('07','03',98)
    课程表
    createtableCourse(
    Cidvarchar(10),
    Cnamevarchar(10),
    Tidvarchar(10));
    insertintoCoursevalues
    ('01','语文','02');
    insertintoCoursevalues
    ('02','数学','01');
    insertintoCoursevalues
    ('03','英语','03')
    教师表
    createtableTeacher(
    Tidvarchar(10),
    Tnamevarchar(10));
    insertintoTeachervalues
    ('01','张三');
    insertintoTeachervalues
    ('02','李四');
    insertintoTeachervalues
    ('03','王五')