Most SQL beginners struggle with this question. Not because it’s hard. But because they ignore the rules. “Find Users With Valid Emails” looks simple. But it tests one key skill: Can you translate logic into patterns? The trick is not SQL. It’s thinking. Break it down: What should the prefix look like? What characters are allowed? What must the email end with? Once you understand the structure, the query becomes easy. SQL isn’t just about joins and aggregates. It’s about clarity. Think in rules. Convert into logic. Then write the query. If you're learning SQL right now… What confuses you more: Regex or joins? . #SQL, #DataAnalytics, #SQLLearning, #LearnSQL, #DataAnalyst, #TechCareers, #CodingJourney .
Pratyasha Bhanu’s Post
More Relevant Posts
-
Good day, Everyone! 😳 “My query returned 2534 rows… then suddenly 0.” Yesterday, one of my students ran a simple SQL filter: 👉 WHERE LOWER(LTRIM(RTRIM(status))) != 'cancelled' Before applying the filter: ✅ 2534 rows After applying the filter: ❌ 0 rows He looked at me and said: “Sir… SQL is broken.” I smiled and asked him one question: 👉 “How many of those 2534 rows have NULL in status?” Silence. 💡 Here’s what actually happened: In SQL, NULL is not a value. It’s unknown. So when you write: 👉 NULL != 'cancelled' It doesn’t return TRUE. It doesn’t return FALSE. It returns… ❓ UNKNOWN And SQL’s WHERE clause only keeps TRUE. 🚨 Result? All NULL rows are silently removed. And if the remaining rows were actually 'cancelled'… 👉 You get 0 rows 🎯 That one concept leads to powerful interview questions: 1️⃣ Why does NULL != 'cancelled' fail? 2️⃣ What are the 3 logical states in SQL? 3️⃣ How do you fix this condition? 4️⃣ When should you use IS NULL vs COALESCE? 5️⃣ How do you debug such issues in real projects? 🔥 Real learning: “Most SQL bugs are not syntax errors… they are logic errors.” If you’re learning SQL or teaching it — understanding NULL will save you hours of debugging. 💬 Comment “NULL” and I’ll share the correct query fix + explanation. #SQL #DataEngineering #MicrosoftFabric #Learning #DataAnalytics #AnalyticsExplainedByHarish
To view or add a comment, sign in
-
-
✅ Solved a SQL problem on StrataScratch — Day 57 of my SQL Journey 💪 Text looks simple… until you try to count words inside it 👀 Today’s challenge: count exact occurrences of specific words — not substrings, but precise matches. The approach: • Normalised text using LOWER() • Used REGEXP with word boundaries (\b) for exact matching • Replaced matches and compared string lengths • Derived counts using length difference logic • Combined results using UNION What I practised: • REGEXP for pattern matching • String manipulation with LENGTH & REPLACE • Handling edge cases like “bull” vs “bullish” • Translating text problems into SQL logic What stood out — Text data looks simple, But precision changes everything. Small variations completely change the meaning. That’s where careful querying matters. SQL isn’t limited to numbers — It can handle text if you think right. Consistent learning, one query at a time 🚀 #SQL #StrataScratch #DataAnalytics #LearningInPublic #SQLPractice
To view or add a comment, sign in
-
-
🚀 Day 39/100 – LeetCode SQL Challenge 🔹 Problem: Find Valid Emails Today’s challenge was about filtering valid email addresses using SQL based on specific rules. 📌 Problem Requirements: Exactly one @ symbol Must end with .com Before @ → only letters, numbers, underscore Domain name → only letters 💡 My Approach: Used REGEXP for pattern matching Defined a strict pattern to validate email format Applied filtering conditions directly in SQL query Sorted the result using ORDER BY user_id 🧠 What I Learned: Difference between LIKE and REGEXP How to write regex patterns in SQL Importance of escaping special characters like . Real-world use of SQL in data validation ⚡ Key Insight: Simple-looking problems can test your understanding of string patterns and edge cases deeply. ✅ Step by step improvement in SQL skills! #Day39 #LeetCode #SQL #DSA #CodingJourney #PlacementPreparation
To view or add a comment, sign in
-
-
SQL is 50 years old and still the most underated skill in tech. 👀 I've seen people with 5 years of experience who can't write a proper JOIN. And I've seen analysts with zero CS degrees outperform engineers just because they mastered SQL. Quick cheat sheet that took me years to internalize: 📋 🔹 Use WHERE before GROUP BY to filter rows early 🔹 HAVING is for filtering AFTER aggregation 🔹 Window functions (ROW_NUMBER, RANK, LAG) > subqueries 90% of the time 🔹 EXPLAIN ANALYZE is your best friend before pushing any query to prod 🔹 Index your JOIN columns. Always. 🙏 SQL doesn't care about your framework or your favourite language. Bad queries will tank your app regardless. ⚡ What SQL trick took you way too long to learn? 👇 #SQL #Database #BackendDevelopment #SoftwareDevelopment #DataEngineering
To view or add a comment, sign in
-
🚀 Day 39 of My SQL Learning Journey Today I worked on a SQL problem involving pattern matching 🔥 🔹 Problem: Find users with valid email addresses 🔗 Problem Link: https://lnkd.in/gWAN__EG 🔹 Solution: SELECT * FROM Users WHERE mail REGEXP '^[A-Za-z][A-Za-z0-9_.-]*@leetcode\\.com$'; 🔹 Key Learning: Using REGEXP for pattern matching Validating strings using conditions Real-world use case: email validation 💡 SQL can handle complex string validations efficiently! Consistency continues 🚀 #SQL #LeetCode #90DaysOfCode #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
✅ Solved a SQL problem on LeetCode — Day 44 of my SQL Journey 💪 IP addresses look structured… but validating them isn’t always simple 🌐 Today’s problem was about identifying invalid IP addresses — not just formatting issues, but logical errors inside each segment. I used string functions and conditional checks to: • Split IP into individual octets using string operations • Validate the number of segments (must be 4) • Check if each octet is within the valid range (0–255) • Detect non-numeric values using pattern matching • Count how often each invalid IP appears What I practised: • Working with string parsing in SQL • Using SUBSTRING_INDEX() for segment extraction • Applying REGEXP for pattern validation • Combining multiple validation rules in one query What stood out — Validation isn’t just about format… it’s about the rules behind the format. A value can look correct, but still logically invalid. That’s where careful checking matters. SQL isn’t just for analysis. It can also enforce data quality. Consistent learning, one query at a time 🚀 #SQL #LeetCode #SQLPractice #DataAnalytics #LearningInPublic
To view or add a comment, sign in
-
-
Day 2 of 7: Learning SQL in Public Today, I went deeper into the WHERE clause, which is used to filter data. Example: SELECT * FROM customers WHERE points > 300; This returns customers with more than 300 points. A few key things I learned: When working with strings (text), values must be in quotes Dates are also written inside quotes I also explored different operators used with the WHERE clause: AND → both conditions must be true OR → at least one condition must be true NOT → excludes a condition IN → checks if a value exists in a list BETWEEN → filters within a range LIKE → used to search for patterns in text Examples: Using AND WHERE points > 300 AND state = 'CA'; Using IN WHERE state IN ('CA', 'NY', 'TX'); Using BETWEEN WHERE points BETWEEN 100 AND 300; Using LIKE WHERE name LIKE 'A%'; -- starts with A WHERE name LIKE '_a%'; -- second letter is 'a' I also learned about REGEXP (Regular Expressions), which are more powerful than LIKE for complex pattern matching. Examples: WHERE name REGEXP '^A'; -- starts with A WHERE name REGEXP 'a$'; -- ends with a WHERE name REGEXP 'A|B'; -- contains A or B WHERE name REGEXP '[a-h]'; -- letters from a to h Key takeaway: Filtering data is where SQL becomes really powerful. On to Day 3 🚀 #SQL #DataAnalytics #LearningInPublic #TechJourney #Day2
To view or add a comment, sign in
-
-
As engineers, we're no strangers to the frustrations of writing complex SQL queries. But did you know that using online tools to generate SQL can compromise your data's security? At Empire Utilities, we believe in empowering developers with secure, local-first solutions. Our AI SQL Generator is a prime example - turning plain English into production-ready SQL in seconds, without ever leaving your browser. Stop using unsecure online tools and visit https://lnkd.in/dmDSNTwG to experience the future of SQL generation.
To view or add a comment, sign in
-
call me old fashioned but there’s still something thrilling about writing a sql query solo on a tight deadline. character building.
To view or add a comment, sign in
-
✅ Solved a SQL problem on LeetCode — Day 42 of my SQL Journey 💪 Reactions look random… but behaviour usually isn’t 🎯 Today’s problem was about identifying emotionally consistent users — people who tend to react the same way across different content, not just react more. The approach: • Counted total reactions per user and per reaction type • Used a window function inside aggregation to get totals in one pass • Calculated the ratio of the dominant reaction to total reactions • Filtered users where the ratio crossed 60% • Used RANK() to identify the most frequent reaction per user What I practised: • Using window functions inside aggregations • Applying RANK() to capture dominant behaviour • Ratio-based filtering instead of just counts • Translating consistency into a measurable SQL condition What stood out — Consistency isn’t about reacting more… it’s about reacting the same way, repeatedly. Once you frame it as a ratio problem, the pattern becomes clearly visible. That’s where the real insight lies. Also noticed — SQL syntax isn’t universal. Things like ::numeric or QUALIFY don’t work in MySQL. Small difference, but important to keep in mind. Consistent learning, one query at a time 🚀 #SQL #LeetCode #SQLPractice #DataAnalytics #WindowFunctions #LearningInPublic
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development