tianyang/spider2-aifunc huggingface dataset:
Database: ELECTRONIC_SALES
Task: For the top 20 sellers by total sales (among those who have sold more than 100 items), prepare a performance report showing: seller ID, total items sold, total sales amount, average item price, average review score, average packing time in hours (from order approval to carrier delivery), the top-selling product category name in English (using the original category name if no English translation exists, with ties broken alphabetically by category name), a sentiment category for review comments classified as 'High' if at least 60% have 'positive' overall sentiment, 'Medium' if at least 40% but less than 60%, or 'Low' if less than 40% (analyzing only reviews that have non-empty comment text), and a summary of customer feedback aggregated using the instruction 'List the top 3 praises and top 3 complaints from reviews, formatted as: Positives: [item1; item2; item3] | Negatives: [item1; item2; item3]'. Order the results by total sales descending.
Required AI functions: AI_AGG, AI_SENTIMENT
Database: BANK_SALES_TRADING
Task: For each month, calculate the total balance from all users for the previous month (replacing any negative individual balances with zero before summing). The first month serves only as a baseline and should be excluded from output. Create a financial description for each month formatted as 'Financial position: Previous month total balance of {balance} across all customer accounts with negative balances zeroed'. Classify each month's financial health into exactly one of ['Strong Financial Position', 'Moderate Financial Position', 'Weak Financial Position'] based on this description. Include only months classified as 'Strong Financial Position' or 'Moderate Financial Position', and where the condition 'This represents a sustainable financial situation: ' concatenated with the financial description evaluates to true. Return the month and previous month total balance, sorted by month in ascending order.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: BANK_SALES_TRADING
Task: Which months demonstrated meaningful customer financial engagement based on aggregate peak balances? For each customer, compute daily balances as the running sum of transaction amounts (deposits positive, withdrawals and purchases negative) for every day between their earliest and latest transaction dates, filling gaps by carrying forward balances. Replace any negative daily balance with zero. Find each customer's maximum daily balance per month, then sum these maximums across all customers for each month. Filter to months where the condition 'The banking period {Month YYYY} with total customer peak balance of {total} demonstrates meaningful customer financial engagement' evaluates to true. Rank the qualifying months by similarity between a description formatted as 'Month: {Month YYYY}, Total: {total}' and the reference text 'exceptional customer financial engagement with peak balance accumulation', with ties broken by higher total balance, then by earlier month. Return the month (as the first day of the month in YYYY-MM-DD format) and total balance.
Required AI functions: AI_FILTER, AI_SIMILARITY
Database: BANK_SALES_TRADING
Task: For the years 2018, 2019, and 2020, analyze sales performance around mid-June using the WEEKLY_SALES table. For each year, calculate the percentage change in sales between the 4 closest weekly data points strictly before June 15 and the 4 closest weekly data points strictly after June 15 (where week dates are parsed from 'DD/MM/YY' format).

For each year, classify the performance trend into exactly one of ['Improving', 'Stable', 'Declining'] based on a description formatted as 'Sales performance changed by {pct_change}% from the 4 weeks before June 15 to the 4 weeks after'.

Rank the years by how similar their performance summary is to 'significant negative decline in sales performance requiring attention', where each year's summary is formatted as 'Year {year}: {pct_change}% change, trend is {performance_trend}'. Return the year, percentage change (rounded to 2 decimal places), and performance trend, ordered from most concerning to least concerning.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: BANK_SALES_TRADING
Task: Analyze the average percentage change in sales between the 12 weeks before and after June 15, 2020 (using week numbers 13-24 for before and 25-36 for after in calendar year 2020), for each attribute type: region, platform, age_band, demographic, and customer_type. For each attribute type, calculate the average percentage change in sales across all its attribute values. Classify each attribute type's sales trend into exactly one of ['Decline', 'Stable', 'Growth'] based on a description formatted as 'The {attribute_type} attribute shows a {avg_pct_change rounded to 2 decimals}% change in sales'. Filter to only those attribute types classified as 'Decline' and where the condition 'This represents a meaningful customer segmentation dimension for retail sales analysis: {attribute_type}' evaluates to true. From these, identify the attribute type with the most negative average percentage change and return the attribute type along with its average percentage change rounded to 2 decimal places.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: F1
Task: Find the top 10 championship years where an Italian-heritage constructor won the Constructors' Championship, that best represent a 'dominant racing legacy with multiple titles'. For each year, report the Drivers' Championship winner's full name and the Constructors' Championship winner's name (these are determined independently from their respective standings). Constructor heritage should be classified into exactly one of ['Italian', 'British', 'German', 'French', 'Japanese', 'Other'] based on constructor name, filtering to 'Italian' only. Rank by semantic similarity to 'dominant racing legacy with multiple titles' using the combined description formatted as '{driver_name} championship with {constructor_name}', with ties broken by year in descending order. Determine champions from final race standings, using wins as tie-breaker when points are equal.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: F1
Task: Among years where the top-scoring constructor (by total points from the results table) is classified as either 'Factory Team' or 'Independent Constructor' from the categories ['Factory Team', 'Independent Constructor', 'Privateer', 'Other'] based on constructor name, find the 3 years with the smallest sum of the top driver's total points for that year and the top constructor's total points for that year. In case of ties in total points, rank by descending similarity of the constructor name to 'legendary championship winning racing team'. Return only the years.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: F1
Task: Which constructors had the top 3 combined points from their best driver's final championship standings and team's final championship standings, and in which years did they achieve them? The best driver for each constructor-year is determined by the driver who scored the most points for that constructor during the season (with ties broken by lower driver_id). When multiple constructor-years have the same combined points, order by constructor name ascending, then by year descending. For each of these top 3 constructor-year achievements, also provide a season summary by aggregating all race results formatted as '[driver_full_name] finished P[position] at [race_name]' using the aggregation instruction: 'List up to 3 notable race victories (P1 finishes) for this team, formatted as: [Driver] won [Race]; [Driver] won [Race]; [Driver] won [Race]. If no wins, state: No wins this season.'
Required AI functions: AI_AGG
Database: LOG
Task: For web pages that appear as either landing pages (first page visited in a session based on timestamp) or exit pages (last page visited in a session based on timestamp), classify each page into exactly one of ['Search', 'Product Detail', 'Conversion', 'Home', 'Other'] based on the URL path. Filter to only pages classified as 'Search' or 'Product Detail'. For each qualifying page, show its URL path, its page category, and the count of unique sessions where it appears as a landing or exit page (counting each session only once per page even if the page serves as both). Order results by semantic similarity to 'user search and product discovery experience' descending, with ties broken by path alphabetically ascending. When multiple activity records have identical timestamps within a session, use path alphabetically ascending as a tiebreaker to determine first and last. Exclude records with NULL or empty paths or sessions.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: LOG
Task: After two consecutive visits to the '/detail' page (with paths normalized by removing trailing slashes so '/detail' and '/detail/' are treated as the same page, but preserving the root path '/' as-is), what are the top 3 third-page visits ranked by semantic relevance to 'user conversion or form submission action'? First, filter to only third pages where the condition 'This URL path represents a user action or navigation page, not a product detail view: ' concatenated with the path evaluates to true. Then rank the remaining paths by similarity to 'user conversion or form submission action' (descending), with ties broken by occurrence count (descending), then alphabetically by path. Only consider 'view' actions for all page visits in the sequence. Return the path and its occurrence count.
Required AI functions: AI_FILTER, AI_SIMILARITY
Database: F1
Task: In the first five laps of races, count overtakes by category: 'Pit Stop' (overtaken driver pitted on that lap or previous lap), 'Start-Related' (lap 1 with grid positions within 2 of each other), 'Retirement' (overtaken driver retired on that lap), and 'On-Track' (all others). For retirement-related overtakes, extract the cause type from the retirement description using the extraction question 'What is the primary cause of this retirement? Return exactly one of: Mechanical, Driver Error, Collision, Other' into a field named 'cause', and show retirement overtakes as 'Retirement - [cause]'. Display each category with its overtake count, ordered by: retirement categories first (alphabetically if multiple), then Pit Stop, Start-Related, and On-Track.
Required AI functions: AI_EXTRACT
Database: F1
Task: Which drivers classified as 'Asian' (from the categories ['European', 'Asian', 'American', 'Other'] based on their full name) have been overtaken on track more times than they have overtaken others during race laps? Return the top 10 most similar to 'Japanese Formula 1 racing driver', ranked by descending similarity.

An on-track overtake is detected when driver A, who was positioned behind driver B at the end of lap L (where L >= 1), moves to a position ahead of driver B at the end of lap L+1. Exclude any overtake where either driver involved had a pit stop recorded on lap L or lap L+1, or where either driver had a retirement recorded on lap L or lap L+1. Only consider laps marked as 'Race' type.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: F1
Task: For drivers who have been overtaken on track more times than they have overtaken others during race laps (where an overtake occurs when driver A is behind driver B on lap L but ahead of B on lap L+1, excluding position changes where either driver pitted on lap L or L+1, either driver retired on lap L or L+1, or the transition occurred from lap 0 to lap 1), provide their full name, a summary of their career retirement history, and a reliability classification. Aggregate each driver's retirement types using the instruction: 'List the main retirement causes, formatted as: [cause1]; [cause2]; [cause3] or fewer if less variety. If no data, return: No retirements recorded'. Then classify each driver into exactly one of ['Reliability Issues', 'Driver Errors', 'Mixed Issues', 'Clean Record'] based on their retirement summary, where 'Reliability Issues' means 'primarily mechanical problems', 'Driver Errors' means 'primarily driver-caused incidents', 'Mixed Issues' means 'combination of mechanical and driver issues', and 'Clean Record' means 'no or minimal retirements'.
Required AI functions: AI_AGG, AI_CLASSIFY
Database: LOG
Task: For each user session, identify the first event where the path contains '/detail' or '/complete' (case-insensitive pattern match). Count the events that occurred strictly before this first target event, considering only events with a non-empty search type. Find all sessions that share the minimum count of such pre-target events. For each qualifying session, return the session ID, the target event's path, and the search type classified into exactly one of ['Geographic Search', 'Job Search', 'Combined Search', 'Unspecified'] based on the search type text. Order results by semantic similarity of the search type to 'geographic area location search' in descending order, using session ID alphabetically as a tiebreaker.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY