习题地址:http://sqlzoo.net/1b.htm

表结构:  nobel(yr, subject, winner)

1a.Change the query shown so that it displays Nobel prizes for 1950.

select *
from nobel
where yr = 1950

1b.Show who won the 1962 prize for Literature.

select winner
from nobel
where yr = 1962 and subject = 'Literature'

2a.Show the year and subject that won 'Albert Einstein' his prize.

select yr, subject
from nobel
where winner = 'Albert Einstein'

2b.Give the name of the 'Peace' winners since the year 2000, including 2000.

select winner
from nobel
where subject = 'Peace' and yr >= 2000

2c.Show all details (yr, subject, winner) of the Literature prize winners for 1980 to 1989 inclusive.

select *
from nobel
where subject = 'Literature' and yr >= 1980 and yr <= 1989

2d.Show all details of the presidential winners: ('Theodore Roosevelt', 'Woodrow Wilson', 'Jed Bartlet', 'Jimmy Carter')

select *
from nobel
where winner in ('Theodore Roosevelt', 'Woodrow Wilson', 'Jed Bartlet', 'Jimmy Carter')

2e.Show the winners with first name John

select winner
from nobel
where winner like 'John%'

3a.In which years was the Physics prize awarded but no Chemistry prize. (WARNING - this question is way too hard for this level, you will need to use sub queries or joins).

select distinct yr
from nobel
where  yr in
(select distinct yr from nobel where subject = 'Physics')
and yr not in
(select distinct yr from nobel where subject = 'Chemistry')

 

转载于:https://www.cnblogs.com/Leo-Forest/archive/2012/06/01/2531319.html

SqlZoo.net习题答案:Using the SELECT statement.【nobel】相关推荐

  1. SqlZoo.net习题答案:How to do joins.【Album】

    习题地址:http://sqlzoo.net/3a.htm 表结构: album(asin, title, artist, price, release, label, rank) track(alb ...

  2. SQLZOO(中文版)习题答案(全)

    目录 SELECT basics/zh SELECT names/zh SQLZOO:SELECT from WORLD Tutorial/zh SELECT from Nobel Tutorial/ ...

  3. 整理对应_JSP第二版课后习题答案【侵权联系我删除】

    JSP第二版课后习题下载:https://download.csdn.net/download/weixin_42859280/11265785 JSP第二版课后习题答案下载:https://down ...

  4. JSP第二版课后习题答案初步不含颜色,冗杂【侵权联系我删除】

    JSP第二版课后习题下载:https://download.csdn.net/download/weixin_42859280/11265785 JSP第二版课后习题答案下载:https://down ...

  5. Oracle数据库PL SQL开发、Oracle-SQL开发习题答案

    第2章 编写简单的查询语句 练习1 1.使用两种方式查询所有员工(EMP)信息. SELECT *FROM emp;SELECT empno,ename,job,mgr,hiredate,sal,co ...

  6. 【R语言编程基础】【课后习题答案】【全】

    文章目录 第1章 R语言概述 1.选择题 2.操作题 第2章 数据对象与数据读写 1.选择题 2.操作题 第3章 数据集基本处理 1.选择题 2.操作题 第4章 函数与控制流 1.选择题 2.操作题 ...

  7. C++程序设计原理与实践 习题答案 第十五章 第15章习题答案

    第十五章:容器和迭代器 习题答案 Document 本章的文本编辑器实现,添加了一些功能 Document.h Document.cpp main.cpp 测试 List_Circular.h 我自己 ...

  8. sql在线练习网站(http://sqlzoo.cn)答案解析(1)

    一:SELECT(http://www.sqlzoo.cn/1.htm)     1a. 查看关于bbc表的详细说明         SELECT name, region, population F ...

  9. 编程的乐趣:用Python解算法谜题 课后习题答案

    说明:作者已经给了各章习题1的答案,其他的习题答案我来补充下,使用语言为Python3,有问题欢迎留言. 附习题一答案:https://mitpress.mit.edu/books/programmi ...

  10. C++ Primer - 5th Edition - 书中源代码 - 课后习题答案

    C++ Primer - 5th Edition - 书中源代码 - 课后习题答案 C++ Primer - 5th Edition - 书中源代码 - 课后习题答案 1. C++ Primer, 5 ...

最新文章

  1. java调用webservice_WebService学习总结(四)——调用第三方提供的webService服务
  2. 搜索引擎基本原理,产品知识普及帖
  3. inputstream转fileinputstream对象_Java Web--Servlet--HttpServletResponse对象
  4. 【数据竞赛】十大重要的时间组合特征!
  5. ES6 Map和Set的用法笔记
  6. Spring源码入门——DefaultBeanNameGenerator解析
  7. 在Linux下使用STM32CubeMX开发和调试STM32
  8. iOS开发之仿照LinkedIn登录界面效果
  9. Paul Graham:未来的互联网创业[转]
  10. 烧脑又过瘾!这个被严重低估的学习方法,看完瑟瑟发抖!
  11. java导出帆软pdf,java后台把fineRepo图表导出pdf格式时发生错误!
  12. 2019ICPC徐州 H - Yuuki and a problem (动态(带修)主席树 + 区间Mex问题)
  13. 看完20部电影,你可以去任何一家公司做董事长或总经理
  14. 扫码支付 (基于微信)
  15. UI设计师未来的发展趋势如何?前景好吗?
  16. 编写python程序按照单利方式计算理财产品收益
  17. SqlServer存储过程中循环的使用
  18. VMware安装win7后,安装VMware Tools时报错安装程序无法继续
  19. Auto.JS 教程(1)
  20. 蓝桥杯C/C++省赛:振兴中华

热门文章

  1. 「代码随想录」本周学习小结!(动态规划系列四)
  2. 适用于苹果Mac的 5 个最佳 SSH 客户端软件
  3. iPad 读不到 USB,在 Mac 上如何进行 USB 格式化?
  4. 如何从 Mac 上的“照片”中导出照片、视频和幻灯片放映?
  5. Zbrush 2022 for Mac(数字雕刻和绘画程序)
  6. 使用VLC Media Player 在Mac上修剪视频
  7. Python中各种括号的区别、用途及使用方法
  8. 我是如何在自学编程9个月后找到工作的
  9. 利用ISCSI存储技术构建IP存储网络(实战篇)
  10. 极棒开启AI挑战 全球寻找顶级语音合成“机械师”