Skip to content

Latest commit

ย 

History

History
308 lines (297 loc) ยท 67 KB

DATABASE_README_EN.md

File metadata and controls

308 lines (297 loc) ยท 67 KB

Database Practice

ไธญๆ–‡ๆ–‡ๆกฃ

Solutions

Press Control + F(or Command + F on the Mac) to search anything you want.

# Solution Tags Difficulty Remark
0175 Combine Two Tables Database Easy
0176 Second Highest Salary Database Medium
0177 Nth Highest Salary Database Medium
0178 Rank Scores Database Medium
0180 Consecutive Numbers Database Medium
0181 Employees Earning More Than Their Managers Database Easy
0182 Duplicate Emails Database Easy
0183 Customers Who Never Order Database Easy
0184 Department Highest Salary Database Medium
0185 Department Top Three Salaries Database Hard
0196 Delete Duplicate Emails Database Easy
0197 Rising Temperature Database Easy
0262 Trips and Users Database Hard
0511 Game Play Analysis I Database Easy
0512 Game Play Analysis II Database Easy ๐Ÿ”’
0534 Game Play Analysis III Database Medium ๐Ÿ”’
0550 Game Play Analysis IV Database Medium
0569 Median Employee Salary Database Hard ๐Ÿ”’
0570 Managers with at Least 5 Direct Reports Database Medium
0571 Find Median Given Frequency of Numbers Database Hard ๐Ÿ”’
0574 Winning Candidate Database Medium ๐Ÿ”’
0577 Employee Bonus Database Easy
0578 Get Highest Answer Rate Question Database Medium ๐Ÿ”’
0579 Find Cumulative Salary of an Employee Database Hard ๐Ÿ”’
0580 Count Student Number in Departments Database Medium ๐Ÿ”’
0584 Find Customer Referee Database Easy
0585 Investments in 2016 Database Medium
0586 Customer Placing the Largest Number of Orders Database Easy
0595 Big Countries Database Easy
0596 Classes More Than 5 Students Database Easy
0597 Friend Requests I Overall Acceptance Rate Database Easy ๐Ÿ”’
0601 Human Traffic of Stadium Database Hard
0602 Friend Requests II Who Has the Most Friends Database Medium
0603 Consecutive Available Seats Database Easy ๐Ÿ”’
0607 Sales Person Database Easy
0608 Tree Node Database Medium
0610 Triangle Judgement Database Easy
0612 Shortest Distance in a Plane Database Medium ๐Ÿ”’
0613 Shortest Distance in a Line Database Easy ๐Ÿ”’
0614 Second Degree Follower Database Medium ๐Ÿ”’
0615 Average Salary Departments VS Company Database Hard ๐Ÿ”’
0618 Students Report By Geography Database Hard ๐Ÿ”’
0619 Biggest Single Number Database Easy
0620 Not Boring Movies Database Easy
0626 Exchange Seats Database Medium
0627 Swap Salary Database Easy
1045 Customers Who Bought All Products Database Medium
1050 Actors and Directors Who Cooperated At Least Three Times Database Easy
1068 Product Sales Analysis I Database Easy
1069 Product Sales Analysis II Database Easy ๐Ÿ”’
1070 Product Sales Analysis III Database Medium
1075 Project Employees I Database Easy
1076 Project Employees II Database Easy ๐Ÿ”’
1077 Project Employees III Database Medium ๐Ÿ”’
1082 Sales Analysis I Database Easy ๐Ÿ”’
1083 Sales Analysis II Database Easy ๐Ÿ”’
1084 Sales Analysis III Database Easy
1097 Game Play Analysis V Database Hard ๐Ÿ”’
1098 Unpopular Books Database Medium ๐Ÿ”’
1107 New Users Daily Count Database Medium ๐Ÿ”’
1112 Highest Grade For Each Student Database Medium ๐Ÿ”’
1113 Reported Posts Database Easy ๐Ÿ”’
1126 Active Businesses Database Medium ๐Ÿ”’
1127 User Purchase Platform Database Hard ๐Ÿ”’
1132 Reported Posts II Database Medium ๐Ÿ”’
1141 User Activity for the Past 30 Days I Database Easy
1142 User Activity for the Past 30 Days II Database Easy ๐Ÿ”’
1148 Article Views I Database Easy
1149 Article Views II Database Medium ๐Ÿ”’
1158 Market Analysis I Database Medium
1159 Market Analysis II Database Hard ๐Ÿ”’
1164 Product Price at a Given Date Database Medium
1173 Immediate Food Delivery I Database Easy ๐Ÿ”’
1174 Immediate Food Delivery II Database Medium
1179 Reformat Department Table Database Easy
1193 Monthly Transactions I Database Medium
1194 Tournament Winners Database Hard ๐Ÿ”’
1204 Last Person to Fit in the Bus Database Medium
1205 Monthly Transactions II Database Medium ๐Ÿ”’
1211 Queries Quality and Percentage Database Easy
1212 Team Scores in Football Tournament Database Medium ๐Ÿ”’
1225 Report Contiguous Dates Database Hard ๐Ÿ”’
1241 Number of Comments per Post Database Easy ๐Ÿ”’
1251 Average Selling Price Database Easy
1264 Page Recommendations Database Medium ๐Ÿ”’
1270 All People Report to the Given Manager Database Medium ๐Ÿ”’
1280 Students and Examinations Database Easy
1285 Find the Start and End Number of Continuous Ranges Database Medium ๐Ÿ”’
1294 Weather Type in Each Country Database Easy ๐Ÿ”’
1303 Find the Team Size Database Easy ๐Ÿ”’
1308 Running Total for Different Genders Database Medium ๐Ÿ”’
1321 Restaurant Growth Database Medium
1322 Ads Performance Database Easy ๐Ÿ”’
1327 List the Products Ordered in a Period Database Easy
1336 Number of Transactions per Visit Database Hard ๐Ÿ”’
1341 Movie Rating Database Medium
1350 Students With Invalid Departments Database Easy ๐Ÿ”’
1355 Activity Participants Database Medium ๐Ÿ”’
1364 Number of Trusted Contacts of a Customer Database Medium ๐Ÿ”’
1369 Get the Second Most Recent Activity Database Hard ๐Ÿ”’
1378 Replace Employee ID With The Unique Identifier Database Easy
1384 Total Sales Amount by Year Database Hard ๐Ÿ”’
1393 Capital GainLoss Database Medium
1398 Customers Who Bought Products A and B but Not C Database Medium ๐Ÿ”’
1407 Top Travellers Database Easy
1412 Find the Quiet Students in All Exams Database Hard ๐Ÿ”’
1421 NPV Queries Database Easy ๐Ÿ”’
1435 Create a Session Bar Chart Database Easy ๐Ÿ”’
1440 Evaluate Boolean Expression Database Medium ๐Ÿ”’
1445 Apples & Oranges Database Medium ๐Ÿ”’
1454 Active Users Database Medium ๐Ÿ”’
1459 Rectangles Area Database Medium ๐Ÿ”’
1468 Calculate Salaries Database Medium ๐Ÿ”’
1479 Sales by Day of the Week Database Hard ๐Ÿ”’
1484 Group Sold Products By The Date Database Easy
1495 Friendly Movies Streamed Last Month Database Easy ๐Ÿ”’
1501 Countries You Can Safely Invest In Database Medium ๐Ÿ”’
1511 Customer Order Frequency Database Easy ๐Ÿ”’
1517 Find Users With Valid E-Mails Database Easy
1527 Patients With a Condition Database Easy
1532 The Most Recent Three Orders Database Medium ๐Ÿ”’
1543 Fix Product Name Format Database Easy ๐Ÿ”’
1549 The Most Recent Orders for Each Product Database Medium ๐Ÿ”’
1555 Bank Account Summary Database Medium ๐Ÿ”’
1565 Unique Orders and Customers Per Month Database Easy ๐Ÿ”’
1571 Warehouse Manager Database Easy ๐Ÿ”’
1581 Customer Who Visited but Did Not Make Any Transactions Database Easy
1587 Bank Account Summary II Database Easy
1596 The Most Frequently Ordered Products for Each Customer Database Medium ๐Ÿ”’
1607 Sellers With No Sales Database Easy ๐Ÿ”’
1613 Find the Missing IDs Database Medium ๐Ÿ”’
1623 All Valid Triplets That Can Represent a Country Database Easy ๐Ÿ”’
1633 Percentage of Users Attended a Contest Database Easy
1635 Hopper Company Queries I Database Hard ๐Ÿ”’
1645 Hopper Company Queries II Database Hard ๐Ÿ”’
1651 Hopper Company Queries III Database Hard ๐Ÿ”’
1661 Average Time of Process per Machine Database Easy
1667 Fix Names in a Table Database Easy
1677 Product's Worth Over Invoices Database Easy ๐Ÿ”’
1683 Invalid Tweets Database Easy
1693 Daily Leads and Partners Database Easy
1699 Number of Calls Between Two Persons Database Medium ๐Ÿ”’
1709 Biggest Window Between Visits Database Medium ๐Ÿ”’
1715 Count Apples and Oranges Database Medium ๐Ÿ”’
1729 Find Followers Count Database Easy
1731 The Number of Employees Which Report to Each Employee Database Easy
1741 Find Total Time Spent by Each Employee Database Easy
1747 Leetflex Banned Accounts Database Medium ๐Ÿ”’
1757 Recyclable and Low Fat Products Database Easy
1767 Find the Subtasks That Did Not Execute Database Hard ๐Ÿ”’
1777 Product's Price for Each Store Database Easy ๐Ÿ”’
1783 Grand Slam Titles Database Medium ๐Ÿ”’
1789 Primary Department for Each Employee Database Easy
1795 Rearrange Products Table Database Easy
1809 Ad-Free Sessions Database Easy ๐Ÿ”’
1811 Find Interview Candidates Database Medium ๐Ÿ”’
1821 Find Customers With Positive Revenue this Year Database Easy ๐Ÿ”’
1831 Maximum Transaction Each Day Database Medium ๐Ÿ”’
1841 League Statistics Database Medium ๐Ÿ”’
1843 Suspicious Bank Accounts Database Medium ๐Ÿ”’
1853 Convert Date Format Database Easy ๐Ÿ”’
1867 Orders With Maximum Quantity Above Average Database Medium ๐Ÿ”’
1873 Calculate Special Bonus Database Easy
1875 Group Employees of the Same Salary Database Medium ๐Ÿ”’
1890 The Latest Login in 2020 Database Easy
1892 Page Recommendations II Database Hard ๐Ÿ”’
1907 Count Salary Categories Database Medium
1917 Leetcodify Friends Recommendations Database Hard ๐Ÿ”’
1919 Leetcodify Similar Friends Database Hard ๐Ÿ”’
1934 Confirmation Rate Database Medium
1939 Users That Actively Request Confirmation Messages Database Easy ๐Ÿ”’
1949 Strong Friendship Database Medium ๐Ÿ”’
1951 All the Pairs With the Maximum Number of Common Followers Database Medium ๐Ÿ”’
1965 Employees With Missing Information Database Easy
1972 First and Last Call On the Same Day Database Hard ๐Ÿ”’
1978 Employees Whose Manager Left the Company Database Easy
1988 Find Cutoff Score for Each School Database Medium ๐Ÿ”’
1990 Count the Number of Experiments Database Medium ๐Ÿ”’
2004 The Number of Seniors and Juniors to Join the Company Database Hard ๐Ÿ”’
2010 The Number of Seniors and Juniors to Join the Company II Database Hard ๐Ÿ”’
2020 Number of Accounts That Did Not Stream Database Medium ๐Ÿ”’
2026 Low-Quality Problems Database Easy ๐Ÿ”’
2041 Accepted Candidates From the Interviews Database Medium ๐Ÿ”’
2051 The Category of Each Member in the Store Database Medium ๐Ÿ”’
2066 Account Balance Database Medium ๐Ÿ”’
2072 The Winner University Database Easy ๐Ÿ”’
2082 The Number of Rich Customers Database Easy ๐Ÿ”’
2084 Drop Type 1 Orders for Customers With Type 0 Orders Database Medium ๐Ÿ”’
2112 The Airport With the Most Traffic Database Medium ๐Ÿ”’
2118 Build the Equation Database Hard ๐Ÿ”’
2142 The Number of Passengers in Each Bus I Database Medium ๐Ÿ”’
2153 The Number of Passengers in Each Bus II Database Hard ๐Ÿ”’
2159 Order Two Columns Independently Database Medium ๐Ÿ”’
2173 Longest Winning Streak Database Hard ๐Ÿ”’
2175 The Change in Global Rankings Database Medium ๐Ÿ”’
2199 Finding the Topic of Each Post Database Hard ๐Ÿ”’
2205 The Number of Users That Are Eligible for Discount Database Easy ๐Ÿ”’
2228 Users With Two Purchases Within Seven Days Database Medium ๐Ÿ”’
2230 The Users That Are Eligible for Discount Database Easy ๐Ÿ”’
2238 Number of Times a Driver Was a Passenger Database Medium ๐Ÿ”’
2252 Dynamic Pivoting of a Table Database Hard ๐Ÿ”’
2253 Dynamic Unpivoting of a Table Database Hard ๐Ÿ”’
2292 Products With Three or More Orders in Two Consecutive Years Database Medium ๐Ÿ”’
2298 Tasks Count in the Weekend Database Medium ๐Ÿ”’
2308 Arrange Table by Gender Database Medium ๐Ÿ”’
2314 The First Day of the Maximum Recorded Degree in Each City Database Medium ๐Ÿ”’
2324 Product Sales Analysis IV Database Medium ๐Ÿ”’
2329 Product Sales Analysis V Database Easy ๐Ÿ”’
2339 All the Matches of the League Database Easy ๐Ÿ”’
2346 Compute the Rank as a Percentage Database Medium ๐Ÿ”’
2356 Number of Unique Subjects Taught by Each Teacher Database Easy
2362 Generate the Invoice Database Hard ๐Ÿ”’
2372 Calculate the Influence of Each Salesperson Database Medium ๐Ÿ”’
2377 Sort the Olympic Table Database Easy ๐Ÿ”’
2388 Change Null Values in a Table to the Previous Value Database Medium ๐Ÿ”’
2394 Employees With Deductions Database Medium ๐Ÿ”’
2474 Customers With Strictly Increasing Purchases Database Hard ๐Ÿ”’
2480 Form a Chemical Bond Database Easy ๐Ÿ”’
2494 Merge Overlapping Events in the Same Hall Database Hard ๐Ÿ”’
2504 Concatenate the Name and the Profession Database Easy ๐Ÿ”’
2668 Find Latest Salaries Database Easy ๐Ÿ”’
2669 Count Artist Occurrences On Spotify Ranking List Database Easy ๐Ÿ”’
2686 Immediate Food Delivery III Database Medium ๐Ÿ”’
2687 Bikes Last Time Used Database Easy ๐Ÿ”’
2688 Find Active Users Database Medium ๐Ÿ”’
2701 Consecutive Transactions with Increasing Amounts Database Hard ๐Ÿ”’
2720 Popularity Percentage Database Hard ๐Ÿ”’
2738 Count Occurrences in Text Database Medium ๐Ÿ”’
2752 Customers with Maximum Number of Transactions on Consecutive Days Database Hard ๐Ÿ”’
2783 Flight Occupancy and Waitlist Analysis Database Medium ๐Ÿ”’
2793 Status of Flight Tickets Hard ๐Ÿ”’
2820 Election Results Medium ๐Ÿ”’
2837 Total Traveled Distance Database Easy ๐Ÿ”’
2853 Highest Salaries Difference Database Easy ๐Ÿ”’
2854 Rolling Average Steps Database Medium ๐Ÿ”’
2893 Calculate Orders Within Each Interval Database Medium ๐Ÿ”’
2922 Market Analysis III Database Medium ๐Ÿ”’
2978 Symmetric Coordinates Database Medium ๐Ÿ”’
2984 Find Peak Calling Hours for Each City Database Medium ๐Ÿ”’
2985 Calculate Compressed Mean Database Easy ๐Ÿ”’
2986 Find Third Transaction Database Medium ๐Ÿ”’
2987 Find Expensive Cities Database Easy ๐Ÿ”’
2988 Manager of the Largest Department Database Medium ๐Ÿ”’
2989 Class Performance Database Medium ๐Ÿ”’
2990 Loan Types Database Easy ๐Ÿ”’
2991 Top Three Wineries Database Hard ๐Ÿ”’
2993 Friday Purchases I Database Medium ๐Ÿ”’
2994 Friday Purchases II Database Hard ๐Ÿ”’
2995 Viewers Turned Streamers Database Hard ๐Ÿ”’
3050 Pizza Toppings Cost Analysis Database Medium ๐Ÿ”’
3051 Find Candidates for Data Scientist Position Database Easy ๐Ÿ”’
3052 Maximize Items Database Hard ๐Ÿ”’
3053 Classifying Triangles by Lengths Database Easy ๐Ÿ”’
3054 Binary Tree Nodes Database Medium ๐Ÿ”’
3055 Top Percentile Fraud Database Medium ๐Ÿ”’
3056 Snaps Analysis Database Medium ๐Ÿ”’
3057 Employees Project Allocation Database Hard ๐Ÿ”’
3058 Friends With No Mutual Friends Database Medium ๐Ÿ”’
3059 Find All Unique Email Domains Database Easy ๐Ÿ”’
3060 User Activities within Time Bounds Database Hard ๐Ÿ”’
3061 Calculate Trapping Rain Water Database Hard ๐Ÿ”’
3087 Find Trending Hashtags Database Medium ๐Ÿ”’
3089 Find Bursty Behavior Database Medium ๐Ÿ”’
3103 Find Trending Hashtags II Database Hard ๐Ÿ”’
3118 Friday Purchase III Database Medium ๐Ÿ”’
3124 Find Longest Calls Database Medium ๐Ÿ”’
3126 Server Utilization Time Database Medium ๐Ÿ”’
3140 Consecutive Available Seats II Database Medium ๐Ÿ”’
3150 Invalid Tweets II Database Easy ๐Ÿ”’
3156 Employee Task Duration and Concurrent Tasks Database Hard ๐Ÿ”’
3166 Calculate Parking Fees and Duration Database Medium ๐Ÿ”’
3172 Second Day Verification Database Easy ๐Ÿ”’
3182 Find Top Scoring Students Database Medium ๐Ÿ”’
3188 Find Top Scoring Students II Database Hard ๐Ÿ”’
3198 Find Cities in Each State Database Easy ๐Ÿ”’
3204 Bitwise User Permissions Analysis Database Medium ๐Ÿ”’
3214 Year on Year Growth Rate Database Hard ๐Ÿ”’
3220 Odd and Even Transactions Database Medium
3230 Customer Purchasing Behavior Analysis Database Medium ๐Ÿ”’
3236 CEO Subordinate Hierarchy Database Hard ๐Ÿ”’
3246 Premier League Table Ranking Database Easy ๐Ÿ”’
3252 Premier League Table Ranking II Database Medium ๐Ÿ”’
3262 Find Overlapping Shifts Medium ๐Ÿ”’

Copyright

The copyright of this project belongs to Doocs community. For commercial reprints, please contact @yanglbme for authorization. For non-commercial reprints, please indicate the source.

Contact Us

We welcome everyone to add @yanglbme's personal WeChat (WeChat ID: YLB0109), with the note "leetcode". In the future, we will create algorithm and technology related discussion groups, where we can learn and share experiences together, and make progress together.

License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.