Trainer
A data-work simulator: tickets from real coworkers, real tasks, real SQL.
217 tickets · 30 free for everyone
Now
#1Getting to know the data
SELECTDifficulty 1 of 3Open ticket- #2A short price listSELECT→
- #3A price list for partnersSELECT→
- #4The discounted priceSELECT→
- #5A price tag without centsSELECT→
- #6A ready-made price tagSELECTSTRINGS→
- #7Price segmentsSELECT→
- #8What categories do we even haveSELECT→
- #9Phones onlyWHERE→
- #10Everything except phonesWHERE→
- #11Low on stockWHERE→
- #12The budget selectionWHERE→
- #13Affordable phonesWHERE→
- #14Top-end laptopsWHERE→
- #15Products that need attentionWHERE→
- #16A sale with several conditionsWHERE→
- #17The mid-range segmentWHERE→
- #18Mobile devicesWHERE→
- #19Searching for "Pro"WHERE→
- #20The Galaxy familyWHERE→
- #21A catalogue without SonyWHERE→
- #22Search that ignores caseWHERE→
- #23The catalogue in alphabetical orderSELECTORDER BY→
- #24Cheapest firstSELECTORDER BY→
- #25Expensive products for the showcaseORDER BYWHERE→
- #26The three most expensiveSELECTORDER BY→
- #27The second pageSELECTORDER BY→
- #28The third page of the catalogueSELECTORDER BY→
- #29The catalogue by shelvesSELECTORDER BY→
- #30Discount rulesSELECT→
- #31How many products in totalSELECTAGGREGATE
- #32How many categoriesSELECTAGGREGATE
- #33How many expensive productsWHEREAGGREGATE
- #34The cheapest and the most expensiveSELECTAGGREGATE
- #35The total warehouse stockSELECTAGGREGATE
- #36The value of the stockSELECTAGGREGATE
- #37The average catalogue priceSELECTAGGREGATE
- #38The catalogue summarySELECTAGGREGATE
- #39A summary with breakdownsWHEREAGGREGATE
- #40More expensive than averageWHERESUBQUERYAGGREGATE
- #41The three priciest above averageORDER BYWHERESUBQUERY+1
- #42Names longer than averageORDER BYWHERESUBQUERY+2
- #43Above or below the averageSUBQUERYAGGREGATE
- #44How many products in each categoryGROUP BYAGGREGATE
- #45Stock by categoryGROUP BYAGGREGATE
- #46The flagship of each categoryGROUP BYAGGREGATE
- #47Categories with more than 2 productsGROUP BYHAVINGAGGREGATE
- #48Premium categoriesGROUP BYHAVINGAGGREGATE
- #49Categories above the overall averageGROUP BYHAVINGSUBQUERY+1
- #50Categories by stockGROUP BYORDER BYAGGREGATE
- #51A profile of the categoriesGROUP BYAGGREGATE
- #52A price list in other currenciesJOINWHERE
- #53A separate table for categoriesDDLCONSTRAINTS
- #54Filling in the categoriesDML
- #55The average price by categoryJOINGROUP BYAGGREGATE
- #56Preparing the key to the categoriesDDL
- #57Linking products to categoriesWHERESUBQUERYDML
- #58A protected link: FOREIGN KEYDDLCONSTRAINTS
- #59A product's category by keyJOIN
- #60A new product in the catalogueDML
- #61A discount on laptopsWHEREDML
- #62Dropping a product lineWHEREDML
- #63Removing the redundant textDDL
- #64Closing the camera line (by id)WHERESUBQUERYDML
- #65A new table: customersDDLCONSTRAINTS
- #66Filling in the customersDML
- #67A new table: ordersDDLCONSTRAINTS
- #68Filling in the ordersDATESDML
- #69Does the key really workDATESDML
- #70Orders with the customer's nameJOIN
- #71Orders with a size labelJOIN
- #72How much each customer spentJOINGROUP BYAGGREGATE
- #73A new column: emailDDL
- #74Recording the customers' emailsDML
- #75Protection from duplicates: UNIQUEDDLCONSTRAINTS
- #76Every customer and their ordersJOINGROUP BYAGGREGATE
- #77Active and dormant customersJOINGROUP BYAGGREGATE
- #78Revenue by statusGROUP BYAGGREGATE
- #79The real revenueWHEREAGGREGATE
- #80The average order valueSELECTAGGREGATE
- #81Who places the biggest ordersJOINGROUP BYORDER BY+2
- #82The best customerJOINGROUP BYORDER BY+2
- #83The orders for one monthWHEREDATES
- #84Product URLs (slugs)STRINGSDDLDML
- #85Customers by email domainGROUP BYSTRINGSAGGREGATE
- #86Orders by email domainJOINGROUP BYSTRINGS+1
- #87Popular email servicesGROUP BYHAVINGSTRINGS+1
- #88Domains by monthJOINGROUP BYDATES+2
- #89Will the database take a duplicate emailDML
- #90Labels for the mobile versionWHERESTRINGS
- #91Customers by cityGROUP BYAGGREGATE
- #92Quiet citiesJOINGROUP BYHAVING+1
- #93Quiet cities by moneyJOINGROUP BYHAVING+1
- #94Revenue by cityJOINGROUP BYAGGREGATE
- #95Repeat customersJOINGROUP BYHAVING+1
- #96Repeat customers through a CTEJOINGROUP BYWHERE+2
- #97Orders by monthGROUP BYDATESAGGREGATE
- #98Strong monthsGROUP BYHAVINGDATES+1
- #99The month as a real dateGROUP BYORDER BYDATES+1
- #100Orders after paydayWHEREDATES
- #101Recent ordersWHERESUBQUERYDATES+1
- #102The three most recent ordersSELECTORDER BYDATES
- #103The season of an orderSELECTDATES
- #104The top three customersJOINGROUP BYORDER BY+2
- #105Orders above averageWHERESUBQUERYAGGREGATE
- #106A shared delivery runJOIN
- #107Who has never orderedWHERESUBQUERY
- #108Orders by sizeGROUP BYAGGREGATE
- #109The processing queueSELECTORDER BY
- #110The large order groupsGROUP BYHAVINGAGGREGATE
- #111The spending of every customerJOINGROUP BYAGGREGATE
- #112Order line itemsDDLCONSTRAINTS
- #113Filling in the line itemsDML
- #114Bought for lessJOINWHERE
- #115An index on a foreign keyDDL
- #116A table to experiment onDATESDDLDML
- #117What the query plan saysDDL
- #118Raise the prices and see the resultWHEREDML
- #119A staging table for the price listDDLDML
- #120Applying the price listWHEREDML
- #121Clearing up after yourselfDDL
- #122Who bought whatJOIN
- #123Sales by productJOINGROUP BYAGGREGATE
- #124Revenue by productJOINGROUP BYAGGREGATE
- #125Revenue by categoryJOINGROUP BYAGGREGATE
- #126Top 3 among the varied categoriesJOINGROUP BYHAVING+2
- #127A category's share of the revenueJOINGROUP BYSUBQUERY+2
- #128How far behind the leaderJOINGROUP BYCTE+2
- #129Categories by strengthJOINGROUP BYCTE+1
- #130The catalogue with revenueJOINGROUP BYCTE+1
- #131Two breakdowns in one queryJOINGROUP BYAGGREGATE
- #132Every breakdown at onceJOINGROUP BYAGGREGATE
- #133The April calendar with no gapsJOINGROUP BYORDER BY+2
- #134Total against the sum of the line itemsJOINGROUP BYAGGREGATE
- #135A running total of the revenueORDER BYWINDOWDATES+1
- #136A moving averageORDER BYWINDOWDATES+1
- #137Ranking customers by spendingJOINGROUP BYORDER BY+2
- #138Ranking every customerJOINGROUP BYORDER BY+2
- #139Who is the leaderJOINGROUP BYORDER BY+2
- #140Ranking among the large categoriesJOINGROUP BYHAVING+3
- #141The leader in each categoryJOINGROUP BYORDER BY+4
- #142Categories with high revenueJOINGROUP BYWHERE+3
- #143Products nobody has boughtWHERESUBQUERYUNION
- #144The priciest that do not sellJOINORDER BYWHERE
- #145Two lists into oneWHERESUBQUERYUNION
- #146The list without duplicatesWHERESUBQUERYUNION
- #147The worst candidatesWHERESUBQUERYUNION
- #148Categories that have emptied outWHERESUBQUERY
- #149A comparison that is safe with NULLWHEREAGGREGATE
- #150Working out the order totalsWHERESUBQUERYAGGREGATE
- #151A view for the catalogueJOINDDL
- #152A view over an aggregateJOINGROUP BYDDL+1
- #153How the revenue changes month to monthGROUP BYORDER BYWHERE+3
- #154The change with no empty cellsGROUP BYORDER BYCTE+3
- #155Price tiers of the catalogueORDER BYWINDOW
- #156Do the customers come backJOINORDER BYWINDOW+1
- #157A report with subtotalsJOINGROUP BYORDER BY+1
- #158A total row by handJOINGROUP BYUNION+1
- #159A price list from the supplierDML
- #160A discount: the column, the data and the ruleWHEREDDLDML+1
- #161Protection from a nonsensical priceDDLCONSTRAINTS
- #162A default statusDATESDDLDML+1
- #163Rolling back only the mistakeWHEREDMLTRANSACTION
- #164Reserving stock safelyWHEREDMLTRANSACTION
- #165The reviews tableDDLCONSTRAINTS
- #166The first reviewsDML
- #167A rating off the scaleDML
- #168Product ratingsJOINGROUP BYAGGREGATE
- #169Places by ratingJOINGROUP BYORDER BY+2
- #170The weakest by ratingJOINGROUP BYORDER BY+1
- #171The sentiment of the reviewsGROUP BYAGGREGATE
- #172What people write about the batteryJOINWHERE
- #173The most detailed reviewsJOINORDER BYSTRINGS
- #174Revenue per reviewJOINGROUP BYAGGREGATE
- #175The gap between sales and reviewsJOINWHERESUBQUERY
- #176Products with no reviewsJOINWHERE
- #177Rating against revenueJOINGROUP BYCTE+1
- #178Reviews from people who did not buyJOINWHERESUBQUERY
- #179A many-to-many linkDDLCONSTRAINTS
- #180Moving the existing links acrossDML
- #181A product in several categoriesDML
- #182A product with all its categoriesJOINGROUP BYORDER BY+2
- #183How many products in a category nowJOINGROUP BYAGGREGATE
- #184Products on two shelvesJOINGROUP BYHAVING+1
- #185Neighbouring categoriesJOINGROUP BYAGGREGATE
- #186Removing a link that is not neededWHEREDML
- #187Category revenue after M:NJOINGROUP BYAGGREGATE
- #188Removing the redundant columnDDL
- #189The payments tableDDLCONSTRAINTS
- #190The statement from accountingDATESDML
- #191A payment with no amountDML
- #192What has not been paid for yetJOINWHERE
- #193Reconciling the paymentsJOINGROUP BYHAVING+1
- #194How exactly people payGROUP BYAGGREGATE
- #195Which months the money came inSELECTORDER BYDATES
- #196How much each customer paidJOINGROUP BYAGGREGATE
- #197How the money piled upORDER BYWINDOWDATES+1
- #198The latest payment for each orderSELECTORDER BYDATES
- #199Money for something cancelledJOINGROUP BYWHERE+1
- #200The shipments tableDDLCONSTRAINTS
- #201The dispatch logDATESDML
- #202Paid for but not dispatchedWHERESUBQUERY
- #203How many days delivery takesJOINWHEREDATES
- #204What is on its way right nowJOINWHEREDATES
- #205The carriers' workloadGROUP BYHAVINGAGGREGATE
- #206What is waiting to be dispatchedJOINGROUP BYWHERE+1
- #207Who delivers fasterJOINGROUP BYWHERE+2
- #208How long we take to pack a parcelJOINGROUP BYDATES+1
- #209Dispatched without waiting for the moneyJOINGROUP BYHAVING+2
- #210Does a long delivery spoil the ratingJOINWHEREDATES
- #211A review but no moneyJOINWHERESUBQUERY
- #212How people pay in different citiesJOINGROUP BYAGGREGATE
- #213An order cardJOINWHERESUBQUERY+1
- #214An order's event feedJOINUNIONDATES
- #215The state of the orders at a glanceJOINGROUP BYDATES+1
- #216An order from start to finishWHERESUBQUERYDATES+3
- #217Closing the stale ordersWHERESUBQUERYDATES+1