အားလုံးပဲ မင်္ဂလာပါ။ ဒီနေ့ Day 19 အတွက်ကတော့ Leetcode ရဲ့ difficulties Easy level problem တစ်ပုဒ်ဖြစ်တဲ့ **511. Game Play Analysis I **ဆိုတဲ့ problem ကို ရွေးချယ်ထားပါတယ်။
1Example 1:2 3Input: 4Activity table:5+-----------+-----------+------------+--------------+6| player_id | device_id | event_date | games_played |7+-----------+-----------+------------+--------------+8| 1 | 2 | 2016-03-01 | 5 |9| 1 | 2 | 2016-05-02 | 6 |10| 2 | 3 | 2017-06-25 | 1 |11| 3 | 1 | 2016-03-02 | 0 |12| 3 | 4 | 2018-07-03 | 5 |13+-----------+-----------+------------+--------------+14Output: 15+-----------+-------------+16| player_id | first_login |17+-----------+-------------+18| 1 | 2016-03-01 |19| 2 | 2017-06-25 |20| 3 | 2016-03-02 |21+-----------+-------------+ဒီပုစ္ဆာ မှာတော့ Activity ဆိုတဲ့ table တစ်ခုပေးထားပါတယ်။ player_id ,device_id, event_date, games_played Column လေးတွေပါဝင်ပါတယ်။
"ကျွန်တော်တို့က player တစ်ယောက်ချင်းစီက login ပထမဆုံးဝင်တဲ့ရက်ကိုရှာပေးရမှာဖြစ်ပါတယ်။" ကျွန်တော်ကတော့ အောက်ပါအတိုင်းရေးဖြစ်ခဲ့ပါတယ်။
1**SQL**2 3SELECT player_id, MIN(event_date) AS 'first_login'4FROM Activity GROUP BY player_id;Player တစ်ယောက်ချင်းစီအတွက်ဆိုတော့ player id နဲ့ Group By လုပ်ပေးလိုက်ပြီး first date ဆိုတော့ Min function လေးသုံးပြီး event date လေးထည့်ပေးလိုက်ရင်အဆင်ပြေသွားပြီပဲဖြစ်ပါတယ်ဗျာ။ Video ကိုတော့အောက်က YouTube link လေးကနေတစ်ဆင့်ဝင်ကြည့်နိုင်ပါတယ်ဗျာ။ Stay safe and see you allပါဗျာ။
30 Days Of LeetCode Database Day 19 - 511. Game Play Analysis I
Watch on YouTubeDiscussion
Join the conversation
How do you feel about this article?
Comments
Sign in to join the conversation
Sign in to be the first to comment!
Share Your Article
Share with your professional network
Recent Articles

AWS - Application Load Balancer
Elastic Load Balancing (ELB) ELB ဆိုတာကတော့ request တွေကို တစ်နေရာတည်းမှ လက်ခံကာ Amazon EC2 instances၊ containers, etc.....

Terraform Day 3: Benefits of Terraform State
Terraform ကိုလေ့လာ တဲ့အခါ ကျွန််တော်တို့ရဲ့ Project Folder ထဲမှာ terraform.tfstate ဆိုတဲ့ ဖိုင်လေးကို တွေ့ဖူးကြပါလိမ့်မယ...

Terraform Day 2: Essential IaC Principles You Must Know
မနေ့ကတော့ Terraform အကြောင်း အကြမ်းဖျင်း Concept ကို ပြောပြခဲ့ပြီးပြီဆိုတော့ ဒီနေ့မှာတော့ Terraform ကို Professional ကျက...

TCP/IP Protocol
အားလုံးပဲမင်္ဂလာပါ။ ဒီနေ့ ကျွန်တော်တို့ TCP/IP Protocol အကြောင်း ဆွေးနွေးသွားပါမယ်။ ပထမဆုံးအနေနဲ့ TCP/IP ရဲ့ History လေး...

Terraform Day 1: Introduction to IAC and Terraform
ကျွန်တော်တို့ cloud အကြောင်း စပြောကြပြီဆိုရင် အရင်ဆုံး ခေါင်းထဲရောက်လာတာ Console ထဲဝင်၊ UI ကနေ ခလုတ်လေးတွေ လိုက်နှိပ်ပြီ...


