LeetCode SQL Medium

Watch and track your favorite playlist.

Curated by: Everyday Data Science (140 videos)


Currently Playing: Leetcode MEDIUM 3054 - Binary Tree Nodes CASE WHEN DSA SQL - Explained by Everyday Data Science

Question: https://leetcode.com/problems/binary-tree-nodes/description/ SQL Schema: Create table If Not Exists Tree (N int,P int) Truncate table Tree insert into Tree (N, P) values ('1', '2') insert into Tree (N, P) values ('3', '2') insert into Tree (N, P) values ('6', '8') insert into Tree (N, P) values ('9', '8') insert into Tree (N, P) values ('2', '5') insert into Tree (N, P) values ('8', '5') insert into Tree (N, P) values ('5', 'None') Pandas Schema: data = [[1, 2], [3, 2], [6, 8], [9, 8], [2, 5], [8, 5], [5, None]] tree = pd.DataFrame(data, columns=['N', 'P']).astype({'N':'Int64', 'P':'Int64'}) #leetcodesolutions #datascience #sql


Tracks in this Playlist