8000 GitHub - dana3601/Leetcode-Problems at d00ec6bd98c6a826f09fbdc5f57babfd7d1f4833
[go: up one dir, main page]

Skip to content

Solved SQL questions in the second round. Aim to organize Multiple solutions and thoughts for each question, compare and find the optimal ones.

Notifications You must be signed in to change notification settings

dana3601/Leetcode-Problems

Repository files navigation

Multiple-Solutions-for-Leetcode-Problems

There will be TWO ways to distribute the sql solutions:

  1. By questions' category - the folders above
  2. By questions' function - the lists below
  3. < 8000 /ol>

    Missing value

    Return and state as "null"
    # 1378. Replace Employee ID With The Unique Identi.sql -
    Return and state as 0
    # 1322. Ads Performance.sql # 1407. Top Travellers.sql
    # 1241. Number of Comments per Post.sql -
    Return the related column value
    # 1350. Students With Invalid Departments.sql # 607. Sales Person.sql

    Aggregate

    Most Frequently
    # 1596. The Most Frequently Ordered Products.sql -
    Return result, and result will be compared "more/less than"
    # 1587. Bank Account Summary II.sql -
    As a condition, the result will be compared "more/less than"
    # 1511. Customer Order Frequency.sql # 1327. List the Products Ordered in a Period.sql
    return categories from numbers
    # 1294. Weather Type in Each Country.sql -
    Include the result, no matter is 0 or not
    # 1280. Students and Examinations.sql -
    Others
    # 1303. Find the Team Size.sql -

    Calculation

    In and Out transaction
    # 1555. Bank Account Summary.sql -
    Rate or Percentage
    # 1322. Ads Performance.sql # 1251. Average Selling Price.sql
    # 1211. Queries Quality and Percentage.sql -
    across two or more tables
    # 1571. Warehouse Manager.sql -

    Date

    Find a specific month
    # 1511. Customer Order Frequency.sql # 1294. Weather Type in Each Country.sql
    Modify into a specific format
    # 1543. Fix Product Name Format.sql # 1565. Unique Orders and Customers Per Month.sql
    Period of Time
    # 1251. Average Selling Price.sql -
    Case by case
    # 1294. Weather Type in Each Country.sql # 1322. Ads Performance.sql
    # 627. Swap Salary.sql -

    Joins

    Three tables
    # 1555. Bank Account Summary.sql # 1280. Students and Examinations.sql
    Self Joins
    # 1241. Number of Comments per Post.sql -

    Formating

    aggregate the product names in one cell
    # 1484. Group Sold Products By The Date.sql -
    String Validation
    # 1517. Find Users With Valid E-Mails.sql -
    • Beginning of the string
    • Any upper/lower case chars
    • No. of chars
    • Range
    • accept chars
    • end with
    String Formay - No lowercase without leading or trailing white spaces
    # 1543. Fix Product Name Format.sql -

About

Solved SQL questions in the second round. Aim to organize Multiple solutions and thoughts for each question, compare and find the optimal ones.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0