conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List the names and symbols of all assets that are mentioned in the description of any DApp." }, { "role": "assistant", "content": "SELECT DISTINCT a.name, a.symbol\nFROM trading_platform.assets a\nJOIN trading_platform.dapps d ON d.description ILIKE '%' || a.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 trading_platform.assets ( asset_id character varying(64) NOT NULL, -- unique identifier for the asset name cha...
[ { "role": "user", "content": "List the names of agencies and their established dates, but only for agencies that offer at least one service." }, { "role": "assistant", "content": "SELECT DISTINCT T1.agency_name , T1.established_date FROM government_services.agencies AS T1 JOIN government_servic...
You are an SQL statement expert. Given the table 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 pairs of routes where one route’s origin matches another route’s destination. Show both route numbers." }, { "role": "assistant", "content": "SELECT r1.route_number AS route1, r2.route_number AS route2\nFROM transportation.routes r1\nJOIN transportation.routes ...
You are an SQL statement expert. Given the table 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": "Show me the review_id, review_date, and comment for all non-public reviews along with the guest's first and last name." }, { "role": "assistant", "content": "SELECT r.review_id, r.review_date, r.comment, g.first_name, g.last_name\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": "I need a list of active drivers with their names and contact details." }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, contact_number, email FROM transportation.drivers WHERE status = 'Active';" }, { "role": "user", "conten...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their latest round name and investment value." }, { "role": "assistant", "content": "SELECT project_name, rounds_name, investment_value, valuation FROM projec...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "Show customers who have made a premium payment greater than $1000." }, { "role": "assistant", "content": "SELECT DISTINCT T1.customer_id, T1.first_name, T1.last_name FROM insurance.customers AS T1 JOIN insurance.premium_payments AS T2 ON T1.customer_id = T2.customer...
You are an SQL statement expert. Given the table 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": "List pairs of documents uploaded by the same lawyer, showing uploader ID and both document names." }, { "role": "assistant", "content": "SELECT d1.uploaded_by_lawyer_id, d1.document_name AS doc1, d2.document_name AS doc2 FROM legal_services.documents d1 JOIN legal_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 legal_services.documents ( document_id character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "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": "Could you show me all scheduled appointments including appointment_id, scheduled_start_time, the citizen's full name, and the location name?" }, { "role": "assistant", "content": "SELECT a.appointment_id,\n a.scheduled_start_time,\n c.first_name || ' ' |...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "List the first and last names of citizens who have appointments scheduled with the employee whose employee_id is 'emp123'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 JOIN government_serv...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show me all fuel logs where the fuel type is diesel and the quantity is more than 50 liters, including the vehicle ID and trip ID." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, trip_id, quantity, fuel_type FROM transportation.fuel_logs 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.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_timestamp.timestamp, fuel_type.text, qu...
[ { "role": "user", "content": "How many UTXOs in total have been marked as spent?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM trading_platform.utxos WHERE spent = true;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.utxos ( utxo_id.text, transaction_id.text, output_index.integer, address.text, amount.numeric, spent.b...
[ { "role": "user", "content": "List all beneficiaries who have a null contact_info. Return beneficiary_id, first_name, last_name, policy_id." }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name, last_name, policy_id\nFROM insurance.policy_beneficiaries\nWHERE contact_info IS N...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la...
[ { "role": "user", "content": "List all tokens held by CEX addresses, showing the token symbol, name, current price, and the total USD value held by all CEXes for that token." }, { "role": "assistant", "content": "SELECT T1.token_symbol, T1.token_name, T1.price, SUM(T2.usd_value) AS total_cex_usd...
You are an SQL statement expert. Given the table 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 pairs of clients that share the same phone area code, including each client’s first name, last name, and phone number." }, { "role": "assistant", "content": "SELECT c1.first_name AS first_name_1,\n c1.last_name AS last_name_1,\n c1.phone ...
You are an SQL statement expert. Given the table 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 number of clients grouped by status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS client_count FROM legal_services.clients GROUP BY status;" }, { "role": "user", "content": "Can you exclude statuses with fewer than 10 cli...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "Find all medical records where the treatment plan includes 'physical therapy' and the patient has an active primary insurance plan, showing the patient ID, record date, and insurance provider details." }, { "role": "assistant", "content": "SELECT mr.patient_id, mr.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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "Get the total payment amount grouped by currency." }, { "role": "assistant", "content": "SELECT currency_code, SUM(amount) AS total_amount\nFROM hospitality_technology.payments\nGROUP BY currency_code;" }, { "role": "user", "content": "Now show only thos...
You are an SQL statement expert. Given the table 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": "How many open cases does each client have? Display the client ID, first name, last name, and the count." }, { "role": "assistant", "content": "SELECT T1.client_id, T1.first_name, T1.last_name, COUNT(T2.case_id) AS open_case_count FROM clients AS T1 JOIN cases AS T2 ...
You are an SQL statement expert. Given the table 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, first_name.text, last_name.text, company_name.text, email.text, phone.text, ad...
[ { "role": "user", "content": "I need to know the total USD value of all ERC-20 holdings by each wallet. Calculate the sum of (amount * price) using the latest token prices from token_prices_latest, grouped by wallet_address." }, { "role": "assistant", "content": "SELECT eb.wallet_address,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, amount.text, pk.text ) CREATE TABLE n...
[ { "role": "user", "content": "List user IDs of users who have private profiles and have liked any post or comment." }, { "role": "assistant", "content": "SELECT DISTINCT T1.user_id FROM social_media.user_settings AS T1 JOIN social_media.likes AS T2 ON T1.user_id = T2.user_id WHERE T1.private_pro...
You are an SQL statement expert. Given the table 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, user_id character varying(64) NOT NULL, post_id character ...
[ { "role": "user", "content": "Show me the usernames of users who have followed someone, but have not been followed by anyone. Include the time they started following others." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, f.created_at AS follow_created_at\nFROM social_media.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.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "List all invoices with a total_amount greater than 5000, and show the associated case name and client_id." }, { "role": "assistant", "content": "SELECT i.invoice_id, i.invoice_number, i.total_amount, i.client_id, c.case_name\nFROM legal_services.invoices i\nLEFT JOI...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, case_number character varying(100) UNIQUE, case_name tex...
[ { "role": "user", "content": "List all insurance products that have a base premium below 300." }, { "role": "assistant", "content": "SELECT product_id, product_name, base_premium FROM insurance.insurance_products WHERE base_premium < 300;" } ]
You are an SQL statement expert. Given the table 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": "List all guests who have a loyalty member ID, showing their full name (first and last name), email, and loyalty ID." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, loyalty_member_id FROM hospitality_technology.guests WHERE loyalty_member_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "List all posts along with the hashtag IDs applied to them and the usernames of the authors." }, { "role": "assistant", "content": "SELECT p.post_id, ph.hashtag_id, u.username\nFROM social_media.posts p\nJOIN social_media.post_hashtags ph ON p.post_id = ph.post_id\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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List the diagnosis_id, patient_id, and doctor_id for all diagnoses with status 'Pending' and is_chronic set to TRUE." }, { "role": "assistant", "content": "SELECT diagnosis_id, patient_id, doctor_id FROM healthcare.diagnoses WHERE status = 'Pending' AND is_chronic =...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty...
[ { "role": "user", "content": "How many NFTs are currently held for each contract address and token ID? Please show contract address, token id, and total amount held." }, { "role": "assistant", "content": "SELECT contract_address, token_id, SUM(CAST(amount AS BIGINT)) as total_held FROM nft_holde...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "List all trades (trade_id, security_id, quantity) where the settlement_date is within the last 30 days and the trade_type is 'Sell', along with the account_id and total_amount." }, { "role": "assistant", "content": "SELECT trade_id, security_id, quantity, account_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 financial_services.trades ( trade_id.text, account_id.text, security_id.text, order_id.text, trade_type.text, quantity....
[ { "role": "user", "content": "How many customers have the risk profile 'High' and live in New York state?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS high_risk_customers\nFROM financial_services.customers\nWHERE risk_profile = 'High' AND state = 'NY';" }, { "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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "How many users have disabled push notifications?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS disabled_push_count\nFROM social_media.user_settings\nWHERE push_notifications_enabled = false;" } ]
You are an SQL statement expert. Given the table 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 first name and last name of employees who have verified documents, along with the document type they verified and the verification status." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, d.document_type, d.verification_status FROM 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 government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "List each employee's first_name, last_name, and the number of documents they've verified. Include employees with zero verifications as well." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, COUNT(d.document_id) AS verified_count\nFROM governm...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id.text, agency_id.text, service_name.text, description.text, category.text, eli...
[ { "role": "user", "content": "List group conversation names and the number of messages sent in each conversation after January 1, 2023." }, { "role": "assistant", "content": "SELECT c.group_name, COUNT(m.message_id) FROM social_media.conversations c JOIN social_media.messages m ON c.conversation...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Show the total file size in bytes for all documents uploaded with a MIME type of 'application/pdf'." }, { "role": "assistant", "content": "SELECT SUM(file_size_bytes) FROM insurance.claim_documents WHERE mime_type = 'application/pdf'" } ]
You are an SQL statement expert. Given the table 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": "Please provide the passenger_id, first_name, last_name, booking_id, and booking_time for all bookings where seat_number is 'A1'." }, { "role": "assistant", "content": "SELECT p.passenger_id, p.first_name, p.last_name, b.booking_id, b.booking_time\nFROM transportatio...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Retrieve the vehicle_id, make, model, and the next_service_due_date for each vehicle based on the most recent maintenance log." }, { "role": "assistant", "content": "SELECT DISTINCT ON (ml.vehicle_id) v.vehicle_id, v.make, v.model, ml.next_service_due_date FROM tran...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "List all unique metadata keys in the system along with how many assets have each key." }, { "role": "assistant", "content": "SELECT key, COUNT(DISTINCT asset_id) as asset_count FROM trading_platform.metadata GROUP BY key;" }, { "role": "user", "content":...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.metadata ( metadata_id character varying(64) NOT NULL, -- unique identifier for the metadata ...
[ { "role": "user", "content": "Show me the top 5 projects by total investment value, along with their latest fundraising round name and valuation." }, { "role": "assistant", "content": "SELECT project_name, rounds_name, valuation, SUM(investment_value) AS total_investment_value FROM project_fundr...
You are an SQL statement expert. Given the table 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": "I want to find total PNL and average ROI of smart money token performance for each narrative category. Only include narratives with average ROI greater than 0.5." }, { "role": "assistant", "content": "SELECT bi.narrative,\n SUM(smtp.pnl) AS total_pnl,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "List the first name, last name, and license plate for drivers who have driven vehicles with a capacity greater than 75." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T3.license_plate FROM transportation.drivers AS T1 JOIN Trips AS T2 ON ...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ...
[ { "role": "user", "content": "How many UTXOs are associated with each transaction_id?" }, { "role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS utxo_count FROM trading_platform.utxos GROUP BY transaction_id;" }, { "role": "user", "content": "Can you also show the sum ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.utxos ( utxo_id character varying(64) NOT NULL, transaction_id character varying(64) NOT NULL, output_...
[ { "role": "user", "content": "Show me the average order price and total quantity traded for each asset, but only for completed orders in the last 30 days." }, { "role": "assistant", "content": "SELECT asset_id, AVG(price) AS avg_price, SUM(quantity) AS total_quantity FROM trading_platform.orders...
You are an SQL statement expert. Given the table 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.orders ( order_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, wallet_id ch...
[ { "role": "user", "content": "Show a list of all DApps together with the total number of unique assets linked to each via the metadata table." }, { "role": "assistant", "content": "SELECT d.dapp_id, d.name, d.url, COUNT(DISTINCT m.asset_id) AS unique_asset_count\nFROM trading_platform.dapps d\nL...
You are an SQL statement expert. Given the table 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.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan...
[ { "role": "user", "content": "List the trip ID, route number, vehicle ID, and the total fuel cost associated with each trip." }, { "role": "assistant", "content": "SELECT t.trip_id, r.route_number, t.vehicle_id, SUM(fl.total_cost) AS total_fuel_cost FROM transportation.trips t JOIN transportatio...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, route_number text, description text, origin_location_id text, destin...
[ { "role": "user", "content": "Show me all claims with estimated loss greater than $50,000 that were reported in the last 6 months, along with their policy IDs and customer IDs." }, { "role": "assistant", "content": "SELECT claim_id, policy_id, customer_id, estimated_loss, reported_date FROM insu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d...
[ { "role": "user", "content": "Show the total number of policies issued by each agent, along with the sum of premium amounts for those policies." }, { "role": "assistant", "content": "SELECT agent_id, COUNT(*) AS policy_count, SUM(premium_amount) AS total_premium FROM insurance.policies 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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d...
[ { "role": "user", "content": "Find all pairs of distinct appointments for the same case that overlap in time. Show both appointment IDs, the case_id, and the start_time and end_time of each appointment." }, { "role": "assistant", "content": "SELECT a1.appointment_id AS appointment_id_1,\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.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "content": "Show me the block ID, timestamp, and the timestamp of its previous block for blocks created between '2023-07-01' and '2023-09-30'." }, { "role": "assistant", "content": "SELECT b1.block_id, b1.timestamp, b2.timestamp AS previous_block_timestamp FROM blockchain.block...
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 blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp tim...
[ { "role": "user", "content": "List all ERC20 tokens where the price is greater than $100, including their names and symbols." }, { "role": "assistant", "content": "SELECT ti.name, ti.symbol FROM token_info ti JOIN token_prices tp ON ti.tick = tp.symbol WHERE tp.price > 100;" }, { "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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "Count the number of policies by their status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS policy_count\nFROM insurance.policies\nGROUP BY status;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "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 username and email of all users who own at least one wallet." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM blockchain.users AS T1 JOIN blockchain.wallets AS T2 ON T1.user_id = T2.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 blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text ) CREATE TABLE blockchain.users ( ...
[ { "role": "user", "content": "Which lawyers have uploaded at least two different types of documents? Show their first name, last name, and the count of unique document types." }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, COUNT(DISTINCT d.document_type) AS document_type...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "List the usernames and emails for users created in the last year." }, { "role": "assistant", "content": "SELECT username, email FROM web3.users WHERE created_at >= NOW() - INTERVAL '1 year';" }, { "role": "user", "content": "Filter this list to only incl...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.users ( user_id character varying(64) NOT NULL, username character varying(128)...
[ { "role": "user", "content": "List all maintenance logs for vehicles acquired in the year 2023. Include log ID, vehicle make, model, service date, and cost." }, { "role": "assistant", "content": "SELECT ml.log_id, v.make, v.model, ml.service_date, ml.cost FROM transportation.maintenance_logs 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List all bookings along with the booking time, fare, and the route number for the associated trip." }, { "role": "assistant", "content": "SELECT b.booking_id, b.booking_time, b.fare, r.route_number\nFROM transportation.bookings b\nJOIN transportation.fuel_logs f ON ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Show the number of staff members in each position and the average access level, grouping by position." }, { "role": "assistant", "content": "SELECT position,\n COUNT(*) AS staff_count,\n AVG(access_level) AS avg_access_level\nFROM hospitality_technology....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.staff ( staff_id text, property_id text, first_name text, last_name text, position text, work_em...
[ { "role": "user", "content": "Can you help me count the total number of active staff members in the database?" }, { "role": "assistant", "content": "db.staff.countDocuments({ is_active: true });" } ]
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 // db.createCollection('stations') // Optional: Add unique index: db.stations.createIndex({ stati...
[ { "role": "user", "content": "Retrieve the names of all properties that have listed room types, along with the name of each room type available at that property." }, { "role": "assistant", "content": "SELECT t1.property_name, t2.type_name FROM hospitality_technology.properties AS t1 INNER JOIN h...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Show me all user IDs who changed their profile settings after June 1, 2024." }, { "role": "assistant", "content": "SELECT user_id FROM social_media.user_settings WHERE updated_at > '2024-06-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 social_media.user_settings ( setting_id text PRIMARY KEY, user_id text, theme text, email_notifications_enabled bool, p...
[ { "role": "user", "content": "Show the total amount of tokens transferred for each token_id along with the number of transfers involving each token." }, { "role": "assistant", "content": "SELECT token_id, SUM(value) AS total_transferred, COUNT(*) AS transfer_count FROM web3.token_transfers GROUP...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.token_transfers ( transfer_id text, token_id text, from_address text, to_address text, value numeric, transaction_...
[ { "role": "user", "content": "I need to find all pairs of diagnoses for the same patient where one diagnosis is chronic and the other is non-chronic. Show patient_id, chronic diagnosis_id as chronic_id, non-chronic diagnosis_id as acute_id, chronic diagnosis_date, and acute diagnosis_date." }, { "ro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry ...
[ { "role": "user", "content": "List the full name of employees and the names of the agencies they work for, but only for employees who are currently employed." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, a.agency_name\nFROM government_ser...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "Show a list of diagnoses along with the chief complaint noted in the corresponding medical record. Display diagnosis description, diagnosis date, and the chief complaint." }, { "role": "assistant", "content": "SELECT T1.description, T1.diagnosis_date, T2.chief_compl...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ch...
[ { "role": "user", "content": "Show me the top 5 tokens by market cap on the Ethereum chain, along with their 24-hour trading volume and 7-day price change percentage." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, market_cap, total_volume, price_change_percentage_7d FROM...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character varying(100) NOT NULL, token_symbol ch...
[ { "role": "user", "content": "Show me all managers (agents who have other agents reporting to them) along with their full names and the count of agents they manage." }, { "role": "assistant", "content": "SELECT m.agent_id, m.first_name, m.last_name, COUNT(a.agent_id) AS team_size FROM insurance....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id text, first_name text, last_name text, agency_name text, license_number text, license_state...
[ { "role": "user", "content": "List all pairs of properties located in the same city, showing each pair's property IDs and names along with the city." }, { "role": "assistant", "content": "SELECT p1.property_id AS property_id_1,\n p1.property_name AS property_name_1,\n p2.property_id ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "List all routes along with the number of unique vehicles assigned to trips on each route." }, { "role": "assistant", "content": "SELECT r.route_id, r.route_number, COUNT(DISTINCT t.vehicle_id) AS unique_vehicles\nFROM transportation.routes r\nLEFT JOIN transportatio...
You are an SQL statement expert. Given the table 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": "Show me all maintenance logs that do not have a next service due date recorded. List the log ID, vehicle ID, and service date." }, { "role": "assistant", "content": "SELECT log_id, vehicle_id, service_date FROM transportation.maintenance_logs WHERE next_service_due_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id character varying(64) NOT NULL, ser...
[ { "role": "user", "content": "List users who have received notifications triggered by another user (non-system notifications). Show the recipient username, notification type, and the sender username." }, { "role": "assistant", "content": "SELECT T1.username AS recipient_username, T2.notification...
You are an SQL statement expert. Given the table 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": "Show me each wallet's address and the total number of trades where the wallet's user was the buyer, along with the symbol and name of the asset traded." }, { "role": "assistant", "content": "SELECT w.address, COUNT(t.trade_id) AS buyer_trade_count, o.asset_id\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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "List all available services in the 'Housekeeping' department that cost less than 20." }, { "role": "assistant", "content": "SELECT service_id, service_name, price\nFROM hospitality_technology.services\nWHERE department = 'Housekeeping' AND is_available = true AND pr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, room_type_id text, floor integer, stat...
[ { "role": "user", "content": "For Avalanche tokens, show me the token `tick`, `creator`, and `max_supply` from the `token_info_avalanche` table." }, { "role": "assistant", "content": "SELECT tick, creator, max_supply FROM token_info_avalanche" }, { "role": "user", "content": "Now, fo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "Show me the total USD value of tokens held by each centralized exchange on the 'Polygon' chain for the most recent snapshot time. List the exchange name and the total USD value." }, { "role": "assistant", "content": "WITH LatestSnapshot AS ( SELECT MAX(snapshot_time...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE project_fundraising_record (", "id character varying(32) NOT NULL, -- fundraising record id", "project_id ch...
[ { "role": "user", "content": "For each insurance product, can you list its product name, the number of unique agents who have sold policies for that product, and the total premium paid across those policies?" }, { "role": "assistant", "content": "SELECT ip.product_name, COUNT(DISTINCT a.agent_id...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Show all SUI coins that are marked as 'exists' in both sui_coins and sui_coins_metadata, displaying their coin_type, symbol, name, and balance." }, { "role": "assistant", "content": "SELECT sc.coin_type, scm.symbol, scm.name, sc.balance FROM sui_coins sc JOIN sui_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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "Find all pairs of contracts that were deployed on the same network. Show both contract IDs, the network ID, and the deployment timestamps for both contracts." }, { "role": "assistant", "content": "SELECT a.contract_id AS contract_id_1, b.contract_id AS contract_id_2...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Show me the top 5 users with the most wallets, along with their email domains." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, SUBSTRING(u.email FROM '@(.+)$') AS email_domain, COUNT(w.wallet_id) AS wallet_count FROM blockchain.users u JOIN bloc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id character varying(64) NOT NULL, -- unique identifier for the block previous_block...
[ { "role": "user", "content": "Show the service names that had documents uploaded for their applications in the calendar year 2023." }, { "role": "assistant", "content": "SELECT DISTINCT T1.service_name FROM government_services.services AS T1 JOIN applications AS T2 ON T1.service_id = T2.service_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego...
[ { "role": "user", "content": "Find all doctors who were created in the last 3 months and have both an email address and phone number listed, showing their full names and contact details." }, { "role": "assistant", "content": "SELECT first_name, last_name, phone_number, email FROM healthcare.doct...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the doctor first_name ...
[ { "role": "user", "content": "Show pairs of customers who live in the same state but different cities. Include their IDs, full names, and state." }, { "role": "assistant", "content": "SELECT a.customer_id AS customer_a_id, a.first_name AS customer_a_first_name, a.last_name AS customer_a_last_nam...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "How many messages did user 'U456' send between '2024-01-01' and '2024-01-31'?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS message_count\nFROM social_media.messages\nWHERE sender_user_id = 'U456'\n AND sent_at BETWEEN '2024-01-01' AND '2024-01-31';" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "I want to find all pairs of wallets that belong to the same user." }, { "role": "assistant", "content": "SELECT w1.wallet_id AS wallet1, w2.wallet_id AS wallet2, w1.user_id\nFROM blockchain.wallets w1\nJOIN blockchain.wallets w2\n ON w1.user_id = w2.user_id\n AND ...
You are an SQL statement expert. Given the table 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.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address_id chara...
[ { "role": "user", "content": "Find, for each case, pairs of documents where one document_type is 'Contract' and the other is 'Evidence'. Return the case_id, the name of the contract document as contract_name, and the name of the evidence document as evidence_name." }, { "role": "assistant", "con...
You are an SQL statement expert. Given the table 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": "How many insurance policies does each patient have? Return patient_id and policy_count." }, { "role": "assistant", "content": "SELECT patient_id,\n COUNT(*) AS policy_count\nFROM healthcare.patient_insurance\nGROUP BY patient_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 healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "Find pairs of reservations for the same guest at the same property where the check-in date of the second reservation is the same as the check-out date of the first reservation. List guest ID, property ID, and both reservation IDs." }, { "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 hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_id.text, room_id.text, room_type_id....
[ { "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 character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "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": "I need to find pairs of players from the same country but with different statuses. Show their usernames, country code, and status for both players in the pair." }, { "role": "assistant", "content": "SELECT p1.username AS player1_username, p2.username AS player2_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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "List maintenance logs including vehicle make, model, service_date, cost, and next_service_due_date for vehicles that are currently 'Active'." }, { "role": "assistant", "content": "SELECT ml.log_id,\n v.make,\n v.model,\n ml.service_date,\n ml...
You are an SQL statement expert. Given the table 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 reviews have been submitted for each review_source?" }, { "role": "assistant", "content": "SELECT review_source, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY review_source;" }, { "role": "user", "content": "Now, show o...
You are an SQL statement expert. Given the table 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": "List the tokens on the BSC chain that have a positive price change in the last 24 hours and a market cap over $10,000,000. Show the symbol, price, and market cap." }, { "role": "assistant", "content": "SELECT token_symbol, price, market_cap\nFROM token_basic_info\nW...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "List all premium payments made by customer 'CUST001' in the year 2024. Show payment ID, policy ID, amount paid, and payment date." }, { "role": "assistant", "content": "SELECT payment_id, policy_id, amount_paid, payment_date FROM insurance.premium_payments WHERE cus...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, -- unique identifier for the payment po...
[ { "role": "user", "content": "List the first name, last name, and agency name for all agents whose status is 'active'." }, { "role": "assistant", "content": "SELECT first_name, last_name, agency_name FROM insurance.agents WHERE status = 'active';" }, { "role": "user", "content": "Cou...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state...
[ { "role": "user", "content": "Show me all transactions (transaction_id, amount, transaction_type) where the amount is greater than $5,000 and the status is 'Completed', along with the account_id and transaction_date, sorted by transaction_date in descending order." }, { "role": "assistant", "con...
You are an SQL statement expert. Given the table 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.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,...
[ { "role": "user", "content": "List the name and location ID for all locations where the postal code is missing." }, { "role": "assistant", "content": "SELECT name, location_id FROM transportation.locations WHERE postal_code IS NULL;" }, { "role": "user", "content": "Also include 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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "Find all projects that increased their investment in a later round compared to an earlier one. List project_id, project_name, earlier round, earlier investment, later round, and later investment." }, { "role": "assistant", "content": "SELECT p2.project_id,\n 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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "Show me the top 5 NFT collections with the highest number of unique owners, along with their names and contract addresses." }, { "role": "assistant", "content": "SELECT nc.name, nc.contract_address, COUNT(DISTINCT nh.wallet_address) AS unique_owners FROM nft_collect...
You are an SQL statement expert. Given the table 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_...