Skip to content

πŸš€ Complete SQL solutions from HackerRank challenges that earned me a 5⭐ rating! Features 45+ problems covering basic queries to advanced topics like window functions, complex joins, string manipulation & mathematical operations. Perfect for SQL mastery & database interview prep! πŸ—„οΈβœ¨

Notifications You must be signed in to change notification settings

Ak-Rajak/SQL-with-Problem-Solving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

55 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SQL with Problem Solving

HackerRank 5 Star SQL Language Problems Solved

πŸ“– About

This repository contains my journey through SQL challenges on HackerRank, where I earned a 5-star rating in SQL programming. Each solution demonstrates different aspects of SQL querying, from basic SELECT statements to advanced window functions, aggregations, and complex joins. These solutions are compatible with MySQL, PostgreSQL, and SQL Server.

🎯 Achievement

SQL 5 Star Badge

5 Star SQL Badge on HackerRank

πŸ“š Problems Solved

🟒 Basic Queries

🟑 Intermediate Queries

Aggregation Functions

Weather Observation Stations (String Functions)

Advanced Weather Stations (Mathematical Functions)

πŸ”΄ Advanced Queries

Employee Management

String Manipulation & Pattern Matching

Advanced Problem Solving

πŸ› οΈ Key SQL Concepts Demonstrated

Basic Operations

  • SELECT, FROM, WHERE clauses
  • Filtering with conditions (=, >, <, >=, <=, <>)
  • Logical operators (AND, OR, NOT)
  • DISTINCT for unique values

String Functions

  • LIKE patterns with wildcards (%, _)
  • SUBSTR() / SUBSTRING() for character extraction
  • LEFT() and RIGHT() functions
  • CONCAT() for string concatenation
  • REPLACE() for character substitution
  • LENGTH() for string length

Aggregate Functions

  • COUNT(), SUM(), AVG(), MAX(), MIN()
  • GROUP BY for data grouping
  • HAVING clause for filtered aggregations

Mathematical Functions

  • ROUND(), TRUNCATE(), CEIL(), FLOOR()
  • SQRT(), POWER() for calculations
  • Mathematical operators (+, -, *, /, %)

Advanced Features

  • Subqueries and correlated subqueries
  • Window functions (ROW_NUMBER(), OVER())
  • CASE statements for conditional logic
  • PIVOT operations for data transformation
  • JOIN operations (LEFT JOIN)

Database Compatibility

  • MySQL syntax and functions
  • PostgreSQL compatibility
  • SQL Server T-SQL features
  • Standard SQL compliance

πŸš€ How to Use

  1. Clone the repository:

    git clone https://github.com/yourusername/SQL-with-Problem-Solving.git
    cd SQL-with-Problem-Solving
  2. Execute any solution:

    -- Copy the SQL code from any .sql file
    -- Run it in your preferred SQL environment (MySQL, PostgreSQL, SQL Server)
  3. Example execution:

    -- From SelectAll.sql
    SELECT * FROM CITY;

πŸ“ˆ Progress Statistics

Category Problems Solved Difficulty Key Concepts
Basic Select 6 🟒 Easy SELECT, WHERE, filtering
Advanced Select 5 🟑 Medium String functions, patterns
Aggregation 6 🟑 Medium COUNT, SUM, AVG, GROUP BY
Weather Stations 20 🟑 Medium String manipulation, math functions
Join Operations 1 πŸ”΄ Hard LEFT JOIN, GROUP BY
Advanced Topics 7 πŸ”΄ Hard CASE, subqueries, window functions

πŸ† Skills Gained

  • βœ… Proficiency in SQL query writing and optimization
  • βœ… String manipulation and pattern matching expertise
  • βœ… Advanced aggregation and mathematical functions
  • βœ… Subquery design and correlated queries
  • βœ… Window functions and analytical queries
  • βœ… Database schema understanding and relationships
  • βœ… Performance optimization techniques
  • βœ… Cross-platform SQL compatibility

🎯 Problem Categories Mastered

Data Retrieval

  • Basic and advanced SELECT statements
  • Multi-table queries with JOINs
  • Filtering and sorting large datasets

Data Analysis

  • Statistical calculations (averages, medians, ranges)
  • Distance calculations (Manhattan, Euclidean)
  • Pattern recognition and classification

String Processing

  • Text pattern matching and extraction
  • Character-based filtering and sorting
  • String formatting and manipulation

Business Logic

  • Employee hierarchy analysis
  • Geographic data processing
  • Educational grading systems

πŸ”— Connect with Me

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Contributing

Feel free to fork this repository and submit pull requests for any improvements or additional solutions! Contributions for SQL optimization or alternative approaches are welcome.


⭐ If you found this repository helpful, please star it! ⭐

Made with ❀️ by Ak-Rajak

About

πŸš€ Complete SQL solutions from HackerRank challenges that earned me a 5⭐ rating! Features 45+ problems covering basic queries to advanced topics like window functions, complex joins, string manipulation & mathematical operations. Perfect for SQL mastery & database interview prep! πŸ—„οΈβœ¨

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages