Oracle SQL面试题精解与应用示例.pdfVIP

  • 1
  • 0
  • 约4.95千字
  • 约 4页
  • 2026-03-13 发布于北京
  • 举报

OracleSQL面试题

一:客户表a(id,name,address),登陆流水表

b(id,time),购物流水表c(id,time,

productid,productnum)

1.求每个客户的登陆时间time、name和客户id:selecta.id,

a.name,d.timeastimefromaleftjoin(selectid,max(time)astime

frombgroupbyid)dona.idd.id;2.查登陆并且已经商品的客户

id、name及登陆的时间time(一条SQL语句):selecta.id,a.name,

d.timeastimefroma,(selectid,max(time)astimefrombgroupbyid)

dwherea.idd.idandexists(select*fromcwhereid=a.id);

二:一个表student中有班级cla、学号id和成

绩grade

1.计算各个班的平均成绩

selectcla,avg(grade)

fromstudentgroupby

cla;

2.查找比该班平均成绩高的学生的班级cla、学号id和成绩grade。

selecta.cla,a.id,a.gradefromstudentawhere

文档评论(0)

1亿VIP精品文档

相关文档