အားလုံးပဲ မင်္ဂလာပါ။ ဒီနေ့ 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

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 ကနေ ခလုတ်လေးတွေ လိုက်နှိပ်ပြီ...


