MySQL79 leetcode 1393. Capital Gain/Loss https://leetcode.com/problems/capital-gainloss/description/ Capital Gain/Loss - LeetCode Capital Gain/Loss - Table: Stocks +---------------+---------+ | Column Name | Type | +---------------+---------+ | stock_name | varchar | | operation | enum | | operation_day | int | | price | int | +---------------+---------+ (stock_name, operation_day) i leetcode.com 1 2 3 4 5 6 7 8 9 10 # Write your MySQL.. 2023. 1. 26. leetcode 1050. Actors and Directors Who Cooperated At Least Three Times 1 2 3 4 5 # Write your MySQL query statement below select actor_id, director_id from ActorDirector group by actor_id, director_id having count(actor_id)>=3 cs 2022. 7. 26. leetcode 1084. Sales Analysis III 1 2 3 4 5 6 7 8 # Write your MySQL query statement below select p.product_id, p.product_name from Sales s left join Product p on p.product_id = s.product_id group by s.product_id having min(s.sale_date)>='2019-01-01' and max(s.sale_date) 2022. 7. 18. leetcode 607. Sales Person 1 2 3 4 5 6 7 8 9 10 # Write your MySQL query statement below select s.name from SalesPerson s where s.name not in ( select s.name from orders o left join company c on o.com_id=c.com_id left join SalesPerson s on o.sales_id =s.sales_id where c.name ='RED' ) Colored by Color Scripter cs 2022. 7. 18. leetcode 1527. Patients With a Condition 1 2 3 4 5 6 # Write your MySQL query statement below select patient_id, patient_name, conditions from Patients where conditions like 'DIAB1%' or conditions like '% DIAB1%' cs 2022. 7. 18. leetcode 1729. Find Followers Count 1 2 3 4 5 # Write your MySQL query statement below select user_id, count(follower_id) as followers_count from Followers group by user_id order by user_id Colored by Color Scripter cs 2022. 7. 18. leetcode 1141. User Activity for the Past 30 Days I 1 2 3 4 5 # Write your MySQL query statement below SELECT activity_date AS day, COUNT(DISTINCT user_id) AS active_users FROM Activity WHERE DATEDIFF("2019-07-27", activity_date) 2022. 4. 2. leetcode 1158. Market Analysis I 1 2 3 4 5 6 7 8 # Write your MySQL query statement below select user_id as buyer_id, join_date, sum(case when order_id is not null then 1 else 0 end) as orders_in_2019 from users left join orders on users.user_id = orders.buyer_id and year(order_date) = 2019 group by user_id order by buyer_id Colored by Color Scripter cs 2022. 4. 1. leetcode 586. Customer Placing the Largest Number of Orders 1 2 3 4 5 6 # Write your MySQL query statement below select customer_number from Orders group by customer_number order by count(customer_number) desc limit 1 Colored by Color Scripter cs 2022. 4. 1. leetcode 584. Find Customer Referee 1 2 3 4 # Write your MySQL query statement below select name from Customer where referee_id!='2' or referee_id is null cs 2022. 4. 1. leetcode 1148. Article Views I 1 2 3 4 5 # Write your MySQL query statement below select distinct author_id as id from views where author_id=viewer_id order by 1 cs 2022. 3. 31. leetcode 511. Game Play Analysis I 1 2 3 4 # Write your MySQL query statement below select player_id, min(event_date) as first_login from Activity group by player_id cs 2022. 3. 31. 이전 1 2 3 4 5 6 7 다음