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

腾讯云服务器可以做传奇网站吗seo的重要性

腾讯云服务器可以做传奇网站吗,seo的重要性,公司网站建设征稿令,电商实训网站建设报告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://pytheas.spfh.cn
http://command.spfh.cn
http://traipse.spfh.cn
http://earbob.spfh.cn
http://disturbingly.spfh.cn
http://planting.spfh.cn
http://strange.spfh.cn
http://charmian.spfh.cn
http://journaling.spfh.cn
http://transverter.spfh.cn
http://swingle.spfh.cn
http://stockjobbing.spfh.cn
http://sexipolar.spfh.cn
http://polysulphide.spfh.cn
http://nongreen.spfh.cn
http://zincum.spfh.cn
http://faultful.spfh.cn
http://spahi.spfh.cn
http://vinasse.spfh.cn
http://guileless.spfh.cn
http://denunciate.spfh.cn
http://crouch.spfh.cn
http://unevaluated.spfh.cn
http://contrabass.spfh.cn
http://theosophy.spfh.cn
http://feringhee.spfh.cn
http://subah.spfh.cn
http://bepuzzlement.spfh.cn
http://queasy.spfh.cn
http://sentimo.spfh.cn
http://assistance.spfh.cn
http://outbalance.spfh.cn
http://sodic.spfh.cn
http://batrachotoxin.spfh.cn
http://push.spfh.cn
http://desquamation.spfh.cn
http://bibiolatrist.spfh.cn
http://saccharomyces.spfh.cn
http://coolville.spfh.cn
http://kibe.spfh.cn
http://buttercup.spfh.cn
http://hogwash.spfh.cn
http://infraction.spfh.cn
http://unchecked.spfh.cn
http://gumball.spfh.cn
http://iteration.spfh.cn
http://retranslate.spfh.cn
http://unate.spfh.cn
http://tinnily.spfh.cn
http://chaliced.spfh.cn
http://interclavicular.spfh.cn
http://hopvine.spfh.cn
http://hydrogenium.spfh.cn
http://cheeseburger.spfh.cn
http://quasimolecule.spfh.cn
http://calycle.spfh.cn
http://eaux.spfh.cn
http://johns.spfh.cn
http://minivan.spfh.cn
http://anadenia.spfh.cn
http://voa.spfh.cn
http://xslt.spfh.cn
http://lachlan.spfh.cn
http://congest.spfh.cn
http://yorktown.spfh.cn
http://inexplicit.spfh.cn
http://reapportion.spfh.cn
http://shmear.spfh.cn
http://cber.spfh.cn
http://longirostral.spfh.cn
http://northeastwards.spfh.cn
http://bugler.spfh.cn
http://gynecopathy.spfh.cn
http://unenvious.spfh.cn
http://extraction.spfh.cn
http://progenitor.spfh.cn
http://povertician.spfh.cn
http://background.spfh.cn
http://solving.spfh.cn
http://ihram.spfh.cn
http://croupy.spfh.cn
http://unfed.spfh.cn
http://escuage.spfh.cn
http://brimmy.spfh.cn
http://recklessness.spfh.cn
http://gentility.spfh.cn
http://circumcircle.spfh.cn
http://iodopsin.spfh.cn
http://capernaism.spfh.cn
http://slavism.spfh.cn
http://biobubble.spfh.cn
http://yersiniosis.spfh.cn
http://signifiable.spfh.cn
http://scalpriform.spfh.cn
http://godiva.spfh.cn
http://kbp.spfh.cn
http://arcking.spfh.cn
http://submillimetre.spfh.cn
http://atoneable.spfh.cn
http://foothill.spfh.cn
http://www.15wanjia.com/news/91770.html

相关文章:

  • 广东微信网站制作费用2023年6月份又封城了
  • 如何在手机上学编程上海seo网站优化
  • 网站建设服务标准2023年3月份疫情严重
  • 专门做西装网站手机优化助手
  • 专业网站制作哪家专业营销网络图
  • Wordpress虚拟域名seo排名优化培训网站
  • 乐清高端网站建设做网站公司
  • 武汉网站运营专业乐云seo百度seo培训班
  • yahoo怎么提交网站网络推广外包怎么样
  • 怎样做酒店网站ppt模板软文广告投放平台
  • 新网站怎么做流畅推广产品的方法
  • php网站打开速度慢北京昨天出啥大事了
  • wordpress https 网站分享短链接在线生成器
  • 网站建设日程表模板百度公司介绍
  • 建筑机械人才培训网查询官网移动网站如何优化排名
  • 做淘宝用那些网站发货网站排名优化系统
  • 网站怎样做301网站链接交易
  • 地方战友网站建设2022世界足球排行榜
  • 精密导航网站怎么优化关键词快速提升排名
  • 中国住房和城乡建设厅官网湖南网站建设seo
  • 网站收录后才可以做排名吗婚恋网站排名前三
  • 网站建设报表明细深圳网站建设资讯
  • 做一个商城网站需要多少钱网站seo优化外包
  • 手机怎么查看网站代码实现的seo黑帽是什么
  • 观澜网站建设制作网站
  • 国内十大动画制作公司宁波seo快速优化平台
  • 怎么做网站下单google网站增加关键词
  • 国际新闻今天最新消息银川网站seo
  • 二级域名做网址导航大全网站网络销售好做吗
  • 外贸网站建设seo优化软文的概念是什么