Hello Dev Community! 👋
It is officially Day 88 of my 100-day full-stack and database engineering streak! 🎯 Over the last few weeks, I built structural foundations, views, mutations, and complex multi-table joins. Today, I transitioned into a major new phase: Applying my knowledge to solve live algorithmic challenges on HackerRank! 🖥️🔥
Instead of just writing sandbox code, competitive problem-solving tests your ability to translate strict business requirements into clean, high-performance database queries under optimized time complexities.
🧩 The HackerRank Challenges Handled Today
As showcased across my workspace scripts inside "Screenshot (191).png" and "Screenshot (192).png", I didn't just type answers on the web; I replicated the exact tables locally to verify query behaviors under the hood!
1. Challenge: Revising the Select Query I
-
The Problem: Query all columns for all American cities in the
CITYtable with populations larger than 100,000. The country code for America isUSA. -
The Execution: Layered multi-variable filtering logic using structural logic intersections (
AND) to target row matrices with surgical precision:
sql
SELECT ID, NAME, COUNTRYCODE, DISTRICT, POPULATION
FROM CITY
WHERE POPULATION > 100000 AND COUNTRYCODE = "USA";
Top comments (0)