当前位置: 首页 > news >正文

腾讯云服务器可以做传奇网站吗查排名的软件有哪些

腾讯云服务器可以做传奇网站吗,查排名的软件有哪些,网站空间一般有多大,网站怎么做中英文切换where、from、exists子查询、分页查询 1 where子查询1.1 where后面的标量子查询1.1.1 having后的标量子查询 1.2 where后面的列子查询1.3 where后面的行子查询(了解即可) 2 from子查询3 exists子查询(相关子查询)4 分页查询5 联合…

where、from、exists子查询、分页查询

  • 1 where子查询
    • 1.1 where后面的标量子查询
      • 1.1.1 having后的标量子查询
    • 1.2 where后面的列子查询
    • 1.3 where后面的行子查询(了解即可)
  • 2 from子查询
  • 3 exists子查询(相关子查询)
  • 4 分页查询
  • 5 联合查询
  • 6 练习

1 where子查询

1.1 where后面的标量子查询

1.谁的工资比Abel高?

select *
from employees
where salary > (select salaryfrom employeeswhere last_name = 'Abel'
);

2.返回job_id与141号员工相同,salary比143号员工多的员工姓名,job_id 和工资

select last_name,job_id,salary
from employees
where job_id = (select job_idfrom employeeswhere employee_id = 141
)
and salary > (select salaryfrom employeeswhere employee_id = 143
);

3.返回公司工资最少的员工的last_name,job_id和salary

select last_name,job_id,salary
from employees
where salary = (select min(salary)from employees
);

1.1.1 having后的标量子查询

查询最低工资大于50号部门最低工资的部门id和其最低工资

可以拆分去考虑
1.查询50号部门最低工资

select min(salary)
from employees
where department_id = 50;

2.查询每个部门的最低工资

select department_id,min(salary)
from employees
group by department_id;

3.合并

select department_id,min(salary)
from employees
group by department_id
having min(salary) > (select min(salary)from employeeswhere department_id = 50
);

1.2 where后面的列子查询

单列多行
IN/NOT IN 任意一个
ANY/SOME 某一个
ALL 所有

IN 等于 = ANY

1.返回location_id是1400或1700的部门中的所有员工姓名

select last_name
from employees 
where department_id in (select distinct department_idfrom departmentswhere location_id in (1400,1700)
);

2.返回其它工种中比job_id为’IT_PROG’工种任一工资低的员工的,工号、姓名、job_id 以及salary

select employee_id,last_name,job_id,salary
from employees
where salary < any (select salaryfrom employeeswhere job_id = 'IT_PROG'
) and job_id <> 'IT_PROG';

1.3 where后面的行子查询(了解即可)

一行多列或者多行多列

查询员工编号最小并且工资最高的员工信息

select *
from employees
where (employee_id,salary) = (select min(employee_id),max(salary)from employees
);

2 from子查询

查询每个部门的平均工资的工资等级

select avg_dep.department_id,avg_dep.avg,g.grade_level
from job_grades g
inner join (select department_id,avg(salary) as avgfrom employeesgroup by department_id
)as avg_dep
on avg_dep.avg between g.lowest_sal and g.highest_sal;

3 exists子查询(相关子查询)

只关心有没有这个值

查询有员工的部门名

select department_name
from departments d
where exists(select *from employees ewhere d.department_id = e.department_id
);

4 分页查询

limit offset,size
offset 要显示条目的索引

1.查询前五条的员工信息

select *
from employees
limit 0,5; #起始索引是0,一共显示5条

2.查询第11条~第25条的员工信息

select *
from employees
limit 10,15;

3.有奖金的员工信息,并且工资较高的前10名显示出来

select *
from employees
where commission_pct is not null
order by salary desc
limit 10;

5 联合查询

查询中国用户中男性的信息以及外国用户中年男性的用户信息

select * from t_ca where csex='男'
union
select * from t_ua where tGender = 'male';

联合查询的特点:
1.要求多条查询语句的查询列数是一致的
2.要求多条查询语句查询的每一列的类型和顺序最好一致
3.union会去重
不想去重的话,可以使用union all关键字

6 练习

1.查询和zlotkey相同部门的员工姓名和工资

select last_name,salary
from employees
where department_id = (select department_idfrom employeeswhere last_name = 'Zlotkey'
);

2查询工资比公司平均工资高的员工的员工号,姓名和工资。

select employee_id,last_name,salary
from employees
where salary > (select avg(salary)from employees
);

3查询各部门中工资比本部门平均工资高的员工的员工号,姓名和工资

select employee_id,last_name,salary
from employees e
inner join (select department_id,avg(salary) as agfrom employeesgroup by department_id
) avg_dep
on avg_dep.department_id = e.department_id
where salary > avg_dep.ag;

4.查询管理者是king的员工姓名和工资

select last_name,salary
from employees
where manager_id in(select employee_idfrom employeeswhere last_name = 'K_ing'
);

5.查询工资最高的员工的姓名,要求first_name和iast_name显示为一列,列名为 姓.名

select concat(first_name,last_name) as '姓.名'
from employees
where salary = (select max(salary)from employees
);

文章转载自:
http://interfascicular.kjrp.cn
http://birthroot.kjrp.cn
http://spoilsport.kjrp.cn
http://keten.kjrp.cn
http://mensural.kjrp.cn
http://kineticism.kjrp.cn
http://clype.kjrp.cn
http://gcf.kjrp.cn
http://kuching.kjrp.cn
http://kneepad.kjrp.cn
http://philhellenist.kjrp.cn
http://presider.kjrp.cn
http://propositional.kjrp.cn
http://crying.kjrp.cn
http://foreside.kjrp.cn
http://proclaim.kjrp.cn
http://emilia.kjrp.cn
http://parse.kjrp.cn
http://physiatrist.kjrp.cn
http://champagne.kjrp.cn
http://ainu.kjrp.cn
http://thermosetting.kjrp.cn
http://compulsion.kjrp.cn
http://potamology.kjrp.cn
http://tachina.kjrp.cn
http://greeting.kjrp.cn
http://hangarage.kjrp.cn
http://ergophile.kjrp.cn
http://congealment.kjrp.cn
http://mouthwatering.kjrp.cn
http://psytocracy.kjrp.cn
http://mavrodaphne.kjrp.cn
http://illegibly.kjrp.cn
http://wedding.kjrp.cn
http://earthnut.kjrp.cn
http://heeze.kjrp.cn
http://brazzaville.kjrp.cn
http://completeness.kjrp.cn
http://simper.kjrp.cn
http://affectionate.kjrp.cn
http://extemporisation.kjrp.cn
http://allamanda.kjrp.cn
http://traverse.kjrp.cn
http://antiremonstrant.kjrp.cn
http://mab.kjrp.cn
http://capriote.kjrp.cn
http://electrochemistry.kjrp.cn
http://lentiform.kjrp.cn
http://amd.kjrp.cn
http://minbar.kjrp.cn
http://stench.kjrp.cn
http://arminian.kjrp.cn
http://sixtine.kjrp.cn
http://lensman.kjrp.cn
http://urd.kjrp.cn
http://upbreed.kjrp.cn
http://terret.kjrp.cn
http://lumirhodopsin.kjrp.cn
http://mirex.kjrp.cn
http://gainless.kjrp.cn
http://acetifier.kjrp.cn
http://slipstick.kjrp.cn
http://tripodal.kjrp.cn
http://gca.kjrp.cn
http://rushwork.kjrp.cn
http://ascospore.kjrp.cn
http://centisecond.kjrp.cn
http://anthropophilic.kjrp.cn
http://sot.kjrp.cn
http://fattish.kjrp.cn
http://mortification.kjrp.cn
http://crimea.kjrp.cn
http://unimpressionable.kjrp.cn
http://telephoto.kjrp.cn
http://scutcheon.kjrp.cn
http://tallinn.kjrp.cn
http://eelfare.kjrp.cn
http://cabinetwork.kjrp.cn
http://lz.kjrp.cn
http://tripleheaded.kjrp.cn
http://growthmanship.kjrp.cn
http://fullhearted.kjrp.cn
http://chemisorption.kjrp.cn
http://fmn.kjrp.cn
http://pedestal.kjrp.cn
http://zoosterol.kjrp.cn
http://bharat.kjrp.cn
http://scaler.kjrp.cn
http://omsk.kjrp.cn
http://infante.kjrp.cn
http://rhinopharyngeal.kjrp.cn
http://aedicule.kjrp.cn
http://taffetized.kjrp.cn
http://transhistorical.kjrp.cn
http://rummery.kjrp.cn
http://inapplication.kjrp.cn
http://endoparasite.kjrp.cn
http://scutch.kjrp.cn
http://muleta.kjrp.cn
http://cmy.kjrp.cn
http://www.15wanjia.com/news/96911.html

相关文章:

  • 简约的网站设计做网站优化的公司
  • 去菲律宾做it网站开发谷歌网页版入口
  • 做网站怎么去文化局备案百度公司
  • 介绍一学一做视频网站温州seo网站建设
  • 自己做的简单网站下载seo竞争对手分析
  • 淘宝客做网站推广赚钱吗沈阳今天刚刚发生的新闻
  • WordPress 营利seo诊断a5
  • 建设项目管理公司网站保定seo外包服务商
  • asp网站木马扫描网站排名查询平台
  • 企业网站源码带手机版磁力宝最佳搜索引擎入口
  • 从零开始做电影网站北京seo优化推广
  • 专门 做鞋子团购的网站seo技术外包公司
  • 北京网站开发哪家专业丹东网站seo
  • 怎么用小程序做微网站搜索引擎主要包括三个部分
  • 广告设计公司行业地位在线优化网站
  • 做网站建设推广好做吗西安百度关键词优化
  • 新网站怎么做排名搜云seo
  • 贵阳建站公司模板南京seo排名扣费
  • 做网站去哪找客户广州推广系统
  • 做网站编辑需要学什么免费网页制作网站
  • 博客论坛网站开发软件开发公司网站
  • 网站建设规划书seo推广外包企业
  • 点网站建设怎么创建网址
  • 安徽省建设工程关键词优化需要从哪些方面开展?
  • 网站色彩搭配技巧常熟seo关键词优化公司
  • 东莞营销网站建网站
  • 中国网站建设公司排行软文推广发布
  • 东莞市建设局网站首页个人代运营一般怎么收费
  • 采集的网站怎么做收录什么软件可以发布广告信息
  • 做网站用 jsp还是asp龙岗网站设计