system stringlengths 333 7.66k | conversations listlengths 2 8 |
|---|---|
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 gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"role": "user",
"content": "Retrieve the top 5 players by the number of distinct achievements unlocked. Show player_id and distinct_unlocks."
},
{
"role": "assistant",
"content": "SELECT p.player_id, COUNT(DISTINCT pa.achievement_id) AS distinct_unlocks\nFROM gaming_technology.players p\nJOIN ... |
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 social_media.likes (
like_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "How many notifications have been marked as read so far?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS read_notifications_count\nFROM social_media.notifications\nWHERE read_at IS NOT NULL;"
}
] |
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.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "Show the distribution of total supply for tokens, grouped into ranges like < 1 million, 1 million to 1 billion, and > 1 billion. Count how many tokens fall into each range."
},
{
"role": "assistant",
"content": "SELECT CASE WHEN total_supply < 1000000 THEN '< 1 mill... |
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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"role": "user",
"content": "How many available services are there per department for each property? Include property_id, department, and the service count."
},
{
"role": "assistant",
"content": "SELECT\n property_id,\n department,\n COUNT(*) AS available_services_count\nFROM hospitality_tec... |
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 legal_services.time_entries ( entry_id text, case_id text, lawyer_id text, date_work... | [
{
"role": "user",
"content": "List all invoices with a total_amount less than 1000 and show the associated client's ID and case ID."
},
{
"role": "assistant",
"content": "SELECT invoice_id, client_id, case_id, total_amount\nFROM legal_services.invoices\nWHERE total_amount < 1000;"
},
{
"... |
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 hospitality_technology.services ( service_id text, property_id text, service_name te... | [
{
"role": "user",
"content": "List all food and beverage services (category = 'Food & Beverage') with their names, prices, and units, where the price is less than $20."
},
{
"role": "assistant",
"content": "SELECT service_name, price, unit FROM hospitality_technology.services WHERE category = 'F... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "I need to find the average maintenance cost per service type."
},
{
"role": "assistant",
"content": "SELECT service_type, AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nGROUP BY service_type;"
},
{
"role": "user",
"content": "Can you filter... |
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.notifications ( notification_id text, user_id text, message text, s... | [
{
"role": "user",
"content": "Show me all notifications sent in the last 7 days, including the user ID and message."
},
{
"role": "assistant",
"content": "SELECT user_id, message, sent_at FROM trading_platform.notifications WHERE sent_at >= NOW() - INTERVAL '7 days';"
},
{
"role": "user"... |
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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"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 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 government_services.services ( service_id text, agency_id text, service_name text, d... | [
{
"role": "user",
"content": "Which services charge more than the average standard fee of their category? Show the service name, its fee, and the average fee for that category."
},
{
"role": "assistant",
"content": "SELECT\n s.service_name,\n s.standard_fee,\n avg_fees.avg_fee\nFROM governmen... |
You are an 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.transactions ( transaction_id text, from_address text, to_address text, value n... | [
{
"role": "user",
"content": "For each transaction, find the next transaction initiated by the same sender. List the original transaction_id, the next transaction_id, the sender address, and the time difference in hours between them."
},
{
"role": "assistant",
"content": "SELECT t1.transaction_i... |
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 character varying(100) NOT NULL, -- the id of th... | [
{
"role": "user",
"content": "Which is the token with the largest difference between its highest and lowest price in the last 24h on each chain, and what is the token's symbol and current price?"
},
{
"role": "assistant",
"content": "SELECT chain, token_symbol, price, (highest_price_24h - lowest... |
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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "For each customer, find pairs of policies where one policy’s premium is at least $5000 higher than the other. Show customer_id, lower_premium_policy_id, higher_premium_policy_id, and the premium_difference."
},
{
"role": "assistant",
"content": "SELECT p1.customer_i... |
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 gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "Could you list the title of each game and the total quantity of items acquired by players for that specific game?"
},
{
"role": "assistant",
"content": "SELECT g.title, SUM(pi.quantity) AS total_acquired_quantity FROM gaming_technology.games g JOIN gaming_technology... |
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 financial_services.securities ( security_id.text, ticker_symbol.text, isin_code.text... | [
{
"role": "user",
"content": "List pairs of securities from the same issuer where one security was updated within the last 30 days, and the other was updated more than 90 days ago. Show issuer name, ticker symbols, and last_updated timestamps for both."
},
{
"role": "assistant",
"content": "SELE... |
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 government_services.service_locations ( location_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List the number of appointments for each booking method."
},
{
"role": "assistant",
"content": "SELECT\n a.booking_method,\n COUNT(*) AS appointment_count\nFROM appointments a\nGROUP BY a.booking_method;"
},
{
"role": "user",
"content": "Filter this to... |
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 government_services.service_locations ( location_id text, agency_id text, location_n... | [
{
"role": "user",
"content": "Find the service locations that are not accessible and located in the state of 'California'. List their name, address, and city."
},
{
"role": "assistant",
"content": "SELECT location_name , address , city FROM government_services.service_locations WHERE is_access... |
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 government_services.services ( service_id character varying(64) NOT NULL, agency_id ... | [
{
"role": "user",
"content": "List all services with an average processing time greater than the overall average processing time for all services. Show the service name, average processing time, and the overall average processing time."
},
{
"role": "assistant",
"content": "SELECT service_name, ... |
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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex... | [
{
"role": "user",
"content": "List policy IDs and policy numbers for policies that have a null cancellation reason."
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number FROM insurance.policies WHERE cancellation_reason IS NULL;"
}
] |
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_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp... | [
{
"role": "user",
"content": "Compute the average realized_ratio and average pnl for smart money token performance grouped by chain."
},
{
"role": "assistant",
"content": "SELECT chain, AVG(realized_ratio) AS avg_realized_ratio, AVG(pnl) AS avg_pnl\nFROM smart_money_token_performance\nGROUP BY c... |
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 smart_money_profit ( address.text, rank.numeric, profit.numeric, roi.numeric, realiz... | [
{
"role": "user",
"content": "How many addresses have a realized_ratio below 0.5?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS address_count FROM smart_money_profit WHERE realized_ratio < 0.5;"
}
] |
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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all documents uploaded for cases handled in the 'District Court' jurisdiction, showing the document name, case number, and upload timestamp."
},
{
"role": "assistant",
"content": "SELECT d.document_name, cs.case_number, d.upload_timestamp\nFROM legal_services.d... |
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.token_transfers (
transfer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all token transfers with a value greater than 1000000. Show transfer ID, token ID, from address, to address, and value."
},
{
"role": "assistant",
"content": "SELECT\n transfer_id,\n token_id,\n from_address,\n to_address,\n value\nFROM web3.token_transfer... |
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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "Find all pairs of drivers who share the same status. Include both driver_ids, full names, and the shared status."
},
{
"role": "assistant",
"content": "SELECT d1.driver_id AS driver1_id, d1.first_name || ' ' || d1.last_name AS driver1_name, d2.driver_id AS driver2_i... |
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 character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "For each narrative in smart_money_token_inflow, calculate the total usd_value and avg_price from buy transactions (type=1) and include the narrative's token count from narrative_info. Show narrative, chain, total_usd_value, avg_price, and token_num, ordered by total_usd_value d... |
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 healthcare.prescriptions ( prescription_id.text, record_id.text, patient_id.text, do... | [
{
"role": "user",
"content": "Find pairs of prescriptions for the same patient with overlapping periods. Show p1.prescription_id, p2.prescription_id, patient_id, and the overlap duration in days where the overlap is greater than 15 days."
},
{
"role": "assistant",
"content": "SELECT p1.prescript... |
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 insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "List policy pairs for the same customer where one policy was cancelled and another active policy started within 30 days after the cancellation. Show customer_id, cancelled policy_number, cancellation_date, active policy_number, start_date."
},
{
"role": "assistant",
... |
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.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a... | [
{
"role": "user",
"content": "For each contract, list the contract address, the number of different tokens deployed on that address, and the sum of total_supply of those tokens."
},
{
"role": "assistant",
"content": "SELECT c.address AS contract_address, COUNT(DISTINCT t.token_id) AS token_count... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List the contact phone and website for all insurance plans provided by 'Continental Health'."
},
{
"role": "assistant",
"content": "SELECT plan_name, contact_phone, website\nFROM healthcare.insurance_plans\nWHERE insurance_provider = 'Continental Health';"
}
] |
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 financial_services.accounts (
account_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Can you provide a breakdown of total and average account balance by account_type and currency for each account status?"
},
{
"role": "assistant",
"content": "SELECT account_type, currency, status, COUNT(*) AS total_accounts, SUM(balance) AS total_balance, AVG(balanc... |
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 financial_services.transactions ( transaction_id character varying(64) NOT NULL, acc... | [
{
"role": "user",
"content": "Show me all transactions with a status of 'FAILED' that occurred within the last 7 days."
},
{
"role": "assistant",
"content": "SELECT * FROM financial_services.transactions WHERE status = 'FAILED' AND transaction_date >= NOW() - INTERVAL '7 day';"
},
{
"rol... |
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 healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "Can you show me the count of new doctors added each month in 2023? Return the month and number of doctors."
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', created_at) AS month, COUNT(*) AS doctor_count\nFROM healthcare.doctors\nWHERE created_at >= ... |
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": "For each user, find the previous user by registration time. List current user_id and username, previous user_id and username, and the time difference in minutes between their registrations."
},
{
"role": "assistant",
"content": "SELECT u.user_id AS current_user_id,\... |
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 character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "For each narrative, what is the average smart money ROI and the total 24-hour trading volume of the narrative?"
},
{
"role": "assistant",
"content": "SELECT T3.narrative, T4.avg_roi, T3.volume_24h FROM narrative_info AS T3 JOIN ( SELECT T2.narrative, AVG(T1.roi) as ... |
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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "List customers who have more than one policy. Show the customer ID and the count of policies."
},
{
"role": "assistant",
"content": "SELECT customer_id, COUNT(*) AS policy_count FROM insurance.policies GROUP BY customer_id HAVING COUNT(*) > 1;"
},
{
"role": ... |
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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_nam... | [
{
"role": "user",
"content": "List all future reservations (where check_in_date > current_date) including guest full name, room_id, property_id, and the number of days until check-in."
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, r.property_id, r.room_id, \n g.first_name ... |
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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "Find pairs of drivers where the first driver was hired after the second driver, but the first driver's license expires before the second driver's. Show driver IDs, hire dates, and license expiry dates for both drivers in each pair."
},
{
"role": "assistant",
"conten... |
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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"role": "user",
"content": "List token symbols on any chain that have both a realized ratio above 0.8 and an ROI greater than 5. Show their symbol, chain, realized ratio, and ROI."
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain, realized_ratio, roi FROM smart_money_token_perf... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "I need a list of all routes and the number of trips made on each route."
},
{
"role": "assistant",
"content": "SELECT route_id, COUNT(*) AS trip_count\nFROM transportation.trips\nGROUP BY route_id;"
},
{
"role": "user",
"content": "Actually, show the rou... |
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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Find all invoices that are currently overdue. Include the invoice number, due date, total amount, and the client's name."
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, i.due_date, i.total_amount, c.first_name, c.last_name FROM legal_services.invoice... |
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 smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "For each chain, show the total number of smart money addresses and the count of addresses with positive profit."
},
{
"role": "assistant",
"content": "SELECT chain, COUNT(address) AS total_addresses, COUNT(CASE WHEN profit > 0 THEN address END) AS positive_profit_ad... |
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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Show me all vehicles that had maintenance in the past month, including their make, model, maintenance service_date, and depot name."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id,\n v.make,\n v.model,\n m.service_date,\n l.name AS... |
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 social_media.user_settings ( setting_id text, user_id text, theme text, email_notifi... | [
{
"role": "user",
"content": "Show the user IDs of all users whose theme is set to 'blue'."
},
{
"role": "assistant",
"content": "SELECT user_id FROM social_media.user_settings WHERE theme = 'blue';"
}
] |
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 smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "Show the tokens with a negative net flow this month on all chains."
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain, net_flow FROM smart_money_token_performance WHERE net_flow < 0 AND date_trunc('month', CURRENT_DATE) = date_trunc('month', now());"
... |
You are an 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 insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty... | [
{
"role": "user",
"content": "List all documents uploaded in the year 2024, showing document_id, file_name, and uploaded_at."
},
{
"role": "assistant",
"content": "SELECT document_id, file_name, uploaded_at FROM insurance.claim_documents WHERE uploaded_at >= '2024-01-01' AND uploaded_at < '2025-... |
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 healthcare.prescriptions (
prescription_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Which doctors have issued prescriptions with a route of 'Oral'? Please show doctor_id and the number of such prescriptions they have written."
},
{
"role": "assistant",
"content": "SELECT doctor_id, COUNT(*) AS oral_prescription_count\nFROM healthcare.prescriptions\... |
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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "Display each product alongside the most recently updated product of the same type. Return original_id, original_updated_at, recent_id, recent_updated_at, and product_type."
},
{
"role": "assistant",
"content": "SELECT p.product_id AS original_id, p.updated_at AS ori... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "List all wallet addresses that hold SUI coins with a balance greater than 1,000,000. Please show the coin_type as well."
},
{
"role": "assistant",
"content": "SELECT owner, coin_type, balance\nFROM sui_coins\nWHERE CAST(balance AS DECIMAL) > 1000000;"
},
{
"... |
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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Retrieve the guest_id, first_name, last_name, and loyalty_member_id for all guests who have communication_consent enabled."
},
{
"role": "assistant",
"content": "SELECT guest_id, first_name, last_name, loyalty_member_id\nFROM hospitality_technology.guests\nWHERE com... |
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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "For each upcoming appointment in the next 7 days, list the appointment_id, scheduled_start_time, full name of the citizen, and the name of the service."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.scheduled_start_time, \n c.first_name || '... |
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 social_media.comments ( comment_id character varying(64) NOT NULL, post_id character... | [
{
"role": "user",
"content": "Show me the usernames and group names for all users who received a 'mention' notification related to group conversations, and when those notifications were created."
},
{
"role": "assistant",
"content": "SELECT us.user_id, us.theme AS username, c.group_name, n.creat... |
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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "List the payment ID, amount, and the name of the service for all payments associated with services in the 'Licensing' category."
},
{
"role": "assistant",
"content": "SELECT p.payment_id, p.amount, s.service_name FROM government_services.payments p JOIN government_s... |
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, previous_block_id text, timestamp timestamp, nonc... | [
{
"role": "user",
"content": "List the block_id, timestamp, and the total amount of transactions for each block, along with the sender and receiver addresses for each transaction that occurred on April 10th, 2023."
},
{
"role": "assistant",
"content": "SELECT b.block_id, b.timestamp, t.sender_ad... |
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.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "Find token transfers within the same transaction where the recipient of an earlier transfer (based on log_index) becomes the sender of a later transfer. List the transaction ID, the earlier transfer ID, the later transfer ID, the shared address, and the value transferred in bot... |
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.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"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 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.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "For each user, show their user ID and the count of unique wallet addresses they own."
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(DISTINCT address) FROM wallets GROUP BY user_id;"
}
] |
You are an 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 social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_... | [
{
"role": "user",
"content": "Show me the notification ID, recipient user ID, and notification type for notifications received by users that user 'user123' is following."
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.recipient_user_id, n.notification_type FROM social_media.no... |
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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Can you provide the total number of fuel refueling events and the sum of total_cost at each fueling location, including the location name and city?"
},
{
"role": "assistant",
"content": "SELECT l.location_id, l.name, l.city, COUNT(fl.fuel_log_id) AS num_refuels, SUM... |
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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the first name and last name of citizens who have scheduled appointments, along with the scheduled start time and purpose of their appointments."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.scheduled_start_time, T2.purpose FROM ... |
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 healthcare.medical_records ( record_id.text, patient_id.text, appointment_id.text, d... | [
{
"role": "user",
"content": "For each patient, find the date of their most recent medical record and the effective date of their current primary insurance plan. Return patient_id, last_record_date, and effective_date."
},
{
"role": "assistant",
"content": "SELECT m.patient_id,\n m.last_da... |
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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "List usernames and the length of their 'bio' field for users whose 'is_verified' status is true."
},
{
"role": "assistant",
"content": "SELECT username, LENGTH(bio) AS bio_length FROM social_media.users WHERE is_verified IS 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
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo... | [
{
"role": "user",
"content": "Show the details of all UTXOs with an amount greater than 5, ordered by amount descending."
},
{
"role": "assistant",
"content": "SELECT utxo_id, transaction_id, output_index, address, amount, spent\nFROM trading_platform.utxos\nWHERE amount > 5\nORDER BY amount DES... |
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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "List customers who have both a canceled policy and an active policy. Show customer_id, canceled_policy_id, and active_policy_id."
},
{
"role": "assistant",
"content": "SELECT p1.customer_id,\n p1.policy_id AS canceled_policy_id,\n p2.policy_id AS active_... |
You are an 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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List all users who have never followed anyone, showing their username, full name, email, and account creation date."
},
{
"role": "assistant",
"content": "SELECT u.username,\n u.full_name,\n u.email,\n u.created_at\nFROM social_media.users AS u\nLE... |
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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam... | [
{
"role": "user",
"content": "I need a report showing the count of drivers per status."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS driver_count\nFROM transportation.drivers\nGROUP BY status;"
},
{
"role": "user",
"content": "Actually, only include statuses that ... |
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.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "Give me a count of log entries for each user."
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(*) AS log_count\nFROM trading_platform.logs\nGROUP BY user_id;"
},
{
"role": "user",
"content": "Only show users who have more than 10 log entries.... |
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 gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, descr... | [
{
"role": "user",
"content": "Which players have unlocked any achievement?"
},
{
"role": "assistant",
"content": "SELECT DISTINCT player_id FROM player_achievements;"
},
{
"role": "user",
"content": "Show me the player ID and the total number of points they've accumulated from all un... |
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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Retrieve the player_id, username, and game title for all players who have at least one item in their inventory."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.player_id, p.username, g.title\nFROM gaming_technology.players p\nJOIN gaming_technology.player_i... |
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 government_services.services ( service_id.text, agency_id.text, service_name.text, d... | [
{
"role": "user",
"content": "Find pairs of active services from the same agency where one service's average processing time is longer than the other's. Display the agency_id, the slower service name with its processing time, and the faster service name with its processing time."
},
{
"role": "assis... |
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": "Show me the total amount held and number of unique wallets for each ERC20 token with a symbol ending in 'X'."
},
{
"role": "assistant",
"content": "SELECT tm.symbol, SUM(CAST(ebh.amount AS DECIMAL)) AS total_amount, COUNT(DISTINCT ebh.wallet_address) AS unique_walle... |
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 legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case... | [
{
"role": "user",
"content": "I want to find all pairs of invoices belonging to the same client. Show me the client_id, the invoice_number for the earlier invoice and the invoice_number for the later invoice."
},
{
"role": "assistant",
"content": "SELECT i1.client_id,\n i1.invoice_number A... |
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.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "Show me the top 10 token transfers by value, including the token ID and the transaction ID, sorted in descending order."
},
{
"role": "assistant",
"content": "SELECT token_id, transaction_id, value FROM web3.token_transfers ORDER BY value DESC LIMIT 10;"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "List all Avalanche tokens where the circulating total supply is less than the maximum supply. Include tick, creator, max_supply, total_supply (sum of amount), and the difference between max_supply and total_supply."
},
{
"role": "assistant",
"content": "SELECT bi.ti... |
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 gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "For each year since 2015, show the total number of games released per year."
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM release_date) AS year, COUNT(*) AS total_games\nFROM gaming_technology.games\nWHERE release_date >= '2015-01-01'\nGROUP BY yea... |
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 erc20_balances ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wa... | [
{
"role": "user",
"content": "List all NFTs minted on the Ethereum blockchain in the last 14 days, including their contract address, token ID, name, and minter."
},
{
"role": "assistant",
"content": "SELECT contract_address, token_id, name, minter\nFROM nft_metadata\nWHERE blockchain = 'Ethereum... |
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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "How many posts have been updated after they were created?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS updated_post_count\nFROM social_media.posts\nWHERE updated_at IS NOT NULL AND updated_at > created_at;"
}
] |
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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "List each client's first and last name along with the number of cases they have, alias the count as case_count."
},
{
"role": "assistant",
"content": "SELECT cl.first_name, cl.last_name, COUNT(c.case_id) AS case_count\nFROM legal_services.clients cl\nLEFT JOIN legal... |
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 healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id ... | [
{
"role": "user",
"content": "Show the total number of appointments created in 2024 for each doctor and each status."
},
{
"role": "assistant",
"content": "SELECT doctor_id, status, COUNT(*) AS appointment_count FROM healthcare.appointments WHERE EXTRACT(YEAR FROM created_at) = 2024 GROUP BY doc... |
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": "Show me the top 5 NFT collections on Ethereum with the highest number of unique owners, along with their names and floor prices."
},
{
"role": "assistant",
"content": "SELECT nc.name, nc.floor_price, COUNT(DISTINCT nh.wallet_address) AS unique_owners FROM nft_collec... |
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 transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "For each passenger, list their email along with the total amount spent on fares across all their bookings."
},
{
"role": "assistant",
"content": "SELECT p.passenger_id, p.email, SUM(b.fare) AS total_fare_spent\nFROM transportation.passengers p\nJOIN transportation.b... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. 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
CREA... | [
{
"role": "user",
"content": "What is the current operational status of the train car with car_id 'CAR123'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the current operational status of the train car with car_id 'CAR123'. The data in the train_cars table ... |
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.transactions (
transaction_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me transactions where the sender and receiver addresses are the same. List transaction_id, amount, and timestamp."
},
{
"role": "assistant",
"content": "SELECT transaction_id, amount, timestamp FROM blockchain.transactions WHERE sender_address = receiver_addres... |
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 financial_services.securities (
security_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List pairs of securities that trade on different exchanges but belong to the same sector, showing ticker_symbol of both as symbol_a and symbol_b, their exchanges, and the sector."
},
{
"role": "assistant",
"content": "SELECT a.ticker_symbol AS symbol_a, a.exchange A... |
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.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "For each recipient address, count how many token transfers they have received."
},
{
"role": "assistant",
"content": "SELECT to_address, COUNT(*) AS received_transfer_count FROM web3.token_transfers GROUP BY to_address;"
},
{
"role": "user",
"content": "... |
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 gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, descr... | [
{
"role": "user",
"content": "List all achievements with points greater than 100, showing achievement_id, name, and points."
},
{
"role": "assistant",
"content": "SELECT achievement_id, name, points\nFROM gaming_technology.achievements\nWHERE points > 100;"
},
{
"role": "user",
"cont... |
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 transportation.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "For each fueling event, show its fuel_log_id, vehicle_id, log_timestamp, and the previous fueling event's fuel_log_id, log_timestamp, and quantity for the same vehicle."
},
{
"role": "assistant",
"content": "SELECT fl.fuel_log_id,\n fl.vehicle_id,\n fl.l... |
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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List the names of services and the total number of times each service has been ordered. Only include services that have been ordered at least once."
},
{
"role": "assistant",
"content": "SELECT T1.service_name, count(T2.order_id) AS order_count FROM hospitality_tech... |
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 hospitality_technology.payments (
payment_id character varying(64) NOT NULL, --... | [
{
"role": "user",
"content": "List all reservations that have made multiple payment transactions. Return reservation_id and payment_id for each occurrence."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p1.reservation_id, p1.payment_id\nFROM hospitality_technology.payments p1\nJOIN hospi... |
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 gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "I need a list of genres and pairs of game titles in the same genre."
},
{
"role": "assistant",
"content": "SELECT g1.genre, g1.title AS game1, g2.title AS game2\nFROM gaming_technology.games g1\nJOIN gaming_technology.games g2\n ON g1.genre = g2.genre;"
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... | [
{
"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 expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "List all NFTs minted in the last 30 days, including their contract address, token id, and minter address."
},
{
"role": "assistant",
"content": "SELECT contract_address, token_id, minter FROM nft_metadata WHERE mint_time >= (strftime('%s', 'now') - 2592000);"
},
... |
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 government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ... | [
{
"role": "user",
"content": "Which agencies offer services in the 'Social Assistance' category? Show the agency name and the service name."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, s.service_name\nFROM government_services.services s\nJOIN government_services.agencies a ON s.a... |
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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "List the first and last names, email, and phone number of all customers whose status is not 'Active'."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email, phone_number\nFROM insurance.customers\nWHERE status <> 'Active';"
},
{
"role": ... |
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 hospitality_technology.services ( service_id.text, property_id.text, service_name.te... | [
{
"role": "user",
"content": "Can you show me the total number of available services and the average price for each department?"
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS available_service_count, AVG(price) AS average_price FROM hospitality_technology.services WHERE is... |
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 transportation.trips ( trip_id character varying(64) NOT NULL, route_id character va... | [
{
"role": "user",
"content": "What is the count of trips for each status?"
},
{
"role": "assistant",
"content": "SELECT\n status,\n COUNT(*) AS trip_count\nFROM transportation.trips\nGROUP BY\n status;"
},
{
"role": "user",
"content": "Only include statuses with more than 5 trips.... |
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 transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"role": "user",
"content": "List all trips with their ID, vehicle ID, and driver ID."
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, driver_id FROM transportation.trips;"
},
{
"role": "user",
"content": "Can you also include the scheduled departure and actual arr... |
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": "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
CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 3 different NFTs from any ERC1155 contract. For each wallet, list the contract address and the count of distinct token_ids."
},
{
"role": "assistant",
"content": "SELECT contract_address, wallet_address, COUNT(DISTINC... |
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 healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "Find overlapping appointments for each doctor. Return doctor_id, appointment_id_1, appointment_id_2, and overlap duration in minutes."
},
{
"role": "assistant",
"content": "SELECT a.doctor_id,\n a.appointment_id AS appointment_id_1,\n b.appointment_id AS... |
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.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a... | [
{
"role": "user",
"content": "Show me the total count and sum of amounts for spent and unspent UTXOs for each asset, including the asset name and symbol."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name AS asset_name, a.symbol, u.spent, COUNT(*) AS utxo_count, SUM(u.amount) AS to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.