SQL Interview Questions and Answers Series | HackerRank | Binary Tree Nodes (MEDIUM)
ฝัง
- เผยแพร่เมื่อ 29 มิ.ย. 2024
- Master Advanced SQL Selects for Interviews!
This video tackles a SQL challenge from HackerRank, focusing on advanced SELECT statements. Conquer your next data analyst interview by learning how to solve this problem and similar ones!
#sql #sqlinterviewquestions #sqlserver #sqltraining #hackerranksolutions #hackerrank #hackerranksolution #sqlforbeginners #sqltips #sqlite #interviewpreparation #interviewprep #interviewquestionsforfreshers #interviewtips #dataanalysts #sqlfordataengineer #programming
Hey Nishtha, i was looking for explanation for some of the logic for these Queries. thanks for making these videos. very helpful
उन्हें मत सराहो, जिन्होंने अनीति पूर्वक धन कमाया और सफलता पाई।
Your solution looks kinda complicated.....
"select N,
case
when (P is null) then 'Root'
when N IN (select P from BST) then 'Inner'
else 'Leaf'
end
from
BST
order by
N;"...I think this one looks more intuitive to understand for beginners....though the solution has a sub-query....(I hate sub-queries myself!)
@@sayanbanerjee7214 We could have done it using sub-query, No doubt. But writing subqueries always doesn’t give us efficient results. Instead, CTEs are far more prioritised when it comes to optimizing a sql query. Most recruiters focus on testing your ability to write CTEs. However, I appreciate your solution :)