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

网站建设教程微云网盘网页模板图片

网站建设教程微云网盘,网页模板图片,宁夏网络推广公司,html网页制作难吗目录 题目 准备数据 分析数据 总结 题目 一家公司想雇佣新员工。公司的工资预算是 $70000 。公司的招聘标准是: 继续雇佣薪水最低的高级职员,直到你不能再雇佣更多的高级职员。用剩下的预算雇佣薪水最低的初级职员。继续以最低的工资雇佣初级职员&…

目录

题目

准备数据

分析数据

总结


题目

一家公司想雇佣新员工。公司的工资预算是 $70000 。公司的招聘标准是:

  1. 继续雇佣薪水最低的高级职员,直到你不能再雇佣更多的高级职员。
  2. 用剩下的预算雇佣薪水最低的初级职员。
  3. 继续以最低的工资雇佣初级职员,直到你不能再雇佣更多的初级职员。

编写一个解决方案,查找根据上述条件雇用职员的 ID。
按 任意顺序 返回结果表。

准备数据

Create table If Not Exists Candidates (employee_id int, experience ENUM('Senior', 'Junior'), salary int)Truncate table Candidatesinsert into Candidates (employee_id, experience, salary) values ('1', 'Junior', '10000')insert into Candidates (employee_id, experience, salary) values ('9', 'Junior', '15000')insert into Candidates (employee_id, experience, salary) values ('2', 'Senior', '20000')insert into Candidates (employee_id, experience, salary) values ('11', 'Senior', '16000')insert into Candidates (employee_id, experience, salary) values ('13', 'Senior', '50000')insert into Candidates (employee_id, experience, salary) values ('4', 'Junior', '40000')

分析数据

with t1 as (selectemployee_id,sum(salary) over(order by salary rows between unbounded preceding and current row) total1from candidateswhere experience = 'Senior'
),t2 as (select max(total1) total from t1 where total1 <=70000
),t3 as (selectemployee_id,sum(salary) over(order by salary rows between unbounded preceding and current row) total2from candidateswhere experience = 'Junior'
)
select employee_id from t3,t2 where total2 < 70000 - ifnull(total,0)
union all
select employee_id from t1 where total1 <= 70000;

总结

与2004题不同的是,2004求个数,而2010是求employee_id.

http://www.ds6.com.cn/news/77241.html

相关文章:

  • 潍坊市建设监理协会网站宁波百度快照优化排名
  • 100款夜间必备软件app360优化大师官方最新
  • 佛山品牌网站设计制作网页设计模板网站免费
  • 主机屋怎么做网站seo基础视频教程
  • 岳阳网站建设哪里有站长工具爱站
  • 自己做网站升seo网络营销方案案例
  • 网站域名不要了怎么做公司宣传网页怎么做
  • ui设计培训机构有用吗南昌seo网站排名
  • 国际大型门户网站企业seo整站优化方案
  • 政府网站建设管理建议谷歌seo快速排名优化方法
  • php公司网站系统外包接单平台
  • 合肥企业网站制作广告营销策划方案模板
  • 网站开发iis怎么配置网站制作流程
  • 建设网站时seo标题培训心得体会范文
  • 网站收录查询主要由哪几个网站大数据精准营销的策略
  • 密云城乡住宅建设委员会网站自动推广软件免费
  • 企业营销策划 网站建设seo还有前景吗
  • 大型网站服务器价格宁波seo推广费用
  • 日本专门做恋足的网站b2b电子商务平台有哪些
  • 做网站建设电话销售新网站seo
  • 海口网站建设公司哪家好郑州百度关键词seo
  • 易思企业网站郑州seo建站
  • 公司简介100字范文郑州专业seo推荐
  • WordPress报价表seo优化运营专员
  • 免费网站程序全自动推广软件
  • 做淘宝店铺标志的网站域名查询万网
  • 网站页头长沙seo网站管理
  • 设计网站 站什么网网络推广代运营公司
  • 劳务公司网站怎么做东莞做网络推广的公司
  • 创意广告武汉seo软件