conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "For each user, count the number of mutual follow relationships they are involved in (users they follow and who also follow them back). List user_id and mutual_count." }, { "role": "assistant", "content": "SELECT\n f1.follower_user_id AS user_id,\n COUNT(*) ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.follows ( follow_id character varying(64) NOT NULL, follower_user_id character varying(64) NOT NULL, follo...
[ { "role": "user", "content": "Show me a list of all customers from California along with their full names and phone numbers." }, { "role": "assistant", "content": "SELECT customer_id, first_name || ' ' || last_name AS full_name, phone_number FROM insurance.customers WHERE state = 'CA';" }, {...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Find the number of addresses for each distinct balance value." }, { "role": "assistant", "content": "SELECT balance, COUNT(*) FROM blockchain.addresses GROUP BY balance;" }, { "role": "user", "content": "Only show balance values that appear more than 5 t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id character varying(64) NOT NULL, -- unique identifier for the block previous_block...
[ { "role": "user", "content": "Can you help me retrieve the details of all platforms at a specific station with station_id 'STATION_001', including the platform status and whether they are accessible?" }, { "role": "assistant", "content": "SELECT platform_id, platform_number, track_number, status...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE train_station_management.platforms ( platform_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "What is the average speed of train number T9876 during its last journey?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the average speed of train number T9876 during its last journey. The data in the trains table does not inclu...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "role": "user", "content": "Can you list all route numbers and their corresponding distance in km for routes that start in 'San Francisco'?" }, { "role": "assistant", "content": "SELECT r.route_number, r.distance_km\nFROM transportation.routes r\nJOIN transportation.locations l ON r.origin_loc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "List policy IDs and policy numbers for policies that have a null cancellation reason." }, { "role": "assistant", "content": "SELECT policy_id, policy_number FROM insurance.policies WHERE cancellation_reason IS NULL;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d...
[ { "role": "user", "content": "List each wallet with its corresponding user_id and the total number of notifications that user has received." }, { "role": "assistant", "content": "SELECT w.wallet_id, w.user_id, COUNT(n.notification_id) as total_notifications\nFROM trading_platform.wallets w\nLEFT...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name) from California (state = 'CA') who have made trades in the last 30 days, along with the total trade amount for each customer." }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "How many verified users are there?" }, { "role": "assistant", "content": "SELECT COUNT(user_id) FROM social_media.users WHERE is_verified = TRUE;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Show me the object ID, coin type, and balance for all SUI coins where the status is 'active'." }, { "role": "assistant", "content": "SELECT object_id, coin_type, balance FROM sui_coins WHERE status = 'active'" }, { "role": "user", "content": "Also, inclu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "Show me all trades with their corresponding ticker_symbol and security_name for trades executed in the last 7 days." }, { "role": "assistant", "content": "SELECT tr.trade_id, tr.account_id, tr.trade_type, tr.quantity, tr.price_per_unit, tr.total_amount,\n tr.c...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ...
[ { "role": "user", "content": "Give me the number of patient insurance policies for each plan where the policy is currently active. Return plan_id and policy_count." }, { "role": "assistant", "content": "SELECT\n plan_id,\n COUNT(*) AS policy_count\nFROM healthcare.patient_insurance\nWHERE (exp...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, patient_id character varying(64) NO...
[ { "role": "user", "content": "Can you help me retrieve a list of all aircraft builds for a specific model, including their assembly line details and current status?" }, { "role": "assistant", "content": "SELECT ab.build_id, ab.serial_number, ab.model_id, ab.current_status, al.line_name, al.locat...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Index 'aircraft_models'. Mapping: { properties: { model_id: { type: 'keyword' }, model_name: { ty...
[ { "role": "user", "content": "List all cancelled trips along with their scheduled departure times and vehicle IDs." }, { "role": "assistant", "content": "SELECT trip_id, scheduled_departure, vehicle_id FROM transportation.trips WHERE status = 'Cancelled';" }, { "role": "user", "conte...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, -- unique identifier for a specific trip instance ...
[ { "role": "user", "content": "Compute the total and average amount_paid for completed premium payments, grouped by payment_method." }, { "role": "assistant", "content": "SELECT payment_method, SUM(amount_paid) AS total_paid, AVG(amount_paid) AS average_paid\nFROM insurance.premium_payments\nWHER...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "role": "user", "content": "List all players and the number of distinct games they have grabbed in-game items from, as well as the name of each game." }, { "role": "assistant", "content": "SELECT p.player_id, p.username, g.game_id, g.title, COUNT(DISTINCT pi.item_id) AS distinct_items_acquired...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "List booking ID, booking time, and the name of the origin location for all bookings made from 'Airport' locations." }, { "role": "assistant", "content": "SELECT b.booking_id, b.booking_time, ol.name AS origin_location_name FROM transportation.bookings AS b JOIN tran...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id.text, name.text, type.text, address_line1.text, city.text, state_province.text, ...
[ { "role": "user", "content": "For each game, count the total number of achievements unlocked across all players. Show game title and count." }, { "role": "assistant", "content": "SELECT g.title, COUNT(pa.player_achievement_id) AS total_unlocked_achievements FROM gaming_technology.games AS g JOIN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "How many active services currently provide an online application URL?" }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM government_services.services\nWHERE is_active = TRUE\n AND online_application_url IS NOT NULL;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli...
[ { "role": "user", "content": "Show me the top 3 exchanges by total USD value of tokens held on the Ethereum chain, along with their top token by USD value from the cex_token_balance table." }, { "role": "assistant", "content": "WITH exchange_totals AS (SELECT exchange, SUM(usd_value) AS total_us...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_dexpool_info ( pair_address text, token_name text, token_symbol text, chain text, price numeric, price_change_per...
[ { "role": "user", "content": "Find pairs of user IDs (A, B) such that user A follows user B, and user B also follows user A (mutual follows). List user A's ID and user B's ID." }, { "role": "assistant", "content": "SELECT T1.follower_user_id AS user_a, T1.following_user_id AS user_b FROM social_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.follows ( follow_id text, follower_user_id text, following_user_id text, created_at timestamp )
[ { "role": "user", "content": "Show me all active agents who were hired in the last 2 years, along with their agency names and commission rates, sorted by hire date in descending order." }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, agency_name, commission_rate, hi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "I want to see the total fare and number of bookings for each passenger." }, { "role": "assistant", "content": "SELECT b.passenger_id, COUNT(b.booking_id) AS booking_count, SUM(b.fare) AS total_fare\nFROM transportation.bookings b\nGROUP BY b.passenger_id;" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "Show me all service orders that have a status of 'Pending'." }, { "role": "assistant", "content": "SELECT * FROM hospitality_technology.service_orders WHERE status = 'Pending';" }, { "role": "user", "content": "For these pending service orders, list the ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "List the asset names and symbols for all assets of type 'token'." }, { "role": "assistant", "content": "SELECT name, symbol FROM trading_platform.assets WHERE type = 'token';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp ) CREATE ...
[ { "role": "user", "content": "Show me the top 5 narratives by market cap, along with their top 3 coins and 24-hour trading volume." }, { "role": "assistant", "content": "SELECT narrative, top_3_coins, volume_24h FROM narrative_info ORDER BY market_cap DESC LIMIT 5;" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "For each SUI coin type, show the total balance across all owners and the number of distinct owners." }, { "role": "assistant", "content": "SELECT\n coin_type,\n SUM(CAST(balance AS DECIMAL)) AS total_balance,\n COUNT(DISTINCT owner) AS owner_count\nFROM sui_coins...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Show me all players and for each, the number of in-game items available in the system." }, { "role": "assistant", "content": "SELECT p.player_id, p.username, COUNT(i.item_id) AS total_items\nFROM gaming_technology.players p\nCROSS JOIN gaming_technology.in_game_item...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "List the titles of games that have at least one server listed in the servers table." }, { "role": "assistant", "content": "SELECT DISTINCT g.title FROM gaming_technology.games g INNER JOIN gaming_technology.servers s ON g.game_id = s.game_id;" }, { "role": "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "How many reviews were posted by each guest? Show the guest ID and the count of reviews." }, { "role": "assistant", "content": "SELECT guest_id, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY guest_id;" }, { "role": "user", "conte...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reviews ( review_id character varying(64) NOT NULL, -- unique identifier for the review ...
[ { "role": "user", "content": "List the usernames and user IDs of all users whose bio contains the word 'developer'." }, { "role": "assistant", "content": "SELECT user_id, username\nFROM social_media.users\nWHERE bio ILIKE '%developer%';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "Get the property name, room type name, base rate, and star rating for all room types with a base_rate above 200 in properties located in the USA, sorted by base_rate in descending order." }, { "role": "assistant", "content": "SELECT p.property_name, rt.type_name, rt...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "How many times is hashtag 'H001' used across all posts?" }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM social_media.post_hashtags\nWHERE hashtag_id = 'H001';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text ) CREATE TABLE social_media.conversati...
[ { "role": "user", "content": "For each project in project_fundraising_record, show the project's earliest and latest fundraising rounds with their corresponding investment_date and investment_value. Include project_name, earliest_round, earliest_date, earliest_value, latest_round, latest_date, and latest_va...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "Show me all active policies for customers who live in New York, along with their total premium payments made so far, and include the agent's full name." }, { "role": "assistant", "content": "SELECT p.policy_id, p.policy_number, p.start_date, p.end_date, p.premium_am...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Which patients have an appointment with doctor 'doctor_222' next week? Show their names and appointment times." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, a.appointment_time FROM healthcare.appointments a JOIN healthcare.patients p ON a....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "List all claims along with the corresponding policy number and the full names of all beneficiaries associated with each policy." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, p.policy_number, b.first_name || ' ' || b.last_name AS beneficiary_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "List the full names and email addresses of users who have liked any comment." }, { "role": "assistant", "content": "SELECT DISTINCT u.full_name, u.email\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.user_id\nWHERE l.comment_id IS NOT NULL;" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Find all PDF claim documents uploaded in May 2024, showing document_id, claim_id, and file_size_bytes, and also list who uploaded each document." }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_size_bytes, uploaded_by FROM insurance.claim_do...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, file_name.text, file_path.text, file_s...
[ { "role": "user", "content": "Give me the count of locations per country and type. List country, type, and location_count." }, { "role": "assistant", "content": "SELECT country, type, COUNT(*) AS location_count\nFROM transportation.locations\nGROUP BY country, type;" }, { "role": "user",...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id character varying(64) NOT NULL, -- unique identifier for the location n...
[ { "role": "user", "content": "Count the total number of followers each user has, showing following_user_id as user_id and follower_count, for those users with more than 100 followers." }, { "role": "assistant", "content": "SELECT following_user_id AS user_id, COUNT(*) AS follower_count\nFROM soc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ...
[ { "role": "user", "content": "List pairs of documents uploaded by the same lawyer but for different cases, showing both document names, their case IDs, and the lawyer ID." }, { "role": "assistant", "content": "SELECT t1.document_name AS document1_name, t1.case_id AS document1_case_id, t2.documen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u...
[ { "role": "user", "content": "List all appointments with status 'Completed' and location 'LOC001' that occurred in December 2023. Show appointment ID, time, duration, and notes." }, { "role": "assistant", "content": "SELECT appointment_id, appointment_time, duration_minutes, notes FROM healthcar...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id character varying(64) NOT NULL, doc...
[ { "role": "user", "content": "Find pairs of drivers who share the same license_expiry_date." }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver1_id,\n d1.first_name AS driver1_first_name,\n d1.last_name AS driver1_last_name,\n d2.driver_id AS driver2_id,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "Count the number of metadata entries for each asset." }, { "role": "assistant", "content": "SELECT asset_id, COUNT(*) AS metadata_count\nFROM trading_platform.metadata\nGROUP BY asset_id;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch...
[ { "role": "user", "content": "Which token had the highest ROI for smart money addresses on the BSC chain? Please show the token symbol and the highest ROI as well as the address." }, { "role": "assistant", "content": "SELECT most_profit_token, MAX(roi) AS highest_roi, address\nFROM smart_money_p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_profit ( address.text, rank.numeric, profit.numeric, roi.numeric, realized_ratio.numeric, most_profit_token...
[ { "role": "user", "content": "List all doctors who have made diagnoses with status 'Active' in the last 3 months, including their full names and specialties." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, d.specialty FROM healthcare.doctors d JOIN healthcar...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "For each doctor, find the longest single appointment duration. Return doctor_id, first_name, last_name, and max_duration." }, { "role": "assistant", "content": "SELECT d.doctor_id,\n d.first_name,\n d.last_name,\n MAX(a.duration_minutes) AS max_dur...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "role": "user", "content": "Show me a list of insurance providers and the number of patient insurance policies they have." }, { "role": "assistant", "content": "SELECT p.insurance_provider,\n COUNT(pi.patient_insurance_id) AS policy_count\nFROM healthcare.insurance_plans p\nLEFT JOIN hea...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "How many tokens are there for each number of decimals?" }, { "role": "assistant", "content": "SELECT decimals, COUNT(*) FROM web3.tokens GROUP BY decimals;" }, { "role": "user", "content": "Now, only show the decimal counts where there are more than 10 t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_at.timestamp, transaction_id.text, l...
[ { "role": "user", "content": "For each ERC1155 NFT contract on Ethereum, show the `contract_address`, `token_id`, total amount held across all wallets, and number of unique holders." }, { "role": "assistant", "content": "SELECT nh.contract_address,\n nh.token_id,\n SUM(CAST(nh.amount...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "특정 공급업체 ID로 공급업체의 세부 정보를 조회하고 싶습니다. 모든 필드를 포함해 주세요." }, { "role": "assistant", "content": "GET suppliers/_doc/{supplier_id}" }, { "role": "user", "content": "만약 여러 공급업체 ID를 한 번에 조회하고 싶다면 어떻게 해야 하나요?" }, { "role": "assistant", "content": "GET ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount, from the erc20_balances table." }, { "role": "assistant", "content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "Show the full names and emails of staff members who have delivered at least one service order." }, { "role": "assistant", "content": "SELECT DISTINCT s.first_name, s.last_name, s.work_email\nFROM hospitality_technology.staff s\nJOIN hospitality_technology.service_or...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "List all players who have unlocked achievements in the last 7 days, showing their username and the number of achievements unlocked." }, { "role": "assistant", "content": "SELECT p.username, COUNT(pa.achievement_id) AS unlocked_count\nFROM gaming_technology.players p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "List the application reference numbers, the corresponding message subjects, and the sent dates for notifications related to each application." }, { "role": "assistant", "content": "SELECT a.reference_number, n.message_subject, n.sent_at\nFROM government_services.app...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.applications ( application_id text, citizen_id text, service_id text, submitted_at timestamp, statu...
[ { "role": "user", "content": "Find all cancelled appointments at location_id 'LOC123' that were supposed to occur in the morning (before 12 PM), showing appointment_time and reason." }, { "role": "assistant", "content": "SELECT appointment_time, reason FROM healthcare.appointments WHERE status =...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, -- unique identifier for the appointment ...
[ { "role": "user", "content": "How many medications are listed per manufacturer? Return manufacturer and med_count for those with more than 10 medications." }, { "role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS med_count\nFROM healthcare.medications\nGROUP BY manufacturer\nHAVING...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appointment_time timestamp, duration_mi...
[ { "role": "user", "content": "Find the username, email, and total number of orders placed by each user." }, { "role": "assistant", "content": "SELECT u.username, u.email, COUNT(o.order_id) AS order_count\nFROM trading_platform.users u\nLEFT JOIN trading_platform.wallets w ON u.user_id = w.user_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "List all pairs of patients who registered on the same day. Show patient1_id, patient1_name, patient2_id, patient2_name, and the shared registration date." }, { "role": "assistant", "content": "SELECT p1.patient_id AS patient1_id, p1.first_name || ' ' || p1.last_name...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "For each token listed in token_dexpool_info, can you show the total net_flow and average ROI from smart_money_token_performance, along with the token's symbol and chain?" }, { "role": "assistant", "content": "SELECT tdi.token_symbol, tdi.chain, SUM(sm.net_flow) AS t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "Which agencies offer more than three services? List the agency ID and the total number of services they provide." }, { "role": "assistant", "content": "SELECT agency_id, COUNT(service_id) AS total_services\nFROM government_services.services\nGROUP BY agency_id\nHAVI...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, -- unique identifier for the agency ag...
[ { "role": "user", "content": "Show me a list of all properties along with their average overall review rating." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Count the number of logs for each action type." }, { "role": "assistant", "content": "SELECT action,\n COUNT(*) AS count\nFROM trading_platform.logs\nGROUP BY action;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.logs ( log_id text PRIMARY KEY, user_id text, action text, details text, logged_at timestamp )
[ { "role": "user", "content": "Show all transactions where the recipient address matches a wallet address, listing the transaction ID, the recipient address, the user ID who owns the wallet, and the value of the transaction." }, { "role": "assistant", "content": "SELECT tx.transaction_id, tx.to_a...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifier for the contract address cha...
[ { "role": "user", "content": "List the make, model, year, and the depot_id for all vehicles acquired before 2020." }, { "role": "assistant", "content": "SELECT make, model, year, depot_id FROM transportation.vehicles WHERE acquisition_date < '2020-01-01';" }, { "role": "user", "conte...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "For each service location in Texas, provide the location name, city, and the number of appointments scheduled there by verified citizens." }, { "role": "assistant", "content": "SELECT sl.location_name, sl.city, COUNT(a.appointment_id) AS appointment_count\nFROM gove...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Which narrative in narrative_info has the highest volume_24h, and what are its top_3_coins and token_num?" }, { "role": "assistant", "content": "SELECT narrative,\n top_3_coins,\n token_num\nFROM narrative_info\nORDER BY volume_24h DESC\nLIMIT 1;" }, { "ro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "List each vehicle that has both Diesel and Gasoline fueling events. Show vehicle_id, the fuel_log_id and log_timestamp for the Diesel event, and the fuel_log_id and log_timestamp for the Gasoline event." }, { "role": "assistant", "content": "SELECT d.vehicle_id,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry...
[ { "role": "user", "content": "Show me all police report documents uploaded in the last month, along with their claim IDs and file sizes in MB." }, { "role": "assistant", "content": "SELECT claim_id, file_size_bytes / (1024 * 1024) AS file_size_mb FROM insurance.claim_documents WHERE document_typ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "role": "user", "content": "List each scheduled appointment along with its client_id and the number of other appointments that overlap with it. Include appointment_id, client_id, and overlap_count." }, { "role": "assistant", "content": "SELECT a1.appointment_id,\n a1.client_id,\n C...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "content": "Please list the top 5 players by number of achievements unlocked since 2023-01-01. Show each player's username and the total count of achievements they unlocked." }, { "role": "assistant", "content": "SELECT p.username, COUNT(*) AS unlock_count\nFROM gaming_technolo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "List all diagnoses with status 'Active' for patients who have had appointments in the last 30 days, including the diagnosis description and appointment time." }, { "role": "assistant", "content": "SELECT d.diagnosis_id, d.description, a.appointment_time FROM healthc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appointment_time timestamp, duration_mi...
[ { "role": "user", "content": "Show me all trips that were completed with a passenger count greater than 15, including their route and vehicle details." }, { "role": "assistant", "content": "SELECT t.trip_id, t.route_id, t.vehicle_id, t.driver_id, t.scheduled_departure, t.actual_departure, t.sche...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti...
[ { "role": "user", "content": "List all accounts and their total outgoing transaction amounts. Please include the account_id, account_type, and the sum of outgoing amount." }, { "role": "assistant", "content": "SELECT a.account_id, a.account_type, COALESCE(SUM(t.amount), 0) AS total_outgoing_amou...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba...
[ { "role": "user", "content": "For each notification, list the next notification sent to the same citizen (if any). Show citizen_id, notification_id, sent_at, next_notification_id, and next_sent_at." }, { "role": "assistant", "content": "SELECT\n n1.citizen_id,\n n1.notification_id,\n n1.sent_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.notifications ( notification_id character varying(64) NOT NULL, citizen_id character varying(64) NO...
[ { "role": "user", "content": "Find all blocks with difficulty above 5000 and include their timestamp." }, { "role": "assistant", "content": "SELECT block_id, timestamp FROM blockchain.blocks WHERE difficulty > 5000;" }, { "role": "user", "content": "Now show me the count of such bloc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp timestamp, nonce int, merkle_root text...
[ { "role": "user", "content": "Find pairs of beneficiaries on the same policy who were added on the exact same date. Show policy_id, beneficiary1_id, beneficiary2_id, and the added_at date." }, { "role": "assistant", "content": "SELECT T1.policy_id, T1.beneficiary_id AS beneficiary1_id, T2.benefi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text...
[ { "role": "user", "content": "Show me the top 5 narratives by market cap, along with their 24-hour trading volume and 7-day price change percentage." }, { "role": "assistant", "content": "SELECT narrative, market_cap, volume_24h, price_change_percentage_7d FROM narrative_info ORDER BY market_cap...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative top_3_coins text, -- the top 3 token...
[ { "role": "user", "content": "Find policies that have two different 'Spouse' beneficiaries. List policy_id, spouse1_id, and spouse2_id." }, { "role": "assistant", "content": "SELECT pb1.policy_id,\n pb1.beneficiary_id AS spouse1_id,\n pb2.beneficiary_id AS spouse2_id\nFROM insurance....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id character varying(64) NOT NULL, policy_id character varying(64) NOT NUL...
[ { "role": "user", "content": "For each open case, find the latest document uploaded: include case_number, document_name, and upload_timestamp." }, { "role": "assistant", "content": "SELECT c.case_number,\n d.document_name,\n d.upload_timestamp\nFROM legal_services.cases c\nJOIN (\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, website text, founded_date date, man...
[ { "role": "user", "content": "List the product_name and description for all active products." }, { "role": "assistant", "content": "SELECT product_name, description FROM insurance.insurance_products WHERE is_active = true;" }, { "role": "user", "content": "Can you also include the pr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_name character varying(150) NOT NULL,...
[ { "role": "user", "content": "List all wallets holding the NFT with contract_address '0xabc123' and token_id '100' and the amount held." }, { "role": "assistant", "content": "SELECT wallet_address, amount\nFROM nft_holders\nWHERE contract_address = '0xabc123'\n AND token_id = '100';" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ...
[ { "role": "user", "content": "Show the total session duration in seconds and the average score for each game." }, { "role": "assistant", "content": "SELECT game_id, SUM(duration_seconds), AVG(score) FROM gaming_technology.game_sessions GROUP BY game_id;" }, { "role": "user", "content...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time...
[ { "role": "user", "content": "Can you show me how many achievements each player unlocks per day? Return player_id, unlock_date, and achievement_count." }, { "role": "assistant", "content": "SELECT player_id,\n CAST(unlocked_at AS date) AS unlock_date,\n COUNT(*) AS achievement_count\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, achievement_id uuid, unlocked_at ti...
[ { "role": "user", "content": "Find pairs of doctors who work at the same hospital but have different specialties. Show the full name of both doctors and their shared hospital affiliation ID." }, { "role": "assistant", "content": "SELECT d1.first_name AS doctor1_first_name, d1.last_name AS doctor...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "role": "user", "content": "List all notifications sent through the 'Email' channel, showing all columns." }, { "role": "assistant", "content": "SELECT notification_id, citizen_id, application_id, message_subject, message_body, channel, sent_at, status, related_entity_type, related_entity_id F...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.notifications ( notification_id text, citizen_id text, application_id text, message_subject text, m...
[ { "role": "user", "content": "How many unique IP addresses are there in the nodes table?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes;" }, { "role": "user", "content": "Can you break this down by port numbers, showi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
[ { "role": "user", "content": "List group conversation names created after 2024-01-01 with the count of verified participants in each group." }, { "role": "assistant", "content": "SELECT c.group_name, COUNT(cp.user_id) AS verified_count\nFROM social_media.conversations c\nJOIN social_media.conver...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "For each vehicle, show the vehicle_id, license_plate, date of its most recent trip (actual_arrival), and the odometer_reading at its latest maintenance service." }, { "role": "assistant", "content": "SELECT\n v.vehicle_id,\n v.license_plate,\n (\n SE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Find customers who made premium payments using both 'credit card' and 'bank transfer' in 2023. Show customer_id." }, { "role": "assistant", "content": "SELECT DISTINCT p1.customer_id\nFROM insurance.premium_payments p1\nJOIN insurance.premium_payments p2\n ON p1.cu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id.text, policy_id.text, customer_id.text, payment_date.timestamp, amount_paid.num...
[ { "role": "user", "content": "For each citizen who has made at least one payment, show the citizen's full name, number of payments, and total amount paid, grouped by currency." }, { "role": "assistant", "content": "SELECT\n c.first_name || ' ' || c.last_name AS full_name,\n p.currency,\n COUN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Find the full names of employees who have verified documents that have an expiry date in the past and are marked as 'Verified'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.employees AS T1 JOIN governmen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.applications ( application_id character varying(64) NOT NULL, citizen_id character varying(64) NOT ...
[ { "role": "user", "content": "What are the top 5 tokens by 7-day price change percentage? Show token_symbol, token_name, narrative, and chain, ordered by price_change_percentage_7d descending." }, { "role": "assistant", "content": "```sql\nSELECT\n token_symbol,\n token_name,\n narrative,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "How many smart money addresses are in the top 100 rank?" }, { "role": "assistant", "content": "SELECT count(address) FROM smart_money_profit WHERE rank <= 100" }, { "role": "user", "content": "Okay, can you break that down by `chain`? Show the count for ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, rank INT, profit numeric(38,6), roi numeric(38,2), realiz...
[ { "role": "user", "content": "List all clients who have an active status." }, { "role": "assistant", "content": "SELECT first_name, last_name FROM legal_services.clients WHERE status = 'active';" }, { "role": "user", "content": "Can you include their phone numbers and the date they r...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "How many applications are currently in 'Processing' status? Return the total count." }, { "role": "assistant", "content": "SELECT COUNT(*) AS processing_applications_count\nFROM government_services.applications\nWHERE status = 'Processing';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "List all games and the servers hosting them, showing the game title, server name, region, and status." }, { "role": "assistant", "content": "SELECT g.title, s.server_name, s.region, s.status FROM gaming_technology.games g JOIN gaming_technology.servers s ON g.game_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "Find all wallets that share the same private key but have different addresses. Show the wallet IDs, addresses, and the shared private key." }, { "role": "assistant", "content": "SELECT w1.wallet_id AS wallet_id_1, w1.address AS address_1, w2.wallet_id AS wallet_id_2...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )