小肥羊666

sunicequeen
2425 号测试 成员, 2020-03-25 01:55:40 加入
1.9k
个人主页浏览
  • 20200325 数据库连接查询面试题作业

    2020-07-24 10:57

    本节课作业:
    #6 查询出语文最高分
    select Max(score) from SC b
    inner join Course c on b.Cno=c.Cno
    where c.Cname="语文";
    #8 查询语数外三门成绩的平均分
    select avg(score) from sc b
    inner join course c on b.Cno=c.Cno
    group by c.Cno
    #9 查询报名孤独求败老师课程的学生信息
    select * from teacher d
    inner join course c on d.Tno=c.Tno
    and d.Tname="孤独求败"
    inner joinsc b on c.Cno=b.Cno
    right join Student a on a.Sno=b.Sno;

  • 20200324 连接查询作业

    2020-07-24 10:57

    根据课上的emp和dept表完成下列作业:
    1、查询张姓员工的员工信息和所在部门信息。
    select * from emp as a inner join dept as b on a.dept_id=b.id
    where a.name like "张%";
    2、查询张三丰管理了几个员工
    select count(*) from emp as a inner join emp as b on a.id=b.leader where a.name="张三丰" and b.is_enable=1;
    3、查询出所有实习员工(实习员工无部门信息)
    select * from emp as a left join dept as b on a.dept_id=b.id
    where b.id is null and is_enable=1;