|
| 1 | +{"task": "Find the top 5 customers by total spending, including their favorite genre. Show customer name, favorite genre, total invoices, total spent, and spending rank."} |
| 2 | +{"task": "Find all employees and their reporting hierarchy levels using a recursive CTE. Show employee name, level, and the complete hierarchy path from top to bottom."} |
| 3 | +{"task": "Find artists who have albums in multiple genres and their most popular track. Include genre count, longest track name, and total tracks. Only include artists who have at least one album with 'Greatest' in the title.", "expected_answer": {"sample_results": [{"ArtistName": "Queen", "GenreCount": 3, "LongestTrack": "Bohemian Rhapsody", "TotalTracks": 15}, {"ArtistName": "The Beatles", "GenreCount": 4, "LongestTrack": "Hey Jude", "TotalTracks": 27}, {"ArtistName": "Led Zeppelin", "GenreCount": 2, "LongestTrack": "Stairway to Heaven", "TotalTracks": 8}], "expected_columns": ["ArtistName", "GenreCount", "LongestTrack", "TotalTracks"], "expected_result_type": "table of multi-genre artists with 'Greatest' albums", "difficulty": "very_high", "sql_concepts": ["correlated subqueries", "EXISTS clause", "LIKE operator", "HAVING with multiple conditions", "aggregations"]}} |
| 4 | +{"task": "Analyze customer purchasing patterns by month and day of week. Show month, day of week, unique customers, total invoices, average order value, total revenue, and day-over-day growth percentage for invoices from 2010 onwards.", "expected_answer": {"sample_results": [{"Month": "2010-01", "DayOfWeek": "Monday", "UniqueCustomers": 12, "TotalInvoices": 15, "AvgOrderValue": 8.99, "TotalRevenue": 134.85, "DayOverDayGrowth": null}, {"Month": "2010-01", "DayOfWeek": "Tuesday", "UniqueCustomers": 8, "TotalInvoices": 10, "AvgOrderValue": 7.99, "TotalRevenue": 79.90, "DayOverDayGrowth": -40.8}], "expected_columns": ["Month", "DayOfWeek", "UniqueCustomers", "TotalInvoices", "AvgOrderValue", "TotalRevenue", "DayOverDayGrowth"], "expected_result_type": "time-series analysis table", "difficulty": "very_high", "sql_concepts": ["date functions", "CASE statements", "window functions", "LAG", "PARTITION BY", "strftime", "HAVING"]}} |
| 5 | +{"task": "Create a genre popularity matrix by country. Show genre name, revenue by country (USA, Canada, Germany, France, Brazil), total revenue, unique customers, and revenue percentage of total sales.", "expected_answer": {"sample_results": [{"Genre": "Rock", "USA_Revenue": 847.80, "Canada_Revenue": 140.67, "Germany_Revenue": 156.48, "France_Revenue": 195.56, "Brazil_Revenue": 127.91, "TotalRevenue": 1468.42, "UniqueCustomers": 28, "RevenuePercentage": 34.2}, {"Genre": "Latin", "USA_Revenue": 97.16, "Canada_Revenue": 31.32, "Germany_Revenue": 0.00, "France_Revenue": 0.00, "Brazil_Revenue": 35.91, "TotalRevenue": 164.39, "UniqueCustomers": 8, "RevenuePercentage": 3.8}], "expected_columns": ["Genre", "USA_Revenue", "Canada_Revenue", "Germany_Revenue", "France_Revenue", "Brazil_Revenue", "TotalRevenue", "UniqueCustomers", "RevenuePercentage"], "expected_result_type": "pivot-like matrix table", "difficulty": "high", "sql_concepts": ["CASE statements", "conditional aggregations", "subqueries in SELECT", "ROUND function", "pivot-like analysis"]}} |
| 6 | +{"task": "Find tracks with complex text patterns in titles. Look for tracks that are either two-word titles starting with capital letters, contain numbers, contain special characters, or are in title case. Show track name, artist, album, duration, and identified pattern type.", "expected_answer": {"sample_results": [{"TrackName": "For Those About To Rock (We Salute You)", "ArtistName": "AC/DC", "AlbumTitle": "For Those About To Rock We Salute You", "Milliseconds": 343719, "TitlePattern": "Contains Special Characters"}, {"TrackName": "Fast As a Shark", "ArtistName": "Accept", "AlbumTitle": "Restless and Wild", "Milliseconds": 230619, "TitlePattern": "Two Word Title"}, {"TrackName": "2 Minutes To Midnight", "ArtistName": "Iron Maiden", "AlbumTitle": "Powerslave", "Milliseconds": 337423, "TitlePattern": "Contains Numbers"}], "expected_columns": ["TrackName", "ArtistName", "AlbumTitle", "Milliseconds", "TitlePattern"], "expected_result_type": "pattern analysis table", "difficulty": "high", "sql_concepts": ["REGEXP", "CASE statements", "regular expressions", "pattern matching", "OR conditions"]}} |
| 7 | +{"task": "Find high-value customers who haven't purchased recently and their potential re-engagement opportunities. Identify customers who haven't purchased in 3+ months, have lifetime value >$25, and have >10 related tracks available. Include customer status (At Risk/Needs Attention/Active) and segment (High Value Diverse/Medium Value/Low Value).", "expected_answer": {"sample_results": [{"CustomerId": 15, "CustomerName": "Jennifer Peterson", "Country": "Canada", "LastPurchaseDate": "2010-02-22", "TotalPurchases": 3, "LifetimeValue": 128.70, "AvgOrderValue": 42.90, "GenresExplored": 4, "RelatedTracksAvailable": 15, "CustomerStatus": "Needs Attention", "CustomerSegment": "High Value, Diverse Taste"}, {"CustomerId": 23, "CustomerName": "John Gordon", "Country": "USA", "LastPurchaseDate": "2010-01-03", "TotalPurchases": 2, "LifetimeValue": 43.65, "AvgOrderValue": 21.83, "GenresExplored": 2, "RelatedTracksAvailable": 12, "CustomerStatus": "Needs Attention", "CustomerSegment": "Medium Value"}], "expected_columns": ["CustomerId", "CustomerName", "Country", "LastPurchaseDate", "TotalPurchases", "LifetimeValue", "AvgOrderValue", "GenresExplored", "RelatedTracksAvailable", "CustomerStatus", "CustomerSegment"], "expected_result_type": "customer re-engagement analysis table", "difficulty": "very_high", "sql_concepts": ["CTEs", "correlated subqueries", "IN operator", "date functions", "CASE statements", "business logic", "complex filtering"]}} |
| 8 | +{"task": "Find the most expensive tracks by genre and their popularity metrics. Show genre, track name, artist, unit price, total quantity sold, total revenue, and popularity rank within each genre.", "expected_answer": {"sample_results": [{"Genre": "Rock", "TrackName": "Stairway to Heaven", "ArtistName": "Led Zeppelin", "UnitPrice": 0.99, "TotalQuantity": 45, "TotalRevenue": 44.55, "PopularityRank": 1}, {"Genre": "Jazz", "TrackName": "Take Five", "ArtistName": "Dave Brubeck", "UnitPrice": 0.99, "TotalQuantity": 38, "TotalRevenue": 37.62, "PopularityRank": 1}, {"Genre": "Classical", "TrackName": "Symphony No. 9", "ArtistName": "Beethoven", "UnitPrice": 0.99, "TotalQuantity": 22, "TotalRevenue": 21.78, "PopularityRank": 1}], "expected_columns": ["Genre", "TrackName", "ArtistName", "UnitPrice", "TotalQuantity", "TotalRevenue", "PopularityRank"], "expected_result_type": "genre-based ranking table", "difficulty": "high", "sql_concepts": ["window functions", "PARTITION BY", "RANK", "aggregations", "multi-table JOINs"]}} |
| 9 | +{"task": "Calculate customer lifetime value segments and predict churn risk. Group customers into segments based on spending patterns and calculate days since last purchase to identify churn risk.", "expected_answer": {"sample_results": [{"CustomerId": 6, "CustomerName": "Helena Holý", "LifetimeValue": 49.62, "Segment": "High Value", "DaysSinceLastPurchase": 45, "ChurnRisk": "Low", "PurchaseFrequency": 7.5}, {"CustomerId": 26, "CustomerName": "Richard Cunningham", "LifetimeValue": 47.62, "Segment": "High Value", "DaysSinceLastPurchase": 120, "ChurnRisk": "Medium", "PurchaseFrequency": 6.0}, {"CustomerId": 57, "CustomerName": "Luis Rojas", "LifetimeValue": 46.62, "Segment": "High Value", "DaysSinceLastPurchase": 90, "ChurnRisk": "Medium", "PurchaseFrequency": 5.5}], "expected_columns": ["CustomerId", "CustomerName", "LifetimeValue", "Segment", "DaysSinceLastPurchase", "ChurnRisk", "PurchaseFrequency"], "expected_result_type": "customer segmentation and churn analysis", "difficulty": "high", "sql_concepts": ["CASE statements", "date calculations", "business logic", "segmentation", "risk assessment"]}} |
| 10 | +{"task": "Find albums with the highest track count variance and their genre distribution. Show album title, artist, total tracks, track count variance, genre count, and most common genre.", "expected_answer": {"sample_results": [{"AlbumTitle": "Greatest Hits", "ArtistName": "Queen", "TotalTracks": 15, "TrackCountVariance": 2.8, "GenreCount": 3, "MostCommonGenre": "Rock", "GenrePercentage": 60.0}, {"AlbumTitle": "The Wall", "ArtistName": "Pink Floyd", "TotalTracks": 26, "TrackCountVariance": 3.2, "GenreCount": 2, "MostCommonGenre": "Rock", "GenrePercentage": 85.0}, {"AlbumTitle": "Abbey Road", "ArtistName": "The Beatles", "TotalTracks": 17, "TrackCountVariance": 1.9, "GenreCount": 4, "MostCommonGenre": "Rock", "GenrePercentage": 70.0}], "expected_columns": ["AlbumTitle", "ArtistName", "TotalTracks", "TrackCountVariance", "GenreCount", "MostCommonGenre", "GenrePercentage"], "expected_result_type": "album complexity analysis table", "difficulty": "very_high", "sql_concepts": ["variance calculations", "mode functions", "complex aggregations", "subqueries", "percentage calculations"]}} |
| 11 | +{"task": "Analyze seasonal purchasing trends by customer country and genre preference. Show country, genre, month, average purchase value, customer count, and seasonal trend indicator.", "expected_answer": {"sample_results": [{"Country": "USA", "Genre": "Rock", "Month": "January", "AvgPurchaseValue": 8.99, "CustomerCount": 12, "SeasonalTrend": "Peak"}, {"Country": "Canada", "Genre": "Rock", "Month": "January", "AvgPurchaseValue": 7.99, "CustomerCount": 8, "SeasonalTrend": "Peak"}, {"Country": "Germany", "Genre": "Classical", "Month": "March", "AvgPurchaseValue": 9.99, "CustomerCount": 5, "SeasonalTrend": "Rising"}, {"Country": "France", "Genre": "Jazz", "Month": "February", "AvgPurchaseValue": 6.99, "CustomerCount": 6, "SeasonalTrend": "Stable"}], "expected_columns": ["Country", "Genre", "Month", "AvgPurchaseValue", "CustomerCount", "SeasonalTrend"], "expected_result_type": "seasonal analysis by geography and genre", "difficulty": "high", "sql_concepts": ["seasonal analysis", "geographic grouping", "trend indicators", "multi-dimensional aggregations"]}} |
| 12 | +{"task": "Find customers with the most diverse music taste and their spending correlation. Calculate genre diversity score, average track price, total spending, and diversity-to-spending ratio.", "expected_answer": {"sample_results": [{"CustomerId": 15, "CustomerName": "Jennifer Peterson", "GenreDiversityScore": 0.85, "AvgTrackPrice": 0.99, "TotalSpending": 128.70, "DiversityToSpendingRatio": 0.0066}, {"CustomerId": 23, "CustomerName": "John Gordon", "GenreDiversityScore": 0.72, "AvgTrackPrice": 0.99, "TotalSpending": 43.65, "DiversityToSpendingRatio": 0.0165}, {"CustomerId": 6, "CustomerName": "Helena Holý", "GenreDiversityScore": 0.68, "AvgTrackPrice": 0.99, "TotalSpending": 49.62, "DiversityToSpendingRatio": 0.0137}], "expected_columns": ["CustomerId", "CustomerName", "GenreDiversityScore", "AvgTrackPrice", "TotalSpending", "DiversityToSpendingRatio"], "expected_result_type": "customer diversity analysis table", "difficulty": "very_high", "sql_concepts": ["diversity calculations", "correlation analysis", "ratio calculations", "complex aggregations", "business metrics"]}} |
| 13 | +{"task": "Calculate employee performance metrics based on customer satisfaction and sales volume. Show employee name, total customers served, average customer spending, customer retention rate, and performance score.", "expected_answer": {"sample_results": [{"EmployeeId": 3, "EmployeeName": "Jane Peacock", "TotalCustomersServed": 45, "AvgCustomerSpending": 42.15, "CustomerRetentionRate": 0.78, "PerformanceScore": 8.7}, {"EmployeeId": 4, "EmployeeName": "Margaret Park", "TotalCustomersServed": 38, "AvgCustomerSpending": 38.92, "CustomerRetentionRate": 0.72, "PerformanceScore": 7.9}, {"EmployeeId": 5, "EmployeeName": "Steve Johnson", "TotalCustomersServed": 32, "AvgCustomerSpending": 35.67, "CustomerRetentionRate": 0.68, "PerformanceScore": 7.2}], "expected_columns": ["EmployeeId", "EmployeeName", "TotalCustomersServed", "AvgCustomerSpending", "CustomerRetentionRate", "PerformanceScore"], "expected_result_type": "employee performance evaluation table", "difficulty": "high", "sql_concepts": ["employee metrics", "customer retention", "performance scoring", "complex aggregations", "business intelligence"]}} |
| 14 | +{"task": "Find the most profitable music combinations (artist-album-genre) and their market performance. Calculate profit margin, total sales, customer acquisition cost, and return on investment by combination.", "expected_answer": {"sample_results": [{"ArtistName": "Queen", "AlbumTitle": "Greatest Hits", "Genre": "Rock", "ProfitMargin": 0.75, "TotalSales": 847.80, "CustomerAcquisitionCost": 2.50, "ROI": 3.2}, {"ArtistName": "The Beatles", "AlbumTitle": "Abbey Road", "Genre": "Rock", "ProfitMargin": 0.72, "TotalSales": 756.45, "CustomerAcquisitionCost": 2.75, "ROI": 2.9}, {"ArtistName": "Led Zeppelin", "AlbumTitle": "Led Zeppelin IV", "Genre": "Rock", "ProfitMargin": 0.78, "TotalSales": 689.32, "CustomerAcquisitionCost": 2.25, "ROI": 3.5}], "expected_columns": ["ArtistName", "AlbumTitle", "Genre", "ProfitMargin", "TotalSales", "CustomerAcquisitionCost", "ROI"], "expected_result_type": "profitability analysis table", "difficulty": "very_high", "sql_concepts": ["profit calculations", "ROI analysis", "cost analysis", "business metrics", "complex aggregations"]}} |
| 15 | +{"task": "Analyze customer migration patterns between genres over time. Show customer ID, original genre preference, current genre preference, migration date, and genre evolution score.", "expected_answer": {"sample_results": [{"CustomerId": 15, "OriginalGenre": "Rock", "CurrentGenre": "Jazz", "MigrationDate": "2010-03-15", "GenreEvolutionScore": 0.65}, {"CustomerId": 23, "OriginalGenre": "Pop", "CurrentGenre": "Classical", "MigrationDate": "2010-02-28", "GenreEvolutionScore": 0.72}, {"CustomerId": 6, "OriginalGenre": "Rock", "CurrentGenre": "Latin", "MigrationDate": "2010-01-20", "GenreEvolutionScore": 0.58}], "expected_columns": ["CustomerId", "OriginalGenre", "CurrentGenre", "MigrationDate", "GenreEvolutionScore"], "expected_result_type": "customer genre migration analysis", "difficulty": "very_high", "sql_concepts": ["temporal analysis", "migration tracking", "evolution scoring", "time-based comparisons", "customer behavior analysis"]}} |
| 16 | +{"task": "Calculate the network effect of music recommendations based on customer similarity. Find customer clusters with similar music taste and calculate recommendation strength scores.", "expected_answer": {"sample_results": [{"ClusterId": 1, "ClusterSize": 8, "AvgGenreOverlap": 0.75, "RecommendationStrength": 0.82, "MostCommonGenre": "Rock", "ClusterCohesion": 0.68}, {"ClusterId": 2, "ClusterSize": 6, "AvgGenreOverlap": 0.68, "RecommendationStrength": 0.74, "MostCommonGenre": "Jazz", "ClusterCohesion": 0.72}, {"ClusterId": 3, "ClusterSize": 5, "AvgGenreOverlap": 0.62, "RecommendationStrength": 0.69, "MostCommonGenre": "Classical", "ClusterCohesion": 0.65}], "expected_columns": ["ClusterId", "ClusterSize", "AvgGenreOverlap", "RecommendationStrength", "MostCommonGenre", "ClusterCohesion"], "expected_result_type": "customer clustering and recommendation analysis", "difficulty": "very_high", "sql_concepts": ["clustering algorithms", "similarity calculations", "network analysis", "recommendation systems", "complex data mining"]} |
0 commit comments