SQL
早早下班
这个作者很懒,什么都没留下…
展开
-
牛客SQL28~29
SQL28查找描述信息(film.description)中包含robot的电影对应的分类名称(category.name)以及电影数目(count(film.film_id)),而且还需要该分类包含电影总数量(count(film_category.category_id))>=5部--SQL28select t2.name, count(t1.film_id)from film t1joincategory t2joinfilm_category t3on t1.film_id原创 2021-08-08 19:58:02 · 146 阅读 · 0 评论 -
牛客SQL1~23
牛客SQL1~23--SQL1select * from employees order by hire_date desc limit 1;--SQL2select * from employees order by hire_date desc limit 2,1;--SQL3select s.*, d.dept_nofrom dept_manager d, salaries swhere s.emp_no = d.emp_no order by s.emp_no asc;--SQL原创 2021-07-28 16:44:49 · 108 阅读 · 0 评论 -
牛客SQL25
牛客SQL25获取员工其当前的薪水比其manager当前薪水还高的相关信息,第一列给出员工的emp_no,第二列给出其manager的manager_no,第三列给出该员工当前的薪水emp_salary,第四列给该员工对应的manager当前的薪水manager_salary--SQL25select distinct t5.emp_no as emp_no, t6.emp_no as manager_no, t5.salary as emp_salary, t6.salary as mana原创 2021-07-28 16:24:00 · 115 阅读 · 0 评论 -
牛客SQL24
牛客SQL24获取所有非manager员工薪水情况,给出dept_no、emp_no以及salary,以上例子输出:--SQL24select t4.dept_no as dept_no, t3.emp_no as emp_no, t4.salary as salaryfrom (select t1.emp_no as emp_nofrom employees t1 left join dept_manager t2on t1.emp_no=t2.emp_nowhere t2.emp原创 2021-07-28 16:21:53 · 103 阅读 · 0 评论