본문 바로가기

SQL101

leetcode 1757. Recyclable and Low Fat Products 1 2 3 4 5 6 /* Write your PL/SQL query statement below */ select p.product_id from products p where 1=1 and p.low_fats='Y' and p.recyclable='Y' cs 2022. 3. 29.
hacker rank The Report 1 2 3 4 5 6 7 8 select case when g.grade >=8 then s.name else null end, g.grade, s.marks from students s join grades g on s.marks between g.min_mark and g.max_mark where s.marks > 8 order by g.grade desc, s.name, s.marks; cs 2022. 3. 29.
Hacker Rank Top Competitors 1 2 3 4 5 6 7 8 9 10 SELECT H.hacker_id, H.name FROM Submissions S INNER JOIN Challenges C ON S.challenge_id = C.challenge_id INNER JOIN Difficulty D ON C.difficulty_level = D.difficulty_level INNER JOIN Hackers H ON S.hacker_id = H.hacker_id WHERE S.score = D.score AND C.difficulty_level = D.difficulty_level GROUP BY H.hacker_id, H.name HAVING COUNT(H.hacker_id) > 1 ORDER BY COUNT(H.hacker_id) .. 2022. 3. 29.
Hacker rank Weather Observation Station 20 1 2 3 4 5 6 /* Enter your query here. Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error. */ select round(median(lat_n),4) from station Colored by Color Scripter cs 2022. 3. 29.
hacker rank Weather Observation Station 19 1 2 3 4 5 6 /* Enter your query here. Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error. */ select round(sqrt(power(min(LAT_N)-max(LAT_N), 2)+power(min(LONG_W)-max(LONG_W), 2)), 4) from station Colored by Color Scripter cs 2022. 3. 29.
Hackerrank Weather Observation Station 18 1 2 3 4 5 6 /* Enter your query here. Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error. */ select round((max(lat_n)-min(lat_n))+(max(long_w)-min(long_w)),4) from station Colored by Color Scripter cs 2022. 3. 29.
leetcode 627. Swap Salary 1 2 3 4 5 /* Write your PL/SQL query statement below */ update Salary set sex = case when sex = 'm' then 'f' when sex = 'f' then 'm' end cs 2022. 3. 17.
leetcode 620. Not Boring Movies 1 2 3 4 5 6 7 /* Write your PL/SQL query statement below */ select * from cinema where 1=1 and mod(id,2)=1 and description!='boring' order by rating desc cs 2022. 3. 17.
leetcode 596. Classes More Than 5 Students 1 2 3 4 5 /* Write your PL/SQL query statement below */ select class from courses group by class having count(*) >=5 cs 2022. 3. 17.
leetcode 197. Rising Temperature 1 2 3 4 5 /* Write your PL/SQL query statement below */ select t1.id as id from Weather t1,Weather t2 where (t1.recordDate-t2.recordDate)=1 and t1.temperature>t2.temperature cs 2022. 3. 17.
leetcode 183. Customers Who Never Order 1 2 3 4 5 /* Write your PL/SQL query statement below */ select c.name as customers from customers c, orders o where c.id=o.customerId(+) and o.customerId is null cs 2022. 3. 17.
leetcode 182. Duplicate Emails 1 2 3 4 5 /* Write your PL/SQL query statement below */ select email from person group by email having count(email)>1 cs 2022. 3. 17.