SQL Strings Practice Problems: 105 Questions with Solutions
105 SQL strings practice problems with solutions: CONCAT, SUBSTRING, TRIM, REPLACE, LIKE and GROUP CONCAT. Written in MySQL, judged on hidden datasets.
- Problems: 105
- By difficulty: 50 easy · 44 medium · 11 hard
- Dialect: MySQL
Practise SQL string functions in MySQL: CONCAT, SUBSTRING, LEFT and RIGHT, UPPER and LOWER, TRIM, REPLACE, LENGTH, LIKE patterns and GROUP_CONCAT. The problems fix names, mask card and phone numbers, read e-mail domains and build labels, the text work that turns up in data-cleaning and reporting rounds.
Easy SQL strings problems
- Fix the Capitalisation of Registered Names
- Students Registered for a Machine Learning Elective
- Applicants With a Valid College E-mail Address
- Canteen Items Sold on Each Day
- Masked Card Numbers for Card Statements
- NGO Donors Grouped by Email Domain
- Library Cards Expiring in March 2025
- B2B Invoices With a Malformed GSTIN
- Masked Reviewer Names for Top Reviews
- Learner Sign-ups by E-mail Domain
- Faculty Names Formatted for ID Cards
- Masked Customer Phone Numbers on Rider Slips
- Gamertags Breaking the Naming Policy
- Patient Mobile Numbers That Cannot Get SMS Reminders
- Doctor Names for the Prescription Letterhead
- Work E-mail Addresses for New Joiners
- Machine Count per Plant From Asset Tags
- Email Subject Lines Cut Off in the Inbox Preview
- Active Fleet Vehicles by Registration State
- Error Codes in the API Gateway Logs
- Masked Tenant Phone Numbers for the Notice Board
- Category Codes From SKU Prefixes
- Signups by Work Email Domain
- Handles Breaking the Username Policy
- Overseas Players in the Auction Pool by Role
- Tracks With a Featured Artist
- Masked Mobile Numbers on Bill Statements
- Current Status Labels for Train PNRs
- Hotel Loyalty Members per Email Domain
- Airbnb: Host Display Names With a Last Initial
- Amazon: Search Queries Mentioning Each Brand
- Apple: Trade-In Credit Paid by Device Family
- Dream11: Promo Code Redemptions per Campaign
- Flipkart: Shopsy Reseller Store Handles
- Google: Read Match Type From Ad Keyword Syntax
- Hotstar: Commentary Languages Live on Each Match
- Hotstar: Playback Errors by App Platform
- LinkedIn: Open-to-Work Members With a Blank Headline
- Meta: Threads Posts Cut Off in the Feed Preview
- Microsoft: Azure Resource Count per Resource Group From Resource IDs
- Myntra: Product Display Names From Brand, Colour and Article
- Ola: Registration Plates Cleaned for the Compliance Upload
- Paytm: Merchant QR Codes Still on the Old @paytm Handle
- PhonePe: Masked UPI IDs on Payment Receipts
- Razorpay: Fund Accounts With a Malformed UPI ID
- Spotify: URL Slugs for Podcast Show Names
- Swiggy: Saved Addresses Without a Valid Pincode
- Uber: Driver Names as Shown in the Rider App
- Walmart: Supercenters per State From Store Codes
- Zomato: Build the URL Slug of Every Restaurant Page
Medium SQL strings problems
- Salary Credits by Employer From Statement Narrations
- Grievance Tickets per Ward From Reference Codes
- Delivery SLA Breaches by Postal Zone
- Course Catalogue Summary by Department and Level
- Packing Slip Item List for Each Quick Order
- Coupon Discount Spend by Campaign Prefix
- Players Reported for Cheating by Three Reporters in a Month
- Email Domains Behind Unverified Sign-ups
- Patients Seen Across Several Specialties
- Appraisal Ratings Falling Two Cycles Running
- Staffing Pool of Multi-Skill Experts
- Incoming Lot Rejection Rate by Supplier
- Machines With Repeating Fault Codes
- Sign-ups by UTM Source Read From Landing URLs
- Promo Campaign Redemptions and Discount Burn
- Error Counts by Region and Environment From Hostnames
- Parse Listing Titles Into Locality and BHK
- Duplicate Vendors After Cleaning Up Their Names
- Signups and Upgrades by UTM Source
- Sign-Ups by Email Provider
- Most Common Leading Hashtags in Captions
- Best Bowling Figures of Each Bowler This Season
- Wickets Credited to Each Bowler From the Dismissal Text
- Playlist Length as Clock Time
- International Voice Call Share per Caller
- Passengers Who Flew a Route in Both Directions
- Connecting Itineraries per City Pair
- Airbnb: Listings With a Kitchen but No Wi-Fi
- Amazon: Warehouse Bins Shared by Several Sellers
- Apple: Daily Share of Checked-In Devices on iOS 18
- Apple: AppleCare Serial Numbers That Fail the Format Check
- Dream11: Multiple Accounts Behind One Gmail Address
- Google: Drive Files Shared Outside the Owner's Domain
- Google: Places per Top-Level Maps Category
- LinkedIn: Custom Profile URLs That Break the Rules
- Meta: Messenger Call Drops by Major App Version
- Microsoft: Top Human Contributor per GitHub Repository in 2025
- Microsoft: Privileged Azure Role Holders for the Access Review
- Myntra: Delivered GMV by Indian Fiscal Year and Quarter
- Razorpay: Bank Credits That Match No Settlement
- Spotify: Featured-Artist Credits in Track Titles per Label
- Swiggy: Orders That Stacked Two Platform Coupons
- Swiggy: Genie Tasks Flagged by Blocked Keywords
- Walmart: Item Records Sharing a UPC After Cleanup
Hard SQL strings problems
- Top Two PSP Handles by Monthly UPI Volume
- Products Most Often Bought in the Same Basket
- Airbnb: Back-to-Back Stays Merged Into Trips
- Apple: Devices That Moved to an Older iOS Version
- Meta: Trending Reels Tags Split Out of Comma-Separated Lists
- Microsoft: OneDrive Files Whose Full Path Is Too Long to Sync
- Ola: Scooters Behind Their Model's Newest Firmware
- Razorpay: Merchants Whose Live Methods Differ From Their Request
- Swiggy: Units Sold per Item From Instamart Combo Codes
- Uber: Split Fare Shares to the Paisa
- Walmart: Truck Routes Rebuilt From Store Geofence Pings