当前位置: 首页 > news >正文

SQL Zoo 8+.NSS Tutorial

以下数据来自SQL Zoo

1.at 'Edinburgh Napier University',studying '(8) Computer Science',Show the the percentage who STRONGLY AGREE.(在爱丁堡纳皮尔大学,学习“计算机科学”,显示STRONGLY AGREE的百分比)

SELECT A_STRONGLY_AGREEFROM nssWHERE question='Q01'AND institution='Edinburgh Napier University'AND subject='(8) Computer Science'

2.Show the institution and subject where the score is at least 100 for question 15.(列出第15题得分至少为100分的院校和科目)

SELECT institution,subjectFROM nssWHERE question='Q15'AND score >=100

3.Show the institution and score where the score for '(8) Computer Science' is less than 50 for question 'Q15'(在“Q15”题中,显示“(8)计算机科学”得分低于50分的院校和分数)

SELECT institution,scoreFROM nssWHERE question='Q15'AND score <50AND subject='(8) Computer Science'

4.Show the subject and total number of students who responded to question 22 for each of the subjects '(8) Computer Science' and '(H) Creative Arts and Design'.(请列出在“(8)计算机科学”和“(H)创意艺术与设计”两个科目中回答问题22的学生总数)

SELECT subject,sum(response)FROM nssWHERE question='Q22'AND (subject='(8) Computer Science' or subject = '(H) Creative Arts and Design') 
group by subject

5.Show the subject and total number of students who A_STRONGLY_AGREE to question 22 for each of the subjects '(8) Computer Science' and '(H) Creative Arts and Design'.(请列出在“(8)计算机科学”和“(H)创意艺术与设计”两个科目中强烈同意问题22的科目和学生总数)

SELECT subject,sum(response*A_STRONGLY_AGREE)/100FROM nssWHERE question='Q22'AND (subject='(8) Computer Science' or subject = '(H) Creative Arts and Design') 
group by subject

6.Show the percentage of students who A_STRONGLY_AGREE to question 22 for the subject '(8) Computer Science' show the same figure for the subject '(H) Creative Arts and Design'.(显示在“(8)计算机科学”科目中强烈同意问题22的学生的百分比,在“(H)创意艺术与设计”科目中显示相同的数字)

SELECT subject,ROUND(SUM(response*A_STRONGLY_AGREE) / SUM(response))
FROM nss
WHERE question = 'Q22'
AND   (subject = '(H) Creative Arts and Design' OR subject = '(8) Computer Science')
GROUP BY subject

7.Show the average scores for question 'Q22' for each institution that include 'Manchester' in the name.(显示名称中包含“曼彻斯特”的每所院校在“Q22”问题上的平均得分)

SELECT institution,round(sum(score*response)/sum(response))FROM nssWHERE question='Q22'AND (institution LIKE '%Manchester%')
group BY institution
order by institution

8.Show the institution, the total sample size and the number of computing students for institutions in Manchester for 'Q01'.(显示该院校、总样本量和曼彻斯特院校计算机专业学生的数量)

SELECT institution,sum(sample),SUM(CASE WHEN subject = '(8) Computer Science' THEN sample ELSE NULL END)FROM nssWHERE question='Q01'AND (institution LIKE '%Manchester%')
group by institution

http://www.lryc.cn/news/420063.html

相关文章:

  • conda pack迁移环境
  • UML建模案例分析-活动图商业建模
  • C++标准模板(STL)- 低层内存管理 - 解分配函数 (operator delete, operator delete[])
  • LeetCode 热题 HOT 100 (025/100)【宇宙最简单版】
  • 【mysql 第三篇章】一条 update语句是怎么持久化到磁盘上的?
  • 深入探索大模型:从基础到实践,开启AI之旅
  • 题解:力扣1567 - 返回乘积为正数的最长子数组
  • 009 | 上证50ETF基金数据分析及预测
  • Wakanda: 1靶场复现【附代码】(权限提升)
  • 内核函数调试
  • Spring IOC使用DButil实现对数据库的操作
  • Android14音频进阶调试之命令播放mp3/aac非裸流音频(八十)
  • vue中怎么自定义组件
  • BM1反转链表[栈+头插法]
  • VisionPro二次开发学习笔记10-使用 PMAlign和Fixture固定Blob工具检测孔
  • 学单片机怎么在3-5个月内找到工作?
  • 探索设计模式:观察者模式
  • gradio之持续输入,持续输出(流式)
  • Git 常用命令指南:从入门到精通
  • Camera驱动 汇总表【小驰行动派】
  • SSRS rdlc报表 九 在.net core中使用RDLC报表
  • 力扣(2024.08.10)
  • Django-文件上传
  • [Meachines] [Easy] valentine SSL心脏滴血+SSH-RSA解密+trp00f自动化权限提升+Tmux进程劫持权限提升
  • 利用单张/多张图内参数标定 OpenCV Python
  • The Llama 3 Herd of Models 第7部分视觉实验部分全文
  • 亚信安慧AntDB-T:使用Brin索引提升OLAP查询性能以及节省磁盘空间
  • web渗透测试常用命令
  • Kylin系列(二)使用
  • CI/CD——CI持续集成实验