본문 바로가기

SQL52

hackerrank Occupations https://www.hackerrank.com/challenges/occupations/problem?isFullScreen=true Occupations | HackerRank Pivot the Occupation column so the Name of each person in OCCUPATIONS is displayed underneath their respective Occupation. www.hackerrank.com 1 2 3 4 5 6 7 8 9 10 select min(case when occupation = 'Doctor' then name end) 'Doctor', min(case when occupation = 'Professor' then name end) 'Professor',.. 2022. 11. 13.
leetcode 1587. Bank Account Summary II 1 2 3 4 5 6 7 /* Write your PL/SQL query statement below */ select u.name, sum(t.amount) as balance from users u join Transactions t on u.account=t.account group by u.name having sum(t.amount)>10000 cs 2022. 3. 30.
leetcode 1693. Daily Leads and Partners 1 2 3 4 5 6 7 8 /* Write your PL/SQL query statement below */ select to_char(date_id, 'yyyy-mm-dd') as date_id , make_name , count(distinct lead_id) as unique_leads , count(distinct partner_id) as unique_partners from DailySales group by date_id, make_name cs 2022. 3. 29.
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 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.
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.
leetcode 181. Employees Earning More Than Their Managers 1 2 3 4 5 /* Write your PL/SQL query statement below */ select e1.name as employee from employee e1, employee e2 where e1.managerId=e2.id and e1.salary>e2.salary cs 2022. 3. 17.