Skip to content

Conversation

@sakshiasati17
Copy link

No description provided.

@super30admin
Copy link
Owner

  1. Correctness:

    • Average_Salary_Department_vs_Company.sql: The solution correctly calculates department and company averages and compares them. It handles the comparison logic well.
    • Game_Play_Analysis_I.sql: Correctly identifies the first login date for each player.
    • Report_Contiguos_Dates.sql: The approach to identify contiguous date ranges is correct but could be simplified.
    • Student_Report_By_Geography.sql: Correctly pivots the data by continent but could handle NULL values more elegantly.
  2. Time Complexity:

    • All solutions use appropriate joins and aggregations, resulting in reasonable time complexity (generally O(n) or O(n log n) for the operations used).
  3. Space Complexity:

    • The solutions create temporary tables/CTEs which use additional space, but this is necessary for the operations being performed.
  4. Code Quality:

    • The code is generally well-structured and readable.
    • Consistent indentation and formatting.
    • Good use of CTEs for complex queries.
    • Could improve with more descriptive aliases (e.g., 'ds' and 'cs' in the first query could be more meaningful).
  5. Efficiency:

    • Report_Contiguos_Dates.sql could be simplified by using LAG/LEAD functions instead of the current approach with multiple CTEs.
    • Student_Report_By_Geography.sql could use COALESCE or IFNULL to handle NULL values more cleanly.
    • All queries would benefit from proper indexing on join and filter columns.

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