首先查看world表的字段: name continent area population gdp capital tld flag SELECT * FROM world: 2.显示人口至少为2亿的国家/地区的名称.2亿=200million SELECT name FROM world ; 3.给出人口至少2亿的国家的名称和人均国内生产总值. ; 4.显示continent ='South America'的国家的名称和人口. 将人口除以100万,以获得数百万人口,也就是population…
SELECT from Nobel Tutorial 1.Change the query shown so that it displays Nobel prizes for 1950. SELECT yr, subject, winner FROM nobel : 2.Show who won the 1962 prize for Literature. and subject='literature'; 3.Show the year and subject that won 'Alber…
SELECT from Nobel Tutorial 1.Change the query shown so that it displays Nobel prizes for 1950. SELECT yr, subject, winner FROM nobel WHERE yr = 1950 2.Show who won the 1962 prize for Literature. SELECT winner FROM nobel WHERE yr = 1962 AND subject =…
面试阶段大家基本都会问一些mysql的题,具体的高深理论以后再慢慢补充,但是刷题是不可避免的,下面直接上货 创建/删除表和索引系列 创建表 CREATE TABLE if not exists `test_date` ( `id` int(11) NOT NULL AUTO_INCREMENT, `date` date DEFAULT NULL, `temp` int(11) NOT NULL, `updateTime` timestamp NOT NULL DEFAULT '0000-00-0…
user_profile表: id device_id gender age university province 1 2138 male 21 北京大学 Beijing 2 3214 male 复旦大学 Shanghai 3 6543 female 20 北京大学 Beijing 4 2315 female 23 浙江大学 ZheJiang 5 5432 male 25 山东大学 Shandong question_pratice_detail表: id device_id questi…
PE刷题记录 PE60 / 20%dif 这道题比较坑爹. 所有可以相连的素数可以构成一张图,建出这张图,在其中找它的大小为5的团.注意上界的估算,大概在1W以内.1W内有1229个素数,处理出这些素数的关系,然后dfs这张图找出大小为5的团. /*** * @name Prime pair sets * @author zball * @algorithm Sieve for primes and dfs search for finding a set of primes */ #inclu…
大四狗找工作,要刷题了,leetcode上面题目比较适合面试算法类题目,也不纯粹为了蒙题,锻炼一下面试类型的思维 Single Number: 有N个数,其中只有一个数出现了一次,其他都是两次,找出那个数 把所有数求一下异或 Maximum Depth of Binary Tree: 求树的最大深度 递归遍历一遍 Same Tree: 给两个树的根节点,看两棵树是否相同 两棵树同时遍历一遍 Reverse Integer: 输出这个数倒过来的数 注意负数情况,模拟一下即可 Best Time t…
写在前面:因为要准备面试,开始了在[LeetCode]上刷题的历程.LeetCode上一共有大约150道题目,本文记录我在<http://oj.leetcode.com>上AC的所有题目,以Leetcode上AC率由高到低排序,基本上就是题目由易到难.我应该会每AC15题就过来发一篇文章,争取早日刷完.所以这个第一篇就是最简单的15道题了. 部分答案有参考网上别人的代码,和leetcode论坛里的讨论,很多答案肯定有不完美的地方,欢迎提问,指正和讨论. No.1 Single NumberGi…