LeetCode_Study_Plan/SQL
-
1527. Patients With a Condition mysqlLeetCode_Study_Plan/SQL 2022. 9. 27. 12:51
https://leetcode.com/problems/patients-with-a-condition/?envType=study-plan&id=sql-i Patients With a Condition - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select * from Patients where conditions like 'DIAB1%' or conditions like '% DIAB1%';
-
1484. Group Sold Products By The Date mysqlLeetCode_Study_Plan/SQL 2022. 9. 27. 12:44
https://leetcode.com/problems/group-sold-products-by-the-date/ Group Sold Products By The Date - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select sell_date, count(distinct product) as num_sold, group_concat(distinct product) as products from Activities group by sell_date orde..
-
1667. Fix Names in a Table oracleLeetCode_Study_Plan/SQL 2022. 9. 27. 12:34
https://leetcode.com/problems/fix-names-in-a-table/ Fix Names in a Table - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select user_id, initcap(name) as name from users order by user_id; SQL 문법 참고 : https://1day1code.tistory.com/entry/SQL-%EB%AC%B8%EC%9E%90-%ED%95%A8%EC%88%98-LO..
-
196. Delete Duplicate Emails mysqlLeetCode_Study_Plan/SQL 2022. 9. 26. 22:08
https://leetcode.com/problems/delete-duplicate-emails/?envType=study-plan&id=sql-i Delete Duplicate Emails - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com delete from person where id not in ( select sub.min_id from ( select min(id) as min_id, email from person group by email) as ..
-
627. Swap Salary mysqlLeetCode_Study_Plan/SQL 2022. 9. 26. 21:48
https://leetcode.com/problems/swap-salary/?envType=study-plan&id=sql-i Swap Salary - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com UPDATE Salary SET sex = IF (sex = 'f','m','f') SQL의 if는 DDL에서도 사용 가능
-
1873. Calculate Special Bonus mysqlLeetCode_Study_Plan/SQL 2022. 9. 26. 21:42
https://leetcode.com/problems/calculate-special-bonus/?envType=study-plan&id=sql-i Calculate Special Bonus - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select employee_id, if (employee_id % 2 = 1 AND name NOT LIKE 'M%', salary, 0) as bonus from Employees order by employee_id;
-
183. Customers Who Never Order mysqlLeetCode_Study_Plan/SQL 2022. 9. 25. 16:01
https://leetcode.com/problems/customers-who-never-order/?envType=study-plan&id=sql-i Customers Who Never Order - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select c.name as Customers from customers as c left join orders as o on c.Id = o.customerId where o.id is null;
-
584. Find Customer Referee mysqlLeetCode_Study_Plan/SQL 2022. 9. 25. 15:49
https://leetcode.com/problems/find-customer-referee/?envType=study-plan&id=sql-i Find Customer Referee - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com SQL에서는 비교 연산자에서는 NULL이 배제된다. (반면 논리 연산자에서는 NULL이 배제되지 않는다.) # Write your MySQL query statement below select name from customer wh..