Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
276
7.45k
[ { "role": "user", "content": "Which narrative and chain combination saw the highest total USD buy value in the first half of 2023? Also list the total token amount bought for each." }, { "role": "assistant", "content": "SELECT narrative, chain, SUM(usd_value) AS total_usd_bought, SUM(token_amoun...
You are an SQL statement expert. Given the table 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_symbol character...
[ { "role": "user", "content": "Find the average percentage share among all beneficiaries for each distinct relationship type." }, { "role": "assistant", "content": "SELECT relationship, AVG(percentage_share) FROM insurance.policy_beneficiaries GROUP BY relationship ORDER BY relationship;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Can you narrow this down to only show cases where the case type is 'Criminal'?" }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Crimin...
You are an SQL statement expert. Given the table 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 all invoices that were paid within 7 days of their issue date. Show invoice number, issue date, payment date, and total amount." }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, payment_date, total_amount FROM legal_services.invoices WHE...
You are an SQL statement expert. Given the table 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.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "Count the number of registered citizens by gender." }, { "role": "assistant", "content": "SELECT\n gender,\n COUNT(*) AS citizen_count\nFROM government_services.citizens\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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "For each prescription, find the next prescription for the same patient. Return current prescription_id, next_prescription_id, patient_id, and days between start dates." }, { "role": "assistant", "content": "SELECT p1.patient_id,\n p1.prescription_id AS current...
You are an SQL statement expert. Given the table 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.prescriptions ( prescription_id.text, record_id.text, patient_id.text, doctor_id.text, medication_id.text, d...
[ { "role": "user", "content": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count." }, { "role": "assistant", "content": "SELECT g.genre, COUNT(gs.session_id) AS session_count, COUNT(DISTIN...
You are an SQL statement expert. Given the table 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": "Show the count of unread notifications per user for notifications related to posts. Return recipient_user_id and unread_count." }, { "role": "assistant", "content": "SELECT recipient_user_id, COUNT(*) AS unread_count\nFROM social_media.notifications\nWHERE target_en...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u...
[ { "role": "user", "content": "Find all wallets that have deployed contracts on both 'ethereum' and 'polygon' networks, showing the wallet address and the count of contracts deployed on each network." }, { "role": "assistant", "content": "SELECT w.address, SUM(CASE WHEN c.network_id = 'ethereum' ...
You are an SQL statement expert. Given the table 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": "Show me all time entries, including the case name they are associated with." }, { "role": "assistant", "content": "SELECT T1.*, T2.case_name FROM time_entries AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id" }, { "role": "user", "content": "Only show 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 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": "What is the average ROI for smart money addresses on the Ethereum chain?" }, { "role": "assistant", "content": "SELECT AVG(roi) FROM smart_money_token_performance WHERE chain = 'Ethereum';" } ]
You are an SQL statement expert. Given the table 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": "What is the average number of days by which paid invoices were paid late? Calculate the average of (payment_date - due_date) for invoices with status 'Paid'." }, { "role": "assistant", "content": "SELECT AVG((payment_date::date - due_date)) AS average_late_days\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 legal_services.invoices ( invoice_id character varying(64) NOT NULL, invoice_number character varying(100) UNIQUE NOT N...
[ { "role": "user", "content": "List all users who have bought assets, along with their wallet addresses." }, { "role": "assistant", "content": "SELECT DISTINCT T1.user_id, T1.address FROM wallets AS T1 JOIN trades AS T2 ON T1.user_id = T2.buyer_id;" }, { "role": "user", "content": "Fi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Show smart money addresses with an ROI greater than 3 and a realized ratio greater than 0.7. Display the address, chain, ROI, realized ratio, and most profitable token." }, { "role": "assistant", "content": "SELECT address, chain, roi, realized_ratio, most_profit_to...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "How many distinct users have sent messages in each conversation? Return conversation_id and user_count." }, { "role": "assistant", "content": "SELECT conversation_id,\n COUNT(DISTINCT sender_user_id) AS user_count\nFROM social_media.messages\nGROUP BY conversa...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, content text, medi...
[ { "role": "user", "content": "For each address, show the total amount contained in UTXOs that have been spent." }, { "role": "assistant", "content": "SELECT address, SUM(amount) FROM utxos WHERE spent = TRUE GROUP BY address;" }, { "role": "user", "content": "Only include addresses 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.utxos ( utxo_id character varying(64) NOT NULL, -- unique identifier for the UTXO transaction...
[ { "role": "user", "content": "Find pairs of BUY and SELL trades from the trades table for the same account that occurred on the same settlement_date and had matching quantities." }, { "role": "assistant", "content": "SELECT\n a.trade_id AS buy_trade_id,\n b.trade_id AS sell_trade_id,\n a.acco...
You are an SQL statement expert. Given the table 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.trades ( trade_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL, securit...
[ { "role": "user", "content": "Find the contract address and name for all NFT collections listed on the 'Ethereum' blockchain." }, { "role": "assistant", "content": "SELECT contract_address, name FROM nft_collections WHERE blockchain = 'Ethereum'" }, { "role": "user", "content": "For ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "For each employee who has verified more than one document, list their employee ID, the first document they verified, and the next document they verified, along with both verification timestamps." }, { "role": "assistant", "content": "SELECT\n d1.verified_by_employe...
You are an SQL statement expert. Given the table 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.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "Retrieve all beneficiaries with their policy numbers, including beneficiary first and last name, relationship, and the policy end date." }, { "role": "assistant", "content": "SELECT pb.beneficiary_id, pb.first_name, pb.last_name, pb.relationship, p.policy_number, 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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "List tokens with trend rank 5 or better and a price below $1. Show symbol, price, and trend rank." }, { "role": "assistant", "content": "SELECT token_symbol, price, trend_rank FROM token_dexpool_info WHERE trend_rank IS NOT NULL AND trend_rank <= 5 AND price < 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 token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "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": "For each group chat, can you show me each participant's username and the date they joined the chat?" }, { "role": "assistant", "content": "SELECT u.username, c.group_name, cp.joined_at\nFROM social_media.conversation_participants cp\nJOIN social_media.users u ON cp....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "List the names of citizens who have submitted applications for services with a standard fee greater than 50." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 JOIN government_services.applicati...
You are an SQL statement expert. Given the table 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": "For each vehicle, list its vehicle_id, license_plate, and any older vehicle of the same type (showing older_vehicle_id and older year)." }, { "role": "assistant", "content": "SELECT cur.vehicle_id,\n cur.license_plate,\n old.vehicle_id AS older_vehicle_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List all patients who have a medical record with a chief complaint containing the word 'headache'. Show patient ID, first name, last name, and date of birth." }, { "role": "assistant", "content": "SELECT DISTINCT\n p.patient_id,\n p.first_name,\n p.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": "Provide a count of notifications, separated by whether they have been read or not." }, { "role": "assistant", "content": "SELECT CASE WHEN T1.read_at IS NULL THEN 'Unread' ELSE 'Read' END, count(T1.notification_id) FROM trading_platform.notifications AS T1 GROUP BY ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id.text, user_id.text, message.text, sent_at.timestamp, read_at.timestamp...
[ { "role": "user", "content": "How many trips are there for each driver?" }, { "role": "assistant", "content": "SELECT driver_id, COUNT(*) AS trip_count FROM transportation.trips GROUP BY driver_id;" }, { "role": "user", "content": "Can you also show the total number of completed 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.trips ( trip_id character varying(64) NOT NULL, -- unique identifier for a specific trip instance ...
[ { "role": "user", "content": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens where the price is greater than $0.10." }, { "role": "assistant", "content": "SELECT tm.name, tm.contract_address, tm.total_supply FR...
You are an SQL statement expert. Given the table 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": "For all NFT collections on the Ethereum blockchain, show me the collection name and the current floor price. Sort by floor price descending." }, { "role": "assistant", "content": "SELECT name, floor_price FROM nft_collections WHERE blockchain = 'Ethereum' ORDER BY C...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "List all pairs of locations that are in the same city. Include their names and the city they are in." }, { "role": "assistant", "content": "SELECT\n l1.name AS location1_name,\n l2.name AS location2_name,\n l1.city\nFROM transportation.locations AS l1\nJOIN trans...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id.text, name.text, type.text, address_line1.text, city.text, state_province.text, ...
[ { "role": "user", "content": "Show each user and the count of users who registered before them." }, { "role": "assistant", "content": "SELECT u.username,\n COUNT(prev.user_id) AS earlier_count\nFROM trading_platform.users u\nLEFT JOIN trading_platform.users prev\n ON prev.created_at < u.c...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT name, symbol, address FROM token_prices_latest WHERE price BETWEEN 1 AND 10 AND blockchain = 'ethereum'...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "List each wallet that has received tokens of more than one distinct token type. Show wallet_id, address, the number of distinct tokens received as distinct_token_count, and the total received value, ordered by total_received_value descending." }, { "role": "assistant", ...
You are an SQL statement expert. Given the table 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 all pairs of distinct routes that share the same origin location ID. List the route IDs and route numbers for both routes in each pair, along with the shared origin location ID." }, { "role": "assistant", "content": "SELECT r1.route_id AS route1_id, r1.route_nu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_location_id.text, destination_locati...
[ { "role": "user", "content": "For each player, count the total number of achievements they've unlocked." }, { "role": "assistant", "content": "SELECT player_id,\n COUNT(*) AS total_achievements\nFROM gaming_technology.player_achievements\nGROUP BY player_id;" }, { "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.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique id...
[ { "role": "user", "content": "How many documents were uploaded in the year 2023?" }, { "role": "assistant", "content": "SELECT count(*) FROM government_services.documents WHERE date_part('year', upload_timestamp) = 2023;" } ]
You are an SQL statement expert. Given the table 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.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "List all ERC20 tokens with their names and symbols where the price is greater than $100, sorted by price in descending order." }, { "role": "assistant", "content": "SELECT scm.name, scm.symbol, tpl.price FROM sui_coins_metadata scm JOIN token_prices_latest tpl ON sc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE nft_holder_historical ( block_number.bigint, contract_address.text, wallet_address.text, token_id.text, contract_type.t...
[ { "role": "user", "content": "Which NFTs minted in the past 14 days on Ethereum have a rarity_score above 70? For each, show contract address, token ID, name, and minter." }, { "role": "assistant", "content": "SELECT contract_address, token_id, name, minter\nFROM nft_metadata\nWHERE blockchain =...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE nft_holders ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wallet_address varchar NOT NULL, token_i...
[ { "role": "user", "content": "Show all rooms that are on floor 3." }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number FROM hospitality_technology.rooms WHERE floor = 3;" }, { "role": "user", "content": "For these rooms, include the property name and room n...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show me the wallet addresses holding the ERC20 token with contract address '0xabcdeffedcba9876543210abcdefedcba9876'. Include the amount they hold." }, { "role": "assistant", "content": "SELECT wallet_address, amount FROM erc20_balances WHERE contract_address = '0xa...
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": "Count the number of law firms founded in each decade. Show the decade (e.g., 1990s, 2000s) and the count." }, { "role": "assistant", "content": "SELECT CONCAT(FLOOR(EXTRACT(YEAR FROM founded_date) / 10) * 10, 's') AS decade, COUNT(*) AS firm_count FROM law_firms WHE...
You are an SQL statement expert. Given the table 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": "Show me each patient's full name along with the name of every doctor they've had an appointment with." }, { "role": "assistant", "content": "SELECT p.first_name || ' ' || p.last_name AS patient_full_name, d.first_name || ' ' || d.last_name AS doctor_full_name\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 healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "Show me each product_type along with the count of products for that type, but only include types where the average base_premium exceeds 500. Order the results by the product count in descending order." }, { "role": "assistant", "content": "SELECT product_type,\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.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "List all accounts for customers who have at least one account with a balance over 10000 and another account with a balance under 1000. Show customer_id, account_id, account_type, balance, and currency." }, { "role": "assistant", "content": "SELECT account_id , cust...
You are an SQL statement expert. Given the table 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": "How many hashtags have been created in March 2024?" }, { "role": "assistant", "content": "```sql\nSELECT COUNT(*) AS march_2024_hashtag_count\nFROM social_media.hashtags\nWHERE created_at >= '2024-03-01'\n AND created_at < '2024-04-01';\n```" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "For each guest, calculate their total spending on delivered service orders and the total number of those orders." }, { "role": "assistant", "content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n SUM(so.total_price) AS total_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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te...
[ { "role": "user", "content": "List all users and the total quantity of orders they have placed for 'buy' orders." }, { "role": "assistant", "content": "SELECT t1.username, SUM(t2.quantity) FROM trading_platform.users AS t1 JOIN trading_platform.orders AS t2 ON t1.user_id = t2.user_id WHERE t2.or...
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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text...
[ { "role": "user", "content": "For projects that have completed more than one fundraising round, calculate the average investment value across all their recorded rounds. Display the project name and this average value." }, { "role": "assistant", "content": "SELECT project_name, AVG(investment_val...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "Show me all SUI coins with a balance greater than 1000, including their symbol and name." }, { "role": "assistant", "content": "SELECT sc.object_id, sc.coin_type, sc.balance, scm.symbol, scm.name FROM sui_coins sc JOIN sui_coins_metadata scm ON sc.coin_type = scm.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 erc20_balances ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar ) CR...
[ { "role": "user", "content": "Give a list of all policies where the deductible is less than 1000. Show policy_id, policy_number, start_date, and deductible." }, { "role": "assistant", "content": "SELECT policy_id, policy_number, start_date, deductible\nFROM insurance.policies\nWHERE deductible <...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "For all chains, which token held by centralized exchanges (CEX) has the highest ROI according to smart money token performance? Show token symbol, chain, exchange, total USD value held on CEX, and the smart money ROI." }, { "role": "assistant", "content": "SELECT c....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "For each property, show the most expensive room type by base_rate, including the property name, room type name, and the highest base_rate." }, { "role": "assistant", "content": "SELECT p.property_name,\n rt.type_name,\n MAX(rt.base_rate) AS max_base_rate...
You are an SQL statement expert. Given the table 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 wallets holding the NFT with contract_address '0xabc123' and token_id '100' and the amount held." }, { "role": "assistant", "content": "SELECT wallet_address, amount\nFROM nft_holders\nWHERE contract_address = '0xabc123'\n AND token_id = '100';" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ...
[ { "role": "user", "content": "Retrieve each agency’s name along with the count of accessible service locations it has in California." }, { "role": "assistant", "content": "SELECT\n a.agency_name,\n COUNT(l.location_id) AS accessible_location_count\nFROM government_services.agencies a\nJOIN 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.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "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.text, volume_24h.numeric, price_change_percentage_7d.numeric FROM narrative_info ORDER BY 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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume...
[ { "role": "user", "content": "Show a list of all trips along with the first and last names of all passengers who have booked on those trips. Each result should have the trip_id, passenger first name and last name." }, { "role": "assistant", "content": "SELECT t.trip_id, p.first_name, p.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 transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti...
[ { "role": "user", "content": "For each chain, find the token with the highest net USD inflow (buys minus sells). Show token_symbol, chain, and net_inflow." }, { "role": "assistant", "content": "WITH inflow AS (\n SELECT token_symbol, chain, SUM(usd_value) AS usd_in\n FROM smart_money_token_inf...
You are an SQL statement expert. Given the table 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.text, token_symbol.text, token_amount.numeric, usd_value.numeric, avg_price.nu...
[ { "role": "user", "content": "List all medical records, showing the record ID, record date, and the full name of the doctor who created the record. Include the patient ID as well." }, { "role": "assistant", "content": "SELECT mr.record_id, mr.record_date, mr.patient_id, d.first_name, d.last_name...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "role": "user", "content": "What is the average ROI for smart money addresses on the Ethereum chain with a realized ratio above 70%?" }, { "role": "assistant", "content": "SELECT AVG(roi) FROM smart_money_profit WHERE chain = 'Ethereum' AND realized_ratio > 70;" } ]
You are an SQL statement expert. Given the table 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": "Show me all business center services (category = 'Business Center') along with their property IDs and descriptions, where the service is available." }, { "role": "assistant", "content": "SELECT service_name, property_id, description FROM hospitality_technology.servi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "role": "user", "content": "Which vehicles have a total maintenance cost exceeding 10000 across all their maintenance logs?" }, { "role": "assistant", "content": "SELECT vehicle_id, SUM(cost) AS total_maintenance_cost FROM transportation.maintenance_logs GROUP BY vehicle_id HAVING SUM(cost) > ...
You are an SQL statement expert. Given the table 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": "Which exchanges on the Ethereum chain hold the highest total USD value of tokens, and what are their top 3 tokens by USD value?" }, { "role": "assistant", "content": "SELECT exchange, token_symbol, usd_value FROM cex_token_balance WHERE chain = 'Ethereum' ORDER BY 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 cex_token_balance ( snapshot_time.text, chain.text, address.text, exchange.text, token_address.text, token_symbol.text,...
[ { "role": "user", "content": "Show me all properties in California with a star rating above 3.5, along with their room types and base rates." }, { "role": "assistant", "content": "SELECT p.property_name, p.city, p.star_rating, rt.type_name, rt.base_rate FROM hospitality_technology.properties p J...
You are an SQL statement expert. Given the table 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 ...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
4