02.SELECT from Nobel Tutorial

注意:where语句中对表示条件的需要用单引号, 下面的译文使用的是有道翻译如有不正确,请直接投诉有道

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

译文:更改显示的查询,使其显示1950年的诺贝尔奖。

SELECT yr, subject, winner FROM nobel WHERE yr = 1950

02.Show who won the 1962 prize for Literature.

译文:展示谁获得了1962年的文学奖。

SELECT winner FROM nobel WHERE yr = 1962  AND subject = 'Literature'

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

译文:展示“爱因斯坦”获奖的年份和主题。

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

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

译文:请说出自2000年(包括2000年)以来的“和平”获奖者的名字。

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

05.Show all details (yrsubjectwinner) of the Literature prize winners for 1980 to 1989 inclusive.

译文:展示1980年至1989年包括在内的所有文学奖得主的详细资料(年份、主题、获奖作品)

select * from nobel where (yr between 1980 and 1989) and subject = 'Literature'

06.

Show all details of the presidential winners:

  • Theodore Roosevelt

  • Woodrow Wilson

  • Jimmy Carter

  • Barack Obama

译文:显示总统候选人的所有信息:

    西奥多。罗斯福

    伍德罗·威尔逊

    吉米•卡特

    巴拉克•奥巴马(Barack Obama)

SELECT * FROM nobel
WHERE winner IN ('Theodore Roosevelt',
'Woodrow Wilson',
'Jimmy Carter', 'Barack Obama')

07.Show the winners with first name John

译文:显示姓名的第一个字为约翰的获奖者

select winner from nobel where winner like 'John%'

08.Show the year, subject, and name of Physics winners for 1980 together with the Chemistry winners for 1984.

译文:展示1980年物理获奖者和1984年化学获奖者的年份、科目和名字。

select * from nobel where (yr=1980 and subject='Physics') or (yr=1984 and subject='Chemistry')

09.Show the year, subject, and name of winners for 1980 excluding Chemistry and Medicine

译文:请列出1980年的获奖年份、获奖科目和获奖名单,化学和医学除外

select * from nobel where yr=1980 and subject not in ('Chemistry','Medicine')

10.Show year, subject, and name of people who won a 'Medicine' prize in an early year (before 1910, not including 1910) together with winners of a 'Literature' prize in a later year (after 2004, including 2004)

译文:展示(1910年以前,不包括1910年)获得“医学奖”的人的信息,以及后来(2004年以后,包括2004年)获得“文学奖”的人的信息

select * from nobel where (yr<1910 and subject='Medicine') or (yr>=2004 and subject='Literature')

11.Find all details of the prize won by PETER GRÜNBERG

译文:找到彼得·格伦伯格获得的奖项的所有信息

select * from nobel where winner='PETER GRÜNBERG'

12.Find all details of the prize won by EUGENE O'NEILL

译文:找到尤金·奥尼尔获奖的所有信息

# 查询的名字里面有个单引号 需要使用两个单引号  即’EUGENE O’’NEILL’

select * from nobel where winner ='EUGENE O''NEILL'

13.List the winners, year and subject where the winner starts with Sir. Show the the most recent first, then by name order.

译文:列出获奖者的名字,年份和主题,获奖者以“先生”开头。先显示最近的,然后按名字顺序排列。

select winner,yr,subject from nobel where winner like 'Sir%' order by yr desc, winner asc

14.Show the 1984 winners and subject ordered by subject and winner name; but list Chemistry and Physics last.

译文:显示1984年获奖者和科目排序的科目和获奖者的名字;但是把化学和物理列在最后。

SELECT winner, subject
FROM nobel
WHERE yr=1984
ORDER BY subject in('Physics','Chemistry') ,subject,winner

练习网址:https://sqlzoo.net/wiki/SELECT_from_Nobel_Tutorial

——————————————————————————————————————————————————————————————————————————————————————————————————————————

SELECT from Nobel Tutorial的更多相关文章

  1. sqlzoo刷题 SELECT from Nobel Tutorial

    SELECT from Nobel Tutorial 1.Change the query shown so that it displays Nobel prizes for 1950. SELEC ...

  2. SQLZOO练习二--SELECT from Nobel Tutorial

    We continue practicing simple SQL queries on a single table. This tutorial is concerned with a table ...

  3. SQLZOO网页中SQL的答案(SELECT from nobel篇)

    SELECT from nobel篇 1. 更改查詢以顯示1950年諾貝爾獎的獎項資料. 答案: SELECT yr, subject, winner FROM nobel WHERE yr = 19 ...

  4. sqlzoo - SELECT from WORLD Tutorial 答案

    01.SELECT from WORLD Tutorial 01.显示所有国家的名称,大洲和人口. SELECT name, continent, population FROM world; 02. ...

  5. MySQL练习题--sqlzoo刷题2

    SELECT from Nobel Tutorial 1.Change the query shown so that it displays Nobel prizes for 1950. SELEC ...

  6. SQLZOO

    一.SELECT basics/zh 以顯示德國 Germany 的人口. select population from world where name = 'Germany'; 查詢面積為 5,0 ...

  7. SQLZOO 习题

    https://sqlzoo.net 8. 美國.印度和中國(USA, India, China)是人口又大,同時面積又大的國家.排除這些國家. 顯示以人口或面積為大國的國家,但不能同時兩者.顯示國家 ...

  8. sqlzoo.net刷题

    只发后面提升题目的题解,前面的太简单,写下来也没有意义 12.查找尤金•奧尼爾EUGENE O'NEILL得獎的所有細節 Find all details of the prize won by EU ...

  9. sqlzoo:3

    顯示1980年物理學(physics)獲獎者,及1984年化學獎(chemistry)獲得者. select yr,subject,winner from nobel ) ) 查看1980年獲獎者,但 ...

随机推荐

  1. cat快速查找文件内指定信息

    cat log.txt | grep "ERROR" | more 查找 log.txt 文件内 包含 “ERROR”  的信息,分屏显示

  2. Python3笔记016 - 4.1 序列

    第4章 序列的应用 python的数据类型分为:空类型.布尔类型.数字类型.字节类型.字符串类型.元组类型.列表类型.字典类型.集合类型 在python中序列是一块用于存放多个值的连续内存空间. py ...

  3. java语言进阶(七)_Lambda表达式

    1 函数式编程思想概述 在数学中,函数就是有输入量.输出量的一套计算方案,也就是"拿什么东西做什么事情".相对而言,面向对象过分强调"必须通过对象的形式来做事情" ...

  4. 用WebIDE(coding)编写c语言

    本期教程有对应视频 首先注册登录coding,打开coding的Cloud Studio 创建一个新的工作环境 安装依赖命令build-essential sudo apt-get update su ...

  5. 「区间DP」「洛谷P3205」「 [HNOI2010]」合唱队

    洛谷P3205 [HNOI2010]合唱队 题目: 题目描述 为了在即将到来的晚会上有更好的演出效果,作为 A 合唱队负责人的小 A 需要将合唱队的人根据他们的身高排出一个队形.假定合唱队一共 n 个 ...

  6. CF796C Bank Hacking 题解

    洛谷链接 题目 Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To ...

  7. 报错信息ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by............)

    报错信息ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by............) L ...

  8. 快讯:asuldb再立功,捕获史前大蛤

    蛤蛤日报7月7日讯 (蛤媒体记者 申蛤 戌蛤) 昨日下午,asuldb成功于生物实验室捕获史前大蛤.据考证,史前大蛤是一种名为楠楠的生物.这种生物体型庞大,距今已有至少1e18年的寿命.这种大蛤行为古 ...

  9. 肝了两天IntelliJ IDEA 2020,解锁11种新姿势, 真香!!!

    IDEA2020版本正式发布已经有3个月了,当时由于各方面原因(太懒)也没有去尝试新功能.于是这个周末特意去在另一个电脑上下载了最新版的IDEA,并尝试了一下.总的来说呢,体验上明显的提升. 作为一个 ...

  10. 2020年Dubbo30道高频面试题!还在为面试烦恼赶快来看看!

    前言 Dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案.简单的说,dubbo就是个服务框架,如果没有分布式的需求,其实是不需要用的,只有在分布式 ...