🚀 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
SQL Pattern Matching for Email Validation
More Relevant Posts
-
SQL Learning Journey — Day 5 Today was all about **revision + debugging real SQL queries** Revised concepts: • SELECT & WHERE • Aggregate functions (AVG, COUNT) • Subqueries • JOIN + GROUP BY + HAVING Biggest learning today: Errors are the best teachers! I faced multiple issues like: Unknown column errors Ambiguous column names JOIN syntax mistakes And learned how to fix them step by step. Highlight: Wrote a query to find students enrolled in more than one course using JOIN and HAVING. Consistency > Perfection Day 5 completed #SQL #LearningInPublic #100DaysOfCode #DataAnalytics
To view or add a comment, sign in
-
Common Table Expressions (CTEs) are one of the most underrated features in SQL. They help break complex queries into simple, readable steps using the WITH clause—making your code cleaner, easier to debug, and more maintainable. From handling multiple transformations to solving hierarchical problems with recursive CTEs, they’re a must-know for any data professional. If you’re still relying heavily on nested subqueries, it might be time to switch to CTEs 🚀 #SQL #DataAnalytics #DataEngineering #Learning #TechSkills
To view or add a comment, sign in
-
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 .
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
-
-
✅ Solved a SQL problem on LeetCode — Day 43 of my SQL Journey 💪 Text looks simple… until you try to handle every edge case ✍️ Today’s problem was about transforming text — capitalising the first letter of each word, while handling special cases like hyphens correctly. I used recursive logic and string operations to: • Break text into individual characters using recursive CTE • Track previous characters using window functions • Identify word boundaries and special cases • Apply conditional uppercase/lowercase transformations • Reconstruct the final string using GROUP_CONCAT What I practised: • Recursive CTEs for step-by-step processing • Using LAG() to track character-level context • Writing precise CASE conditions for formatting • Handling edge cases like hyphenated words What stood out — Text transformations aren’t just formatting… they’re about handling context. A single character can change the logic, and missing one condition can break everything. That’s where attention to detail matters most. SQL isn’t just for numbers and aggregations. It can handle complex text logic too. Consistent learning, one query at a time 🚀 #SQL #LeetCode #SQLPractice #DataAnalytics #LearningInPublic
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
-
-
🚀 Tackling SQL challenges one query at a time! Today I solved #LeetCode #1280: Students and Examinations — a problem that tests how well you can combine tables and count relationships. 📌 The challenge: Find the number of times each student attended each exam. 💡 The solution: Use a CROSS JOIN to pair every student with every subject. Apply a LEFT JOIN with the Examinations table to capture attendance. Finally, group and count to get the number of exams attended per student per subject. #sql #SQL #Leetcode #dataanalysis
To view or add a comment, sign in
-
-
✅ Solved a SQL problem on LeetCode — Day 47 of my SQL Journey 💪 Learning doesn’t always move in a straight line… sometimes it spirals 🔄 Today’s problem was about identifying students who follow a study spiral pattern — studying multiple subjects in a structured, repeating cycle. The approach: • Tracked session order using ROW_NUMBER() • Measured gaps between sessions with LAG() and DATEDIFF() • Filtered sequences with gaps longer than 2 days • Detected repeating cycles using MOD() on row position • Counted students with at least 3 subjects across multiple cycles What I practised: • Window functions for sequence tracking • Time gap detection using date functions • Sequential pattern recognition • Using HAVING for conditional aggregation What stood out — A single session tells you nothing… A sequence tells you everything. Patterns don’t announce themselves, They hide in the order of events. That’s where the real insight lies. SQL doesn’t just query data. It helps read the story behind it. Consistent learning, one query at a time 🚀 #SQL #LeetCode #DataAnalytics #LearningInPublic #SQLPractice
To view or add a comment, sign in
-
-
🚀 Day 28/100 – LeetCode SQL Challenge Today’s problem: Triangle Judgement 📌 What I learned today: How to apply real-world mathematical logic (Triangle Inequality Rule) in SQL Using CASE statements to create conditional outputs Writing clean and readable SQL queries for decision-making problems 🔍 Key Concept: A triangle is valid only if: x + y > z y + z > x x + z > y 💡 If all conditions are satisfied → “Yes” Otherwise → “No” 🧠 This problem helped me understand how SQL is not just about data retrieval, but also about applying logical conditions effectively. Consistency is the key 🔑 #Day28 #100DaysOfCode #LeetCode #SQL #Learning #CodingJourney #PlacementPreparation
To view or add a comment, sign in
-
-
Day 5/50 – #SQLChallenge 🚀 Solved “Invalid Tweets” problem on LeetCode. ✅ Approach: Used LENGTH() to filter tweets exceeding character limits ✅ Key Concept: Data validation using string functions 💡 Advanced Insight: While LENGTH() works well here, it’s important to note that different databases handle string length differently (e.g., LENGTH vs CHAR_LENGTH in MySQL). Choosing the right function ensures accurate results, especially with multi-byte characters. 🔍 Takeaway: Writing queries isn’t just about solving the problem — it’s about understanding how functions behave across real-world scenarios. Consistency over intensity 💪 #SQL #LeetCode #Database #CodingChallenge #ProblemSolving #LearningInPublic #DeveloperJourney #TechGrowth
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