အားလုံးပဲ မင်္ဂလာပါ။ ဒီနေ့ Day 26 အတွက်ကတော့ Leetcode ရဲ့ difficulties Easy level problem တစ်ပုဒ်ဖြစ်တဲ့ 620. Not Boring Movies ဆိုတဲ့ problem ကို ရွေးချယ်ထားပါတယ်။
1Table: Cinema2 3+----------------+----------+4| Column Name | Type |5+----------------+----------+6| id | int |7| movie | varchar |8| description | varchar |9| rating | float |10+----------------+----------+11id is the primary key (column with unique values) for this table.12Each row contains information about the name of a movie, its genre, and its rating.13rating is a 2 decimal places float in the range [0, 10]ဒီပုစ္ဆာ မှာတော့ Cinema ဆိုတဲ့ table လေးကိုပေးထားပါတယ်။
1Example 1:2 3Input: 4Cinema table:5+----+------------+-------------+--------+6| id | movie | description | rating |7+----+------------+-------------+--------+8| 1 | War | great 3D | 8.9 |9| 2 | Science | fiction | 8.5 |10| 3 | irish | boring | 6.2 |11| 4 | Ice song | Fantacy | 8.6 |12| 5 | House card | Interesting | 9.1 |13+----+------------+-------------+--------+14Output: 15+----+------------+-------------+--------+16| id | movie | description | rating |17+----+------------+-------------+--------+18| 5 | House card | Interesting | 9.1 |19| 1 | War | great 3D | 8.9 |20+----+------------+-------------+--------+21Explanation: 22We have three movies with odd-numbered IDs: 1, 3, and 5. The movie with ID = 3 is boring so we do not include it in the answer.23 ကျွန်တော်တို့လုပ်ပေးဖို့လိုတာကတော့ id က မဂဏန်းဖြစ်ပြီး description က boring နဲ့မညီတဲ့ record တွေကို ရှာပေးရမှာပဲဖြစ်ပါတယ်။ Order ကိုလည်း rating နဲ့ DESC စီပေးရမှာပဲဖြစ်ပါတာ်။ ကျွန်တော်ကတော့ အောက်ကအတိုင်းလေး ရေးဖြစ်ခဲ့ပါတယ်ဗျာ။
1**SQL**2 3SELECT * FROM Cinema WHERE 4MOD(id, 2) != 0 AND description != 'boring' ORDER BY rating DESC;ပထမဆုံးအနေနဲ့ Id က မဂဏန်း ဖြစ်ရမယ်ဆိုတော့ MOD function လေးသုံးပြီး အကြွင်းရှာလိုက်ပါတယ်။ 2 နဲ့စား လို့ 0 နဲ့ မညီရဘူးဆိုပြီး မဂဏန်းဖြစ်အောင်စစ်ပေးလိုက်ပါတယ်။ Description ကိုလည်း boring နဲ့မညီရဘူးဆိုပြီးစစ်လိုက်ပြီးတော့ rating ကို DESC order စီပေးလိုက်ပါတယ်ဗျာ။
ဒါဆိုရင် လိုချင်တဲ့အဖြေလေးရရှိသွားပြီပဲဖြစ်ပါတယ်ဗျာ။ Video ကိုတော့အောက်က YouTube link လေးကနေတစ်ဆင့်ဝင်ကြည့်နိုင်ပါတယ်ဗျာ။ Stay safe and see you allပါဗျာ။
30 Days Of LeetCode Database Day 26 - 620. Not Boring Movies
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 2 - GitHub Actions ရဲ့ အဓိက Concepts များနှင့် Runner အကြောင်း
ပြီးခဲ့တဲ့အပတ် Day 1 တုန်းက ကျွန်တော်တို့ CI/CD ရဲ့ Concept တွေကို အကြမ်းဖျင်း ပြောခဲ့ကြပြီးပြီနော်။ ဒီနေရာမှာ လက်တွေ့မစ...
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 တိုင်း စဉ်းစားဖူးကြမှာပါ။ ဈေးကွက်အခြေအနေ...

