Hello Dev Community! π
It is officially Day 91 of my 100-day full-stack engineering streak! π― Yesterday, I reached the 90% milestone by cracking compound matching queries. Today, I broke into heavy-duty data transformation and string analytics on HackerRank by mastering: SQL Exclusion Operators (NOT REGEXP), CONCAT() dynamic formatting, and advanced GROUP BY structural analytics! ππ₯
In enterprise backend applications, data reporting requires clean formattingβlike appending metadata tags next to usernames or generating automated system summaries directly from your database tier.
π§ Breaking Down the Day 91 Engineering Challenges
As tracked inside my workspace scripts across "Screenshot (198).png", "Screenshot (199).png", and "Screenshot (200).png", I built full local environments to stress-test these query structures:
1. Advanced Pattern Exclusions (Station Series)
- The Goal: Isolate record fields that do not conform to vowel arrays at their boundary lines.
-
The Execution: Used the
NOT REGEXPoperator combined with caret (^) and dollar ($) anchors to seamlessly block matched arrays:
sql
-- Filtering out starting vowel strings
SELECT CITY FROM STATION WHERE CITY NOT REGEXP "^(a|e|i|o|u)";
-- Filtering out ending vowel strings
SELECT DISTINCT CITY FROM STATION WHERE CITY NOT REGEXP "(a|e|i|o|u)$"; -- Query 1: Dynamic Formatting with String Sub-Slicing
SELECT CONCAT(Name, "(", substring(OCCUPATION, 1, 1), ")")
FROM OCCUPATIONS
ORDER BY NAME;
-- Query 2: Analytical Aggregation Summary
SELECT CONCAT('There are a total of ', COUNT(occupation), ' ', LOWER(occupation), 's.')
FROM OCCUPATIONS
GROUP BY occupation
ORDER BY COUNT(occupation) ASC, occupation ASC;
Top comments (0)