conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Tell me the count of hidden achievements and non-hidden achievements." }, { "role": "assistant", "content": "SELECT hidden, COUNT(*) FROM achievements GROUP BY hidden;" }, { "role": "user", "content": "What's the average point value for hidden vs non-hid...
You are an SQL statement expert. Given the table 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, game_id.uuid, name.text, description.text, icon_url.text, points....
[ { "role": "user", "content": "I need to find pairs of nodes that share the same port but have different IP addresses. Can you write a query for that?" }, { "role": "assistant", "content": "SELECT n1.node_id AS node1_id,\n n2.node_id AS node2_id,\n n1.port\nFROM blockchain.nodes n1\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 blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ...
[ { "role": "user", "content": "What is the total number of unique manufacturers listed in the medications table?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT manufacturer) FROM healthcare.medications;" }, { "role": "user", "content": "Could you also show the count of 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 healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, generic_name text, manufacturer text, nd...
[ { "role": "user", "content": "Find all blocks where the nonce is greater than 100000 and the difficulty is above 5000." }, { "role": "assistant", "content": "SELECT * FROM blockchain.blocks WHERE nonce > 100000 AND difficulty > 5000;" }, { "role": "user", "content": "Now show me the ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id character varying(64) NOT NULL, -- unique identifier for the block previous_block...
[ { "role": "user", "content": "Can you list each server along with its game title and how many players it can still accommodate (max_players - current_players)?" }, { "role": "assistant", "content": "SELECT s.server_id,\n s.server_name,\n g.title AS game_title,\n (s.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.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title character varying(200) NOT NULL, devel...
[ { "role": "user", "content": "What is the average ROI for smart money addresses on the Ethereum chain with a realized profit ratio above 50%?" }, { "role": "assistant", "content": "SELECT AVG(roi) AS average_roi FROM smart_money_profit WHERE chain = 'Ethereum' AND realized_ratio > 50;" } ]
You are an SQL statement expert. Given the table 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": "Show all premium payments made via 'bank transfer' along with the policy_id and customer_id." }, { "role": "assistant", "content": "SELECT payment_id, policy_id, customer_id, amount_paid, payment_date FROM insurance.premium_payments WHERE payment_method = 'bank tran...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin...
[ { "role": "user", "content": "Find pairs of token transfers within the same transaction and for the same token, where the value of one transfer is exactly twice the value of the other. Show the transaction ID, token ID, and both transfer IDs and their values." }, { "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 web3.token_transfers ( transfer_id character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "Show the tokens with a negative net flow this month on all chains." }, { "role": "assistant", "content": "SELECT token_symbol, chain, net_flow FROM smart_money_token_performance WHERE net_flow < 0 AND date_trunc('month', CURRENT_DATE) = date_trunc('month', now());" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_token_performance ( token_address character varying(100) NOT NULL, token_symbol character varying(100), pnl...
[ { "role": "user", "content": "For each event recorded, list its ID, name, and the status and value of the transaction in which it occurred." }, { "role": "assistant", "content": "SELECT E.event_id, E.event_name, E.transaction_id, T.status, T.value FROM web3.events AS E JOIN web3.transactions 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 web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "For each user, what is the average time difference in days between their wallet creations? Return user_id and avg_diff_days." }, { "role": "assistant", "content": "WITH diffs AS (\n SELECT\n user_id,\n EXTRACT(EPOCH FROM (created_at - LAG(created_at) OVER (PA...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "Show me the user who received the most notifications in the last 30 days, along with the count of notifications they received." }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) AS notification_count FROM trading_platform.notifications WHERE sent_at >= ...
You are an SQL statement expert. Given the table 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.notifications ( notification_id.text, user_id.text, message.text, sent_at.timestamp, read_at.timestamp...
[ { "role": "user", "content": "What is the average interest rate for personal loans (loan_type = 'Personal') with a term of 60 months?" }, { "role": "assistant", "content": "SELECT AVG(interest_rate) FROM financial_services.loans WHERE loan_type = 'Personal' AND term_months = 60;" } ]
You are an SQL statement expert. Given the table 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": "List all unavailable services along with their names, prices, and the departments they belong to." }, { "role": "assistant", "content": "SELECT service_name, price, department FROM hospitality_technology.services WHERE is_available = false;" }, { "role": "us...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.text, description.text, category.text...
[ { "role": "user", "content": "List the payment_id, amount_paid, and payment_date for all premium payments with an amount above 2500." }, { "role": "assistant", "content": "SELECT payment_id, amount_paid, payment_date\nFROM insurance.premium_payments\nWHERE amount_paid > 2500;" } ]
You are an SQL statement expert. Given the table 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": "Which DEX tokens currently have a negative price change over the last hour and a trading volume above $100,000?" }, { "role": "assistant", "content": "SELECT token_name, token_symbol, chain, price_change_percentage_1h, volume_24h\nFROM token_dexpool_info\nWHERE pric...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show a list of departments with more than 5 employees. Include the department name and the count." }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS employee_count\nFROM government_services.employees\nGROUP BY department\nHAVING COUNT(*) > 5;" }...
You are an SQL statement expert. Given the table 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.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa...
[ { "role": "user", "content": "Get the number of distinct wallet holders and total amount held for each NFT collection on Ethereum. Include collection name and contract_address." }, { "role": "assistant", "content": "SELECT nc.contract_address, nc.name, COUNT(DISTINCT nh.wallet_address) AS holder...
You are an SQL statement expert. Given the table 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": "I need to find pairs of claims handled by the same claim handler where their incident dates are within 7 days of each other. For each pair, list claim_id1, claim_id2, claim_handler_id, and days_between." }, { "role": "assistant", "content": "SELECT c1.claim_id AS cl...
You are an SQL statement expert. Given the table 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": "How many clients are registered with an active status?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM legal_services.clients WHERE status = 'active';" }, { "role": "user", "content": "Could you also tell me the average number of days since r...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "Show me the average transaction amount per block, along with the block_id and the count of transactions in each block." }, { "role": "assistant", "content": "SELECT block_id, AVG(amount) as avg_amount, COUNT(*) as transaction_count FROM blockchain.transactions 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 blockchain.transactions ( transaction_id text PRIMARY KEY, block_id text, sender_address text, receiver_address text, a...
[ { "role": "user", "content": "Show me all claims and the file names of documents uploaded for each claim." }, { "role": "assistant", "content": "SELECT T1.claim_id, T2.file_name FROM insurance.claims AS T1 JOIN insurance.claim_documents AS T2 ON T1.claim_id = T2.claim_id;" }, { "role": "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "List clients who have appointments with lawyers from law firms founded before the year 2010. Show the client's first name, last name, the appointment subject, the lawyer's first name, last name, and the firm name." }, { "role": "assistant", "content": "SELECT T1.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.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "List each conversation_id and the number of unread messages (where read_at is null)." }, { "role": "assistant", "content": "SELECT m.conversation_id, COUNT(*) AS unread_messages FROM social_media.messages m WHERE m.read_at IS NULL GROUP BY m.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 character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "List customers who have both a canceled policy and an active policy. Show customer_id, canceled_policy_id, and active_policy_id." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_id AS canceled_policy_id,\n p2.policy_id AS active_...
You are an SQL statement expert. Given the table 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 associated with the 'AI' narrative. For each token, show its symbol and current price. Also include the 24-hour volume for the 'AI' narrative itself." }, { "role": "assistant", "content": "SELECT T1.token_symbol, T1.price, T2.volume_24h FROM token_basic_...
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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character...
[ { "role": "user", "content": "List all reservations, showing the guest's full name (first and last name) and the property name for each." }, { "role": "assistant", "content": "SELECT t2.first_name, t2.last_name, t3.property_name FROM hospitality_technology.reservations AS t1 INNER 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, property_name character varying(255) NO...
[ { "role": "user", "content": "List all service orders for spa services in the last month, including the guest ID and total price." }, { "role": "assistant", "content": "SELECT order_id, guest_id, total_price FROM hospitality_technology.service_orders WHERE service_id LIKE 'SPA%' AND order_timest...
You are an SQL statement expert. Given the table 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 me the top 5 buyers by total trade volume (quantity * price) in the last 30 days, along with their trade count." }, { "role": "assistant", "content": "SELECT buyer_id, COUNT(trade_id) AS trade_count, SUM(quantity * price) AS total_volume FROM trading_platform.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 trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "role": "user", "content": "I want to find regions where the average number of current_players across servers exceeds 200. Provide a SQL query that lists each region and its average current_players." }, { "role": "assistant", "content": "SELECT region, AVG(current_players) AS avg_players\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 gaming_technology.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game se...
[ { "role": "user", "content": "List all tokens with a price below $1 and a 24-hour trading volume over $10 million." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE price < 1 AND CAST(total_volume AS double precision) > 100000...
You are an SQL statement expert. Given the table 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": "Could you list the name, type, and rarity for all in-game items that belong to games released on or after January 1st, 2022?" }, { "role": "assistant", "content": "SELECT ii.item_name, ii.item_type, ii.rarity FROM gaming_technology.in_game_items AS ii JOIN gaming_te...
You are an SQL statement expert. Given the table 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": "For each trip, provide the trip ID, the name of the vehicle's make and model, and the total quantity of fuel used during that trip." }, { "role": "assistant", "content": "SELECT t.trip_id, v.make, v.model, SUM(f.quantity) AS total_fuel_used\nFROM transportation.trip...
You are an SQL statement expert. Given the table 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 users who have wallets but have never placed any orders, along with their wallet creation dates." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, w.wallet_id, w.created_at FROM trading_platform.users u JOIN trading_platform.wallets w ...
You are an SQL statement expert. Given the table 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 the usernames and email addresses of users who have commented on their own posts, and the content of such comments." }, { "role": "assistant", "content": "SELECT u.username, u.email, c.content AS comment_content\nFROM social_media.comments c\nJOIN social_med...
You are an SQL statement expert. Given the table 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": "Show me all pairs of patients who share the same emergency contact phone, including both patient IDs, their names, and the shared emergency contact phone." }, { "role": "assistant", "content": "SELECT p1.patient_id,\n p1.first_name,\n p1.last_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List all NFT collections from the sui_nfts table 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", "cont...
You are an SQL statement expert. Given the table 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 users who have unread notifications sent in the last 7 days, along with the notification message and when it was sent." }, { "role": "assistant", "content": "SELECT user_id, message, sent_at FROM trading_platform.notifications WHERE read_at IS NULL 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 trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, message text, sent_at timestamp, read_...
[ { "role": "user", "content": "Show me the latest 10 NFTs minted on Ethereum with their name, mint_block_number, collection name and floor price." }, { "role": "assistant", "content": "SELECT nm.name,\n nm.token_id,\n nm.mint_block_number,\n nc.name AS collection_name,\n 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "List each player along with the number of achievements they have unlocked in game 'SuperQuest'." }, { "role": "assistant", "content": "SELECT p.player_id,\n p.username,\n COUNT(pa.achievement_id) AS achievement_count\nFROM gaming_technology.player_achiev...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "List each citizen's first and last name along with the number of applications they have submitted, only include those with at least 3 applications." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(a.application_id) AS application_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.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Show me all medical records created before January 1, 2022." }, { "role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE record_date < '2022-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 healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointment_id text, doctor_id text, record_d...
[ { "role": "user", "content": "List all appointments scheduled in the next 30 days with appointment_id, client_id, case_id, and any invoice_id linked to that case." }, { "role": "assistant", "content": "SELECT\n a.appointment_id,\n a.client_id,\n a.case_id,\n i.invoice_id\nFROM legal_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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, -- unique identifier for the law firm firm_...
[ { "role": "user", "content": "Show the total fuel cost for each month in 2023 based on the log timestamp." }, { "role": "assistant", "content": "SELECT\n EXTRACT(MONTH FROM log_timestamp) AS log_month,\n SUM(total_cost) AS monthly_total_cost\nFROM transportation.fuel_logs\nWHERE EXTRACT(YE...
You are an SQL statement expert. Given the table 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, vehicle_id character varying(64) NOT NULL, trip_...
[ { "role": "user", "content": "List the names and numbers of cases that were opened in June 2024." }, { "role": "assistant", "content": "SELECT case_name, case_number FROM legal_services.cases WHERE date_opened >= '2024-06-01' AND date_opened < '2024-07-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 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": "List the name and latest price for all tokens that have a price listed." }, { "role": "assistant", "content": "SELECT t1.name, t2.price FROM token_metas AS t1 JOIN token_prices AS t2 ON t1.contract_address = t2.address WHERE t2.timestamp IN (SELECT MAX(timestamp) FR...
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_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "List the latest version of each document (identified by case_id and document_name), showing the version number and its upload_timestamp." }, { "role": "assistant", "content": "SELECT d.case_id,\n d.document_name,\n d.version AS latest_version,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "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": "Which users have received both a comment notification and a like notification? List the recipient_user_id and the total number of such users." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT recipient_user_id) AS user_count\nFROM (\n SELECT recipient_us...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.likes ( like_id character varying(64) NOT NULL, -- unique identifier for the like user_id characte...
[ { "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 also ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "Show me all contracts deployed on the 'ethereum' network along with their deployer addresses and the length of their ABI in characters, sorted by ABI length in descending order." }, { "role": "assistant", "content": "SELECT address, deployer_address, LENGTH(abi) 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 web3.contracts ( contract_id text PRIMARY KEY, address text, abi text, bytecode text, deployer_address text, deployed_a...
[ { "role": "user", "content": "List all 'Evidence' documents uploaded in the last 30 days, including document_name, case_number, case_name, and upload_timestamp." }, { "role": "assistant", "content": "SELECT d.document_name, c.case_number, c.case_name, d.upload_timestamp\nFROM legal_services.docu...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, case_number text UNIQUE, case_name text, client_id text, lead_lawyer_i...
[ { "role": "user", "content": "List all medical report documents with descriptions containing 'x-ray', showing their claim IDs and upload dates." }, { "role": "assistant", "content": "SELECT claim_id, document_id, uploaded_at FROM insurance.claim_documents WHERE document_type = 'medical_report' 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.claim_documents ( document_id text, claim_id text, document_type text, file_name text, file_path text, file_s...
[ { "role": "user", "content": "List all peers with their IP addresses who have not been seen in the last 7 days." }, { "role": "assistant", "content": "SELECT peer_id, ip_address, port, last_seen\nFROM trading_platform.peers\nWHERE last_seen < NOW() - INTERVAL '7 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 trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch...
[ { "role": "user", "content": "I want to calculate the average duration of completed appointments for each doctor, showing the doctor\\u2019s full name." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name || ' ' || d.last_name AS doctor_name, AVG(a.duration_minutes) AS avg_dur...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "Retrieve the name and description of services offered by agencies in the 'Federal' jurisdiction." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.description FROM government_services.services AS T1 JOIN government_services.agencies AS T2 ON T1.agenc...
You are an SQL statement expert. Given the table 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": "List all trips that originated from locations in California, showing the trip ID, vehicle make and model, and origin location details." }, { "role": "assistant", "content": "SELECT t.trip_id, v.make, v.model, l.name AS origin_name, l.city AS origin_city FROM transpo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "Can you help me get a list of inspections performed on a specific aircraft build, including the employee who performed them and the inspected component details?" }, { "role": "assistant", "content": "MATCH (ab:AircraftBuild {build_id: 'specific_build_id'})-[:UNDERWE...
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 ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St...
[ { "role": "user", "content": "List all comments that have at least one like, showing comment_id, content, and like_count." }, { "role": "assistant", "content": "SELECT c.comment_id, c.content, COUNT(l.like_id) AS like_count\nFROM social_media.comments c\nJOIN social_media.likes l ON c.comment_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.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "List all ERC20 tokens where the total supply is between '1000000000' and '5000000000'. Show the symbol and name." }, { "role": "assistant", "content": "SELECT symbol, name FROM token_metas WHERE is_erc20 = 1 AND total_supply >= '1000000000' AND total_supply <= '5000...
You are an SQL statement expert. Given the table 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 each agency along with its parent agency’s name and jurisdiction level." }, { "role": "assistant", "content": "SELECT child.agency_id, child.agency_name, child.jurisdiction_level, parent.agency_name AS parent_agency_name, parent.jurisdiction_level AS parent_jur...
You are an SQL statement expert. Given the table 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 me all loans (loan_id, loan_type, principal_amount) where the current principal balance is less than 30% of the original principal amount, along with their account_id and status." }, { "role": "assistant", "content": "SELECT loan_id, loan_type, principal_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.loans ( loan_id.text, account_id.text, loan_type.text, principal_amount.numeric, current_principal_b...
[ { "role": "user", "content": "Count the number of completed premium payments grouped by payment_method." }, { "role": "assistant", "content": "SELECT payment_method,\n COUNT(*) AS payment_count\nFROM insurance.premium_payments\nWHERE status = 'Completed'\nGROUP BY payment_method;" } ]
You are an SQL statement expert. Given the table 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 PRIMARY KEY, policy_id text, customer_id text, payment_date timestamp, amo...
[ { "role": "user", "content": "What is the total estimated loss for all claims reported in the year 2024?" }, { "role": "assistant", "content": "SELECT SUM(estimated_loss) FROM insurance.claims WHERE EXTRACT(YEAR FROM reported_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.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "Which services have 'Eligibility' mentioned in their eligibility_criteria field?" }, { "role": "assistant", "content": "SELECT service_name, eligibility_criteria\nFROM government_services.services\nWHERE eligibility_criteria ILIKE '%Eligibility%';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "List all trades for asset 'BTC' where the trade quantity is greater than 5." }, { "role": "assistant", "content": "SELECT trade_id, order_id, buyer_id, seller_id, quantity, price, traded_at FROM trading_platform.trades WHERE asset_id = 'BTC' AND quantity > 5;" } ]
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "role": "user", "content": "For each user, show their user ID and the count of unique wallet addresses they own." }, { "role": "assistant", "content": "SELECT user_id, COUNT(DISTINCT address) FROM wallets GROUP BY 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.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
[ { "role": "user", "content": "Provide the route_number, description, origin location name, and destination location name for all routes of type 'Express'." }, { "role": "assistant", "content": "SELECT r.route_number,\n r.description,\n o.name AS origin_name,\n d.name AS destina...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, employee_id character varying(64) NOT NULL UNIQUE, f...
[ { "role": "user", "content": "List the token symbol and name for all tokens whose associated contract address has emitted at least one event. Also include the contract address." }, { "role": "assistant", "content": "SELECT T.token_symbol, T.token_name, T.contract_address FROM web3.tokens AS T JO...
You are an SQL statement expert. Given the table 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": "Find pairs of notifications for the same application where one was sent via 'Email' and the other via 'SMS'. Display the application_id, email_notification_id, sms_notification_id, email_sent_at, and sms_sent_at." }, { "role": "assistant", "content": "SELECT\n n_em...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.notifications ( notification_id character varying(64) NOT NULL, citizen_id character varying(64) NO...
[ { "role": "user", "content": "List all failed payments (status = 'failed') with their reservation IDs and amounts, ordered by the payment timestamp." }, { "role": "assistant", "content": "SELECT payment_id, reservation_id, amount, payment_timestamp FROM hospitality_technology.payments WHERE stat...
You are an SQL statement expert. Given the table 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": "List all services, showing the service name, category, and the name of the property where it is offered." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.category, T2.property_name FROM hospitality_technology.services AS T1 JOIN hospitality_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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "List all depot locations in the United States with their city and state information." }, { "role": "assistant", "content": "SELECT name, city, state_province FROM transportation.locations WHERE type = 'depot' AND country = 'United States';" }, { "role": "use...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "Which token has the highest net USD value difference between buys and sells? Show token_symbol, chain, narrative, average buy price, average sell price, and the net difference." }, { "role": "assistant", "content": "WITH buys AS (\n SELECT token_address, token_symb...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE smart_money_token_inflow (", "token_address character varying(100) NOT NULL, -- the token's address", "token...
[ { "role": "user", "content": "List all rooms currently under Maintenance, including their room number, property name, room type name, and base rate." }, { "role": "assistant", "content": "SELECT r.room_number, p.property_name, rt.type_name, rt.base_rate\nFROM hospitality_technology.rooms r\nJOIN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "How many players registered in each year? Show the year and the registration count." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM registration_date) AS year,\n COUNT(*) AS registrations\nFROM gaming_technology.players\nGROUP BY year;" }, ...
You are an SQL statement expert. Given the table 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 chronic diagnoses made by Cardiology specialists in the last year, including the patient ID, diagnosis description, and doctor's full name." }, { "role": "assistant", "content": "SELECT dg.patient_id, dg.description, d.first_name || ' ' || d.last_name AS do...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "Show me pairs of developers from the same country, listing both names, country, and founded years." }, { "role": "assistant", "content": "SELECT\n d1.name AS developer1_name,\n d2.name AS developer2_name,\n d1.country,\n d1.founded_year AS developer1_founded_yea...
You are an SQL statement expert. Given the table 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": "Show me all active policies with coverage limits above $1,000,000, along with their customer IDs and agent IDs." }, { "role": "assistant", "content": "SELECT policy_id, customer_id, agent_id, coverage_limit FROM insurance.policies WHERE status = 'active' AND coverag...
You are an SQL statement expert. Given the table 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": "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": "How many patients have provided both a phone_number and emergency_contact_phone?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.patients WHERE phone_number IS NOT NULL AND emergency_contact_phone 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.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "List all policies that have a coverage_limit exactly equal to the deductible. Show policy_id, policy_number, coverage_limit, and deductible." }, { "role": "assistant", "content": "SELECT policy_id, policy_number, coverage_limit, deductible\nFROM insurance.policies\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.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Show me all active staff members with their property_id, position, and hire_date." }, { "role": "assistant", "content": "SELECT staff_id, property_id, position, hire_date FROM hospitality_technology.staff WHERE is_active = true;" }, { "role": "user", "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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Show me all service orders with their reservation IDs and total prices where the quantity is more than 1." }, { "role": "assistant", "content": "SELECT order_id, reservation_id, total_price FROM hospitality_technology.service_orders WHERE quantity > 1;" }, { ...
You are an SQL statement expert. Given the table 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.reservations ( reservation_id.text, property_id.text, guest_id.text, room_id.text, room_type_id....
[ { "role": "user", "content": "List all trips that are currently 'Scheduled'." }, { "role": "assistant", "content": "SELECT * FROM transportation.trips WHERE status = 'Scheduled'" }, { "role": "user", "content": "For these scheduled trips, can you also include the route number and est...
You are an SQL statement expert. Given the table 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": "How many policy beneficiaries in the system have no contact information recorded?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM insurance.policy_beneficiaries WHERE contact_info IS NULL;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la...
[ { "role": "user", "content": "List all users who have created wallets in the last 30 days, showing their usernames and wallet addresses." }, { "role": "assistant", "content": "SELECT u.username, w.address FROM web3.users u JOIN web3.wallets w ON u.user_id = w.user_id WHERE w.created_at >= NOW() ...
You are an SQL statement expert. Given the table 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 each lawyer's first and last name along with the number of open cases they lead, ordered by the highest number of open cases first." }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, COUNT(c.case_id) AS open_case_count\nFROM legal_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 legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer first_n...
[ { "role": "user", "content": "Calculate the average price for services within each category." }, { "role": "assistant", "content": "SELECT category, AVG(price) FROM hospitality_technology.services GROUP BY category;" }, { "role": "user", "content": "Only include categories where the ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.text, description.text, category.text...
[ { "role": "user", "content": "List each vehicle's ID, make, and model along with the count of trips scheduled to depart in the next 7 days." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, COUNT(t.trip_id) AS trip_count\nFROM transportation.vehicles v\nJOIN transporta...
You are an SQL statement expert. Given the table 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": "Show all staff responses to public reviews, including the review_id, staff full name, and response_date." }, { "role": "assistant", "content": "SELECT r.review_id, s.first_name || ' ' || s.last_name AS staff_name, r.response_date\nFROM hospitality_technology.reviews...
You are an SQL statement expert. Given the table 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, property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Find tokens that appear in both the smart money token performance and the smart money token inflow tables. List the token symbol, chain, the PNL from the performance table, and the total USD value from all corresponding inflow records." }, { "role": "assistant", "co...
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": "Show me the total number of appointments grouped by status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS appointment_count\nFROM legal_services.appointments\nGROUP BY status;" }, { "role": "user", "content": "Focus only on st...
You are an SQL statement expert. Given the table 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": "Retrieve the first name, last name, and email address for all passengers who are part of the loyalty program." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM transportation.passengers WHERE loyalty_program_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 transportation.drivers ( driver_id character varying(64) NOT NULL, -- unique identifier for the driver employe...
[ { "role": "user", "content": "Show me the top 5 narratives by market cap, along with their top 3 coins and 24-hour trading volume." }, { "role": "assistant", "content": "SELECT narrative, top_3_coins, volume_24h FROM narrative_info ORDER BY market_cap DESC LIMIT 5;" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "List all claim IDs, policy IDs, and incident dates for claims reported after February 1st, 2024." }, { "role": "assistant", "content": "SELECT claim_id, policy_id, incident_date\nFROM insurance.claims\nWHERE reported_date > '2024-02-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 insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara...
[ { "role": "user", "content": "Show all achievements for games developed in Germany, including achievement names and their point values." }, { "role": "assistant", "content": "SELECT a.name AS achievement_name, a.points\nFROM gaming_technology.achievements a\nJOIN gaming_technology.games g ON a.g...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "For each security traded on the 'LSE', what is the total quantity traded and the average price_per_unit? Include the security_name and ticker_symbol." }, { "role": "assistant", "content": "SELECT s.security_name,\n s.ticker_symbol,\n SUM(t.quantity) AS t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba...
[ { "role": "user", "content": "Show me all wallet addresses that hold more than 100 of any ERC1155 token, along with the token ID and amount." }, { "role": "assistant", "content": "SELECT wallet_address, token_id, amount FROM erc20_balances WHERE CAST(amount AS decimal) > 100 AND contract_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Count the number of patients grouped by gender, showing gender and patient_count." }, { "role": "assistant", "content": "SELECT gender, COUNT(*) AS patient_count\nFROM healthcare.patients\nGROUP BY gender;" } ]
You are an SQL statement expert. Given the table 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 ...