conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "How many unique medications have ever been prescribed to each patient? Show patient_id and medication_count." }, { "role": "assistant", "content": "SELECT patient_id, COUNT(DISTINCT medication_id) AS medication_count\nFROM healthcare.prescriptions\nGROUP BY patient_...
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.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, patient_i...
[ { "role": "user", "content": "Find tokens that have a positive price change percentage over the last 1 hour, 6 hours, and 24 hours. Display their symbol and chain." }, { "role": "assistant", "content": "SELECT token_symbol, chain FROM token_dexpool_info WHERE price_change_percentage_1h > 0 AND 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 token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "role": "user", "content": "Count the number of patients whose address includes the word 'Street' and are male." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.patients WHERE address LIKE '%Street%' AND gender = 'Male';" } ]
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": "What is the average and maximum total_supply for tokens grouped by decimals? Provide columns: decimals, avg_supply, max_supply." }, { "role": "assistant", "content": "SELECT decimals,\n AVG(total_supply) AS avg_supply,\n MAX(total_supply) AS max_supply\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.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "List the first name and last name of citizens along with the type and verification status of their documents." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.document_type, T2.verification_status FROM government_services.citizens AS T1 ...
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 PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "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": "What is the total USD value of tokens held by Binance exchange on the Ethereum chain according to the cex_token_balance table?" }, { "role": "assistant", "content": "SELECT SUM(usd_value) AS total_usd_value FROM cex_token_balance WHERE exchange = 'Binance' AND chain...
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": "Show me the average high price and average low price for each security sector using market data." }, { "role": "assistant", "content": "SELECT T1.sector, AVG(T2.high_price) AS average_high_price, AVG(T2.low_price) AS average_low_price FROM financial_services.securit...
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": "List all claim documents of type 'POLICE_REPORT' uploaded in June 2024. Show document_id, claim_id, and file_name." }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_name\nFROM insurance.claim_documents\nWHERE document_type = 'POLICE_REPORT'\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": "Find all pairs of products that share the same product_type but have differing active statuses, listing both their product_ids, product_types, and is_active flags." }, { "role": "assistant", "content": "SELECT p1.product_id AS product_id_1,\n p1.product_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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, product_type text, description text, bas...
[ { "role": "user", "content": "Please list all trades for security with ticker symbol 'AAPL', showing the trade id, account number, trade type, quantity, and price per unit." }, { "role": "assistant", "content": "SELECT t.trade_id, a.account_number, t.trade_type, t.quantity, t.price_per_unit\nFRO...
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 all claim documents for claims with an estimated loss greater than $50,000, including the claim ID, document_id, document type, and file name." }, { "role": "assistant", "content": "SELECT cd.claim_id, cd.document_id, cd.document_type, cd.file_name\nFROM insura...
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": "I need the total amount and count of payments for each policy." }, { "role": "assistant", "content": "SELECT policy_id,\n COUNT(*) AS payment_count,\n SUM(amount_paid) AS total_paid\nFROM insurance.premium_payments\nGROUP BY policy_id;" }, { "rol...
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 character varying(64) NOT NULL, -- unique identifier for the payment po...
[ { "role": "user", "content": "List all patient insurance entries where the subscriber name is different from the patient's last name. Include patient ID, subscriber name, and patient last name." }, { "role": "assistant", "content": "SELECT T1.patient_id, T1.subscriber_name, T2.last_name FROM 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.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "List all trips along with the assigned vehicle's license plate, driver full name, and the scheduled departure time." }, { "role": "assistant", "content": "SELECT t.trip_id, t.scheduled_departure, v.license_plate, d.first_name || ' ' || d.last_name AS driver_name\nFR...
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, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Show me all insurance products of type 'Travel', including their product_id, product_name, and base_premium." }, { "role": "assistant", "content": "SELECT product_id, product_name, base_premium\nFROM insurance.insurance_products\nWHERE product_type = 'Travel';" } ...
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 active policies with coverage limits above $1,000,000, along with their customer IDs and agent IDs, sorted by coverage limit in descending order." }, { "role": "assistant", "content": "SELECT policy_id, customer_id, agent_id, coverage_limit FROM insuranc...
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 PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "How many messages in total have been sent that do not contain any media attachment?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS non_media_message_count\nFROM social_media.messages\nWHERE media_url IS NULL OR media_url = '';" } ]
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 text PRIMARY KEY, conversation_id text, sender_user_id text, content text, media_url...
[ { "role": "user", "content": "List each citizen's first and last name along with the first and last name of another citizen who shares the same last name. Show each pair only once." }, { "role": "assistant", "content": "SELECT c1.first_name || ' ' || c1.last_name AS citizen_name,\n c2.firs...
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": "Show me the top 3 narratives by market cap, along with their top 3 coins and 24-hour trading volume." }, { "role": "assistant", "content": "SELECT n.narrative, n.top_3_coins, n.volume_24h FROM narrative_info n ORDER BY n.market_cap DESC LIMIT 3;" }, { "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_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO...
[ { "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": "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": "List all pairs of achievements in the same game, returning game_id, the first achievement name as achv1, and the second as achv2." }, { "role": "assistant", "content": "SELECT a1.game_id, a1.name AS achv1, a2.name AS achv2\nFROM achievements a1\nJOIN achievements a2...
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.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name text, description text, icon_url t...
[ { "role": "user", "content": "For each chain, find the token with the highest 24h trading volume and the token with the lowest 24h trading volume. Show chain, high_volume_token, high_volume_24h, low_volume_token, and low_volume_24h." }, { "role": "assistant", "content": "WITH max_vol AS (\n SEL...
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 character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "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": "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": "Show me all staff members who are currently active, along with their property name and position." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name \nFROM hospitality_technology.staff s \nJOIN hospitality...
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": "List all NFTs on the 'Ethereum' blockchain, showing their name, contract address, token ID, and the name of the collection they belong to." }, { "role": "assistant", "content": "SELECT t1.name, t1.contract_address, t1.token_id, t2.name AS collection_name FROM nft_me...
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, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "Show me the total transaction amount sent by each sender_address in the last 30 days, along with the count of transactions for each sender." }, { "role": "assistant", "content": "SELECT sender_address, SUM(amount) AS total_amount, COUNT(*) AS transaction_count FROM ...
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 text, block_id text, sender_address text, receiver_address text, amount numeri...
[ { "role": "user", "content": "List all tokens with a total supply greater than 1,000,000." }, { "role": "assistant", "content": "SELECT token_id, token_name, token_symbol, contract_address, total_supply\nFROM web3.tokens\nWHERE total_supply > 1000000;" }, { "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 web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "List all token transfers where the from_address is '0x1234' and the value is greater than 1000." }, { "role": "assistant", "content": "SELECT * FROM web3.token_transfers WHERE from_address = '0x1234' AND value > 1000;" }, { "role": "user", "content": "Ac...
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 text PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ...
[ { "role": "user", "content": "List all tokens with a liquidity over $1 million and a positive 1-hour price change percentage on the Ethereum chain." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, price_change_percentage_1h FROM token_dexpool_info WHERE chain = 'Eth...
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": "How many developers are there in each country?" }, { "role": "assistant", "content": "SELECT\n country,\n COUNT(developer_id) AS developer_count\nFROM\n gaming_technology.developers\nWHERE country IS NOT NULL\nGROUP BY\n country;" }, { "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": "For each reservation in the last three months, show the reservation ID, check-in date, number of adults, and the corresponding room type name." }, { "role": "assistant", "content": "SELECT r.reservation_id, r.check_in_date, r.num_adults, rt.type_name\nFROM 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 text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Please list all law firms with their names and address, and also indicate the year they were founded." }, { "role": "assistant", "content": "SELECT firm_name, address, EXTRACT(YEAR FROM founded_date) AS founded_year FROM legal_services.law_firms;" }, { "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 legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, website.text, founded_date.date, man...
[ { "role": "user", "content": "List all patients who have been prescribed medications with dosage greater than 50mg, along with their medication details and prescribing doctor's name." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, pr.dosage, pr.medication_id, pr.frequenc...
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": "Find all pairs of contracts deployed by the same deployer on the same day, showing the deployer_address, the deployment date, and both contract IDs." }, { "role": "assistant", "content": "SELECT c1.deployer_address,\n DATE(c1.deployed_at) AS deploy_date,\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.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,...
[ { "role": "user", "content": "List all medications with a description that includes the word 'antibiotic'." }, { "role": "assistant", "content": "SELECT * FROM healthcare.medications WHERE description ILIKE '%antibiotic%';" } ]
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 text PRIMARY KEY, medication_name text, generic_name text, manufacturer text, nd...
[ { "role": "user", "content": "For each game_id and region, show me the server that currently has the highest current_players and the server that has the highest max_players. Return game_id, region, top_current_server_id, top_current_players, top_capacity_server_id, and top_capacity." }, { "role": "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.servers ( server_id uuid, game_id uuid, server_name text, region text, ip_address text, port integer,...
[ { "role": "user", "content": "Get the count of unread 'message' notifications per group chat, showing conversation_id, group_name, and unread_message_notifications." }, { "role": "assistant", "content": "SELECT c.conversation_id,\n c.group_name,\n COUNT(n.notification_id) AS unread_m...
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.conversations ( conversation_id.text, created_at.timestamp, last_message_at.timestamp, is_group_chat.boole...
[ { "role": "user", "content": "List the first name and last name of citizens along with their application reference number, status, and the agency name for services categorized as 'Healthcare'." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.reference_number, a.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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Show me all service orders for spa services (service_id LIKE 'SPA%') with their guest names and the staff who delivered the service, ordered by delivery timestamp." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, s.staff_id_delivered, so.deli...
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.guests ( guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil...
[ { "role": "user", "content": "Show all loans with a maturity date in the next 60 days, along with their account_id, principal_amount, interest_rate, and maturity_date." }, { "role": "assistant", "content": "SELECT loan_id, account_id, principal_amount, interest_rate, maturity_date FROM financial...
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.loans ( loan_id text, account_id text, loan_type text, principal_amount numeric, current_principal_b...
[ { "role": "user", "content": "For each block number, show the minimum transaction value and the transaction_id(s) that have that minimum value." }, { "role": "assistant", "content": "SELECT t.block_number, t.transaction_id, t.value\nFROM web3.transactions t\nINNER JOIN (\n SELECT block_number, ...
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": "Show me all managers (agents who have other agents reporting to them) along with their team size and average commission rate of their team members." }, { "role": "assistant", "content": "SELECT m.agent_id, m.first_name, m.last_name, COUNT(r.agent_id) as team_size, 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 insurance.agents ( agent_id character varying(64) NOT NULL, -- unique identifier for the agent first_name chara...
[ { "role": "user", "content": "Which ERC20 tokens have a total supply between 1,000,000 and 5,000,000? List their symbol, name, and contract address." }, { "role": "assistant", "content": "SELECT symbol, name, contract_address FROM token_metas WHERE is_erc20 = 1 AND CAST(total_supply AS numeric) ...
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 each player's highest score for each game they have played." }, { "role": "assistant", "content": "SELECT player_id, game_id, MAX(score) AS highest_score FROM gaming_technology.game_sessions GROUP BY player_id, game_id;" }, { "role": "user", "conten...
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": "Provide a list of all drivers and for each, show their driver_id, full name, the total number of completed trips they've driven, and the sum of all fares from bookings on those completed trips. Include drivers even if they have no completed trips. Order by total_fares descendin...
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, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List all replacement policies where a customer received a new policy starting the day after their previous policy was cancelled. Return customer_id, original_policy_id, original_cancellation_date, new_policy_id, new_start_date." }, { "role": "assistant", "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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "List tokens that exist in both the token basic information and the DEX pool information tables. For these tokens, show their symbol, the chain they are on, the current price from basic info, and the liquidity from the DEX pool info." }, { "role": "assistant", "conte...
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 token_basic_info ( coin_id.text, token_name.text, token_symbol.text, token_address.t...
[ { "role": "user", "content": "How many service orders were placed by each staff member (staff_id_ordered)? Show the staff ID and the count." }, { "role": "assistant", "content": "SELECT staff_id_ordered, COUNT(*) FROM hospitality_technology.service_orders GROUP BY staff_id_ordered;" }, { ...
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.service_orders ( order_id text, reservation_id text, guest_id text, service_id text, staff_id_or...
[ { "role": "user", "content": "Find pairs of documents in the same case where one document is version 1 and the other is the highest version for that document_name, showing case_id, document_name, version1, latest_version, version1_upload_timestamp, and latest_upload_timestamp." }, { "role": "assista...
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 character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "role": "user", "content": "How many policies were canceled in the previous month, grouped by cancellation reason?" }, { "role": "assistant", "content": "SELECT cancellation_reason,\n COUNT(*) AS canceled_count\nFROM insurance.policies\nWHERE cancellation_date BETWEEN date_trunc('month',...
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": "Can you show me all insurance plans along with the full names of patients who are enrolled in them and the start date of their coverage? Please include plan name, insurance provider, patient first and last name, and the effective date." }, { "role": "assistant", "co...
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": "Show me all users who have unread notifications about DApp updates, along with the notification message and DApp name." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, n.message, d.name AS dapp_name FROM trading_platform.users u JOIN trading_plat...
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 Sui NFT collections where the owner is not null, including their name and collection_type." }, { "role": "assistant", "content": "SELECT name, collection_type FROM sui_nfts WHERE owner IS NOT NULL;" }, { "role": "user", "content": "Can you filte...
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 the total number of hours billed for each case along with the invoice number and its total amount." }, { "role": "assistant", "content": "SELECT c.case_number, c.case_name, i.invoice_number, i.total_amount, SUM(te.hours_spent) AS total_hours_billed\nFROM leg...
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...
[ { "role": "user", "content": "Show me all managers (agents who have other agents reporting to them) along with their full names and the count of agents they manage." }, { "role": "assistant", "content": "SELECT m.agent_id, m.first_name, m.last_name, COUNT(a.agent_id) AS team_size FROM 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.agents ( agent_id text, first_name text, last_name text, agency_name text, license_number text, license_state...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name) from California (state = 'CA') who have both a checking account (account_type = 'Checking') and a home loan (loan_type = 'Home'), along with their total account balance and loan principal amount." }, { "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 financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad...
[ { "role": "user", "content": "List all assets that have been traded at least 50 times, along with their total trade volume (quantity * price)." }, { "role": "assistant", "content": "SELECT asset_id, COUNT(*) AS trade_count, SUM(quantity * price) AS total_volume FROM trading_platform.trades 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 trading_platform.trades ( trade_id text, order_id text, buyer_id text, seller_id text, asset_id text, quantity numeric,...
[ { "role": "user", "content": "List all hashtags created after '2024-06-01', showing hashtag_id and tag_name." }, { "role": "assistant", "content": "SELECT hashtag_id, tag_name\nFROM social_media.hashtags\nWHERE created_at > '2024-06-01';" }, { "role": "user", "content": "Now also inc...
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.hashtags ( hashtag_id character varying(64) NOT NULL, -- unique identifier for the hashtag tag_nam...
[ { "role": "user", "content": "Show me all PDF documents uploaded by agent 'AG456', along with their claim IDs and file sizes." }, { "role": "assistant", "content": "SELECT claim_id, file_size_bytes FROM insurance.claim_documents WHERE mime_type = 'application/pdf' AND uploaded_by = 'AG456';" }...
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 all beneficiaries who have a null contact_info. Return beneficiary_id, first_name, last_name, policy_id." }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name, last_name, policy_id\nFROM insurance.policy_beneficiaries\nWHERE contact_info IS 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.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la...
[ { "role": "user", "content": "How many conversations are group chats?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = 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.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "List all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange (exchange = 'NASDAQ') and have had at least one trade with a total_amount greater than $100,000, along with the count of such trades for each security." }, { "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 financial_services.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ...
[ { "role": "user", "content": "Show the count of applications submitted per day for the last 7 days. Include the date and application_count, ordered by date ascending." }, { "role": "assistant", "content": "SELECT CAST(submitted_at AS date) AS date,\n COUNT(*) AS application_count\nFROM gov...
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": "Retrieve each employee with their manager's first_name and last_name." }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name AS employee_first_name, e.last_name AS employee_last_name, m.first_name AS manager_first_name, m.last_name AS manager_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.accounts ( account_id.text, customer_id.text, account_number.text, account_type.text, balance.numeri...
[ { "role": "user", "content": "Find all patients who have insurance plans with group numbers, showing their patient IDs and the count of such plans per patient, ordered by count in descending order." }, { "role": "assistant", "content": "SELECT patient_id, COUNT(*) AS group_plan_count\nFROM healt...
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": "Provide a list of all future appointments showing appointment_id, scheduled_start_time, location_name, city, and state." }, { "role": "assistant", "content": "SELECT\n a.appointment_id,\n a.scheduled_start_time,\n sl.location_name,\n sl.city,\n sl.state\nFROM 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 government_services.service_locations ( location_id character varying(64) NOT NULL, agency_id character varying(64) NOT...
[ { "role": "user", "content": "What is the average balance for each account_type among accounts with status 'Open'?" }, { "role": "assistant", "content": "SELECT account_type, AVG(balance) AS avg_balance FROM financial_services.accounts WHERE status = 'Open' GROUP BY account_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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "Show each asset's symbol and the number of unique addresses that have UTXOs associated with it." }, { "role": "assistant", "content": "SELECT a.symbol, COUNT(DISTINCT u.address) AS unique_addresses\nFROM trading_platform.assets a\nJOIN trading_platform.utxos u 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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "Show me all addresses with a balance greater than 500, ordered by balance in descending order." }, { "role": "assistant", "content": "SELECT address_id, public_key, balance FROM blockchain.addresses WHERE balance > 500 ORDER BY balance DESC;" }, { "role": "u...
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.addresses ( address_id.text, public_key.text, balance.numeric )
[ { "role": "user", "content": "How many UTXOs are associated with each transaction_id?" }, { "role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS utxo_count FROM trading_platform.utxos GROUP BY transaction_id;" }, { "role": "user", "content": "Can you also show the sum ...
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, transaction_id character varying(64) NOT NULL, output_...
[ { "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": "How many contracts are deployed each month for each status?" }, { "role": "assistant", "content": "SELECT TO_CHAR(deployed_at, 'YYYY-MM') AS deploy_month,\n status,\n COUNT(*) AS contract_count\nFROM web3.contracts\nGROUP BY TO_CHAR(deployed_at, 'YYYY-MM...
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": "For each reservation, display the guest's full name, property_id, the total number of service orders placed, and the total price of those service orders." }, { "role": "assistant", "content": "SELECT r.reservation_id, g.first_name, g.last_name, r.property_id, 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 hospitality_technology.rooms ( room_id text, property_id text, room_number text, room_type_id text, floor integer, stat...
[ { "role": "user", "content": "I need to get a list of employees assigned to a specific assembly line, including their job title and hire date." }, { "role": "assistant", "content": "MATCH (e:Employee)-[:ASSIGNED_TO]->(al:AssemblyLine {line_id: 'specific_line_id'})\nRETURN e.employee_id, e.first_...
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 ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str...
[ { "role": "user", "content": "List all time entries that do not have a description, including the entry ID, date worked, hours spent, and the first and last name of the lawyer who recorded the entry." }, { "role": "assistant", "content": "SELECT te.entry_id, te.date_worked, te.hours_spent, l.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 legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu...
[ { "role": "user", "content": "Show me the number of game servers in each region and the average maximum number of players they can accommodate. Exclude any servers that are currently offline." }, { "role": "assistant", "content": "SELECT region, COUNT(server_id) AS server_count, AVG(max_players)...
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(), -- unique identifier for the player ...
[ { "role": "user", "content": "List all public reviews that have a staff response, showing the review ID, overall rating, and the full name of the staff member who responded." }, { "role": "assistant", "content": "SELECT T1.review_id, T1.rating_overall, T2.first_name, T2.last_name FROM hospitalit...
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": "Show all documents where the document description includes the word 'summary'. Please display their document name and type." }, { "role": "assistant", "content": "SELECT document_name, document_type FROM legal_services.documents WHERE description ILIKE '%summary%';"...
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 PRIMARY KEY, case_id text, document_name text, document_type text, storage_...
[ { "role": "user", "content": "List the plan ID, name, provider, and contact phone for all insurance plans that share the same contact phone as another plan in the system." }, { "role": "assistant", "content": "SELECT t1.plan_id, t1.plan_name, t1.insurance_provider, t1.contact_phone FROM healthca...
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.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, plan_type.text, contact_phone.text,...
[ { "role": "user", "content": "List all wallet addresses that have unspent UTXOs with amounts greater than 100, along with the total unspent amount for each address." }, { "role": "assistant", "content": "SELECT w.address, SUM(u.amount) AS total_unspent FROM trading_platform.wallets w JOIN tradin...
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 text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "List all rooms along with their room type name and features." }, { "role": "assistant", "content": "SELECT T1.room_number, T2.type_name, T1.features FROM rooms AS T1 JOIN room_types AS T2 ON T1.room_type_id = T2.room_type_id" }, { "role": "user", "conten...
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": "Retrieve the number of drivers grouped by their status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS driver_count\nFROM transportation.drivers\nGROUP BY status;" }, { "role": "user", "content": "Now, only show statuses where ...
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": "Show me all guests from California (state_province = 'California') who are loyalty members and have provided both email and phone number, ordered by their last name in alphabetical order." }, { "role": "assistant", "content": "SELECT guest_id, first_name, 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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "Show all review IDs, property IDs, and the rating for service given for each review." }, { "role": "assistant", "content": "SELECT review_id, property_id, rating_service\nFROM hospitality_technology.reviews;" }, { "role": "user", "content": "Only display...
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 all beneficiaries who have a percentage share greater than 50% on a policy. Please include the beneficiary's first name, last name, relationship, the policy ID, and the policy's start date." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_na...
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, -- unique identifier for the benefi...
[ { "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": "For all claims, show the claim ID, policy ID, incident date, status, and the claim handler ID, only for claims that have both an estimated loss and a settlement amount over 5000." }, { "role": "assistant", "content": "SELECT claim_id, policy_id, incident_date, statu...
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": "Show me the number of vehicles for each make in the system." }, { "role": "assistant", "content": "SELECT make, COUNT(*) AS vehicle_count\nFROM transportation.vehicles\nGROUP BY make" }, { "role": "user", "content": "Now, only show makes that have more 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 transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Show me the earliest created smart contract for each creator address." }, { "role": "assistant", "content": "SELECT creator_address, MIN(timestamp) AS earliest_contract_timestamp FROM blockchain.smart_contracts GROUP BY creator_address;" }, { "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 blockchain.smart_contracts ( contract_id character varying(64) NOT NULL, creator_address character varying(128) NOT NUL...
[ { "role": "user", "content": "Count the number of smart contracts deployed for each unique creator address." }, { "role": "assistant", "content": "SELECT creator_address, COUNT(*) FROM blockchain.smart_contracts GROUP BY creator_address;" }, { "role": "user", "content": "Show me only...
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.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "role": "user", "content": "List the total number of UTXOs and the total sum of amounts for each address that has spent UTXOs." }, { "role": "assistant", "content": "SELECT address, COUNT(*) AS utxo_count, SUM(amount) AS total_amount FROM trading_platform.utxos WHERE spent = TRUE GROUP BY addr...
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, transaction_id character varying(64) NOT NULL, output_...
[ { "role": "user", "content": "What is the average and maximum standard fee for services in each category?" }, { "role": "assistant", "content": "SELECT category, AVG(standard_fee) AS avg_standard_fee, MAX(standard_fee) AS max_standard_fee FROM government_services.services GROUP BY category;" }...
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 PRIMARY KEY, agency_id text, service_name text, description text, catego...
[ { "role": "user", "content": "How many fuel logs were created for each unit of measurement? Show the unit and the corresponding count." }, { "role": "assistant", "content": "SELECT unit, COUNT(*) as log_count\nFROM transportation.fuel_logs\nGROUP BY unit;" }, { "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.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "For each staff member who placed a service order, show their full name and the total revenue generated from those orders." }, { "role": "assistant", "content": "SELECT S.first_name, S.last_name, SUM(SO.total_price) AS total_generated_revenue FROM hospitality_technol...
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": "List the content and comment ID for all comments made by users with private profiles." }, { "role": "assistant", "content": "SELECT c.comment_id, c.content FROM social_media.comments AS c JOIN social_media.user_settings AS us ON c.user_id = us.user_id WHERE us.priva...
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 character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "I need a report showing, for each server region, how many distinct achievements exist for any game hosted in that region." }, { "role": "assistant", "content": "SELECT s.region,\n COUNT(DISTINCT a.achievement_id) AS achievement_count\nFROM gaming_technology.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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "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...