- 博客(11)
- 收藏
- 关注
原创 SQLZOO_9 SELF JOIN
1.How many stops are in the database.select count(*) from stops;2.Find the id value for the stop ‘Craiglockhart’select id from stopswhere name='Craiglockhart';3.Give the id and the name for the stops on the ‘4’ ‘LRT’ service.select id,name from sto
2020-09-21 17:43:18
228
原创 SQLZOO_8 USING NULL
1.List the teachers who have NULL for their department.select name from teacherwhere dept is null;2.Note the INNER JOIN misses the teachers with no department and the departments with no teacher.SELECT teacher.name, dept.name FROM teacher INNER JOIN
2020-09-21 17:41:03
240
原创 SQLZOO_7 MORE JOIN
1.List the films where the yr is 1962 [Show id, title]SELECT id, title FROM movie WHERE yr=19622.Give year of ‘Citizen Kane’.select yr from moviewhere title='Citizen Kane'3.List all of the Star Trek movies, include the id, title and yr (all of the
2020-09-21 17:39:17
198
原创 SQLZOO_6 JOIN
1.The first example shows the goal scored by a player with the last name ‘Bender’. The * says to list all the columns in the table - a shorter way of saying matchid, teamid, player, gtimeModify it to show the matchid and player name for all goals scored b
2020-09-21 17:36:35
253
1
原创 SQLZOO_5 SUM and COUNT
1.Show the total population of the world.world(name, continent, area, population, gdp)SELECT SUM(population)FROM world2.List all the continents - just once each.select distinct continent from world3.Give the total GDP of Africaselect sum(gdp) from
2020-09-21 17:32:27
202
原创 SQLZOO_4 SELECT within SELECT
1.List each country name where the population is larger than that of ‘Russia’.world(name, continent, area, population, gdp)select name from world where population>(select population from worldwhere name='Russia')2.Show the countries in Europe with
2020-09-21 17:26:23
266
原创 SQLZOO_3 SELECT from Nobel
1.Change the query shown so that it displays Nobel prizes for 1950.SELECT yr, subject, winnerFROM nobelWHERE yr = 19502.Show who won the 1962 prize for Literature.SELECT winnerFROM nobelWHERE yr = 1962AND subject = ‘Literature’3.Show the year a
2020-09-21 17:17:28
328
原创 SQLZOO_2 SELECT from WORLD
1.Read the notes about this table. Observe the result of running this SQL command to show the name, continent and population of all countries.SELECT name, continent, population FROM world2.How to use WHERE to filter records. Show the name for the countr
2020-09-21 17:12:40
299
原创 SQLZOO_1 SELECT basic
1.The example uses a WHERE clause to show the population of ‘France’. Note that strings (pieces of text that are data) should be in ‘single quotes’;Modify it to show the population of GermanySELECT population FROM world WHERE name = 'Germany'2.Checki
2020-09-21 17:03:42
156
原创 某房地产平台数据运营SQL测试题目
某房地产平台的SQL测试题目题目:导出昨日需要发放线上成交奖励的订单及明细;表格名称:rpt_shh_deal_agreemment_base_da规则:1.当月截止昨天二手线上成交单量占比(含车位)>=50%的门店可获奖;2.符合获奖条件的门店shop_code的第1单线上成交可获得200贝壳币,第2单可获400贝壳币,第3单及以上可获800贝壳币,但车库不奖励;3.stat_function_name字段:“车位”、“车库”认为是车库;4.线上成交占比=线上成交单量/总成交单量;5
2020-09-19 23:46:59
521
1
原创 Python 用while()判断并输出1000以内(或10000以内)的水仙花数
什么是水仙花数:水仙花数是指一个 n 位数(n≥3 ),它的每个位上的数字的 n 次幂之和等于它本身(例如:1**3 + 5**3 + 3**3 = 153)思路解析判断这个数的位数是否是3位以上。(如果是1000以内的数字,问题比较简单,可以直接判断是否≥100;如果要判断的数还包括4位的,那还需要判断数字的位数,可以考虑用循环来做) 判断这个数各个位上的数字。(我认为这个是这个题的核心点) 各位上的数字的n次幂的和的计算。(循环) 第3点计算的值是否和该数字相等。(条件判断)具体解析
2020-08-29 17:47:47
5245
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人