conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "List all rooms with their number, property ID, floor, and status where the room has the feature 'Balcony'."
},
{
"role": "assistant",
"content": "SELECT room_id, room_number, property_id, floor, status FROM hospitality_technology.rooms WHERE features ILIKE '%Balcony... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, room... |
[
{
"role": "user",
"content": "What is the average ROI for smart money addresses on the Ethereum chain?"
},
{
"role": "assistant",
"content": "SELECT AVG(roi) FROM smart_money_token_performance WHERE chain = 'Ethereum';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundraising record id",
"project_id ch... |
[
{
"role": "user",
"content": "Show the total billed hours and total billed amount for each case that has at least one billed and billable time entry."
},
{
"role": "assistant",
"content": "SELECT t.case_id, c.case_number, SUM(t.hours_spent) AS total_billed_hours, SUM(t.hours_spent * t.billing_ra... | You are an SQL statement expert. Given the table 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, -- unique identifier for the case/matter
case_n... |
[
{
"role": "user",
"content": "Show me all bookings with a status of 'confirmed' that were made in the last 7 days, including passenger_id and fare."
},
{
"role": "assistant",
"content": "SELECT booking_id, passenger_id, fare FROM transportation.bookings WHERE status = 'confirmed' AND booking_tim... | You are an SQL statement expert. Given the table 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.bookings ( booking_id text PRIMARY KEY, passenger_id text, trip_id text, seat_number text, booking_time ... |
[
{
"role": "user",
"content": "List each wallet that has received tokens of more than one distinct token type. Show wallet_id, address, the number of distinct tokens received as distinct_token_count, and the total received value, ordered by total_received_value descending."
},
{
"role": "assistant",
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for the token
contract_address cha... |
[
{
"role": "user",
"content": "Find the average time it takes for users to read notifications after they are sent."
},
{
"role": "assistant",
"content": "SELECT AVG(EXTRACT(EPOCH FROM (read_at - sent_at))/3600) as avg_hours_to_read FROM trading_platform.notifications WHERE read_at IS NOT NULL;"
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, message text, sent_at timestamp, read_... |
[
{
"role": "user",
"content": "List asset_id, issuer and launch_date metadata values for each asset that has both 'issuer' and 'launch_date' keys."
},
{
"role": "assistant",
"content": "SELECT m_iss.asset_id,\n m_iss.value AS issuer,\n m_ld.value AS launch_date\nFROM 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.metadata ( metadata_id character varying(64) NOT NULL, asset_id character varying(64) NOT NULL, key ch... |
[
{
"role": "user",
"content": "Which tokens have the highest liquidity on the Ethereum chain and what are their current prices and 24-hour trading volumes?"
},
{
"role": "assistant",
"content": "SELECT token_symbol, price, liquidity, volume_24h FROM token_dexpool_info WHERE chain = 'Ethereum' ORD... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address.text, token_name.text, token_symbol.text, chain.text, price.numeric, price_change_per... |
[
{
"role": "user",
"content": "Show me each guest's total payment amount and total number of reservations, including their guest_id. Only include guests who have at least two reservations."
},
{
"role": "assistant",
"content": "SELECT r.guest_id, SUM(p.amount) AS total_payment_amount, COUNT(DISTI... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r... |
[
{
"role": "user",
"content": "Count the number of users for each location where the location is not empty."
},
{
"role": "assistant",
"content": "SELECT location, COUNT(user_id) FROM social_media.users WHERE location IS NOT NULL AND location != '' GROUP BY location;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "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 SQL statement expert. Given the table 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, post_id character varying(64) NOT NULL, user_id char... |
[
{
"role": "user",
"content": "For every game, can you provide the count of unique item types and the average item cost?"
},
{
"role": "assistant",
"content": "SELECT game_id, COUNT(DISTINCT item_type) AS num_unique_types, AVG(cost_amount) AS avg_item_cost FROM gaming_technology.in_game_items GRO... | You are an SQL statement expert. Given the table 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 NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ite... |
[
{
"role": "user",
"content": "List all DApps along with their URLs."
},
{
"role": "assistant",
"content": "SELECT name, url FROM trading_platform.dapps;"
}
] | You are an SQL statement expert. Given the table 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": "Show me all intercity routes that have an estimated duration of more than 2 hours, along with their origin and destination locations."
},
{
"role": "assistant",
"content": "SELECT r.route_id, r.route_number, r.estimated_duration_minutes, lo.name AS origin_location, ... | You are an SQL statement expert. Given the table 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": "Show me the total number of trades and total volume for each buyer-seller pair where the same two users traded multiple assets."
},
{
"role": "assistant",
"content": "SELECT buyer_id, seller_id, COUNT(DISTINCT asset_id) AS asset_count, COUNT(*) AS trade_count, SUM(q... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.trades ( trade_id text, order_id text, buyer_id text, seller_id text, asset_id text, quantity numeric,... |
[
{
"role": "user",
"content": "How many users registered in each month?"
},
{
"role": "assistant",
"content": "SELECT date_trunc('month', created_at) AS month,\n COUNT(*) AS registrations\nFROM web3.users\nGROUP BY month\nORDER BY month;"
},
{
"role": "user",
"content": "Actuall... | You are an SQL statement expert. Given the table 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.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email character varying(... |
[
{
"role": "user",
"content": "Which token symbols have the highest number of addresses buying them on the Ethereum chain? Show the top 3 symbols, their total address_amount, and narrative."
},
{
"role": "assistant",
"content": "SELECT token_symbol, narrative, SUM(address_amount) AS total_buying_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the token's address token_symbol character... |
[
{
"role": "user",
"content": "Which securities use EUR as their currency, and what is the average length of their ticker symbols? Please show the ticker symbol, security name, and calculated length."
},
{
"role": "assistant",
"content": "SELECT ticker_symbol, security_name, LENGTH(ticker_symbol)... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ... |
[
{
"role": "user",
"content": "List claims along with the name of the insurance product associated with the policy under which the claim was filed. Show claim_id, incident_date, and product_name."
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T1.incident_date, T3.product_name FROM ins... | You are an SQL statement expert. Given the table 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, -- unique identifier for the claim
policy_id charac... |
[
{
"role": "user",
"content": "What is the total count of blocks and the average difficulty?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*), AVG(difficulty) FROM blockchain.blocks"
},
{
"role": "user",
"content": "Now, show me the total count and average difficulty only for bl... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp tim... |
[
{
"role": "user",
"content": "Can you list all patients who switched their primary insurance plan, including the patient_id, old plan_id, new plan_id, and the date of the switch?"
},
{
"role": "assistant",
"content": "SELECT p1.patient_id,\n p1.plan_id AS old_plan_id,\n p2.plan_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.patient_insurance ( patient_insurance_id text, patient_id text, plan_id text, policy_number text, group_numb... |
[
{
"role": "user",
"content": "List all rooms currently under Maintenance, including their room number, property name, room type name, and base rate."
},
{
"role": "assistant",
"content": "SELECT r.room_number, p.property_name, rt.type_name, rt.base_rate\nFROM hospitality_technology.rooms r\nJOIN... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... |
[
{
"role": "user",
"content": "Count the number of claims for each status in the system."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) FROM insurance.claims GROUP BY status;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d... |
[
{
"role": "user",
"content": "List the document ID, document_type, verification_timestamp, the full name of the employee who verified each document, and the agency_name for all documents verified in the last 30 days."
},
{
"role": "assistant",
"content": "SELECT d.document_id,\n d.document... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "Retrieve all invoice numbers, their issue date, and the client ID."
},
{
"role": "assistant",
"content": "SELECT invoice_number, issue_date, client_id FROM legal_services.invoices;"
},
{
"role": "user",
"content": "Filter to only show invoices currently ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph... |
[
{
"role": "user",
"content": "Retrieve the average base premium of insurance products for each product_type, including only types that have more than 5 products."
},
{
"role": "assistant",
"content": "SELECT product_type, AVG(base_premium) AS avg_premium\nFROM insurance.insurance_products\nGROUP... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu... |
[
{
"role": "user",
"content": "Count the number of users whose location is 'London'."
},
{
"role": "assistant",
"content": "SELECT count(*) FROM social_media.users WHERE location = 'London';"
}
] | You are an SQL statement expert. Given the table 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": "Which invoices have a status of 'Partially Paid' and have not reached their due date yet? Show the invoice number, client ID, due date, and amount paid."
},
{
"role": "assistant",
"content": "SELECT invoice_number, client_id, due_date, amount_paid\nFROM legal_servic... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.invoices (
invoice_id character varying(64) NOT NULL, -- unique identifier for the invoice
invo... |
[
{
"role": "user",
"content": "Show me the top 5 smart money addresses by profit on the Ethereum chain, along with their most profitable token and ROI."
},
{
"role": "assistant",
"content": "SELECT address, most_profit_token, roi FROM smart_money_profit WHERE chain = 'Ethereum' ORDER BY profit DE... | You are an SQL statement expert. Given the table 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_profit ( address character varying(100) NOT NULL, rank INT, profit numeric(38,6), roi numeric(38,2), realiz... |
[
{
"role": "user",
"content": "List all orders that are currently pending and were created more than 24 hours ago."
},
{
"role": "assistant",
"content": "SELECT * FROM trading_platform.orders WHERE status = 'pending' AND created_at < CURRENT_TIMESTAMP - INTERVAL '24 hours';"
},
{
"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 trading_platform.orders ( order_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, wallet_id ch... |
[
{
"role": "user",
"content": "Show the total number of documents uploaded for each lawyer. Display the lawyer's first and last name and the document count."
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, COUNT(d.document_id) AS document_count\nFROM legal_services.lawyers... | You are an SQL statement expert. Given the table 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": "For the ticker 'doge', what are the different types of activities recorded in the `token_activities_bitcoin` table?"
},
{
"role": "assistant",
"content": "SELECT DISTINCT type FROM token_activities_bitcoin WHERE tick = 'doge'"
},
{
"role": "user",
"conte... | 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_historical ( block_number.bigint, contract_address.text, wallet_addre... |
[
{
"role": "user",
"content": "List all Sui NFT collections where the owner is not null, including their name and collection_type, sorted by name."
},
{
"role": "assistant",
"content": "SELECT name, collection_type FROM sui_nfts WHERE owner IS NOT NULL ORDER BY name ASC;"
},
{
"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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ... |
[
{
"role": "user",
"content": "Find all wallets that have more than 10 unspent UTXOs, along with their user's email and creation date."
},
{
"role": "assistant",
"content": "SELECT w.address, u.email, w.created_at, COUNT(ut.utxo_id) AS unspent_count FROM trading_platform.wallets w JOIN trading_pl... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username ch... |
[
{
"role": "user",
"content": "I want to find each player's total score across all sessions and the total number of items they have in their inventory."
},
{
"role": "assistant",
"content": "SELECT gs.player_id,\n SUM(gs.score) AS total_score,\n COALESCE(SUM(pi.quantity), 0) AS total_... | You are an SQL statement expert. Given the table 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.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, game_id ... |
[
{
"role": "user",
"content": "Show me all insurance products along with the number of distinct agents whose handled claims are for policies using that product. Include product_id, product_name, and agent_count."
},
{
"role": "assistant",
"content": "SELECT ip.product_id, ip.product_name, COUNT(D... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... |
[
{
"role": "user",
"content": "List all assets along with the names of any DApps they are linked to via metadata, assuming the metadata key is 'associated_dapp' and the value is a DApp ID. Show the asset name, asset symbol, and the linked DApp name."
},
{
"role": "assistant",
"content": "SELECT 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 trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type text )
CREATE TABLE trading_platform.... |
[
{
"role": "user",
"content": "Show me the total market cap and the total smart money inflow USD value for each narrative. Join the `token_basic_info` and `smart_money_token_inflow` tables based on narrative."
},
{
"role": "assistant",
"content": "WITH Narratives AS ( SELECT DISTINCT narrative FR... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address t... |
[
{
"role": "user",
"content": "For each application, show the application ID, the full name of the assigned employee, and the number of payments made for that application."
},
{
"role": "assistant",
"content": "SELECT a.application_id, CONCAT(e.first_name, ' ', e.last_name) AS employee_full_name,... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.applications ( application_id text, citizen_id text, service_id text, submitted_at timestamp, statu... |
[
{
"role": "user",
"content": "How many followers does each user have? Show user_id and follower_count."
},
{
"role": "assistant",
"content": "SELECT following_user_id AS user_id, COUNT(*) AS follower_count\nFROM social_media.follows\nGROUP BY following_user_id;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u... |
[
{
"role": "user",
"content": "List all users who have participated in group conversations created in April 2024, showing their username, conversation ID, and the group name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, c.conversation_id, c.group_name\nFROM social_media.conv... | You are an SQL statement expert. Given the table 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 wallet addresses and their private keys for users who have more than 3 wallets."
},
{
"role": "assistant",
"content": "SELECT w.address_id, w.private_key FROM blockchain.wallets w WHERE w.user_id IN (SELECT user_id FROM blockchain.wallets GROUP BY user_i... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.wallets (
wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet
user_id cha... |
[
{
"role": "user",
"content": "Show me all securities (security_id, ticker_symbol, security_name, currency) that are denominated in EUR or GBP, along with the employees (employee_id, email) who last updated them (assuming last_updated corresponds to employee actions)."
},
{
"role": "assistant",
"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.securities (
security_id character varying(64) NOT NULL, -- unique identifier for the security
... |
[
{
"role": "user",
"content": "Retrieve all room types where the base rate exceeds 200, listing the type name and base rate."
},
{
"role": "assistant",
"content": "SELECT type_name, base_rate FROM hospitality_technology.room_types WHERE base_rate > 200"
},
{
"role": "user",
"content":... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu... |
[
{
"role": "user",
"content": "For each trip, show the scheduled and actual arrival time alongside the vehicle_id and driver_id. Only include trips where the actual arrival was later than the scheduled arrival."
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, driver_id, schedule... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.trips ( trip_id text, route_id text, vehicle_id text, driver_id text, scheduled_departure timestamp, act... |
[
{
"role": "user",
"content": "How many insurance products are currently marked as inactive?"
},
{
"role": "assistant",
"content": "SELECT count(*) FROM insurance.insurance_products WHERE is_active = false;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_name character varying(150) NOT NULL,... |
[
{
"role": "user",
"content": "List all agents and their managers' full names."
},
{
"role": "assistant",
"content": "SELECT a.first_name, a.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name FROM insurance.agents a LEFT JOIN insurance.agents m ON a.manager_id = m.age... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l... |
[
{
"role": "user",
"content": "Show me the total quantity of fuel consumed and the total cost for each vehicle that has fuel log entries, including the vehicle's make and model."
},
{
"role": "assistant",
"content": "SELECT T1.vehicle_id, T2.make, T2.model, SUM(T1.quantity) AS total_fuel_quantity... | You are an SQL statement expert. Given the table 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": "Which chain has the highest total USD inflow from buy transactions (type=1), and how many distinct tokens were involved in that inflow?"
},
{
"role": "assistant",
"content": "SELECT chain, SUM(usd_value) AS total_inflow, COUNT(DISTINCT token_symbol) AS distinct_toke... | You are an SQL statement expert. Given the table 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": "For each property, show the property name, average price of available services, and the maximum price of available services."
},
{
"role": "assistant",
"content": "SELECT p.property_name,\n AVG(s.price) AS avg_price,\n MAX(s.price) AS max_price\nFROM hos... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.services (
service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ... |
[
{
"role": "user",
"content": "I need to find pairs of nodes that share the same port but have different IP addresses. Can you write a query for that?"
},
{
"role": "assistant",
"content": "SELECT n1.node_id AS node1_id,\n n2.node_id AS node2_id,\n n1.port\nFROM blockchain.nodes n1\nJ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ... |
[
{
"role": "user",
"content": "List pairs of bookings made for the same trip, showing booking IDs and their booking_time."
},
{
"role": "assistant",
"content": "SELECT b1.booking_id AS booking1,\n b2.booking_id AS booking2,\n b1.trip_id,\n b1.booking_time AS time1,\n b2.bo... | You are an SQL statement expert. Given the table 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.bookings ( booking_id.text, passenger_id.text, trip_id.text, seat_number.text, booking_time.timestamp, s... |
[
{
"role": "user",
"content": "List all insurance products that have 'auto' in their product type and are currently active, showing their product name and base premium."
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, product_type, base_premium FROM insurance.insurance_prod... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name... |
[
{
"role": "user",
"content": "What is the average delivery time in hours for all delivered service orders?"
},
{
"role": "assistant",
"content": "SELECT AVG(EXTRACT(EPOCH FROM (so.delivery_timestamp - so.order_timestamp)) / 3600) AS avg_delivery_hours\nFROM hospitality_technology.service_orders ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id.text, property_name.text, address_line1.text, address_line2.text, city.... |
[
{
"role": "user",
"content": "List reservations, including the reservation ID, check-in date, check-out date, property name, room type name, and room type base rate, for reservations with 3 or more adults."
},
{
"role": "assistant",
"content": "SELECT T1.reservation_id, T1.check_in_date, T1.chec... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ... |
[
{
"role": "user",
"content": "List the appointment ID, the scheduled start time, and the name of the service location for all appointments scheduled between '2024-01-01' and '2024-12-31'."
},
{
"role": "assistant",
"content": "SELECT T1.appointment_id, T1.scheduled_start_time, T2.location_name F... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "Show me all active policies with coverage limits above $1,000,000, along with the customer names and agent names, sorted by coverage limit in descending order."
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.coverage_limit, p.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d... |
[
{
"role": "user",
"content": "List `user_id` and `conversation_id` for participants who are in conversations where there is at least one message sent by *another* user that they have not read."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.user_id, T1.conversation_id FROM social_media... | You are an SQL statement expert. Given the table 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.messages ( message_id character varying(64) NOT NULL, conversation_id character varying(64) NOT NULL, send... |
[
{
"role": "user",
"content": "Show me all rooms that were last cleaned more than 3 days ago, along with their room numbers and cleaning status."
},
{
"role": "assistant",
"content": "SELECT room_number, current_condition FROM hospitality_technology.rooms WHERE last_cleaned_at < NOW() - INTERVAL ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text PRIMARY KEY, property_id text, room_number text, room_type_id text, floor i... |
[
{
"role": "user",
"content": "List all contracts with status 'active' and include the number of events they've emitted in the last 30 days."
},
{
"role": "assistant",
"content": "SELECT c.contract_id, c.address, COUNT(e.event_id) AS recent_event_count FROM web3.contracts c LEFT JOIN web3.events ... | You are an SQL statement expert. Given the table 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, -- unique identifier for the contract
address cha... |
[
{
"role": "user",
"content": "List service orders showing order ID, quantity, total price, and the name of the service ordered."
},
{
"role": "assistant",
"content": "SELECT T1.order_id, T1.quantity, T1.total_price, T2.service_name FROM hospitality_technology.service_orders AS T1 INNER JOIN hosp... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id.text, property_name.text, address_line1.text, address_line2.text, city.... |
[
{
"role": "user",
"content": "Show the policy number, start date, and the first and last name of the agent for all policies that started in 2024."
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.start_date, a.first_name AS agent_first_name, a.last_name AS agent_last_name\nFROM in... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,... |
[
{
"role": "user",
"content": "Show me all documents uploaded in 2024 that do not have a description."
},
{
"role": "assistant",
"content": "SELECT document_id, file_name, uploaded_at\nFROM insurance.claim_documents\nWHERE uploaded_at >= '2024-01-01'\n AND uploaded_at < '2025-01-01'\n AND (desc... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id character varying(64) NOT NULL, docume... |
[
{
"role": "user",
"content": "List the first name and last name of employees who were hired in the year 2023, along with the name of the agency they work for."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, a.agency_name FROM government_services.employees AS e JOIN gover... | You are an SQL statement expert. Given the table 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 for each loan_type, the total number of loans and the average principal_amount, along with the average account balance for the accounts associated with those loans."
},
{
"role": "assistant",
"content": "SELECT l.loan_type, COUNT(l.loan_id) AS loan_count, AV... | You are an SQL statement expert. Given the table 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 each narrative along with the token that has the highest current price and the token that has the lowest current price from the token_basic_info table."
},
{
"role": "assistant",
"content": "WITH ranked_high AS (\n SELECT narrative, token_symbol, price,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri... |
[
{
"role": "user",
"content": "List the document ID, document type, and the full name of the citizen who submitted the document, but only for documents submitted for applications with a status of 'Approved'."
},
{
"role": "assistant",
"content": "SELECT T1.document_id, T1.document_type, T3.first_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.documents ( document_id.text, application_id.text, citizen_id.text, document_type.text, file_refere... |
[
{
"role": "user",
"content": "Could you retrieve the number of appointments each doctor had in March 2024? Return the doctor's ID, full name, and total appointments."
},
{
"role": "assistant",
"content": "SELECT d.doctor_id, d.first_name || ' ' || d.last_name AS doctor_name, COUNT(a.appointment_... | You are an SQL statement expert. Given the table 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 transactions together with the event names they triggered (if any), showing transaction id, value, and event name. If a transaction does not have events, include it with a NULL event name."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.va... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,... |
[
{
"role": "user",
"content": "Show me all DApps that have 'exchange' in their name or description, along with their URLs and creation dates."
},
{
"role": "assistant",
"content": "SELECT dapp_id, name, description, url FROM trading_platform.dapps WHERE name LIKE '%exchange%' OR description LIKE ... | You are an SQL statement expert. Given the table 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": "How many beneficiaries are there for each relationship type in the policy_beneficiaries table?"
},
{
"role": "assistant",
"content": "SELECT relationship, COUNT(*) AS beneficiary_count\nFROM insurance.policy_beneficiaries\nGROUP BY relationship;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text... |
[
{
"role": "user",
"content": "List all premium payments with the amount_paid exactly 1000, showing the payment_id and payment_date."
},
{
"role": "assistant",
"content": "SELECT payment_id, payment_date\nFROM insurance.premium_payments\nWHERE amount_paid = 1000;"
}
] | You are an SQL statement expert. Given the table 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, -- unique identifier for the claim
policy_id charac... |
[
{
"role": "user",
"content": "List the peer IDs and IP addresses for all peers where the port is greater than 1024."
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address \nFROM trading_platform.peers \nWHERE port > 1024"
}
] | You are an SQL statement expert. Given the table 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, name character varying(128) NOT NULL, symbol charact... |
[
{
"role": "user",
"content": "Show me all service orders along with their status and the associated review comment for the same reservation, if there is one."
},
{
"role": "assistant",
"content": "SELECT so.order_id, so.status, r.comment \nFROM hospitality_technology.service_orders so\nLEFT JOIN... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_id.text, room_id.text, room_type_id.... |
[
{
"role": "user",
"content": "List all medical record IDs and the record date for records created by doctors specializing in 'Gastroenterology'."
},
{
"role": "assistant",
"content": "SELECT mr.record_id, mr.record_date FROM healthcare.medical_records mr JOIN healthcare.doctors d ON mr.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.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "List the full name of all guests who have submitted a review."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM hospitality_technology.guests AS T1 JOIN hospitality_technology.reviews AS T2 ON T1.guest_id = T2.guest_id;"
},
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la... |
[
{
"role": "user",
"content": "Show me the name of each property and the full name of the staff member assigned as its manager."
},
{
"role": "assistant",
"content": "SELECT T1.property_name, T2.first_name, T2.last_name FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.staf... | You are an SQL statement expert. Given the table 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": "Show me all smart contracts created by addresses that have a balance greater than 1000, along with the contract creation timestamp."
},
{
"role": "assistant",
"content": "SELECT sc.contract_id, sc.creator_address, sc.timestamp FROM blockchain.smart_contracts sc JOIN... | You are an SQL statement expert. Given the table 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 text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic... |
[
{
"role": "user",
"content": "List all customers whose email domain is 'gmail.com'. Show their customer_id, full name, and email."
},
{
"role": "assistant",
"content": "SELECT customer_id, CONCAT(first_name, ' ', last_name) AS full_name, email FROM financial_services.customers WHERE email LIKE '... | You are an SQL statement expert. Given the table 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 all users whose usernames start with the letter 'B'."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, created_at FROM trading_platform.users WHERE username LIKE 'B%';"
},
{
"role": "user",
"content": "Can you make it case-inse... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username ch... |
[
{
"role": "user",
"content": "Find the diagnosis code and description for all non-chronic diagnoses for patient 'patient_789' made by doctor 'doctor_abc'."
},
{
"role": "assistant",
"content": "SELECT diagnosis_code, description FROM healthcare.diagnoses WHERE patient_id = 'patient_789' AND doct... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.diagnoses (
diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry
... |
[
{
"role": "user",
"content": "For each driver, find the other driver whose license_expiry_date is the next one after theirs. Show both IDs, names and their expiry dates."
},
{
"role": "assistant",
"content": "SELECT\n d1.driver_id AS driver_id,\n d1.first_name || ' ' || d1.last_name... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens... |
[
{
"role": "user",
"content": "Which policies have a premium amount greater than the base premium of their respective insurance product? Please show the policy_number, premium_amount, product_name, and base_premium."
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.premium_amount, ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d... |
[
{
"role": "user",
"content": "Show all review IDs, property IDs, and the rating for service given for each review."
},
{
"role": "assistant",
"content": "SELECT review_id, property_id, rating_service\nFROM hospitality_technology.reviews;"
},
{
"role": "user",
"content": "Only display... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reviews (
review_id character varying(64) NOT NULL, -- unique identifier for the review
... |
[
{
"role": "user",
"content": "For each doctor specialty, count the total number of prescriptions issued by doctors in that specialty. Show the specialty and the prescription count."
},
{
"role": "assistant",
"content": "SELECT T2.specialty, COUNT(T1.prescription_id) FROM healthcare.prescriptions... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "What is the schedule of trains arriving at station with ID 'ST789' tomorrow?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the train schedule for station ID 'ST789' as this information is not available in the current database. The table only ... | 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": "Calculate the average price for services within each category."
},
{
"role": "assistant",
"content": "SELECT category, AVG(price) FROM hospitality_technology.services GROUP BY category;"
},
{
"role": "user",
"content": "Only include categories where the ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.text, description.text, category.text... |
[
{
"role": "user",
"content": "Calculate the total transfer volume and number of transfers for each Avalanche token tick over the past 7 days."
},
{
"role": "assistant",
"content": "SELECT ta.tick,\n SUM(ta.amt) AS total_volume,\n COUNT(*) AS transfer_count\nFROM token_activities_av... | You are an SQL statement expert. Given the table 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": "Show me all maintenance logs for vehicles that had a 'Brake Inspection' service type, along with the mechanic who performed the service."
},
{
"role": "assistant",
"content": "SELECT log_id, vehicle_id, service_date, mechanic_name FROM transportation.maintenance_log... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.maintenance_logs ( log_id text, vehicle_id text, service_date date, odometer_reading integer, service_ty... |
[
{
"role": "user",
"content": "List all individual token holdings by CEX addresses on the 'Arbitrum' chain with a USD value greater than $100,000. Show the exchange, token symbol, and USD value."
},
{
"role": "assistant",
"content": "SELECT exchange, token_symbol, usd_value FROM cex_token_balance... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id.text, token_name.text, token_symbol.text, token_address.text, chain.text, price.numeric, pri... |
[
{
"role": "user",
"content": "Tell me the count of hidden achievements and non-hidden achievements."
},
{
"role": "assistant",
"content": "SELECT hidden, COUNT(*) FROM achievements GROUP BY hidden;"
},
{
"role": "user",
"content": "What's the average point value for hidden vs non-hid... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, description.text, icon_url.text, points.... |
[
{
"role": "user",
"content": "List all patients who have been prescribed medications with dosage greater than 100mg, including their names and the medication details."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, m.medication_name, m.generic_name, pr.dosage FROM health... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "List all contracts with status 'active' and include their ABI length in characters."
},
{
"role": "assistant",
"content": "SELECT contract_id, address, LENGTH(abi) AS abi_length FROM web3.contracts WHERE status = 'active';"
},
{
"role": "user",
"content"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,... |
[
{
"role": "user",
"content": "For each doctor, list their full name along with the number of prescriptions they have written and the number of unique insurance providers among their patients."
},
{
"role": "assistant",
"content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(pr.prescript... | You are an SQL statement expert. Given the table 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 spa services (category = 'Wellness') with their names, prices, and units, ordered by price in descending order."
},
{
"role": "assistant",
"content": "SELECT service_name, price, unit FROM hospitality_technology.services WHERE category = 'Wellness' ORDER 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 hospitality_technology.guests (
guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil... |
[
{
"role": "user",
"content": "For each player, calculate the total quantity of items they have acquired. Return player_id and total_quantity."
},
{
"role": "assistant",
"content": "SELECT player_id,\n SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, item_id uuid, quantity int, acquire... |
[
{
"role": "user",
"content": "List pairs of token transfers within the same transaction and for the same token_id where the transfer values are different. Show the transaction ID, token ID, and both transfer IDs and their values."
},
{
"role": "assistant",
"content": "SELECT t1.transaction_id, 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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ... |
[
{
"role": "user",
"content": "Find pairs of items within each game that share the same rarity but have different item_types. Show game_id, rarity, item1_name, and item2_name."
},
{
"role": "assistant",
"content": "SELECT i1.game_id, i1.rarity, i1.item_name AS item1_name, i2.item_name AS item2_na... | You are an SQL statement expert. Given the table 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": "List smart money addresses, their chain, and profit for those who have incurred a loss. Order the results by the magnitude of the loss (smallest profit value first)."
},
{
"role": "assistant",
"content": "SELECT address, chain, profit FROM smart_money_profit WHERE p... | 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": "List all pending orders that were created more than 7 days ago, along with their order details."
},
{
"role": "assistant",
"content": "SELECT order_id, user_id, asset_id, order_type, quantity, price, created_at FROM trading_platform.orders WHERE status = 'pending' 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 trading_platform.orders ( order_id text, user_id text, wallet_id text, asset_id text, order_type text, quantity numeric... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.