# 有一个试卷作答记录表exam_record,请从中统计出总作答次数total_pv、
# 试卷已完成作答数complete_pv、已完成的试卷数complete_exam_cnt。

# 写法一:不用case when
# select count(id),count(score)
# ,(
#     select count(distinct exam_id)
#     from exam_record
# ) as complete_exam_cnt
# from exam_record

# 写法二:case when
select count(id)
,count(case when score is not null then 1 else null end )
,count(distinct CASE when score is not null then exam_id else null end)
from exam_record