SQL Basics Practice Problems: 102 Questions with Solutions
102 SQL basics practice problems with solutions: SELECT, WHERE, ORDER BY, LIMIT, DISTINCT and NULLs. Written in MySQL, judged on hidden datasets.
- Problems: 102
- By difficulty: 100 easy · 1 medium · 1 hard
- Dialect: MySQL
Practise the SQL every query is built from: SELECT, WHERE, ORDER BY, LIMIT, DISTINCT and NULL handling, on small tables you can read at a glance. Each problem asks for one exact result set and is judged on hidden datasets as well as the example. Start here if you are new to SQL or warming up before an interview.
Easy SQL basics problems
- Scholarship Shortlist by CGPA or Hackathon Wins
- Canteen Orders Not Placed With the FEST50 Coupon
- Main-Stage Fest Events Ranked by Rating
- Bowlers Who Took a Caught-and-Bowled Wicket
- High-Value UPI Transfers for Compliance Review
- Loan Applicants by Credit Score Band
- Library Loans Overdue on Audit Day
- Polling Booth Turnout Bands
- Cash Donations and 80G Eligibility
- Prepaid High-Value Orders Awaiting Dispatch
- B2B Invoices With a Malformed GSTIN
- Cart Shipping Fee and Amount Payable
- Masked Reviewer Names for Top Reviews
- Students Short of 75% Attendance in a Course
- Exam Marks to University Grade Letters
- Students Who Accepted Offers of 10 LPA or More
- Pure-Veg Restaurants Rated 4.2 or Higher
- Payable Amount on Surge-Priced Orders
- Masked Customer Phone Numbers on Rider Slips
- Refund Due on Cancelled Food Orders
- Diamond and Master Players Who Went Quiet
- Average Completed Match Length by Game Mode
- Battle Pass Progress Labels for Season 12
- Lab Reports Breaching the 24-Hour Turnaround
- Controlled Drug Prescriptions With Their Prescriber
- Medicine Batches Expiring Within 90 Days
- Patient Mobile Numbers That Cannot Get SMS Reminders
- Employees Overdue for Probation Confirmation
- Earned Leave Lapsing Above the Carry-Forward Cap
- Work Anniversaries Coming Up in October 2025
- Machines Overdue for Calibration on Audit Day
- Dimensional Inspection: Pass, Rework or Scrap
- Production Batches Over Two Percent Defects
- Ad Campaigns Still Live at the Quarter Close
- Email Subject Lines Cut Off in the Inbox Preview
- Instagram Creator Deals Signed in Q3 2024
- Label Each Campaign by Its Monthly Budget Tier
- Airport Drop Trips Charged With Surge Pricing
- Late-Night Ride Requests for the May Safety Audit
- Undelivered Shipments Past Their Promised Date
- Urgent Support Tickets Waiting More Than a Day
- Production Incidents Opened on a Weekend
- Label CSAT Survey Responses by Sentiment
- Ready-to-Move 2 BHK Listings Under ₹80 Lakh
- Masked Tenant Phone Numbers for the Notice Board
- Broker Commission by Deal Slab
- Leases Ending Within the Next 30 Days
- Store SKUs At or Below Their Reorder Point
- Open Purchase Orders Past Their Promised Date
- Annual Enterprise Accounts Signed Up in 2024
- Workspace Seat Utilisation Status
- Active Subscriptions Above the Average MRR
- Free Trials Ending Within a Week
- Verified Creators With Over One Lakh Followers
- Handles Breaking the Username Policy
- Moderation Reports Filed on Weekends in March 2025
- Posts With More Likes Than the Platform Average
- T20 Innings Scored at a Strike Rate Above 150
- Full-Time Results Board for the Football League
- New Kids-Safe Originals for the Family Row
- Short, Standard and Long Episodes
- Movies Longer Than the Average Movie
- Prepaid Plans Expiring in the First Week of June
- Cell Tower Dropped-Call Health Check
- Completed Port-Outs by Recipient Operator
- Power Outages Lasting Four Hours or More
- Premium New Year Stays in Goa
- Flights Departing More Than an Hour Late
- Airbnb: Instant Book Listings for a Last-Minute Weekend
- Airbnb: Reviews Where Cleanliness Trails the Overall Rating
- Airbnb: Host Payout for Each Completed Stay
- Amazon: Lightning Deals That Sold Out Before Ending
- Apple: iCloud Accounts Using More Than Their Plan
- Dream11: Paid Public Contests Still Under Half Full
- Flipkart: Plus Members Sitting on Unused SuperCoins
- Google: Chromebooks Not Synced in 90 Days
- Hotstar: Death-Over Ad Breaks Running Long
- LinkedIn: Invitations Pending for More Than 30 Days
- LinkedIn: Open-to-Work Members With a Blank Headline
- Meta: Marketplace Listings Sold Within a Day
- Microsoft: Dev and Test VMs Still Billing Over the Weekend
- Microsoft: Outlook Mailboxes at 90% of Their Quota or More
- Ola: Scooters Still Below MoveOS 4.2
- Paytm: Failed Recharges Still Awaiting a Refund
- PhonePe: UPI Lite Payments Above the Per-Payment Cap
- Razorpay: Payment Links That Lapsed Without Payment
- Razorpay: Gateway Fee and Settled Amount for Each Payment
- Razorpay: Normal-Speed Refunds That Took Over a Week
- Spotify: Long-Form Podcast Episodes Released in 2024
- Spotify: Student Plans Due for Re-Verification
- Swiggy: Instamart Orders Delivered Within 10 Minutes
- Swiggy: Genie Fare by Distance Slab
- Swiggy: Packaging Charges Above the Per-Item Cap
- Uber: Uber One Trials Ending Without Auto-Renew
- Uber: Rider Cancellations That Earn a Late-Cancel Fee
- Uber: Freight Loads Booked Below the Posted Rate
- Walmart: Active Rollbacks and the Savings on Each
- Walmart: Associate Shifts Clocked Over Ten Hours
- Walmart: DC Trailers Dispatched Under 80% Full
- Zomato: Hygiene Certificates Expiring in July