日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

HackerRank SQL练习题答案大全

發布時間:2023/12/20 数据库 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 HackerRank SQL练习题答案大全 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

太弱智的就不寫了


  • Weather Observation Station 5
select city,length(city) from station order by length(city),city limit 1; select city,length(city) from station order by length(city) desc,city limit 1;
  • Weather Observation Station 8
select city from station where city REGEXP '^[AEIOU].*[aeiou]$';
  • Higher Than 75 Marks
select name from students where marks > 75 order by right(name,3),id asc;
  • Type of Triangle
select case when(a+b>c and a+c>b and c+b>a) then ( case when(a=b and b=c) then 'Equilateral' when(a=b or b=c or a=c) then 'Isosceles' else 'Scalene' end ) else 'Not A Triangle' end from triangles;
  • The Blunder
select ceil(AVG(salary) - AVG(replace(salary,'0',''))) from employees;
  • Top Earners
select max(salary*months),count(employee_id) from employee where salary*months = (select max(salary*months) from employee);
  • Weather Observation Station 18
set @a =(select min(lat_n) from station); set @b = (select min(long_w) from station); set @c = (select max(lat_n) from station); set @d = (select max(long_w) from station); select round(@c+@d-@a-@b,4);
  • Draw The Triangle 1
set @i = 21; select repeat('* ',@i:=@i-1) from information_schema.tables limit 20;
  • Binary Tree Nodes
/* Enter your query here. */ select B2.N, case when ((select count(*) from BST B1 where B1.P = B2.N)=0) then 'Leaf' when (isnull(B2.P) = 1) then 'Root' else 'Inner' end from BST B2 order by B2.N;
  • Placements
/* Enter your query here. */ select T.name from (select S.Id Id,S.name name,P.Salary Salary,F.Friend_Id FId,(select Packages.Salary from Packages where Packages.Id=FId) FSalaryFROM Students S, Friends F, Packages Pwhere F.Id=S.Idand P.Id=S.Id ) T where FSalary>Salary order by FSalary;

總結

以上是生活随笔為你收集整理的HackerRank SQL练习题答案大全的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。