tianyang/spider2-aifunc huggingface dataset:
Database: THELOOK_ECOMMERCE
Task: For users who registered in 2019 and made purchases in 2019, classify their traffic source into exactly one of ['Organic Search', 'Paid Advertising', 'Social Media', 'Email Marketing', 'Direct', 'Other']. Filter to users whose acquisition channel is 'Organic Search' or 'Paid Advertising', and where the condition 'The traffic source indicates intentional product research behavior: ' concatenated with the traffic source evaluates to true. List the email addresses of the top 10 users ranked by their average order value, where average order value is calculated as the sum of sale prices across all order items per order, summed across all orders for a user, then divided by the number of distinct orders. Exclude orders and order items with status 'Cancelled' or 'Returned' (case-insensitive). In case of ties in average order value, rank alphabetically by email.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: THELOOK_ECOMMERCE
Task: Among products sold in 2020 in the 'Accessories' category, which products are semantically identified as wearable fashion accessories (using the condition 'This is a wearable fashion accessory item like sunglasses, scarves, ties, hats, belts, or jewelry: ' concatenated with the product name) and had the lowest profit margin in each month? For each result, also classify the product into exactly one of ['Eyewear', 'Neckwear', 'Headwear', 'Bags & Belts', 'Other Accessories'] based on product name. Profit is calculated as retail_price minus cost from the products table. Return the month (as first day of month in YYYY-MM-DD format), the accessory type classification, and product name, ordered chronologically by month, with ties broken alphabetically by product name.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: THELOOK_ECOMMERCE
Task: For each month in 2020, identify the product with the lowest profit margin (calculated as retail_price minus cost from the products table) that had at least one sale during that month. If multiple products tie for lowest profit in a month, include all tied products ordered alphabetically by product name. For each such product, extract two attributes from its name using the following extraction questions: 'product_type' with the question 'What is the main product type or item? Answer in 1-3 words only, lowercase (e.g., hat, shirt, sunglasses, bow tie)', and 'target_audience' with the question 'Who is the target audience if mentioned? Answer in 1-2 words, always lowercase (e.g., men, women, unisex, boys). If no target audience is mentioned, return exactly "unspecified" (not "none" or "N/A").' Return the sale month (as the first day of that month in YYYY-MM-DD format), product name, extracted product type, and extracted target audience. Order results chronologically by month, then alphabetically by product name within each month.
Required AI functions: AI_EXTRACT
Database: GA360
Task: What were the monthly add-to-cart and purchase conversion rates (calculated as percentages of product detail views, rounded to 2 decimal places) from January to March 2017, with months displayed in YYYYMM format, ranked by similarity to 'excellent e-commerce conversion with high add-to-cart rate above 35% and strong purchase rate above 8%' using a description formatted as 'Add-to-cart rate: {rate}%, Purchase rate: {rate}%', with highest similarity first and month ascending as tie-breaker?
Required AI functions: AI_SIMILARITY
Database: THELOOK_ECOMMERCE
Task: For each month in 2021 (formatted as YYYY-MM), generate a strategic market report showing the number of orders, unique purchasers, and profit (sum of retail prices minus sum of costs, rounded to 2 decimal places) for orders placed in 2021 by users who registered in 2021 for inventory items created in 2021. Instead of grouping by raw product department and category, classify each product category into exactly one of ['Core Essentials', 'Fashion & Lifestyle', 'Specialty & Seasonal', 'Premium & Luxury'] based on the category name, and only include categories where the condition 'This product category represents fashion-forward, trendy, or lifestyle-oriented merchandise: ' concatenated with the category name evaluates to true. Group the results by month, user country, and the classified strategic segment, ordered by month, country, and strategic segment.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: THELOOK_ECOMMERCE
Task: For each month from January 2019 through August 2022, identify the top 3 most profitable products (excluding canceled or returned orders), where profit is calculated as the sum of sale prices minus the sum of inventory item costs. For each month, aggregate the names of these top 3 products to determine the dominant product category using the instruction: 'Based on these product names, identify the single dominant product category. Return only the category name (e.g., Outerwear, Dresses, Activewear, Accessories, Casual Wear, Formal Wear, Swimwear, Loungewear).'

Filter to show only months where the dominant category is 'Outerwear'. For each qualifying month, also aggregate the product names to identify the primary target demographic using the instruction: 'Based on these product names, identify the primary target demographic. Return exactly one of: Men, Women, or Unisex.'

Return the month (formatted as YYYY-MM), the three product names separated by '; ' (semicolon followed by a space, ordered by profit descending, then alphabetically by product name for ties), and the target demographic. Order results chronologically by month.
Required AI functions: AI_AGG
Database: GA360
Task: Which visitor IDs belong to users whose first transaction occurred on a device with deviceCategory exactly equal to 'mobile' on a calendar date strictly later than their first visit date, considering sessions from August 2016 (days 01-31) and July 2017 (days 01-31 plus August 1st 2017), where a transaction is defined as a session having totals:transactions greater than 0, and the first transaction is determined by the earliest session date (YYYYMMDD format)? Classify each qualifying visitor's acquisition channel into exactly one of ['Organic Acquisition', 'Paid Acquisition', 'Social Acquisition', 'Direct Acquisition', 'Referral Acquisition', 'Other Acquisition'] based on the channelGrouping of their first transaction session. Only return visitors classified as 'Organic Acquisition' or 'Social Acquisition', and where the condition 'This represents a delayed mobile conversion where the user returned after their initial visit: ' concatenated with the channelGrouping evaluates to true.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: AUSTIN
Task: For bike share stations that had trip activity in 2013 or 2014, classify each station into exactly one of ['Downtown', 'University/Campus', 'Parks/Recreation', 'Residential/Neighborhood', 'Commercial/Business'] based on the station name. Additionally, filter to only include stations where the condition 'This station name suggests it is located at a major intersection, transit hub, or well-known landmark' evaluates to true when applied to the station name. For each year and each area type, provide the count of stations grouped by their operational status (the 'status' field in the stations table, which contains 'active' or 'closed').
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: STACKOVERFLOW
Task: Among the top 50 Stack Overflow users by answer count (with reputation greater than 10), filter to those with non-NULL about_me profiles where the condition 'This user profile indicates an active technical community contributor: ' concatenated with their about_me text evaluates to true. For the remaining users, classify their expertise into exactly one of ['Database Expert', 'Web Developer', 'Systems Programmer', 'General Developer', 'Other'] based on a description formatted as 'Name: {display_name}, Profile: {about_me}'. Return the display name and expertise classification of the user who has answered the most questions among these filtered users.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: STACKOVERFLOW
Task: Among the top 20 most prolific answerers on Stack Overflow (with reputation greater than 10), extract the primary professional role from their about_me profile using the extraction question 'What is this person's primary job title or professional role? Return only the title in 1-3 words (e.g., "Software Engineer", "Ph.D.", "Data Scientist"), or "None" if not mentioned.' Return the display name and extracted professional role for the answerer with the highest answer count who has an identifiable professional role (excluding those where the role is "None").
Required AI functions: AI_EXTRACT
Database: AUSTIN
Task: What is the highest number of electric bike rides lasting more than 10 minutes taken in a single day by subscribers whose membership type semantically indicates a student or educational affiliation (filtered using the condition 'This subscriber type indicates a student or educational membership: ' concatenated with the subscriber type), excluding rides where either the start or end station semantically indicates a mobile, temporary, or repair facility (identified from candidate stations containing 'mobile', 'repair', or 'temp' in the name, then confirmed using the condition 'This station name indicates a mobile, temporary, or repair/maintenance facility: ' concatenated with the station name)?
Required AI functions: AI_FILTER
Database: AUSTIN
Task: Among active bikeshare stations, consider only the top 30 most semantically similar to 'downtown urban business district commercial area' (based on a description formatted as 'Station: {name}. Address: {address}'). Among trips between these stations, which council district has the highest number of trips that start and end within the same district but at different stations? If there is a tie, return the lowest-numbered district. Return only the council district number.
Required AI functions: AI_SIMILARITY
Database: AUSTIN
Task: For the council district with the highest number of bike trips that start and end within the same district but at different stations (where both the start station and end station have 'active' status), what is the numeric district value, and what areas does this district serve? Aggregate the station names using the instruction: 'Based on these station names, summarize the main areas or landmarks this district serves in one concise sentence, formatted as: Areas served: [summary]'
Required AI functions: AI_AGG
Database: BBC
Task: For BBC News articles where the body contains the word 'education' (case-insensitive), analyze the overall sentiment of each article using the first 2000 characters of the body. Provide a breakdown showing, for each news category, the count of articles with 'positive' sentiment, 'negative' sentiment, 'neutral' sentiment, and 'mixed' sentiment. Order the results by category alphabetically, then by sentiment alphabetically.
Required AI functions: AI_SENTIMENT
Database: FDA
Task: Which Florida zip code has the highest number of distinct community-focused banking institutions? Consider both institution headquarters and branch locations in Florida. Classify each institution into exactly one of ['Large National Bank', 'Regional Bank', 'Community Bank', 'Credit Union', 'Other'] based on the institution name, then filter to only those classified as 'Community Bank' or 'Credit Union'. Additionally, only include institutions where the condition 'This institution primarily serves local communities and small businesses: {institution_name}' evaluates to true. Count distinct institutions (by FDIC certificate number) per zip code and return only the zip code with the highest count. In case of a tie, return the numerically smallest zip code.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: USA_NAMES
Task: Among female baby names in Wyoming for the year 2021 that satisfy the condition 'This name is commonly used for both boys and girls or has gender-neutral connotations: ' concatenated with the name, which name has the highest proportion of Wyoming female babies compared to the total number of female babies given the same name across all states in 2021? Also classify this name into exactly one of ['English Origin', 'Biblical/Hebrew Origin', 'Latin/Greek Origin', 'Nature-Inspired', 'Modern Invented'] based on the name's etymology. Return the name and its origin classification.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: FDA
Task: What is the total number of banking institutions in the state that has the highest sum of assets from banks with valid (non-NULL) state names and total assets, established between January 1, 1900 and December 31, 2000, with institution names starting with 'Bank'? Also, for all institutions in that state, provide a summary of their banking focus areas by aggregating the primary specialization field using the instruction: 'List the top 5 most common types of banking specializations, formatted as: Type1; Type2; Type3; Type4; Type5'.
Required AI functions: AI_AGG
Database: NOAA_GLOBAL_FORECAST_SYSTEM
Task: Provide a daily weather summary for July 2019 within a 5 km radius of the geographic point specified as 'POINT(26.75 51.5)' in ST_GEOGRAPHY format (longitude 26.75, latitude 51.5). For each forecast date, calculate the maximum, minimum, and average temperatures in Fahrenheit; total precipitation; average cloud cover between 10 AM and 5 PM inclusive (hours 10 through 17); total snowfall (precipitation when average temperature is below 32°F); and total rainfall (precipitation when average temperature is 32°F or above). All numeric values in the output should be rounded to 1 decimal place. Only include data from forecasts created in July 2019 (based on UTC timestamps) for the following day. Classify each day's weather into exactly one of ['Hot and Dry', 'Hot and Rainy', 'Warm and Dry', 'Warm and Rainy', 'Cool and Dry', 'Cool and Rainy'] based on a weather description formatted as 'Temperature range: {min}-{max}°F (avg {avg}°F). Precipitation: {precip}mm. Cloud cover: {cloud}%' where values are rounded to 1 decimal place. Order results by semantic similarity between each day's weather description and the reference pattern 'hot summer day with clear skies and minimal precipitation' in descending order, with forecast date ascending as a tie-breaker.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: CRYPTO
Task: Analyze Bitcoin CoinJoin activity since July 2023. For each month with CoinJoin transactions (defined as transactions with more than 2 outputs, output value not exceeding input value, and at least two outputs with identical values), calculate the percentage of transactions, UTXOs (as the average of CoinJoin input and output ratios to total network inputs and outputs from the TRANSACTIONS table), and volume (based on input value) attributed to CoinJoins, each rounded to 4 decimal places. Classify each month's privacy adoption into exactly one of ['High Privacy Adoption', 'Moderate Privacy Adoption', 'Low Privacy Adoption'] based on a description formatted as 'CoinJoin metrics - Transactions: {tx_pct}%, UTXOs: {utxo_pct}%, Volume: {vol_pct}%'. Order results by semantic similarity to 'Strong privacy adoption with high CoinJoin transaction percentage and high volume percentage' (most similar first), limited to top 10 months. Return the month, the three percentage metrics, and the privacy adoption classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: NEW_YORK_GEO
Task: For NYC yellow taxi trips on January 1, 2015, analyze pickup patterns by zip code and hour. Compute hourly trip counts per zip code with 14-day moving averages. For the top 10 zip code-hour combinations by trip count, filter to only those where the demand represents a surge pattern using the condition 'The current trip count of {trip_count} significantly exceeds the 14-day average of {ma_14d} trips, indicating a demand surge'. Then rank the remaining results by semantic similarity to 'New Year midnight celebration peak taxi demand in busy Manhattan neighborhoods' using a description formatted as 'Zip code {zip_code} with {trip_count} taxi pickups at {hour_HH24:MI}' where the hour is formatted in 24-hour notation (HH24:MI). In case of similarity ties, order by trip count descending, then by zip code ascending, then by hour ascending. Return the top 5 results showing zip code, hour (as a timestamp in YYYY-MM-DD HH24:MI:SS format), and trip count.
Required AI functions: AI_FILTER, AI_SIMILARITY
Database: SAN_FRANCISCO_PLUS
Task: What are the top 5 longest bike share trips that started between July 1, 2017 and December 31, 2017, where the start station is identified as a 'street intersection' type location? For each start station name, extract the location type into a field named 'location_type' using the extraction question: 'What type of location does this station name describe? Answer with exactly one of: BART station, street intersection, park, plaza, pier, other'. Only include trips where the extracted location type is 'street intersection'.

For each qualifying trip, provide: trip ID, duration in seconds, start date (converted from microseconds to timestamp format), start station name, the extracted location type, route (formatted as '{start_station_name} - {end_station_name}'), bike number, subscriber type, member birth year, current age (calculated as current year minus birth year), age classification (where age below 40 is 'Young (<40 Y.O)', age between 40 and 60 inclusive is 'Adult (40-60 Y.O)', and age above 60 is 'Senior Adult (>60 Y.O)'), member gender, and region name of the start station.

Exclude any trips where start station name is null or empty, member birth year is null, or member gender is null or empty. Consider only the top 200 longest trips as candidates before applying the location type filter. Order results by duration descending, with trip ID as a tie-breaker.
Required AI functions: AI_EXTRACT
Database: GITHUB_REPOS_DATE
Task: Among Python repositories from the 2017 GitHub Archive watch events data (containing at least one .py file smaller than 15,000 bytes with the substring "def " in its content), which three repositories have Python code most semantically similar to 'machine learning and data science algorithms'? For each repository, use the largest qualifying Python file (by byte size) as the representative code for similarity comparison.
Required AI functions: AI_SIMILARITY
Database: GITHUB_REPOS_DATE
Task: Using 2017 GitHub Archive watch events, which three repositories that include at least one Python file (with .py extension) smaller than 15,000 bytes containing the substring "def " have the highest total watch counts? For each repository, also aggregate its qualifying Python file contents (only files with .py extension, smaller than 15,000 bytes, and containing "def ") using the instruction: 'Based on these Python code files, state the main purpose in exactly 5-10 words, formatted as: Purpose: [5-10 word description]'.
Required AI functions: AI_AGG
Database: STACKOVERFLOW
Task: What is the highest number of answers received for a single Stack Overflow question whose tags are classified as 'Python 2 Only' (from the categories ['Python 2 Only', 'Python 3 Only', 'Both Versions', 'Other'] based on the tags field), where none of its answers contain Python 3 keywords ('python3' or 'python-3' in the body), and where none of its remaining answers have semantic similarity greater than 0.5 to 'Python 3 programming, Python 3.x features, print function syntax, Python 3 migration'?
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: STACKOVERFLOW
Task: Retrieve details of accepted answers to Stack Overflow questions posted in January 2016 (from January 1, 2016 00:00:00 UTC to January 31, 2016 23:59:59 UTC inclusive) where the question tags include "javascript" and at least one of "xss", "cross-site", "exploit", or "cybersecurity". The accepted answers must also have been posted within the same January 2016 timeframe. 

For each accepted answer, classify the security threat type based on the question tags into exactly one of ['XSS/Injection', 'Code Exploitation', 'Cross-Site Attack', 'General Security'] using the input format 'Security tags: {tags}'. Additionally, only include answers where the answer body satisfies the condition 'This answer provides defensive security guidance, mitigation strategies, or protective coding practices. Answer content: ' concatenated with the answer body.

Return the security threat classification, the answer's ID, the answerer's reputation (0 if unknown), answer score (0 if null), and answer comment count (0 if null), along with the question's tags, score (0 if null), answer count (0 if null), the asker's reputation (0 if unknown), view count (0 if null), and comment count (0 if null). Order results by answer ID ascending.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: STACKOVERFLOW
Task: For each month in 2022, among Stack Overflow questions with a score of at least 7, what proportion are semantically about Python programming? A question is considered Python-related if the condition 'This Stack Overflow question is primarily about Python programming: ' concatenated with the question title evaluates to true. Output the month in 'YYYY-MM' format and the proportion as a decimal rounded to 4 decimal places. Order results chronologically by month.
Required AI functions: AI_FILTER
Database: STACKOVERFLOW
Task: For each of the following Android-related StackOverflow tags: 'android-layout', 'android-activity', 'android-intent', 'android-edittext', 'android-fragments', 'android-recyclerview', 'listview', 'android-actionbar', 'google-maps', and 'android-asynctask', identify questions that contain the standalone word 'how' (matched as a complete word at the start of text or surrounded by spaces/punctuation, not as a substring within another word) in either the title or body, and do not contain any of these troubleshooting substrings in either title or body: 'fail', 'problem', 'error', 'wrong', 'fix', 'bug', 'issue', 'solve', or 'trouble'. Only consider tags that have at least 50 such qualifying questions. For each qualifying tag, take the top 50 questions by view count (with ties broken by question ID ascending), then aggregate their titles using the instruction: 'What is the single most frequently mentioned Android component or class name in these titles? Return ONLY the component name, nothing else.'. Return the tag and its primary topic, ordered alphabetically by tag.
Required AI functions: AI_AGG
Database: STACKOVERFLOW
Task: Which 10 users have the highest combined view counts for questions they are associated with, and what is the overall sentiment of each user's profile bio (about_me field)? A user is considered associated with a question if they own the question, or their answer is the accepted answer, or their answer's score is greater than 5, or their answer's score exceeds 20% of the total answer scores for that question (and is above 0), or their answer is among the top three highest-scoring answers for that question (using row-number ranking by score descending, with ties broken by answer_id ascending). Return the user's display name, total associated view count, and profile sentiment. Order by total view count descending, with ties broken by user_id ascending.
Required AI functions: AI_SENTIMENT
Database: STACKOVERFLOW
Task: Identify the top 10 tags for user 1908967, based only on answers posted before June 7, 2018, where each tag's score is 10 times the number of upvotes (vote_type_id=2) and 15 times the number of accepted answers (vote_type_id=1). Derive tags from the questions associated with those answers. For each of the top 10 tags, also provide a summary of the user's expertise by aggregating the first 1500 characters of each answer body using the instruction: 'List the top 3 technical topics this user discusses, formatted as: topic1; topic2; topic3'. Return the tags with the highest total scores in descending order, with ties broken alphabetically by tag name, limited to 10 tags, showing the tag, total score, and expertise summary.
Required AI functions: AI_AGG