အားလုံးပဲ မင်္ဂလာပါ။ ဒီနေ့ Day 15 အတွက်ကတော့ Leetcode ရဲ့ difficulties Easy level problem တစ်ပုဒ်ဖြစ်တဲ့ 584. Find Customer Referee ဆိုတဲ့ problem ကို ရွေးချယ်ထားပါတယ်။ ဒီပုစ္ဆာ အတွက်ကတော့ Customer ဆိုတဲ့ table တစ်ခုပဲပေးထားပါတယ်။ ဒီ table လေးထဲမှာကတော့ **id, name, referee_id **ဆိုပြီး column လေးတွေပါဝင်ပါတယ်။
1Example 1:
2
3Input:
4Customer table:
5+----+------+------------+
6| id | name | referee_id |
7+----+------+------------+
8| 1 | Will | null |
9| 2 | Jane | null |
10| 3 | Alex | 2 |
11| 4 | Bill | null |
12| 5 | Zack | 1 |
13| 6 | Mark | 2 |
14+----+------+------------+
15Output:
16+------+
17| name |
18+------+
19| Will |
20| Jane |
21| Bill |
22| Zack |
23+------+
24 ဒီပုစ္ဆာအတွက်ကတော့ ကျွန်တော်တို့က referee လုပ်တဲ့ customer က id 2 မဖြစ်ရဘူး။ ပြီးတော့လုံးဝ referee မရှိတဲ့ customer တွေရဲ့ name ကိုရှာပေးရမှာပဲဖြစ်ပါတယ်။ ကျွန်တော်ကတော့ အောက်ကအတိုင်း condition နှစ်ခုနဲ့ စစ်ပေးလိုက်ပါတယ်ဗျ။
1SELECT name FROM Customer WHERE
2referee_id != 2 OR referee_id IS NULL;Id က 2 မဟုတ်ရဘူး ပြီးတော့ null ဖြစ်ရမယ်ပေါ့ဗျာ။ ဒါဆို ဒီနေ့အတွက်လည်းအဆင်ပြေခဲ့ပါပြီဗျာ။ Video ကိုတော့အောက်က YouTube link လေးကနေတစ်ဆင့်ဝင်ကြည့်နိုင်ပါတယ်ဗျာ။ Stay safe and see you allပါဗျာ။
30 Days Of LeetCode Database Day 15 - 584. Find Customer Referee
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
Day 1 - Software Development ကို ပိုပြီးမြန်စေမယ့် CI/CD
Software တစ်ခုရေးပြီးပြီဆိုရင် "ငါ့စက်ထဲမှာတော့ အလုပ်လုပ်တယ်" ဆိုရုံနဲ့ မပြီးသေးပါဘူး။ User တွေသုံးမယ့် Server ပေါ်ရောက်...

Secure AWS ECR Github Action Using OIDC
Modern DevOps နှင့် Cloud Security တို့မှာ အဓိကဖြစ်လာသည့် Authentication System ယနေ့ခေတ် DevOps, Cloud Engineering, CI/C...

Manual vs Automated Infrastructure: Why "useradd" Still Matters in the Terraform Era
DevOps careerကို လျှောက်နေတဲ့သူတိုင်း Terraform၊ Ansible စတဲ့ Infrastructure as Code (IaC) tools တွေရဲ့ အလုပ်လုပ်နိုင်စွ...
From Surviving to Thriving
“AI ကြောင့် developer အလုပ်ပျောက်သွားမလား?” ဆိုတဲ့ မေးခွန်းကို Junior developer တိုင်း စဉ်းစားဖူးကြမှာပါ။ ဈေးကွက်အခြေအနေ...

AWS - Global Infra
AWS Global Infra AWS Global Infra & Service Type ဆိုတဲ့ ခေါင်းစဉ်နဲ့ ၂၀၂၅ ဒီဇင်ဘာမှာရေးထားဖူးတဲ့ article ကို အရင်ဆုံး ဖတ...

