conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "What is the average maintenance cost per service_type for maintenance performed in 2023?" }, { "role": "assistant", "content": "SELECT service_type, AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nWHERE service_date BETWEEN '2023-01-01' AND '2023-12-31'...
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": "For each transaction ID, provide a count of unspent UTXOs." }, { "role": "assistant", "content": "SELECT transaction_id, COUNT(*) FROM utxos WHERE spent = FALSE GROUP BY transaction_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.utxos ( utxo_id character varying(64) NOT NULL, -- unique identifier for the UTXO transaction...
[ { "role": "user", "content": "How many claims were reported in the last 90 days?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM claims WHERE reported_date >= CURRENT_DATE - INTERVAL '90 days'" } ]
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 character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "Show the count of applications assigned to employees, grouped by the job title of the assigned employee." }, { "role": "assistant", "content": "SELECT e.job_title, COUNT(a.application_id) AS application_count FROM government_services.applications AS a 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.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "Show the total transfer volume and number of transfers for each Avalanche token in the past 7 days, including token tick and its creator." }, { "role": "assistant", "content": "SELECT ta.tick, ti.creator, SUM(ta.amt) AS total_volume, COUNT(*) AS transfer_count\nFROM...
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 me all appointments scheduled for tomorrow with a duration longer than 45 minutes, including patient_id, doctor_id, and appointment_time." }, { "role": "assistant", "content": "SELECT patient_id, doctor_id, appointment_time FROM healthcare.appointments WHERE DA...
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 PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,...
[ { "role": "user", "content": "For each date in the last 30 days with market data, show the total volume and the maximum high price recorded." }, { "role": "assistant", "content": "SELECT data_timestamp::date, SUM(volume) AS total_volume, MAX(high_price) AS max_high_price FROM financial_services....
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.market_data ( data_point_id bigserial NOT NULL, -- auto-incrementing primary key security_id...
[ { "role": "user", "content": "For each token, show the token_id and the total number of unique addresses that have ever received it." }, { "role": "assistant", "content": "SELECT token_id, COUNT(DISTINCT to_address) AS unique_recipients\nFROM web3.token_transfers\nGROUP BY token_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 web3.token_transfers ( transfer_id character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "For each block, compute the total number of transactions and the average gas_price." }, { "role": "assistant", "content": "SELECT block_number, COUNT(*) AS total_txs, AVG(gas_price) AS avg_gas_price FROM web3.transactions GROUP BY block_number;" }, { "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 web3.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address text, value numeric, gas_used int, g...
[ { "role": "user", "content": "What is the total balance and the number of accounts for each currency, including only accounts opened in the last 2 years?" }, { "role": "assistant", "content": "SELECT currency , SUM(balance) AS total_balance , COUNT(*) AS account_count FROM financial_services.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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table." }, { "role": "assistant", "content": "SELECT pfr.project_name, pfr.valuation, tbi.token_symbol,...
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, -- fundraising record id", "project_id ch...
[ { "role": "user", "content": "For each conversation, how many participants have joined before January 1, 2024?" }, { "role": "assistant", "content": "SELECT conversation_id, COUNT(user_id) AS participant_count\nFROM social_media.conversation_participants\nWHERE joined_at < '2024-01-01'\nGROUP BY...
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.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ...
[ { "role": "user", "content": "Which exchange holds the largest total USD value of the token with the highest 24h price increase in the 'AI' narrative, and what is that value?" }, { "role": "assistant", "content": "SELECT ctb.exchange, SUM(ctb.usd_value) AS total_usd_value\nFROM token_basic_info ...
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_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "Show the staff_id, full name, and position for all staff hired before 2015." }, { "role": "assistant", "content": "SELECT staff_id, CONCAT(first_name, ' ', last_name) AS full_name, position\nFROM hospitality_technology.staff\nWHERE hire_date < '2015-01-01';" }, ...
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.staff ( staff_id character varying(64) NOT NULL, -- unique identifier for the staff member ...
[ { "role": "user", "content": "List each user's username along with the number of posts they've made that include any media attachment, ordering the results by that count descending." }, { "role": "assistant", "content": "SELECT u.username, COUNT(p.post_id) AS media_post_count\nFROM social_media....
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": "List the service name, category, and standard fee for all services offered by agencies that have at least one accessible service location in the state of 'California'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.service_name, T1.category, T1.standard_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.services ( service_id character varying(64) NOT NULL, -- unique identifier for the service ...
[ { "role": "user", "content": "List all posts that have at least two hashtags and have received more than 5 likes. Return the post_id and the number of likes as like_count." }, { "role": "assistant", "content": "SELECT p.post_id,\n COUNT(l.like_id) AS like_count\nFROM social_media.posts p\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 social_media.posts ( post_id character varying(64) NOT NULL, -- unique identifier for the post user_id characte...
[ { "role": "user", "content": "List service orders placed in the last 7 days, showing order_id, service_name, guest full name, and order_timestamp." }, { "role": "assistant", "content": "SELECT so.order_id, s.service_name, g.first_name || ' ' || g.last_name AS guest_name, so.order_timestamp\nFROM...
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.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat...
[ { "role": "user", "content": "I want a summary of each asset showing the total number of trades executed and the average trade price, including asset name and symbol." }, { "role": "assistant", "content": "SELECT a.asset_id,\n a.name,\n a.symbol,\n COUNT(t.trade_id) AS trades_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 trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp ) CREATE ...
[ { "role": "user", "content": "List all claims for the same customer occurring within 7 days of each other. Return customer_id, claim1_id, claim2_id, claim1_incident_date, and claim2_incident_date." }, { "role": "assistant", "content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_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 insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "Show me all users who have wallets but have never placed any orders, along with their wallet addresses." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, u.email, w.address FROM trading_platform.users u JOIN trading_platform.wallets w ON u.user_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.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "Which employees have verified more than 5 documents in the last 30 days? Return the employee's full name, department, and the number of verifications." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS full_name, e.department, 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 government_services.services ( service_id character varying(64) NOT NULL, agency_id character varying(64) NOT NULL, ser...
[ { "role": "user", "content": "List all maintenance services performed on vehicle 'VHCL789', showing the service date and type." }, { "role": "assistant", "content": "SELECT service_date, service_type FROM transportation.maintenance_logs WHERE vehicle_id = 'VHCL789';" }, { "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.maintenance_logs ( log_id text, vehicle_id text, service_date date, odometer_reading integer, service_ty...
[ { "role": "user", "content": "How many reviews does each staff member respond to, along with their full name and the average response time in hours?" }, { "role": "assistant", "content": "SELECT st.staff_id,\n st.first_name || ' ' || st.last_name AS staff_full_name,\n COUNT(*) AS res...
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 text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Show me the top 3 tokens by 24-hour trading volume in the 'NFT' narrative, along with their price and market cap." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, total_volume, price, market_cap FROM token_basic_info WHERE narrative = 'NFT' 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 token_basic_info ( coin_id character varying(100) NOT NULL, token_name character varying(100) NOT NULL, token_symbol ch...
[ { "role": "user", "content": "List all SUI coins that have the status 'inactive', including their owner address and coin_type." }, { "role": "assistant", "content": "SELECT coin_type, owner FROM sui_coins WHERE status = 'inactive';" }, { "role": "user", "content": "Add the name and s...
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": "List all contracts along with the username of the deployer, showing contract_id, contract address, deployed_at, and the username. Order by deployed_at descending." }, { "role": "assistant", "content": "SELECT c.contract_id,\n c.address AS contract_address,\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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "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, --...
[ { "role": "user", "content": "List the names of all developers and the number of years since they were founded." }, { "role": "assistant", "content": "SELECT name, EXTRACT(YEAR FROM CURRENT_DATE) - founded_year AS years_since_founded FROM gaming_technology.developers;" }, { "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 gaming_technology.developers ( developer_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d...
[ { "role": "user", "content": "Give me a count of invoices issued for each case this year, and show the case ID with the count." }, { "role": "assistant", "content": "SELECT case_id, COUNT(*) AS invoice_count\nFROM legal_services.invoices\nWHERE EXTRACT(YEAR FROM issue_date) = EXTRACT(YEAR FROM 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.invoices ( invoice_id character varying(64) NOT NULL, -- unique identifier for the invoice invo...
[ { "role": "user", "content": "How many law firms were founded after 2010, and what are their names and phone numbers?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS firm_count FROM legal_services.law_firms WHERE founded_date > '2010-01-01';" }, { "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 legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, website text, founded_date date, man...
[ { "role": "user", "content": "Show me the number of distinct room types offered by each property, including the property name and the count." }, { "role": "assistant", "content": "SELECT T1.property_name, COUNT(DISTINCT T2.room_type_id) FROM hospitality_technology.properties AS T1 JOIN hospitali...
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": "For each contract that has received transactions, list its address and the total value of Ether received." }, { "role": "assistant", "content": "SELECT T1.address, SUM(T2.value) FROM web3.contracts AS T1 JOIN web3.transactions AS T2 ON T1.address = T2.to_address GRO...
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, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Find the total number of distinct manufacturers listed in the medications table." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT manufacturer) FROM healthcare.medications;" } ]
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.medications ( medication_id character varying(64) NOT NULL, medication_name character varying(255) NOT NULL,...
[ { "role": "user", "content": "Find all transactions where the from_address is the same as the to_address, indicating self-transactions, and show the transaction_id, value, and gas_used." }, { "role": "assistant", "content": "SELECT transaction_id, value, gas_used FROM web3.transactions WHERE fro...
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.transactions ( transaction_id character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add...
[ { "role": "user", "content": "List all claims that were reported more than 30 days after the incident date." }, { "role": "assistant", "content": "SELECT claim_id, policy_id, customer_id, incident_date, reported_date FROM insurance.claims WHERE DATEDIFF(reported_date, incident_date) > 30;" }, ...
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.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d...
[ { "role": "user", "content": "List each payment method with the total payment amount and the latest payment_timestamp for that method." }, { "role": "assistant", "content": "SELECT payment_method, SUM(amount) AS total_amount, MAX(payment_timestamp) AS latest_payment\nFROM 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.payments ( payment_id text, reservation_id text, guest_id text, bill_id text, amount numeric, cu...
[ { "role": "user", "content": "Show me the total number of customers and their average age grouped by city." }, { "role": "assistant", "content": "SELECT city, COUNT(customer_id) AS total_customers, AVG(EXTRACT(YEAR FROM NOW()) - EXTRACT(YEAR FROM date_of_birth)) AS average_age FROM financial_ser...
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": "Show the agency name and the number of employees for each agency that has at least one employee hired after January 1st, 2023." }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(e.employee_id) AS employee_count\nFROM government_services.agencies a\nJ...
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.text, agency_name.text, jurisdiction_level.text, primary_contact_email.text, m...
[ { "role": "user", "content": "I want to find all patients who have scheduled appointments with a doctor specializing in 'Neurology', including the patient's full name, appointment_time, and the doctor's full name." }, { "role": "assistant", "content": "SELECT p.first_name || ' ' || p.last_name 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 text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List the user ID, KYC status, and the number of UTXOs they have, including spent and unspent." }, { "role": "assistant", "content": "SELECT T1.user_id, T1.status, COUNT(T2.utxo_id) FROM trading_platform.kyc_audit AS T1 JOIN trading_platform.utxos AS T2 ON T1.user_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.utxos ( utxo_id text, transaction_id text, output_index integer, address text, amount numeric, spent b...
[ { "role": "user", "content": "Show the full name of citizens and the total amount they have paid for appointments they have scheduled. Only include citizens who have scheduled at least one appointment." }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS full_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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Show me the top 5 blocks with the highest difficulty, along with their timestamps and the public key of the address that created the merkle root (assuming merkle_root corresponds to an address_id)." }, { "role": "assistant", "content": "SELECT b.block_id, b.timestam...
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, previous_block_id character varying(64), timestamp timesta...
[ { "role": "user", "content": "List the reference number and status for applications where the notes contain the keyword 'urgent'." }, { "role": "assistant", "content": "SELECT reference_number, status FROM government_services.applications WHERE notes ILIKE '%urgent%';" }, { "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 government_services.applications ( application_id character varying(64) NOT NULL, citizen_id character varying(64) NOT ...
[ { "role": "user", "content": "How many achievements were unlocked in total in the year 2023?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM gaming_technology.player_achievements WHERE unlocked_at >= '2023-01-01 00:00:00+00' AND unlocked_at < '2024-01-01 00:00:00+00';" }, { "...
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 NOT NULL DEFAULT gen_random_uuid(), player_id uuid N...
[ { "role": "user", "content": "Show me the total number of time entries for each case." }, { "role": "assistant", "content": "SELECT case_id, COUNT(*) AS entry_count\nFROM legal_services.time_entries\nGROUP BY case_id;" }, { "role": "user", "content": "Only include cases where the tot...
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.time_entries ( entry_id character varying(64) NOT NULL, -- unique identifier for the time entry ...
[ { "role": "user", "content": "Show me the first and last names of citizens and the number of appointments they have scheduled with the employee whose last name is 'Smith'." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(a.appointment_id) AS appointment_count\nFROM ...
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, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Give me the max supply, creator, and current supply for all Avalanche tokens by their tick." }, { "role": "assistant", "content": "SELECT tia.tick, tia.max_supply, tia.creator, tb.total_supply\nFROM token_info_avalanche tia\nLEFT JOIN token_balances tb ON tia.tick =...
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": "Can you show me all doctors affiliated with hospital ID 'HOSP1001', including their doctor ID, full name, and specialty?" }, { "role": "assistant", "content": "SELECT doctor_id, first_name, last_name, specialty FROM healthcare.doctors WHERE hospital_affiliation_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 healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "What is the total USD value of tokens held by 'Binance' on the 'BSC' chain according to the latest snapshot?" }, { "role": "assistant", "content": "SELECT SUM(usd_value) FROM cex_token_balance WHERE exchange = 'Binance' AND chain = 'BSC' AND snapshot_time = (SELECT ...
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_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO...
[ { "role": "user", "content": "List all group chats with their conversation ID, group_name, and the total number of likes that occurred after the chat was created." }, { "role": "assistant", "content": "SELECT c.conversation_id,\n c.group_name,\n COUNT(l.like_id) AS total_likes\nFROM ...
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.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, created_at.timestamp ) CREATE TABLE soc...
[ { "role": "user", "content": "Count the number of active services provided by each agency. Show the agency name and the count." }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(s.service_id) AS active_service_count FROM government_services.agencies AS a JOIN government_services....
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, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Get the conversation_id and participant_count for each conversation that has more than 2 participants." }, { "role": "assistant", "content": "SELECT conversation_id, COUNT(*) AS participant_count\nFROM social_media.conversation_participants\nGROUP BY conversation_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 social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Can you give me the list of server names and their regions, along with the total number of players currently online in each region?" }, { "role": "assistant", "content": "SELECT region, SUM(current_players) AS total_current_players, STRING_AGG(server_name, ', ') AS ...
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.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,...
[ { "role": "user", "content": "Find all pairs of developers who share the exact same founded_year but are from different countries. Show both developer names, their countries, and the founded_year." }, { "role": "assistant", "content": "SELECT d1.name AS developer1_name, d1.country AS country1, d...
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.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "How many insurance policies have 'Group' in their group_number?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.patient_insurance WHERE group_number ILIKE '%Group%';" } ]
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 text, patient_id text, plan_id text, policy_number text, group_numb...
[ { "role": "user", "content": "I need a report showing each security's ticker_symbol along with the total sum of trade total_amount and the count of trades executed in the last three months." }, { "role": "assistant", "content": "SELECT s.ticker_symbol, SUM(t.total_amount) AS total_trade_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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "Find all contracts where the deployer address is the same as the contract address, indicating self-deployed contracts." }, { "role": "assistant", "content": "SELECT address, deployer_address FROM web3.contracts WHERE address = deployer_address;" } ]
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 text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "Calculate the total points from all achievements unlocked by each player. Show player_id and total points." }, { "role": "assistant", "content": "SELECT pa.player_id, SUM(a.points) AS total_points FROM gaming_technology.player_achievements AS pa JOIN 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 ERC20 tokens (from token_metas) that have 'Governance' in their name." }, { "role": "assistant", "content": "SELECT contract_address, symbol, name FROM token_metas WHERE is_erc20 = 1 AND name ILIKE '%Governance%';" }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Show me all users along with the total number of unique hashtags used in their posts." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(DISTINCT ph.hashtag_id) AS unique_hashtag_count\nFROM social_media.users u\nLEFT JOIN social_media.posts ...
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": "Can you help me find all staff members assigned to a specific station with station_id 'STATION_002', along with their roles and the platform details at that station?" }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, s.role, p.platf...
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": "List all sender and receiver address pairs that have exchanged more than 2 transactions with each other, along with the total amount transferred between them." }, { "role": "assistant", "content": "SELECT sender_address, receiver_address, COUNT(*) AS transaction_cou...
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.transactions ( transaction_id character varying(64) NOT NULL, -- unique identifier for the transaction ...
[ { "role": "user", "content": "Show me all pairs of time entries that are associated with the same invoice, including their entry IDs, lawyer IDs, and the shared invoice ID." }, { "role": "assistant", "content": "SELECT te1.entry_id AS entry1_id,\n te2.entry_id AS entry2_id,\n te1.law...
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.time_entries ( entry_id character varying(64) NOT NULL, -- unique identifier for the time entry ...
[ { "role": "user", "content": "Show me all terminated staff members along with their termination dates and the names of their managers, ordered by termination date." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, s.termination_date, m.first_name AS manager_fir...
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.staff ( staff_id character varying(64) NOT NULL, -- unique identifier for the staff member ...
[ { "role": "user", "content": "List all doctors who have a hospital affiliation and include their specialty and affiliation ID." }, { "role": "assistant", "content": "SELECT first_name, last_name, specialty, hospital_affiliation_id FROM healthcare.doctors WHERE hospital_affiliation_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 healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "List each patient's active insurance policy and the number of prescriptions they have during that policy. Show patient_id, plan_id, policy_number, and prescription_count." }, { "role": "assistant", "content": "SELECT pi.patient_id, pi.plan_id, pi.policy_number, 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 healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appointment_time timestamp, duration_mi...
[ { "role": "user", "content": "Find pairs of claims filed by the same customer where the incident dates are within 7 days of each other. Return customer_id, both claim IDs, and their incident dates." }, { "role": "assistant", "content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_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 insurance.claims ( claim_id character varying(64) NOT NULL, -- unique identifier for the claim policy_id charac...
[ { "role": "user", "content": "How many distinct projects conducted fundraising in April 2023?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT project_id) AS num_projects\nFROM project_fundraising_record\nWHERE investment_date LIKE '2023-04%';" }, { "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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "Which services charge more than the average standard fee of their category? Show the service name, its fee, and the average fee for that category." }, { "role": "assistant", "content": "SELECT\n s.service_name,\n s.standard_fee,\n avg_fees.avg_fee\nFROM 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.services ( service_id text, agency_id text, service_name text, description text, category text, eli...
[ { "role": "user", "content": "For each transaction status, what is the average transaction value?" }, { "role": "assistant", "content": "SELECT status, AVG(value) FROM web3.transactions GROUP BY status" }, { "role": "user", "content": "Could you filter this to only show statuses wher...
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": "Count the total number of premium payments made in the year 2024." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM premium_payments WHERE EXTRACT(YEAR FROM payment_date) = 2024" } ]
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": "List the names of services that have been scheduled at accessible service locations." }, { "role": "assistant", "content": "SELECT DISTINCT T1.service_name FROM government_services.services AS T1 JOIN government_services.appointments AS T2 ON T1.service_id = T2.serv...
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 text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "Show me all reservations with more than 2 adults that are confirmed (status = 'Confirmed'), including their check-in dates and total amounts." }, { "role": "assistant", "content": "SELECT r.reservation_id, r.property_id, r.guest_id, r.check_in_date, r.total_amount 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 hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, property_id character varying(64) NOT ...
[ { "role": "user", "content": "List consecutive fueling events for each vehicle where the refill quantity increased compared to the previous event. Include vehicle_id, previous timestamp and quantity, current timestamp and quantity." }, { "role": "assistant", "content": "SELECT\n prev.vehicle_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.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry...
[ { "role": "user", "content": "能否帮我统计特定车站(station_id 为 'station_xyz')的所有工作人员数量?" }, { "role": "assistant", "content": "MATCH (s:Station {station_id: 'station_xyz'})<-[:BASED_AT]-(staff:Staff)\nRETURN COUNT(staff) AS total_staff" } ]
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 // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_...
[ { "role": "user", "content": "For each reservation, show the guest's first and last name, the property name, and the names of all services ordered during that reservation." }, { "role": "assistant", "content": "SELECT r.reservation_id, g.first_name, g.last_name, p.property_name, s.service_name\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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "List all posts that have received at least one like and at least one comment, showing the post_id and the total number of likes and comments each has." }, { "role": "assistant", "content": "SELECT p.post_id, COUNT(DISTINCT l.like_id) AS like_count, COUNT(DISTINCT 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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "For each ERC20 token contract, show the contract address and the total number of approval events recorded." }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS approval_count\nFROM erc20_approval\nGROUP BY contract_address;" }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Show me all trips where the actual arrival was delayed by more than 30 minutes compared to the scheduled arrival, including the trip ID, driver's full name, scheduled arrival, and actual arrival." }, { "role": "assistant", "content": "SELECT t.trip_id, d.first_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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Which customers have traded securities with the highest average trading amount per trade across all their accounts? Show me the customer full name, email, and the average trade amount for each customer." }, { "role": "assistant", "content": "SELECT c.first_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "For each user, show their username and how many unique conversations they have sent at least one message in where the conversation is a group chat." }, { "role": "assistant", "content": "SELECT T1.username , COUNT(DISTINCT T2.conversation_id) FROM users AS T1 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 social_media.messages ( message_id character varying(64) NOT NULL, -- unique identifier for the message convers...
[ { "role": "user", "content": "I need to get the total trading volume for each asset along with the asset name." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name, SUM(t.quantity * t.price) AS total_volume\nFROM trading_platform.trades t\nJOIN trading_platform.assets a ON t.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, -- unique identifier for the wallet user_...
[ { "role": "user", "content": "Find pairs of distinct nodes that share the same 'last_seen' timestamp but have different port numbers. Show the node IDs, ports, and the shared timestamp for each pair." }, { "role": "assistant", "content": "SELECT T1.node_id AS node1_id , T1.port AS node1_port , ...
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 character varying(64) NOT NULL, -- unique identifier for the node ip_address charac...
[ { "role": "user", "content": "Which citizens have made payments but have not uploaded any documents? Please show their first and last names and contact emails." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name, c.last_name, c.contact_email\nFROM government_services.citizens c\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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Find any two policies for the same customer whose coverage dates overlap. Return the customer ID, both policy numbers, and their start and end dates." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_number AS policy1_number,\n p1...
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": "Show me all users who had their KYC rejected along with when their review was completed." }, { "role": "assistant", "content": "SELECT user_id, reviewed_at FROM trading_platform.kyc_audit WHERE status = 'rejected';" } ]
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.kyc_audit ( kyc_audit_id.text, user_id.text, status.text, reviewed_at.timestamp )
[ { "role": "user", "content": "Show me all services along with their property names." }, { "role": "assistant", "content": "SELECT s.service_id, s.service_name, p.property_name\nFROM hospitality_technology.services s\nJOIN hospitality_technology.properties p ON s.property_id = p.property_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 hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "role": "user", "content": "List all properties and the room types they offer, including the base rate for each room type." }, { "role": "assistant", "content": "SELECT T1.property_name, T2.type_name, T2.base_rate FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_ty...
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 event names and their corresponding transaction IDs for events that occurred in July 2024." }, { "role": "assistant", "content": "SELECT event_name, transaction_id FROM web3.events WHERE emitted_at >= '2024-07-01 00:00:00' AND emitted_at < '2024-08-01 00:00...
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 web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a...
[ { "role": "user", "content": "Show me all insurance products with 'auto' in their product type, along with their coverage details." }, { "role": "assistant", "content": "SELECT product_name, coverage_details FROM insurance.insurance_products WHERE product_type LIKE '%auto%';" }, { "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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Which service categories have an average processing time greater than 7 days? Please show the category and the average processing time." }, { "role": "assistant", "content": "SELECT category, AVG(average_processing_time_days) AS avg_processing_time FROM government_s...
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 all claims along with the related customer's full name and the policy number for incidents that occurred in 2024." }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, c.description, cu.first_name || ' ' || cu.last_name AS customer_full_...
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, -- unique identifier for the customer first_...
[ { "role": "user", "content": "Which fundraising round in 2022 had the highest single investment amount, and what is the name and introduction of the associated project?" }, { "role": "assistant", "content": "SELECT rounds_name, project_name, introduction, investment_value FROM project_fundraisin...
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, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "Retrieve a list of all patient insurance policies, showing the subscriber name and the name of the insurance provider for the plan." }, { "role": "assistant", "content": "SELECT T1.subscriber_name, T2.insurance_provider FROM healthcare.patient_insurance AS T1 JOIN h...
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, -- unique identifier for this p...
[ { "role": "user", "content": "Show me all trips that were completed with vehicles manufactured after 2020, including the vehicle make and model." }, { "role": "assistant", "content": "SELECT t.trip_id, v.make, v.model FROM transportation.trips t JOIN transportation.vehicles v ON t.vehicle_id = v...
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 a list of all users who have made posts that are set to 'private' visibility. Include their user_id, post_id, post creation time, and the user's current theme." }, { "role": "assistant", "content": "SELECT p.user_id, p.post_id, p.created_at, us.theme\nFROM s...
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": "Can you show me the number of items per rarity and item type combination, along with the minimum and maximum cost for each group?" }, { "role": "assistant", "content": "SELECT item_type, rarity, COUNT(*) AS num_items, MIN(cost_amount) AS min_cost, MAX(cost_amount) 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 gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ite...
[ { "role": "user", "content": "For each game, show the game ID, title, and the total number of players who have unlocked at least one achievement in that game." }, { "role": "assistant", "content": "SELECT g.game_id, g.title, COUNT(DISTINCT pa.player_id) AS total_players\nFROM gaming_technology.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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt...
[ { "role": "user", "content": "List the number of cases for each case type that are currently marked as 'Open'." }, { "role": "assistant", "content": "SELECT case_type, COUNT(*) FROM legal_services.cases WHERE status = 'Open' GROUP BY case_type;" } ]
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.cases ( case_id text, case_number text, case_name text, client_id text, lead_lawyer_id text, case_type t...