Skip to content

Conversation

@DhruvParashar246
Copy link

No description provided.

@super30admin
Copy link
Owner

  1. Correctness:

    • The "Average Salary Department vs Company" solution correctly calculates and compares department vs company averages using CTEs and JOINs.
    • "Game Play Analysis I" correctly finds the first login date for each player.
    • "Report Contiguous Dates" correctly identifies contiguous periods of success/failure using window functions.
    • "Student Report by Geography" correctly pivots student data by continent using ROW_NUMBER() and joins.
  2. Time Complexity:

    • All solutions use appropriate operations (GROUP BY, JOIN, window functions) with expected O(n log n) or O(n) complexity for typical database operations.
  3. Space Complexity:

    • The solutions create temporary tables (CTEs) but release them after execution, so space complexity is reasonable.
  4. Code Quality:

    • Generally well-structured with clear CTE naming.
    • Some improvements could be made:
      • In "Average Salary Department vs Company", the GROUP BY should include the month from the pay_date.
      • In "Student Report by Geography", the RIGHT JOIN could be simplified to LEFT JOIN since 'first' is the primary table.
      • Consistent formatting (some queries use AS for aliases, others don't).
      • The CASE statement in the first solution could be formatted more clearly.
  5. Efficiency:

    • All solutions are efficient for their respective problems.
    • The "Report Contiguous Dates" solution could potentially be optimized by combining some CTEs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants