Hackerrank SQL Solutions | Binary Tree Nodes SQL Hackerrank Medium Problem

Опубликовано: 17 May 2020
на канале: The Coding Mentor
6,241
62

In this video I am solving "Binary Tree Nodes" with you. This is a Medium SQL Problem on Hackerrank. See also my other videos for more SQL Problems.

MSSQL Solution for this Problem:

SELECT N, 'Root' FROM BST WHERE P is null

UNION

SELECT N, 'Inner' FROM BST
EXCEPT
(Select N, 'Inner' FROM BST WHERE P is null)
EXCEPT
(SELECT N, 'Inner' FROM BST
EXCEPT
SELECT DISTINCT P, 'Inner' FROM BST WHERE P is not NULL)

UNION

SELECT N, 'Leaf' FROM BST
EXCEPT
SELECT DISTINCT P, 'Leaf' FROM BST WHERE P is not NULL
ORDER BY N ASC
;
____________________________________________

SUBSCRIBE!
Do you want to understand how to solve SQL Problems in every detail? That's what my channel is about. When I was younger I thought I could never program because it looked way too difficult. The truth is that it takes time but with some patience anybody can do it! Follow me along and get better!
____________________________________________

SUPPORT MY CHANNEL

🙌The best way to support my channel right now is to give me a Super Thanks. You can do that by clicking thanks next to the title of the video. It is much appreciated!

____________________________________________

💾GitHub: https://github.com/CuriosityLeonardo?...
✋Add me on LinkedIn to get in contact:   / markus-friemann-221b3814b  


На этой странице сайта вы можете посмотреть видео онлайн Hackerrank SQL Solutions | Binary Tree Nodes SQL Hackerrank Medium Problem длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь The Coding Mentor 17 May 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 6,241 раз и оно понравилось 62 зрителям. Приятного просмотра!