Hi, I am MLV Prasad.
I am a Deep-Learning Enthusiast,I create content on Youtube on Various topics of Data Science.
This repository is an All in one Code Solution Repository of LEETCODE SQL QUESTIONS (220+) and video Explanations on my Channel here: Youtube
If you find this channel and this repository helpful, you can Support by subscribing to it...💫
| S.No | Ques.No | Question Name | Category | Solution video | Code |
|---|---|---|---|---|---|
| 01 | 175 | Combine Two Tables | Easy | - | - |
| 02 | 176 | Second Highest Salary | Medium | - | - |
| 03 | 177 | Nth Highest Salary | Medium | - | - |
| 04 | 178 | Rank Scores | Medium | - | - |
| 05 | 180 | Consecutive Numbers | Medium | - | - |
| 06 | 181 | Employees Earning More Than Their Managers | Easy | - | - |
| 07 | 182 | Duplicate Emails | Easy | - | - |
| 08 | 183 | Customers Who Never Order | Easy | - | - |
| 09 | 184 | Department Highest Salary | Medium | - | - |
| 10 | 185 | Department Top Three Salaries | Hard | - | - |
| 11 | 196 | Delete Duplicate Emails | Easy | - | - |
| 12 | 197 | Rising Temperature | Easy | - | - |
| 13 | 262 | Trips and Users | Hard | - | - |
| 14 | 511 | Game Play Analysis I | Easy | - | - |
| 15 | 512 | Game Play Analysis II | Easy | - | - |
| 16 | 534 | Game Play Analysis III | Medium | - | - |
| 17 | 550 | Game Play Analysis IV | Medium | - | - |
| 18 | 569 | Median Employee Salary | Hard | - | - |
| 19 | 570 | Managers with at Least 5 Direct Reports | Medium | - | - |
| 20 | 571 | Find Median Given Frequency of Numbers | Hard | - | - |
| 21 | 574 | Winning Candidate | Medium | - | - |
| 22 | 577 | Employee Bonus | Easy | - | - |
| 23 | 578 | Get Highest Answer Rate Question | Medium | - | - |
| 24 | 579 | Find Cumulative Salary of an Employee | Hard | - | - |
| 25 | 580 | Count Student Number in Departments | Medium | - | - |
| 26 | 584 | Find Customer Referee | Easy | - | - |
| 27 | 585 | Investments in 2016 | Medium | - | - |
| 28 | 586 | Customer Placing the Largest Number of Orders | Easy | - | - |
| 29 | 595 | Big Countries | Easy | - | - |
| 30 | 596 | Classes More Than 5 Students | Easy | - | - |
| 31 | 597 | Friend Requests I: Overall Acceptance Rate | Easy | - | - |
| 32 | 601 | Human Traffic of Stadium | Hard | - | - |
| 33 | 602 | Friend Requests II: Who Has the Most Friends | Medium | - | - |
| 34 | 603 | Consecutive Available Seats | Easy | - | - |
| 35 | 607 | Sales Person | Easy | - | - |
| 36 | 608 | Tree Node | Medium | - | - |
| 37 | 610 | Triangle Judgement | Easy | - | - |
| 38 | 612 | Shortest Distance in a Plane | Medium | - | - |
| 39 | 613 | Shortest Distance in a Line | Easy | - | - |
| 40 | 614 | Second Degree Follower | Medium | - | - |
| 41 | 615 | Average Salary: Departments VS Company | Hard | - | - |
| 42 | 618 | Students Report By Geography | Hard | - | - |
| 43 | 619 | Biggest Single Number | Easy | - | - |
| 44 | 620 | Not Boring Movies | Easy | - | - |
| 45 | 626 | Exchange Seats | Medium | - | - |
| 46 | 627 | Swap Salary | Easy | - | - |
| 47 | 1045 | Customers Who Bought All Products | Medium | - | - |
| 48 | 1050 | Actors and Directors Who Cooperated At Least Three Times | Easy | - | - |
| 49 | 1068 | Product Sales Analysis I | Easy | - | - |
| 50 | 1069 | Product Sales Analysis II | Easy | - | - |
| 51 | 1070 | Product Sales Analysis III | Medium | - | - |
| 52 | 1075 | Project Employees I | Easy | - | - |
| 53 | 1076 | Project Employees II | Easy | - | - |
| 54 | 1077 | Project Employees III | Medium | - | - |
| 55 | 1082 | Sales Analysis I | Easy | - | - |
| 56 | 1083 | Sales Analysis II | Easy | - | - |
| 57 | 1084 | Sales Analysis III | Easy | - | - |
| 58 | 1097 | Game Play Analysis V | Hard | - | - |
| 59 | 1098 | Unpopular Books | Medium | - | - |
| 60 | 1107 | New Users Daily Count | Medium | - | - |
| 61 | 1112 | Highest Grade For Each Student | Medium | - | - |
| 62 | 1113 | Reported Posts | Easy | - | - |
| 63 | 1126 | Active Businesses | Medium | - | - |
| 64 | 1127 | User Purchase Platform | Hard | - | - |
| 65 | 1132 | Reported Posts II | Medium | - | - |
| 66 | 1141 | User Activity for the Past 30 Days I | Easy | - | - |
| 67 | 1142 | User Activity for the Past 30 Days II | Easy | - | - |
| 68 | 1148 | Article Views I | Easy | - | - |
| 69 | 1149 | Article Views II | Medium | - | - |
| 70 | 1158 | Market Analysis I | Medium | - | - |
| 71 | 1159 | Market Analysis II | Hard | - | - |
| 72 | 1164 | Product Price at a Given Date | Medium | - | - |
| 73 | 1173 | Immediate Food Delivery I | Easy | - | - |
| 74 | 1174 | Immediate Food Delivery II | Medium | - | - |
| 75 | 1179 | Reformat Department Table | Easy | - | - |
| 76 | 1193 | Monthly Transactions I | Medium | - | - |
| 77 | 1194 | Tournament Winners | Hard | - | - |
| 78 | 1204 | Last Person to Fit in the Bus | Medium | - | - |
| 79 | 1205 | Monthly Transactions II | Medium | - | - |
| 80 | 1211 | Queries Quality and Percentage | Easy | - | - |
| 81 | 1212 | Team Scores in Football Tournament | Medium | - | - |
| 82 | 1225 | Report Contiguous Dates | Hard | - | - |
| 83 | 1241 | Number of Comments per Post | Easy | - | - |
| 84 | 1251 | Average Selling Price | Easy | - | - |
| 85 | 1264 | Page Recommendations | Medium | - | - |
| 86 | 1270 | All People Report to the Given Manager | Medium | - | - |
| 87 | 1280 | Students and Examinations | Easy | - | - |
| 88 | 1285 | Find the Start and End Number of Continuous Ranges | Medium | - | - |
| 89 | 1294 | Weather Type in Each Country | Easy | - | - |
| 90 | 1303 | Find the Team Size | Easy | - | - |
| 91 | 1308 | Running Total for Different Genders | Medium | - | - |
| 92 | 1321 | Restaurant Growth | Medium | - | - |
| 93 | 1322 | Ads Performance | Easy | - | - |
| 94 | 1327 | List the Products Ordered in a Period | Easy | - | - |
| 95 | 1336 | Number of Transactions per Visit | Hard | - | - |
| 96 | 1341 | Movie Rating | Medium | - | - |
| 97 | 1350 | Students With Invalid Departments | Easy | - | - |
| 98 | 1355 | Activity Participants | Medium | - | - |
| 99 | 1364 | Number of Trusted Contacts of a Customer | Medium | - | - |
| 100 | 1369 | Get the Second Most Recent Activity | Hard | - | - |
| 101 | 1378 | Replace Employee ID With The Unique Identifier | Easy | - | - |
| 102 | 1384 | Total Sales Amount by Year | Hard | - | - |
| 103 | 1393 | Capital Gain/Loss | Medium | - | - |
| 104 | 1398 | Customers Who Bought Products A and B but Not C | Medium | - | - |
| 105 | 1407 | Top Travellers | Easy | - | - |
| 106 | 1412 | Find the Quiet Students in All Exams | Hard | - | - |
| 107 | 1421 | NPV Queries | Easy | - | - |
| 108 | 1435 | Create a Session Bar Chart | Easy | - | - |
| 109 | 1440 | Evaluate Boolean Expression | Medium | - | - |
| 110 | 1445 | Apples & Oranges | Medium | - | - |
| 111 | 1454 | Active Users | Medium | - | - |
| 112 | 1459 | Rectangles Area | Medium | - | - |
| 113 | 1468 | Calculate Salaries | Medium | - | - |
| 114 | 1479 | Sales by Day of the Week | Hard | - | - |
| 115 | 1484 | Group Sold Products By The Date | Easy | - | - |
| 116 | 1495 | Friendly Movies Streamed Last Month | Easy | - | - |
| 117 | 1501 | Countries You Can Safely Invest In | Medium | - | - |
| 118 | 1511 | Customer Order Frequency | Easy | - | - |
| 119 | 1517 | Find Users With Valid E-Mails | Easy | - | - |
| 120 | 1527 | Patients With a Condition | Easy | - | - |
| 121 | 1532 | The Most Recent Three Orders | Medium | - | - |
| 122 | 1543 | Fix Product Name Format | Easy | - | - |
| 123 | 1549 | The Most Recent Orders for Each Product | Medium | - | - |
| 124 | 1555 | Bank Account Summary | Medium | - | - |
| 125 | 1565 | Unique Orders and Customers Per Month | Easy | - | - |
| 126 | 1571 | Warehouse Manager | Easy | - | - |
| 127 | 1581 | Customer Who Visited but Did Not Make Any Transactions | Easy | - | - |
| 128 | 1587 | Bank Account Summary II | Easy | - | - |
| 129 | 1596 | The Most Frequently Ordered Products for Each Customer | Medium | - | - |
| 130 | 1607 | Sellers With No Sales | Easy | - | - |
| 131 | 1613 | Find the Missing IDs | Medium | - | - |
| 132 | 1623 | All Valid Triplets That Can Represent a Country | Easy | - | - |
| 133 | 1633 | Percentage of Users Attended a Contest | Easy | - | - |
| 134 | 1635 | Hopper Company Queries I | Hard | - | - |
| 135 | 1645 | Hopper Company Queries II | Hard | - | - |
| 136 | 1651 | Hopper Company Queries III | Hard | - | - |
| 137 | 1661 | Average Time of Process per Machine | Easy | - | - |
| 138 | 1667 | Fix Names in a Table | Easy | - | - |
| 139 | 1677 | Product's Worth Over Invoices | Easy | - | - |
| 140 | 1683 | Invalid Tweets | Easy | - | - |
| 141 | 1693 | Daily Leads and Partners | Easy | - | - |
| 142 | 1699 | Number of Calls Between Two Persons | Medium | - | - |
| 143 | 1709 | Biggest Window Between Visits | Medium | - | - |
| 144 | 1715 | Count Apples and Oranges | Medium | - | - |
| 145 | 1729 | Find Followers Count | Easy | - | - |
| 146 | 1731 | The Number of Employees Which Report to Each Employee | Easy | - | - |
| 147 | 1741 | Find Total Time Spent by Each Employee | Easy | - | - |
| 148 | 1747 | Leetflex Banned Accounts | Medium | - | - |
| 149 | 1757 | Recyclable and Low Fat Products | Easy | - | - |
| 150 | 1767 | Find the Subtasks That Did Not Execute | Hard | - | - |
| 151 | 1777 | Product's Price for Each Store | Easy | - | - |
| 152 | 1783 | Grand Slam Titles | Medium | - | - |
| 153 | 1789 | Primary Department for Each Employee | Easy | - | - |
| 154 | 1795 | Rearrange Products Table | Easy | - | - |
| 155 | 1809 | Ad-Free Sessions | Easy | - | - |
| 156 | 1811 | Find Interview Candidates | Medium | - | - |
| 157 | 1821 | Find Customers With Positive Revenue this Year | Easy | - | - |
| 158 | 1831 | Maximum Transaction Each Day | Medium | - | - |
| 159 | 1841 | League Statistics | Medium | - | - |
| 160 | 1843 | Suspicious Bank Accounts | Medium | - | - |
| 161 | 1853 | Convert Date Format | Easy | - | - |
| 162 | 1867 | Orders With Maximum Quantity Above Average | Medium | - | - |
| 163 | 1873 | Calculate Special Bonus | Easy | - | - |
| 164 | 1875 | Group Employees of the Same Salary | Medium | - | - |
| 165 | 1890 | The Latest Login in 2020 | Easy | - | - |
| 166 | 1892 | Page Recommendations II | Hard | - | - |
| 167 | 1907 | Count Salary Categories | Medium | - | - |
| 168 | 1917 | leetcodify Friends Recommendations | Hard | - | - |
| 169 | 1919 | Leetcodify Similar Friends | Hard | - | - |
| 170 | 1934 | Confirmation Rate | Medium | - | - |
| 171 | 1939 | Users That Actively Request Confirmation Messages | Easy | - | - |
| 172 | 1949 | Strong Friendship | Medium | - | - |
| 173 | 1951 | All the Pairs With the Maximum Number of Common Followers | Medium | - | - |
| 174 | 1965 | Employees With Missing Information | Easy | - | - |
| 175 | 1972 | First and Last Call On the Same Day | Hard | - | - |
| 176 | 1978 | Employees Whose Manager Left the Company | Easy | - | - |
| 177 | 1988 | Find Cutoff Score for Each School | Medium | - | - |
| 178 | 1990 | Count the Number of Experiments | Medium | - | - |
| 179 | 2004 | The Number of Seniors and Juniors to Join the Company | Hard | - | - |
| 180 | 2010 | The Number of Seniors and Juniors to Join the Company II | Hard | - | - |
| 181 | 2020 | Number of Accounts That Did Not Stream | Medium | - | - |
| 182 | 2026 | Low-Quality Problems | Easy | - | - |
| 183 | 2041 | Accepted Candidates From the Interviews | Medium | - | - |
| 184 | 2051 | The Category of Each Member in the Store | Medium | - | - |
| 185 | 2066 | Account Balance | Medium | - | - |
| 186 | 2072 | The Winner University | Easy | - | - |
| 187 | 2082 | The Number of Rich Customers | Easy | - | - |
| 188 | 2084 | Drop Type 1 Orders for Customers With Type 0 Orders | Medium | - | - |
| 189 | 2112 | The Airport With the Most Traffic | Medium | - | - |
| 190 | 2118 | Build the Equation | Hard | - | - |
| 191 | 2142 | The Number of Passengers in Each Bus I | Medium | - | - |
| 192 | 2153 | The Number of Passengers in Each Bus II | Hard | - | - |
| 193 | 2159 | Order Two Columns Independently | Medium | - | - |
| 194 | 2173 | Longest Winning Streak | Hard | - | - |
| 195 | 2175 | The Change in Global Rankings | Medium | - | - |
| 196 | 2199 | Finding the Topic of Each Post | Hard | - | - |
| 197 | 2205 | The Number of Users That Are Eligible for Discount | Easy | - | - |
| 198 | 2228 | Users With Two Purchases Within Seven Days | Medium | - | - |
| 199 | 2230 | The Users That Are Eligible for Discount | Easy | - | - |
| 200 | 2238 | Number of Times a Driver Was a Passenger | Medium | - | - |
| 201 | 2252 | Dynamic Pivoting of a Table | Hard | - | - |
| 202 | 2253 | Dynamic Unpivoting of a Table | Hard | - | - |
| 203 | 2292 | Products With Three or More Orders in Two Consecutive Years | Medium | - | - |
| 204 | 2298 | Tasks Count in the Weekend | Medium | - | - |
| 205 | 2308 | Arrange Table by Gender | Medium | - | - |
| 206 | 2314 | The First Day of the Maximum Recorded Degree in Each City | Medium | - | - |
| 207 | 2324 | Product Sales Analysis IV | Medium | - | - |
| 208 | 2329 | Product Sales Analysis V | Easy | - | - |
| 209 | 2339 | All the Matches of the League | Easy | - | - |
| 210 | 2346 | Compute the Rank as a Percentage | Medium | - | - |
| 211 | 2356 | Number of Unique Subjects Taught by Each Teacher | Easy | - | - |
| 212 | 2362 | Generate the Invoice | Hard | - | - |
| 213 | 2372 | Calculate the Influence of Each Salesperson | Medium | - | - |
| 214 | 2377 | Sort the Olympic Table | Easy | - | - |
| 215 | 2388 | Change Null Values in a Table to the Previous Value | Medium | - | - |
| 216 | 2394 | Employees With Deductions | Medium | - | - |
| 217 | 2474 | Customers With Strictly Increasing Purchases | Hard | - | - |
| 218 | 2480 | Form a Chemical Bond | Easy | - | - |
| 219 | 2494 | Merge Overlapping Events in the Same Hall | Hard | - | - |
| 220 | 2504 | Concatenate the Name and the Profession | Easy | - | - |