conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "Show me the average high price and average low price for each security sector using market data."
},
{
"role": "assistant",
"content": "SELECT T1.sector, AVG(T2.high_price) AS average_high_price, AVG(T2.low_price) AS average_low_price FROM financial_services.securit... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad... |
[
{
"role": "user",
"content": "Show me all clients along with the total number of invoices they have and the sum of total_amount for those invoices."
},
{
"role": "assistant",
"content": "SELECT cl.client_id, cl.first_name, cl.last_name, COUNT(inv.invoice_id) AS invoice_count, SUM(inv.total_amoun... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad... |
[
{
"role": "user",
"content": "What is the total transaction amount for each transaction_type in the last 30 days, considering only 'Completed' status transactions?"
},
{
"role": "assistant",
"content": "SELECT transaction_type, SUM(amount) as total_amount FROM financial_services.transactions WHE... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,... |
[
{
"role": "user",
"content": "Which projects that raised funds in 2023 have an associated token, and what are their fundraising amounts, token symbols, and token market caps?"
},
{
"role": "assistant",
"content": "SELECT T1.project_name, T1.investment_value, T2.token_symbol, T2.market_cap FROM 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 character varying(32) NOT NULL, -- fundraising record id project_id character varying(... |
[
{
"role": "user",
"content": "List all beneficiaries with a percentage_share greater than 30%, showing beneficiary_id, first_name, last_name, relationship, percentage_share, and policy_id."
},
{
"role": "assistant",
"content": "SELECT beneficiary_id,\n first_name,\n last_name,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d... |
[
{
"role": "user",
"content": "Give me the total number of doctors for each specialty."
},
{
"role": "assistant",
"content": "SELECT specialty, COUNT(*) AS doctor_count\nFROM healthcare.doctors\nGROUP BY specialty;"
}
] | You are an SQL statement expert. Given the table 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 smart money addresses that have a positive ROI but their realized profit ratio is less than 50%. List their address, ROI, and realized ratio, ordered by ROI in descending order."
},
{
"role": "assistant",
"content": "SELECT address, roi, realized_ratio FROM sma... | 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 character varying(100) NOT NULL, rank INT, profit numer... |
[
{
"role": "user",
"content": "Could you please list the first name, last name, and email address for all passengers in the system?"
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM transportation.passengers;"
},
{
"role": "user",
"content": "Now, refine ... | You are an SQL statement expert. Given the table 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.passengers (
passenger_id character varying(64) NOT NULL, -- unique identifier for the passenger
... |
[
{
"role": "user",
"content": "For each account status, what is the total quantity of securities traded?"
},
{
"role": "assistant",
"content": "SELECT T2.status, SUM(T1.quantity) FROM financial_services.trades AS T1 JOIN financial_services.accounts AS T2 ON T1.account_id = T2.account_id 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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri... |
[
{
"role": "user",
"content": "Retrieve each citizen's first_name, last_name, and their most recent notification's message_subject and sent_at, only for notifications sent via 'Email'."
},
{
"role": "assistant",
"content": "SELECT c.first_name,\n c.last_name,\n n.message_subject,\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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "List the appointment ID, start time, and the case number for all appointments that are linked to a case."
},
{
"role": "assistant",
"content": "SELECT T1.appointment_id, T1.start_time, T2.case_number FROM legal_services.appointments AS T1 JOIN legal_services.cases A... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.cases ( case_id text, case_number text, case_name text, client_id text, lead_lawyer_id text, case_type t... |
[
{
"role": "user",
"content": "Show me the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their price and 24-hour price change percentage from the token_dexpool_info table."
},
{
"role": "assistant",
"content": "SELECT token_symbol, price, price_change_percentage_24h, vo... | You are an SQL statement expert. Given the table 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 the post ID, content, and any associated hashtag IDs for posts that have media_type 'image'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.post_id, T1.content, T2.hashtag_id FROM social_media.posts AS T1 JOIN social_media.post_hashtags AS T2 ON T... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "Show me all players who have unlocked a hidden achievement. List the player ID, the name of the achievement, and the date they unlocked it."
},
{
"role": "assistant",
"content": "SELECT pa.player_id, a.name AS achievement_name, pa.unlocked_at FROM gaming_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 gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,... |
[
{
"role": "user",
"content": "Show me all insurance plans that have more than 5 patients enrolled as their primary insurance, along with the provider name and count of patients, sorted by patient count in descending order."
},
{
"role": "assistant",
"content": "SELECT ip.insurance_provider, ip.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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"role": "user",
"content": "List all assets mentioned in DApp descriptions along with the DApp name and URL."
},
{
"role": "assistant",
"content": "SELECT a.name AS asset_name,\n a.symbol AS asset_symbol,\n d.name AS dapp_name,\n d.url\nFROM trading_platform.assets a\nJOIN tr... | You are an SQL statement expert. Given the table 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 all users whose email notifications are disabled, showing their usernames and the last time their settings were updated."
},
{
"role": "assistant",
"content": "SELECT u.username, us.updated_at\nFROM social_media.users u\nJOIN social_media.user_settings us ON 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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"role": "user",
"content": "Show me all active agents who have handled claims with police reports, along with the count of such claims per agent."
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name, a.last_name, COUNT(c.claim_id) as police_report_claims FROM insurance.agents... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c... |
[
{
"role": "user",
"content": "I need to list the top 5 ERC20 tokens by total supply, including symbol, contract_address, and name."
},
{
"role": "assistant",
"content": "SELECT tm.contract_address, tm.symbol, tm.name, CAST(tm.total_supply AS DECIMAL) AS total_supply\nFROM token_metas tm\nWHERE t... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"role": "user",
"content": "List pairs of block IDs where the second block is the direct successor of the first block (based on previous_block_id) and both blocks were mined on the same calendar day."
},
{
"role": "assistant",
"content": "SELECT b1.block_id AS block_id_1, b2.block_id AS block_... | You are an SQL statement expert. Given the table 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": "I need a summary of the number of cases by case_type. Please show the case_type and how many cases exist for each."
},
{
"role": "assistant",
"content": "SELECT case_type, COUNT(*) AS case_count FROM legal_services.cases GROUP BY case_type;"
},
{
"role": "us... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.cases ( case_id character varying(64) NOT NULL, case_number character varying(100) UNIQUE, case_name tex... |
[
{
"role": "user",
"content": "List all claims and the first and last name of the agent who handled each claim."
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T1.estimated_loss, T2.first_name, T2.last_name FROM claims AS T1 JOIN agents AS T2 ON T1.claim_handler_id = T2.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.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d... |
[
{
"role": "user",
"content": "List all posts that have never received a comment. Return post_id and user_id."
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.user_id FROM social_media.posts p WHERE NOT EXISTS (SELECT 1 FROM social_media.comments c WHERE c.post_id = p.post_id);"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "Show me the names of citizens who have both uploaded at least one document and have made a payment, along with the total payment amount and the number of documents they have uploaded."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, SUM(p.amo... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Show me the policy number, claim ID, document file name, and document type for all policies that have associated claim documents."
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T2.claim_id, T3.file_name, T3.document_type FROM insurance.policies AS T... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin... |
[
{
"role": "user",
"content": "For each maintenance log, list the vehicle's license plate, the name of the mechanic, and the service date, ordered by most recent service first."
},
{
"role": "assistant",
"content": "SELECT ml.log_id, v.license_plate, ml.mechanic_name, ml.service_date\nFROM transp... | You are an SQL statement expert. Given the table 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": "Find pairs of documents within the same case that were uploaded on the same day but by different lawyers. Show the case_id, upload_date, document_id and uploader_id for both documents in the pair."
},
{
"role": "assistant",
"content": "SELECT d1.case_id, DATE(d1.upl... | You are an SQL statement expert. Given the table 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": "List the record ID, record date, and chief complaint for all medical records created by doctor 'doc_321' for patient 'pat_007'."
},
{
"role": "assistant",
"content": "SELECT record_id, record_date, chief_complaint\nFROM healthcare.medical_records\nWHERE doctor_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 healthcare.medical_records (
record_id character varying(64) NOT NULL, -- unique identifier for the medical record... |
[
{
"role": "user",
"content": "Find tokens that are currently trending (trend rank 10 or lower) and have a positive net flow from smart money addresses. Show their token symbol, chain, trend rank, and smart money net flow. Order the results by trend rank ascending."
},
{
"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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO... |
[
{
"role": "user",
"content": "How many cases are associated with each unique lead lawyer ID? Show the lead lawyer ID and the count of cases, but only for lawyers who lead at least 5 cases. Sort the results by the case count in descending order."
},
{
"role": "assistant",
"content": "SELECT lead_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t... |
[
{
"role": "user",
"content": "Show me the usernames and group names for users who have joined group chats and also created at least one post."
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name\nFROM social_media.conversation_participants cp\nJOIN social_media.conversations c ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, full_name.text, profile_picture_url.t... |
[
{
"role": "user",
"content": "List all users who have deployed contracts, along with their email addresses and the count of contracts they've deployed."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.email, COUNT(c.contract_id) AS contract_count FROM web3.users u JOIN web3.contracts c... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "Show me all fuel logs where the location is 'LOC456', including the vehicle ID, fuel type, and quantity."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, fuel_type, quantity FROM transportation.fuel_logs WHERE location_id = 'LOC456';"
},
{
"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 transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu... |
[
{
"role": "user",
"content": "List the agent ID, first name, last name, and commission rate for all agents with a commission rate between 0.08 and 0.15."
},
{
"role": "assistant",
"content": "SELECT agent_id, first_name, last_name, commission_rate FROM insurance.agents WHERE commission_rate BETW... | You are an SQL statement expert. Given the table 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": "How many unique customers are there in the system?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT customer_id) AS unique_customer_count\nFROM insurance.customers;"
}
] | You are an SQL statement expert. Given the table 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": "Calculate the total quantity traded for each asset, showing the asset name and symbol."
},
{
"role": "assistant",
"content": "SELECT T1.name, T1.symbol, SUM(T2.quantity) FROM trading_platform.assets AS T1 JOIN trading_platform.trades AS T2 ON T1.asset_id = T2.asset_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp )
CREATE TAB... |
[
{
"role": "user",
"content": "List all token transfers with values greater than 1000, including the token ID and transaction ID."
},
{
"role": "assistant",
"content": "SELECT transfer_id, token_id, transaction_id, value FROM web3.token_transfers WHERE value > 1000;"
},
{
"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 web3.events ( event_id text PRIMARY KEY, contract_id text, event_name text, data text, emitted_at timestamp, transactio... |
[
{
"role": "user",
"content": "Show me the name of each property and how many rooms it has."
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(r.room_id) FROM hospitality_technology.properties p JOIN hospitality_technology.rooms r ON p.property_id = r.property_id GROUP BY p.prop... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "List total billable hours and total amount per lawyer for July 2023."
},
{
"role": "assistant",
"content": "SELECT lawyer_id,\n SUM(hours_spent) AS total_hours,\n SUM(hours_spent * billing_rate) AS total_amount\nFROM legal_services.time_entries\nWHERE is... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.time_entries ( entry_id text, case_id text, lawyer_id text, date_worked date, hours_spent numeric, billi... |
[
{
"role": "user",
"content": "Show me all trades where the traded quantity is less than 2, including the trade_id, quantity, and the buyer and seller IDs."
},
{
"role": "assistant",
"content": "SELECT trade_id, quantity, buyer_id, seller_id\nFROM trading_platform.trades\nWHERE quantity < 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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
CREATE ... |
[
{
"role": "user",
"content": "Show the total sum and average amount for all OUTGOING transactions within the last 30 days, grouped by transaction_type."
},
{
"role": "assistant",
"content": "SELECT transaction_type, SUM(amount) AS total_amount, AVG(amount) AS avg_amount FROM financial_services.t... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... |
[
{
"role": "user",
"content": "Which employees have scheduled appointments with citizens whose account has not been verified? Please show the employee's first name, last name, and number of such appointments."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(a.appoint... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Show me the usernames of users who have posted a comment on a post that includes the hashtag 'nature', along with the content of the comment."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, c.content\nFROM social_media.comments c\nJOIN social_medi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ... |
[
{
"role": "user",
"content": "Show me, for each city, how many notifications have been sent to citizens living in that city."
},
{
"role": "assistant",
"content": "SELECT c.city, COUNT(n.notification_id) AS notification_count\nFROM government_services.citizens c\nJOIN government_services.notific... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "List all upcoming appointments within the next 7 days along with each client's full name, email, appointment subject, and start_time."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, \n c.first_name || ' ' || c.last_name AS client_full_name, \n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "Find the first name, last name, national ID number, and contact email for all citizens who do not have a contact phone number listed."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, national_id_number, contact_email FROM government_services.citi... | You are an SQL statement expert. Given the table 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": "For each trade in the past 14 days, show the trade_id, account_id, security_id, and the latest close_price for that security from market_data."
},
{
"role": "assistant",
"content": "SELECT tr.trade_id, tr.account_id, tr.security_id, md.close_price AS latest_close_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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri... |
[
{
"role": "user",
"content": "For all NFT collections on the Ethereum blockchain, show me the collection name and the current floor price. Sort by floor price descending."
},
{
"role": "assistant",
"content": "SELECT name, floor_price FROM nft_collections WHERE blockchain = 'Ethereum' ORDER BY C... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t... |
[
{
"role": "user",
"content": "Show me all room types with a base rate over $200 and max occupancy of at least 4, along with their property IDs and amenities."
},
{
"role": "assistant",
"content": "SELECT rt.room_type_id, rt.property_id, rt.type_name, rt.base_rate, rt.max_occupancy, rt.amenities ... | You are an SQL statement expert. Given the table 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.room_types ( room_type_id character varying(64) NOT NULL, property_id character varying(64) NOT ... |
[
{
"role": "user",
"content": "Show me all notifications where the target entity type is 'comment', and for each notification, include the content of the corresponding comment."
},
{
"role": "assistant",
"content": "SELECT n.*, c.content AS comment_content FROM social_media.notifications n JOIN 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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ... |
[
{
"role": "user",
"content": "Show me all the unique item names, their types, and rarities, along with their cost amount."
},
{
"role": "assistant",
"content": "SELECT item_name, item_type, rarity, cost_amount\nFROM gaming_technology.in_game_items;"
},
{
"role": "user",
"content": "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 gaming_technology.in_game_items ( item_id uuid PRIMARY KEY, game_id uuid, item_name text, item_type text, description t... |
[
{
"role": "user",
"content": "Show me all nodes that haven't been seen in the last 24 hours."
},
{
"role": "assistant",
"content": "SELECT node_id,\n ip_address,\n port,\n last_seen\nFROM blockchain.nodes\nWHERE last_seen < NOW() - INTERVAL '24 hours';"
},
{
"role": "us... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ... |
[
{
"role": "user",
"content": "Retrieve the top 5 Avalanche tokens by total transfer volume in the last 7 days. Include tick, total_volume, and creator from token_info_avalanche."
},
{
"role": "assistant",
"content": "SELECT\n a.tick,\n SUM(a.amt) AS total_volume,\n i.creator\nFROM token_activ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t... |
[
{
"role": "user",
"content": "List all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector."
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, security_name\nFROM financial_services.securities\... | You are an SQL statement expert. Given the table 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": "Please list all doctors and their specialties, along with the phone numbers of any other doctors who share the same specialty."
},
{
"role": "assistant",
"content": "SELECT d1.doctor_id, d1.first_name, d1.last_name, d1.specialty, d2.phone_number AS colleague_phone_n... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number... |
[
{
"role": "user",
"content": "List all maintenance logs for vehicles that had 'Tire Rotation' service in the last 6 months, showing vehicle ID and service date."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date FROM transportation.maintenance_logs WHERE service_type = 'Tire ... | You are an SQL statement expert. Given the table 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": "List all patients with active diagnoses of chronic conditions, including their diagnosis details and the diagnosing doctor's specialty."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, dg.diagnosis_code, dg.description, dg.diagnosis_date, d.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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"role": "user",
"content": "Can you list all securities that have had at least one trade in the past 30 days? Please include the ticker_symbol, security_name, exchange, and the total number of trades for each security."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_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 financial_services.securities ( security_id text, ticker_symbol text, isin_code text, cusip_code text, security_name te... |
[
{
"role": "user",
"content": "I want a list of each department's top 3 longest-tenured active employees, showing their full names, hire_date, and their manager’s full names."
},
{
"role": "assistant",
"content": "WITH ranked AS (\n SELECT\n e.department,\n e.employee_id,\n e.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 financial_services.trades ( trade_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL, securit... |
[
{
"role": "user",
"content": "Show a list of all routes including their route number, type, distance in km, and estimated duration in minutes."
},
{
"role": "assistant",
"content": "SELECT\n route_number,\n type,\n distance_km,\n estimated_duration_minutes\nFROM 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": "List all distinct email domains found in the user email addresses."
},
{
"role": "assistant",
"content": "SELECT DISTINCT SUBSTRING(email, INSTR(email, '@') + 1) AS email_domain FROM web3.users;"
},
{
"role": "user",
"content": "For each domain, show the... | 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.text, username.text, email.text, password_hash.text, created_at... |
[
{
"role": "user",
"content": "Which tokens have both buy and sell transactions? Show token_symbol and chain."
},
{
"role": "assistant",
"content": "SELECT DISTINCT i1.token_symbol, i1.chain\nFROM smart_money_token_inflow i1\nJOIN smart_money_token_inflow i2\n ON i1.token_symbol = i2.token_symbo... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_token_inflow ( token_address text, token_symbol text, token_amount numeric, usd_value numeric, avg_price nu... |
[
{
"role": "user",
"content": "Find all claims with a settlement amount between 5000 and 10000. List the claim ID, incident date, and settlement date."
},
{
"role": "assistant",
"content": "SELECT claim_id, incident_date, settlement_date\nFROM insurance.claims\nWHERE settlement_amount BETWEEN 500... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara... |
[
{
"role": "user",
"content": "Retrieve the first_name, last_name, and email of all passengers who have never made a booking."
},
{
"role": "assistant",
"content": "SELECT\n p.first_name,\n p.last_name,\n p.email\nFROM transportation.passengers p\nLEFT JOIN transportation.bookings b\n ON p.pa... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_location_id.text, destination_locati... |
[
{
"role": "user",
"content": "I'd like to see, for each month, the total number of players who registered and how many of them are active versus inactive."
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', registration_date) AS month,\n COUNT(*) AS total_registrations,\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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... |
[
{
"role": "user",
"content": "I need to retrieve asset IDs along with their category and website metadata values for assets that have both entries."
},
{
"role": "assistant",
"content": "SELECT m_cat.asset_id,\n m_cat.value AS category,\n m_web.value AS website_url\nFROM trading_plat... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.metadata ( metadata_id character varying(64) NOT NULL, asset_id character varying(64) NOT NULL, key ch... |
[
{
"role": "user",
"content": "Which ERC1155 NFT contracts on Ethereum have more than 25 approval-for-all events? List their contract addresses and approval counts."
},
{
"role": "assistant",
"content": "SELECT ea.contract_address, COUNT(*) AS approval_count\nFROM erc1155_approval_for_all ea\nGRO... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"role": "user",
"content": "List all usernames and their respective group chat names where they are participants."
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name \nFROM social_media.conversation_participants cp\nJOIN social_media.users u ON cp.user_id = u.user_id\nJOIN 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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"role": "user",
"content": "What is the average daily trading volume for each security_id in the market_data table from the last 30 days?"
},
{
"role": "assistant",
"content": "SELECT security_id, AVG(volume) AS average_daily_volume\nFROM financial_services.market_data\nWHERE data_timestamp >=... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... |
[
{
"role": "user",
"content": "List staff members who were hired in the last calendar year, showing their full name, position, and hire date."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, position, hire_date FROM hospitality_technology.staff WHERE hire_date >= date_trunc('y... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, property_id text, first_name text, last_name text, position t... |
[
{
"role": "user",
"content": "For each booking, list the booking_id, trip_id, origin city, destination city, and fare."
},
{
"role": "assistant",
"content": "SELECT b.booking_id, b.trip_id, lo.city AS origin_city, ld.city AS destination_city, b.fare\nFROM transportation.bookings b\nJOIN transpor... | You are an SQL statement expert. Given the table 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": "Show me all active loans (loan_id, loan_type, principal_amount) where the remaining term is less than 12 months, along with the account_id and monthly_payment."
},
{
"role": "assistant",
"content": "SELECT loan_id, loan_type, principal_amount, account_id, monthly_pa... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.loans ( loan_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL UNIQUE, lo... |
[
{
"role": "user",
"content": "Show me all wallets holding SUI coins with a balance greater than 2,000,000. Include the coin_type, balance, and owner address."
},
{
"role": "assistant",
"content": "SELECT coin_type, balance, owner FROM sui_coins WHERE status = 'exists' AND CAST(balance AS bigint)... | You are an SQL statement expert. Given the table 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 want each user with the date and action of their most recent log entry, along with how many log entries they have in the last 7 days."
},
{
"role": "assistant",
"content": "WITH recent_logs AS (\n SELECT user_id, action, logged_at,\n ROW_NUMBER() OVER (PA... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "Calculate the total value of unspent UTXOs for each user whose KYC status has been 'approved'."
},
{
"role": "assistant",
"content": "SELECT kyc.user_id, SUM(u.amount) FROM trading_platform.kyc_audit kyc JOIN trading_platform.utxos u ON kyc.user_id = u.user_id 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 trading_platform.utxos ( utxo_id.text, transaction_id.text, output_index.integer, address.text, amount.numeric, spent.b... |
[
{
"role": "user",
"content": "Show me the first name, last name, and email for all clients registered in January 2023."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM legal_services.clients WHERE EXTRACT(YEAR FROM date_registered) = 2023 AND EXTRACT(MONTH FROM dat... | You are an SQL statement expert. Given the table 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 the count of citizens grouped by their verification status."
},
{
"role": "assistant",
"content": "SELECT is_verified, COUNT(*) FROM government_services.citizens GROUP BY is_verified;"
},
{
"role": "user",
"content": "Now, only include citizens who ... | You are an SQL statement expert. Given the table 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": "Find projects from the project_fundraising_record table that have completed both a 'Seed' fundraising round and a 'Series A' fundraising round."
},
{
"role": "assistant",
"content": "SELECT pf_seed.project_name FROM project_fundraising_record pf_seed JOIN project_fu... | You are an SQL statement expert. Given the table 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": "For each chain, retrieve the token_symbol and roi of the token with the highest roi."
},
{
"role": "assistant",
"content": "SELECT t.chain, t.token_symbol, t.roi\nFROM smart_money_token_performance t\nJOIN (\n SELECT chain, MAX(roi) AS max_roi\n FROM smart_money_t... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, net_flow.numeric, avg_cost.numeric,... |
[
{
"role": "user",
"content": "List all servers that are currently online. Show their name, region, current player count, and maximum player capacity."
},
{
"role": "assistant",
"content": "SELECT server_name, region, current_players, max_players FROM gaming_technology.servers WHERE status = 'onl... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_id uuid NOT NULL, server_name chara... |
[
{
"role": "user",
"content": "List all comment IDs that have not received any likes."
},
{
"role": "assistant",
"content": "SELECT T1.comment_id FROM social_media.comments AS T1 LEFT JOIN social_media.likes AS T2 ON T1.comment_id = T2.comment_id WHERE T2.like_id IS NULL;"
},
{
"role": "u... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique identifier for the comment
post_id... |
[
{
"role": "user",
"content": "List all pairs of transactions within the same block where the from_address of one transaction is the to_address of another transaction. Show both transaction_ids, the block_number, from_address, and to_address."
},
{
"role": "assistant",
"content": "SELECT t1.trans... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.transactions ( transaction_id text, from_address text, to_address text, value numeric, gas_used integer, gas_price... |
[
{
"role": "user",
"content": "Give me the list of DApp names and URLs whose description contains any asset symbol from the assets table."
},
{
"role": "assistant",
"content": "SELECT DISTINCT d.name, d.url\nFROM trading_platform.dapps d\nJOIN trading_platform.assets a ON d.description ILIKE '%' ... | You are an SQL statement expert. Given the table 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": "Show all beneficiaries added in 2024. Include beneficiary_id, full name, relationship, percentage_share, and the added_at timestamp."
},
{
"role": "assistant",
"content": "SELECT beneficiary_id, first_name || ' ' || last_name AS full_name, relationship, percentage_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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text... |
[
{
"role": "user",
"content": "What is the average project valuation for each round name in 2023?"
},
{
"role": "assistant",
"content": "SELECT rounds_name, AVG(valuation) AS avg_valuation\nFROM project_fundraising_record\nWHERE investment_date LIKE '2023-%'\nGROUP BY rounds_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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... |
[
{
"role": "user",
"content": "Show each user_id for users with 'pending' KYC status along with the count of unread notifications they have."
},
{
"role": "assistant",
"content": "SELECT k.user_id, COUNT(n.notification_id) AS unread_count\nFROM trading_platform.kyc_audit k\nJOIN trading_platform.... | You are an SQL statement expert. Given the table 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": "Can you help me get the total number of operational platforms across all stations?"
},
{
"role": "assistant",
"content": "db.platforms.countDocuments({ status: 'Operational' });"
}
] | 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('platforms')
// Optional: db.platforms.createIndex({ platform_id: 1 }, { u... |
[
{
"role": "user",
"content": "List all pairs of achievements in the same game where the difference in their points is greater than 50."
},
{
"role": "assistant",
"content": "SELECT a1.game_id,\n a1.name AS achv1,\n a2.name AS achv2,\n ABS(a1.points - a2.points) AS point_dif... | You are an SQL statement expert. Given the table 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": "For each state_province, count the number of guests."
},
{
"role": "assistant",
"content": "SELECT state_province,\n COUNT(*) AS guest_count\nFROM guests\nGROUP BY state_province;"
},
{
"role": "user",
"content": "Only include states with more than... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la... |
[
{
"role": "user",
"content": "What are the training programs or certifications completed by a staff member with the role of Platform Supervisor?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about the training programs or certifications completed by sta... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.s... |
[
{
"role": "user",
"content": "List the names and cities of all locations that have at least one fuel log entry recorded."
},
{
"role": "assistant",
"content": "SELECT DISTINCT l.name, l.city\nFROM transportation.locations l\nJOIN transportation.fuel_logs f ON l.location_id = f.location_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 transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id character varying(64) NOT NULL UNIQUE, f... |
[
{
"role": "user",
"content": "What is the average token price held by Binance exchange across all chains?"
},
{
"role": "assistant",
"content": "SELECT AVG(price) as average_token_price FROM cex_token_balance WHERE exchange = 'Binance';"
}
] | You are an SQL statement expert. Given the table 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": "List the location name and contact phone number for all service locations situated in the city of 'New York'."
},
{
"role": "assistant",
"content": "SELECT location_name, contact_phone FROM government_services.service_locations WHERE city = 'New York';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.service_locations ( location_id.text, agency_id.text, location_name.text, address.text, city.text, ... |
[
{
"role": "user",
"content": "List each document name, document_type, the case_number, and case_name for all documents uploaded in the year 2023."
},
{
"role": "assistant",
"content": "SELECT d.document_name, d.document_type, c.case_number, c.case_name\nFROM legal_services.documents d\nJOIN lega... | You are an SQL statement expert. Given the table 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": "Show me the total balance for each SUI coin type for coins with status 'exists'. Include the coin type and the sum of balances."
},
{
"role": "assistant",
"content": "SELECT coin_type, SUM(CAST(balance AS DECIMAL)) AS total_balance FROM sui_coins WHERE status = 'exi... | You are an SQL statement expert. Given the table 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": "Get name pairs of achievements for each game where one is hidden and the other is visible."
},
{
"role": "assistant",
"content": "SELECT a.achievement_id AS hidden_achievement_id, a.name AS hidden_name, b.achievement_id AS visible_achievement_id, b.name AS visible_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 gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, description text, icon_url text, points ... |
[
{
"role": "user",
"content": "Find smart money addresses from the smart_money_profit table that have performance records on more than one blockchain chain."
},
{
"role": "assistant",
"content": "SELECT address FROM smart_money_profit GROUP BY address HAVING COUNT(DISTINCT chain) > 1;"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(... |
[
{
"role": "user",
"content": "Show the contract address and total number of approvals for all ERC20 tokens from the erc20_approval table."
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS total_approvals\nFROM erc20_approval\nGROUP BY contract_address;"
},
{
"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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"role": "user",
"content": "Find all route numbers for routes where the distance is exactly equal to the estimated duration in minutes."
},
{
"role": "assistant",
"content": "SELECT route_number\nFROM transportation.routes\nWHERE distance_km = estimated_duration_minutes;"
}
] | You are an SQL statement expert. Given the table 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": "List all pairs of record_id for the same patient that were created on the same day. Show the two record_ids, patient_id, and the date."
},
{
"role": "assistant",
"content": "SELECT\n mr1.patient_id,\n date_trunc('day', mr1.record_date) AS record_day,\n mr1.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- unique identifier for the medical record... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.