sqlzoo练习系列(二)——SELECT name
【Tips】
- sqlzoo官网链接:
- 每个系列开头介绍所用表及其信息
- 每道题均测试通过,含有题目描述、代码和结果
- 题目为自己简写,最好在官网查看具体题目
- 部分测试结果不完整,仅为一部分截图
SELECT name练习链接:
- name:国家名称
- continent:洲
SELECT name FROM world WHERE name LIKE 'Y%'
SELECT name FROM world WHERE name LIKE '%Y'
SELECT name FROM world WHERE name LIKE '%x%'
SELECT name FROM world WHERE name LIKE '%land'
SELECT name FROM world WHERE name LIKE 'C%ia'
SELECT name FROM world WHERE name LIKE '%oo%'
SELECT name FROM world WHERE name LIKE '%a%a%a%'
SELECT name FROM world WHERE name LIKE '_t%' ORDER BY name
SELECT name FROM world WHERE name LIKE '%o__o%'
SELECT name FROM world WHERE name LIKE '____'
SELECT name FROM world WHERE name = capital
SELECT name FROM world WHERE capital = concat(name, ' City')
SELECT capital,name FROM world WHERE capital LIKE concat('%',name,'%')
SELECT name,capital FROM world WHERE capital LIKE concat('%',name,'_%')
SELECT name, REPLACE(capital, name,'') FROM world WHERE capital LIKE concat('%',name,'_%')