This repository is a comprehensive showcase of SQL (Structured Query Language) skills. It features a wide range of queries from basic data retrieval to complex analytical reporting, demonstrating a deep understanding of extracting business insights from relational databases.
- Precision Filtering: Mastery of
WHEREclauses usingIN,BETWEEN,LIKE(Wildcards), and Logical Operators (AND,OR,NOT). - Data Refinement: Proficient use of
DISTINCT,TOP, andTOP PERCENTfor controlled data sampling. - Null Handling: Specialized queries to manage and report on missing data using
IS NULLandIS NOT NULL.
- Summary Statistics: Expert use of Aggregate Functions:
COUNT(),SUM(),AVG(),MIN(), andMAX(). - Segmented Reporting: Advanced
GROUP BYoperations to categorize data (e.g., reporting vehicle counts per manufacturer). - Post-Aggregation Filtering: Using
HAVINGto filter grouped results based on specific aggregate conditions.
- Multi-Table Integration: Seamlessly combining data using
INNER JOIN,LEFT JOIN,RIGHT JOIN, andFULL OUTER JOIN. - Deep Relationships: Experience in joining 3+ tables to build comprehensive data views.
- Relational Logic: Using
EXISTSandNOT EXISTSfor high-performance subquery validation.
- Conditional Logic: Implementing complex
CASEstatements for data categorization (e.g., creating custom tax brackets or describing data in words). - Arithmetic & Aliasing: Performing on-the-fly calculations (Yearly Salary, Age, Tax) and using
ASfor clean, readable output. - Data Casting: Using
CASTto handle floating-point divisions for accurate percentage calculations.
- Views: Creating reusable and simplified data abstractions (e.g.,
ActiveEmployees,VehicleMasterDetails). - Set Operations: Combining result sets using
UNIONandUNION ALL. - Optimization: Utilizing
TOP 1insideEXISTSclauses to optimize query execution speed.
- Industry Analysis: Detailed reports on vehicle specifications, fuel types, and manufacturing trends.
- HR Reporting: Calculating employee salaries, bonuses, and status tracking.
- Performance Benchmarking: Identifying records that exceed or fall below Average benchmarks using subqueries.
- Open any
.sqlfile to see the query logic. - Each script is documented with comments explaining the business requirement it solves.
- Queries are optimized for SQL Server (T-SQL) environments.