SQLZOO练习题(1)

本文介绍了SQLZOO上的一组挑战性查询练习,包括如何将Oceania改名为Australasia,Eurasia和Turkey归属调整,以及Caribbean岛屿的归属变化。详细解答了一个涉及Case函数运用的问题,通过案例解释了如何根据特定条件为国家指定新的大陆归属。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SQLZOO练习题(1)

sqlzoo上较难的一些sql查询练习题及其解题思路。

在这里插入图片描述

题目
Put the continents right…

  • Oceania becomes Australasia
  • Countries in Eurasia and Turkey go to Europe/Asia
  • Caribbean islands starting with ‘B’ go to North America, other Caribbean islands go to South America
    Show the name, the original continent and the new continent of all countries.

答案

select name, continent, case
	when continent='oceania' then 'Au
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值