![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
练习
UnbreakableLim
这个作者很懒,什么都没留下…
展开
-
记录安装hive和mysql的那些坑
1.先装mysql再装hive2.根据这篇博文安装mysql:https://www.jianshu.com/p/276d59cbc529安装过程debug:https://blog.csdn.net/zxlhaoren/article/details/88022523Remove Your MySQL Config File很有用3.查询错误日志:/usr/local/mysql/data/hadoop01.err使用命令/usr/local/mysql/support-files/mysql.原创 2020-09-17 00:22:09 · 194 阅读 · 0 评论 -
linux下卸载系统自带mysql出错解决
错误信息:[hadoop@hadoop01 mysql]$ rpm -e mysql-libs-5.1.73-5.el6_6.x86_64error: Failed dependencies: libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64 libmysqlclient.so.16(libmysqlclient_16)(64bit) is neede原创 2020-09-13 23:20:45 · 166 阅读 · 0 评论 -
CRT连接Centos7配置IP,搭建集群时ping不通问题等解决
最近在学hadoop,记录一下自己用CRT连接虚拟机时遇到问题的处理方法。centos7将之前版本的默认网卡名改为了ensxx,可将其修改回eth01.用root用户登录(密码与配置的普通用户密码一样),在终端进入网卡配置所在目录,并查看目录下文件(我已经将网卡配置文件名改成了eth0,未改前是ifcfg-ens33)cd /etc/sysconfig/network-scriptsls2.修改网卡配置文件vim ifcfg-ens33[修改网卡配置文件:按insert切换修改模.原创 2020-08-20 16:15:43 · 899 阅读 · 0 评论 -
用正则爬取名言网——实现自动换页爬取及自动停止
# 导入库from urllib.request import urlopenimport re# 模拟浏览器发起请求url = 'http://quotes.toscrape.com/page/'for index in range(1, 30): uo = (url+str(index)+'/') response = urlopen(uo) # 获取网页内容 html_content = response.read().decode("utf-8")原创 2020-07-28 17:04:06 · 176 阅读 · 0 评论 -
用re库正则方法抓取名言网数据
写在前面:感谢马中华老师。# 导入库from urllib.request import urlopenimport re# 模拟浏览器发起请求url = 'http://quotes.toscrape.com/'# 第二页# url = 'http://quotes.toscrape.com/page/2/'# url = 'http://quotes.toscrape.com/page/3/'response = urlopen(url)# 获取网页内容html_content原创 2020-07-28 00:25:03 · 132 阅读 · 0 评论 -
SQLZOO:White Christmas
1.The units are 10th of a degree Celcius. The columns are yr and dy for year and day of month. The next twelve columns are for January through to December.Show the average daily temperature for August 10th 1964SELECT m8/10 FROM hadcet WHERE yr=1964 AND原创 2020-07-05 12:14:52 · 314 阅读 · 0 评论 -
SQLZOO:SELECT within SELECT Tutorial
SELECT within SELECT Tutorial1.List each country name where the population is larger than that of ‘Russia’.world(name, continent, area, population, gdp)SELECT name FROM worldWHERE population > (SELECT population FROM world WHERE name原创 2020-06-19 17:30:26 · 179 阅读 · 0 评论 -
牛客网sql实战:11-20
11.获取所有员工当前的(dept_manager.to_date=‘9999-01-01’)manager,如果员工是manager的话不显示(也就是如果当前的manager是自己的话结果不显示)。输出结果第一列给出当前员工的emp_no,第二列给出其manager对应的emp_no。select de.emp_no,dm.emp_no manager_nofrom dept_emp as de left join dept_manager as dmon de.dept_no=dm.dept_no原创 2020-07-04 17:21:13 · 202 阅读 · 0 评论 -
SQLZOO:COVID-19
The example uses a WHERE clause to show the cases in ‘Italy’ in March.Modify the query to show data from SpainSELECT name, DAY(whn), confirmed, deaths, recovered FROM covidWHERE name = 'Spain'AND MONTH(whn) = 3ORDER BY whn原创 2020-07-02 23:16:41 · 1342 阅读 · 11 评论 -
SQLZOO:Window functions
1.Show the lastName, party and votes for the constituency ‘S14000024’ in 2017.SELECT lastName, party, votes FROM ge WHERE constituency = 'S14000024' AND yr = 2017ORDER BY votes DESC在题目给出的范例基础上无脑改就完事了2.You can use the RANK function to see the orde原创 2020-06-27 21:07:26 · 500 阅读 · 2 评论 -
SQLZOO:8+ Numeric Examples
1.The example shows the number who responded for:question 1at ‘Edinburgh Napier University’studying ‘(8) Computer Science’Show the the percentage who STRONGLY AGREESELECT round(A_STRONGLY_AGREE/(A_STRONGLY_DISAGREE+A_DISAGREE+A_NEUTRAL+A_AGREE+A_原创 2020-06-26 20:51:46 · 398 阅读 · 3 评论 -
牛客网sql实战:1-10
1.查找最晚入职员工的所有信息,为了减轻入门难度,目前所有的数据里员工入职的日期都不是同一天select *from employeeswhere emp_no=10008;2.查找入职员工时间排名倒数第三的员工所有信息,为了减轻入门难度,目前所有的数据里员工入职的日期都不是同一天select * from employees where hire_date = (select distinct hire_date from employees原创 2020-06-25 21:05:40 · 150 阅读 · 0 评论 -
SQLZOO:Self join
1.How many stops are in the database.select count(name)from stops;2.Find the id value for the stop ‘Craiglockhart’SELECT IDFROM stopswhere name='Craiglockhart'3.Give the id and the name for the stops on the ‘4’ ‘LRT’ service.select id,namefrom s原创 2020-06-22 20:10:24 · 251 阅读 · 0 评论 -
SQLZOO:Using Null
1.List the teachers who have NULL for their department.Why we cannot use =You might think that the phrase dept=NULL would work here but it doesn’t - you can use the phrase dept IS NULLselect namefrom teacherwhere dept is null;原创 2020-06-21 14:56:54 · 167 阅读 · 0 评论 -
SQLZOO:More JOIN operations
2.Give year of ‘Citizen Kane’.select yrFROM movieWHERE title='Citizen Kane';3.List all of the Star Trek movies, include the id, title and yr (all of these movies include the words Star Trek in the title). Order results by year.select id,title,yrfrom原创 2020-06-20 17:01:56 · 177 阅读 · 0 评论 -
SQLZOO:Old JOIN Tutorial
2.Show the who and the color of the medal for the medal winners from ‘Sweden’.ttms(games,color,who,country)country(id,name)select who,colorfrom ttms join country on country=idwhere name='sweden';3.Show the years in which ‘China’ won a ‘gold’ medal原创 2020-06-20 14:01:46 · 267 阅读 · 1 评论 -
SQLZOO:The JOIN operation
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, gtimeSELECT * FROM goalWHERE player LIKE ‘%Bender’Modify it to show t原创 2020-06-20 02:47:32 · 188 阅读 · 0 评论 -
SQLZOO: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 world;3.Give the total GDP of Africaselect sum(gdp)原创 2020-06-19 19:58:34 · 122 阅读 · 0 评论