conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "List the usernames and full names of users who created their account in 2024 and are verified."
},
{
"role": "assistant",
"content": "SELECT username, full_name FROM social_media.users WHERE created_at >= '2024-01-01' AND created_at < '2025-01-01' AND is_verified = ... | You are an SQL statement expert. Given the table 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 all claim documents (document_id, file_name, and document_type) for claims that have a settlement amount greater than 5000."
},
{
"role": "assistant",
"content": "SELECT cd.document_id, cd.file_name, cd.document_type\nFROM insurance.claim_documents cd\nJOIN 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.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name... |
[
{
"role": "user",
"content": "Provide a summary of the total number of loans and the average principal_amount for each loan_type."
},
{
"role": "assistant",
"content": "SELECT loan_type, COUNT(*) AS loan_count, AVG(principal_amount) AS avg_principal\nFROM financial_services.loans\nGROUP BY loan_... | You are an SQL statement expert. Given the table 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 text PRIMARY KEY, account_id text, loan_type text, principal_amount numeric, current... |
[
{
"role": "user",
"content": "Show me all active policies with coverage limits above $500,000, along with the customer IDs and agent IDs, sorted by coverage limit in descending order."
},
{
"role": "assistant",
"content": "SELECT policy_id, customer_id, agent_id, coverage_limit FROM insurance.po... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ... |
[
{
"role": "user",
"content": "Show each review's comment, the property name, and the review date for all public reviews submitted in 2023."
},
{
"role": "assistant",
"content": "SELECT rv.comment, p.property_name, rv.review_date\nFROM hospitality_technology.reviews rv\nJOIN hospitality_technolog... | You are an SQL statement expert. Given the table 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": "Which citizens have made successful payments and also have had at least one appointment scheduled? I want to see their first name, last name, total payment amount, and number of appointments."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, 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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Which tokens on BSC and Polygon have a ROI higher than 2 this year? Show their symbols, ROI, and average cost."
},
{
"role": "assistant",
"content": "SELECT token_symbol, roi, avg_cost, chain FROM smart_money_token_performance WHERE (chain = 'BSC' OR chain = 'Polygo... | You are an SQL statement expert. Given the table 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 character varying(100) NOT NULL, token_symbol character varying(100), pnl... |
[
{
"role": "user",
"content": "Which doctors do not have an email address listed? Please show their doctor ID, first name, last name, and the hospital they are affiliated with."
},
{
"role": "assistant",
"content": "SELECT doctor_id, first_name, last_name, hospital_affiliation_id FROM healthcare.... | You are an SQL statement expert. Given the table 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 wallet addresses holding at least 2 different NFTs from the same contract on Ethereum. Show contract_address, wallet_address, and the count of token_ids held."
},
{
"role": "assistant",
"content": "SELECT contract_address, wallet_address, COUNT(DISTINCT tok... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE nft_holders ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wallet_address varchar NOT NULL, token_i... |
[
{
"role": "user",
"content": "List all active reservations with their guest names and room numbers, ordered by check-in date."
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, g.first_name, g.last_name, ro.room_number, r.check_in_date FROM hospitality_technology.reservations r 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.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... |
[
{
"role": "user",
"content": "Show each user's earliest wallet and latest wallet with their wallet_id and created_at."
},
{
"role": "assistant",
"content": "SELECT w1.user_id,\n w1.wallet_id AS earliest_wallet,\n w1.created_at AS earliest_date,\n w2.wallet_id AS latest_wallet,\... | You are an SQL statement expert. Given the table 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 )
|
[
{
"role": "user",
"content": "Show me the usernames of users who have followed someone, but have not been followed by anyone. Include the time they started following others."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, f.created_at AS follow_created_at\nFROM social_media.us... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "Can you help me retrieve the details of all platforms at a specific station with station_id 'STATION_001', including the platform status and whether they are accessible?"
},
{
"role": "assistant",
"content": "SELECT platform_id, platform_number, track_number, status... | 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 train_station_management.platforms (
platform_id character varying(64) NOT NULL,... |
[
{
"role": "user",
"content": "Can you help me retrieve the details of all bookings for a specific route with route_id 'RT789', including the passenger names and the scheduled departure times?"
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name, p.last_name, s.departure_datet... | 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 train_station_management.train_cars (
car_id character varying(64) NOT NULL, -- ... |
[
{
"role": "user",
"content": "Find the average transaction value for successful transactions grouped by block number, showing only blocks with more than 10 transactions."
},
{
"role": "assistant",
"content": "SELECT block_number, AVG(value) as avg_value, COUNT(*) as transaction_count FROM web3.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.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address text, value numeric, gas_used int, g... |
[
{
"role": "user",
"content": "Show me the appointment ID, subject, and the full name of the lawyer for all appointments where a location is specified."
},
{
"role": "assistant",
"content": "SELECT T2.appointment_id, T2.subject, T1.first_name, T1.last_name FROM legal_services.lawyers AS T1 JOIN l... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam... |
[
{
"role": "user",
"content": "For each Sui NFT with status 'exists', show its object ID, collection type, and owner."
},
{
"role": "assistant",
"content": "SELECT object_id, collection_type, owner FROM sui_nfts WHERE status = 'exists';"
},
{
"role": "user",
"content": "Only show NFTs... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "Show me all users who had their KYC rejected along with when their review was completed."
},
{
"role": "assistant",
"content": "SELECT user_id, reviewed_at FROM trading_platform.kyc_audit WHERE status = 'rejected';"
}
] | You are an SQL statement expert. Given the table 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.kyc_audit ( kyc_audit_id.text, user_id.text, status.text, reviewed_at.timestamp )
|
[
{
"role": "user",
"content": "List all insurance products along with their product type and creation date."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, created_at\nFROM insurance.insurance_products;"
}
] | You are an SQL statement expert. Given the table 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": "Could you please list the first and last names of all clients?"
},
{
"role": "assistant",
"content": "SELECT first_name, last_name FROM clients;"
},
{
"role": "user",
"content": "Now, only show clients whose status is 'active'."
},
{
"role": "ass... | You are an SQL statement expert. Given the table 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": "Retrieve conversation IDs and user IDs of participants who joined after '2024-01-01', including their last_read_at timestamps."
},
{
"role": "assistant",
"content": "SELECT conversation_id, user_id, last_read_at FROM social_media.conversation_participants WHERE 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 social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, created_at.timestamp )
CREATE TABLE soc... |
[
{
"role": "user",
"content": "Show all contracts that share the same deployment date, along with their contract IDs and the corresponding deployment date."
},
{
"role": "assistant",
"content": "SELECT a.contract_id AS contract_id_1, b.contract_id AS contract_id_2, a.deployed_at::date AS deployme... | You are an SQL statement expert. Given the table 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": "I need a breakdown showing, for each game, how many in-game items exist per rarity category."
},
{
"role": "assistant",
"content": "SELECT i.game_id,\n i.rarity,\n COUNT(*) AS item_count\nFROM gaming_technology.in_game_items i\nGROUP BY i.game_id, i.rari... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player
... |
[
{
"role": "user",
"content": "I need a list of each case_number and case_name with the total hours spent on each case based on time_entries, but only include cases where the total hours is greater than 10."
},
{
"role": "assistant",
"content": "SELECT c.case_number, c.case_name, SUM(te.hours_spe... | You are an SQL statement expert. Given the table 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 amount paid across all premium payments for payments marked as 'Failed'?"
},
{
"role": "assistant",
"content": "SELECT sum(amount_paid) FROM insurance.premium_payments WHERE status = 'Failed';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... |
[
{
"role": "user",
"content": "Show 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": "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 failed payments with their details."
},
{
"role": "assistant",
"content": "SELECT payment_id, application_id, citizen_id, service_id, amount, currency, payment_method, payment_provider_reference, payment_timestamp, status, notes FROM government_services.pay... | You are an SQL statement expert. Given the table 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.payments ( payment_id.text, application_id.text, citizen_id.text, service_id.text, amount.numeric, ... |
[
{
"role": "user",
"content": "Show all prescriptions made in 2024 for medications prescribed during appointments scheduled at location 'LOC001', including prescription_id, patient_id, medication_id, and appointment_time."
},
{
"role": "assistant",
"content": "SELECT pr.prescription_id, pr.patien... | You are an SQL statement expert. Given the table 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": "Show me all pairs of medications that share the same manufacturer. Include each medication's medication_id, medication_name, and the manufacturer."
},
{
"role": "assistant",
"content": "SELECT m1.medication_id AS med1_id, m1.medication_name AS med1_name, m2.medicati... | You are an SQL statement expert. Given the table 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.medications (
medication_id character varying(64) NOT NULL, -- unique identifier for the medication type... |
[
{
"role": "user",
"content": "Show the full names and job titles of employees who work in the same department as at least one other employee."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, job_title\nFROM government_services.employees\nWHERE department IN (\n SELECT depa... | You are an SQL statement expert. Given the table 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.employees ( employee_id text, agency_id text, first_name text, last_name text, job_title text, depa... |
[
{
"role": "user",
"content": "Show me all customers who have missing contact information (either phone number or email is null), along with their state and city."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, state, city FROM insurance.customers WHERE phone_number IS NULL O... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,... |
[
{
"role": "user",
"content": "Show the count of unread notifications per user for notifications related to posts. Return recipient_user_id and unread_count."
},
{
"role": "assistant",
"content": "SELECT recipient_user_id, COUNT(*) AS unread_count\nFROM social_media.notifications\nWHERE target_en... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u... |
[
{
"role": "user",
"content": "List the token symbol, USD value, and narrative for all smart money token inflows."
},
{
"role": "assistant",
"content": "SELECT token_symbol, usd_value, narrative FROM smart_money_token_inflow;"
},
{
"role": "user",
"content": "Now, only show entries wh... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_inflow ( token_address text, token_symbol text, token_amount numer... |
[
{
"role": "user",
"content": "Get all non-smoking rooms with status 'Available'."
},
{
"role": "assistant",
"content": "SELECT room_id, property_id, room_number, floor\nFROM hospitality_technology.rooms\nWHERE is_smoking = FALSE\n AND status = 'Available';"
},
{
"role": "user",
"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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "What is the average estimated_loss for claims with status 'Filed' or 'Approved'?"
},
{
"role": "assistant",
"content": "SELECT AVG(estimated_loss) AS avg_estimated_loss\nFROM insurance.claims\nWHERE status IN ('Filed', 'Approved');"
}
] | You are an SQL statement expert. Given the table 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": "Provide a count of lawyers based on whether they are a partner or not."
},
{
"role": "assistant",
"content": "SELECT is_partner, COUNT(*) FROM legal_services.lawyers GROUP BY is_partner;"
}
] | You are an SQL statement expert. Given the table 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": "How many unique IP addresses are there in the nodes table?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes;"
},
{
"role": "user",
"content": "Can you break this down by port numbers, showi... | You are an SQL statement expert. Given the table 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 text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
|
[
{
"role": "user",
"content": "Show me all open cases along with the case number, the client's full name, and the name and email of the lead lawyer."
},
{
"role": "assistant",
"content": "SELECT c.case_number, cl.first_name || ' ' || cl.last_name AS client_full_name, l.first_name || ' ' || l.last... | You are an SQL statement expert. Given the table 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 all messages sent in the system, along with their sender's username and the time they were sent."
},
{
"role": "assistant",
"content": "SELECT m.message_id, m.content, u.username, m.sent_at\nFROM social_media.messages m\nJOIN social_media.users u ON m.sender... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "Show me the top 5 players by their average game session score, including their username and calculated average score."
},
{
"role": "assistant",
"content": "SELECT p.username,\n AVG(gs.score) AS average_score\nFROM gaming_technology.players p\nJOIN gaming_tech... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player
... |
[
{
"role": "user",
"content": "I want to list each security alongside another security issued by the same issuer."
},
{
"role": "assistant",
"content": "SELECT a.security_id, a.ticker_symbol, b.security_id AS other_security_id, b.ticker_symbol AS other_ticker, a.issuer_name\nFROM financial_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 financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, isin_code text, cusip_code text, secu... |
[
{
"role": "user",
"content": "I want to know how many times each smart contract has been invoked by transactions; also include the contract creator."
},
{
"role": "assistant",
"content": "SELECT sc.contract_id, sc.creator_address, COUNT(t.transaction_id) AS invocation_count\nFROM blockchain.smar... | You are an SQL statement expert. Given the table 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.transactions ( transaction_id text, block_id text, sender_address text, receiver_address text, amount numeri... |
[
{
"role": "user",
"content": "List the document ID, document type, upload timestamp, and the full name of the employee who verified it for all documents that have been verified."
},
{
"role": "assistant",
"content": "SELECT d.document_id, d.document_type, d.upload_timestamp, CONCAT(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 government_services.documents (
document_id character varying(64) NOT NULL, -- unique identifier for the document i... |
[
{
"role": "user",
"content": "For each publisher, find pairs of games they have published that belong to different genres. Include publisher_id, the genre and title of both games in each pair."
},
{
"role": "assistant",
"content": "SELECT g1.publisher_id,\n g1.genre AS genre1,\n g1.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 gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "Show me all loans and the type of account each loan is associated with. Include the loan ID and the account type."
},
{
"role": "assistant",
"content": "SELECT l.loan_id, a.account_type FROM financial_services.loans l JOIN financial_services.accounts a ON l.account_... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac... |
[
{
"role": "user",
"content": "Show the usernames of users who have a non-empty bio."
},
{
"role": "assistant",
"content": "SELECT username FROM social_media.users WHERE bio IS NOT NULL AND bio != '';"
},
{
"role": "user",
"content": "Now, only show users who were created before 2024.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "Show me the total number of bookings and total fare collected per trip. Only include trips that have collected more than 500 in total fare."
},
{
"role": "assistant",
"content": "SELECT trip_id, COUNT(*) AS booking_count, SUM(fare) AS total_fare\nFROM transportation... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the booking
pass... |
[
{
"role": "user",
"content": "For each snapshot_time in cex_token_balance, calculate the total usd_value across all exchanges and order by snapshot_time ascending."
},
{
"role": "assistant",
"content": "SELECT snapshot_time,\n SUM(usd_value) AS total_usd_value\nFROM cex_token_balance\nGROU... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... |
[
{
"role": "user",
"content": "Show me all cancelled policies with their cancellation reasons and premium amounts, sorted by cancellation date in descending order."
},
{
"role": "assistant",
"content": "SELECT policy_id, cancellation_reason, premium_amount, cancellation_date FROM insurance.polici... | You are an SQL statement expert. Given the table 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 me the top 3 tokens by liquidity on the Binance chain, along with their price and 1-hour price change percentage."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, price_change_percentage_1h, liquidity FROM token_dexpool_info 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 token_dexpool_info ( pair_address character varying(512) NOT NULL, token_name character varying(100) NOT NULL, token_sy... |
[
{
"role": "user",
"content": "Find pairs of BUY and SELL trades from the trades table for the same account that occurred on the same settlement_date and had matching quantities."
},
{
"role": "assistant",
"content": "SELECT\n a.trade_id AS buy_trade_id,\n b.trade_id AS sell_trade_id,\n a.acco... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.trades ( trade_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL, securit... |
[
{
"role": "user",
"content": "List all room types that have at least one service in the 'Spa' category, including the room type name, property name, and service name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT rt.type_name, p.property_name, s.service_name\nFROM hospitality_technology... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... |
[
{
"role": "user",
"content": "List all SUI NFT objects with status 'exists', showing the object_id, name, and owner."
},
{
"role": "assistant",
"content": "SELECT object_id, name, owner FROM sui_nfts WHERE status = 'exists';"
},
{
"role": "user",
"content": "Add the collection type 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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "List all prescriptions with a dosage greater than 50mg, including the medication ID and patient ID."
},
{
"role": "assistant",
"content": "SELECT prescription_id, medication_id, patient_id FROM healthcare.prescriptions WHERE dosage > '50mg';"
},
{
"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 healthcare.prescriptions ( prescription_id text PRIMARY KEY, record_id text, patient_id text, doctor_id text, medicatio... |
[
{
"role": "user",
"content": "Show me the count of posts per media_type for public posts."
},
{
"role": "assistant",
"content": "SELECT media_type, COUNT(*) AS post_count\nFROM social_media.posts\nWHERE visibility = 'public'\nGROUP BY media_type;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, content text, medi... |
[
{
"role": "user",
"content": "Show me all diesel fuel logs where the quantity is more than 50 liters, including the vehicle_id, trip_id, and total_cost."
},
{
"role": "assistant",
"content": "SELECT fuel_log_id, vehicle_id, trip_id, total_cost FROM transportation.fuel_logs WHERE fuel_type = 'die... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, route_id character varying(64), vehicle_id character var... |
[
{
"role": "user",
"content": "Retrieve the usernames and email addresses of users who updated their profiles in the last 30 days."
},
{
"role": "assistant",
"content": "SELECT username, email\nFROM social_media.users\nWHERE updated_at >= NOW() - INTERVAL '30 days';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "Show the total value and total gas used for all transactions occurring in each distinct year."
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM timestamp) AS transaction_year, SUM(value) AS total_value, SUM(gas_used) AS total_gas_used FROM web3.transac... | You are an SQL statement expert. Given the table 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": "For each fueling event, show the fuel_log_id, vehicle_id, the full name of the assigned driver for the trip during that fueling event, and the log_timestamp."
},
{
"role": "assistant",
"content": "SELECT fl.fuel_log_id, fl.vehicle_id, d.first_name || ' ' || d.last_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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens... |
[
{
"role": "user",
"content": "For each doctor, count how many diagnoses they have recorded in total. Display doctor ID and the total count."
},
{
"role": "assistant",
"content": "SELECT doctor_id, COUNT(*) AS total_diagnoses FROM healthcare.diagnoses GROUP BY doctor_id;"
},
{
"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 healthcare.diagnoses (
diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry
... |
[
{
"role": "user",
"content": "How many games are available on each platform?"
},
{
"role": "assistant",
"content": "SELECT platform,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY platform;"
},
{
"role": "user",
"content": "Only include platforms that have mor... | You are an SQL statement expert. Given the table 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.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "List the names of services for which documents are set to expire in the next 90 days."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.service_name FROM government_services.services AS T1 JOIN applications AS T2 ON T1.service_id = T2.service_id JOIN governm... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego... |
[
{
"role": "user",
"content": "Show me all contracts deployed on the 'ethereum' network along with their deployer addresses and the count of token transfers associated with each contract, sorted by transfer count in descending order."
},
{
"role": "assistant",
"content": "SELECT c.address, c.depl... | You are an SQL statement expert. Given the table 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": "Find, for each token, how many unique recipient addresses it has. Show token_symbol, contract_address, and recipient_count, ordered by recipient_count descending."
},
{
"role": "assistant",
"content": "SELECT t.token_symbol,\n t.contract_address,\n COUNT... | You are an SQL statement expert. Given the table 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 top 5 transactions with the highest gas prices that were successful, including the from_address, to_address, and block_number."
},
{
"role": "assistant",
"content": "SELECT from_address, to_address, block_number, gas_price FROM web3.transactions WHERE statu... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add... |
[
{
"role": "user",
"content": "List the first name, last name, and license plate for drivers who have driven vehicles with a capacity greater than 75."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T3.license_plate FROM transportation.drivers AS T1 JOIN Trips AS T2 ON ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ... |
[
{
"role": "user",
"content": "List policy_number, customer_id, and product_name for policies that are currently active."
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.customer_id, ip.product_name\nFROM insurance.policies p\nJOIN insurance.insurance_products ip ON p.product_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.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d... |
[
{
"role": "user",
"content": "What is the average fare for bookings with status 'Completed'?"
},
{
"role": "assistant",
"content": "SELECT AVG(fare) FROM transportation.bookings WHERE status = 'Completed';"
},
{
"role": "user",
"content": "What about the average fare for 'Cancelled' ... | You are an SQL statement expert. Given the table 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 pairs of token transfers that occurred within the same transaction and for the same token, but were sent to different recipient addresses. Show both transfer IDs and the shared transaction ID and token ID."
},
{
"role": "assistant",
"content": "SELECT t1.transf... | You are an SQL statement expert. Given the table 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": "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": "Count the number of unique locations specified in the users table."
},
{
"role": "assistant",
"content": "SELECT count(DISTINCT location) FROM social_media.users WHERE location 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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "List all beneficiaries added in the last 6 months, showing their full names and relationship to the policyholder."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, relationship FROM insurance.policy_beneficiaries WHERE added_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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text... |
[
{
"role": "user",
"content": "Which properties offer services in the 'Business Center' department, and what are the names and prices of those services?"
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, s.service_name, s.price\nFROM hospitality_technology.properties 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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "Which bed types are offered in each property and how many different room types are associated with each bed type?"
},
{
"role": "assistant",
"content": "SELECT property_id, bed_type, COUNT(DISTINCT room_type_id) AS room_type_count FROM hospitality_technology.room_ty... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, property_id text, type_name text, description text, ... |
[
{
"role": "user",
"content": "Show me the names and types of all assets, and also display for each the most recent reviewed_at time from the kyc_audit table for any user."
},
{
"role": "assistant",
"content": "SELECT a.name, a.type, (\n SELECT MAX(ka.reviewed_at) \n FROM trading_platform.k... | You are an SQL statement expert. Given the table 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": "List all documents, including their document_id, document_type, upload_timestamp, and the reference number of the associated application."
},
{
"role": "assistant",
"content": "SELECT d.document_id, d.document_type, d.upload_timestamp, a.reference_number\nFROM 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": "List all beneficiaries who do not have any contact information provided. Show beneficiary_id, first_name, and last_name."
},
{
"role": "assistant",
"content": "SELECT beneficiary_id, first_name, last_name FROM insurance.policy_beneficiaries WHERE contact_info IS NUL... | You are an SQL statement expert. Given the table 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 each port along with the count of distinct IP addresses observed on that port."
},
{
"role": "assistant",
"content": "SELECT port, COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes GROUP BY port;"
},
{
"role": "user",
"content": "O... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ... |
[
{
"role": "user",
"content": "List all available rooms with their room number, property_name, type_name, and the number of days since they were last cleaned."
},
{
"role": "assistant",
"content": "SELECT p.property_name,\n r.room_number,\n rt.type_name,\n date_part('day', curre... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "List each user with 'pending' KYC status, including their user_id, the number of unread notifications they have, and the date of their latest unread notification."
},
{
"role": "assistant",
"content": "SELECT k.user_id, COUNT(n.notification_id) AS unread_count, MAX(... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan... |
[
{
"role": "user",
"content": "List all narratives with a trend rank in the top 10 and their 7-day price change percentage."
},
{
"role": "assistant",
"content": "SELECT narrative, price_change_percentage_7d\nFROM narrative_info\nWHERE trend_rank <= 10\nORDER BY trend_rank;"
}
] | You are an SQL statement expert. Given the table 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 token transfers where the value is an even number, showing transfer ID, token ID, value, and transaction ID."
},
{
"role": "assistant",
"content": "SELECT transfer_id, token_id, value, transaction_id\nFROM web3.token_transfers\nWHERE MOD(value, 2) = 0;"
}... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id.text, token_id.text, from_address.text, to_address.text, value.numeric, transaction_... |
[
{
"role": "user",
"content": "How many distinct relationships are listed for policy beneficiaries?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT relationship) FROM insurance.policy_beneficiaries;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la... |
[
{
"role": "user",
"content": "Show me all users who registered with a Gmail email address, along with their usernames and registration dates."
},
{
"role": "assistant",
"content": "SELECT username, email FROM blockchain.users WHERE email LIKE '%@gmail.com';"
},
{
"role": "user",
"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 blockchain.users ( user_id text, username text, email text, password_hash text )
|
[
{
"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": "For each Avalanche token tick, calculate the total transfer volume and transaction count over the past 7 days using token_activities_avalanche. Include the token tick, total_volume, and tx_count."
},
{
"role": "assistant",
"content": "SELECT\n tick,\n SUM(amt) AS ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"role": "user",
"content": "List all managers (employees who are managers to someone else) showing their employee ID, first name, last name, and job title."
},
{
"role": "assistant",
"content": "SELECT DISTINCT m.employee_id, m.first_name, m.last_name, m.job_title\nFROM government_services.emp... | You are an SQL statement expert. Given the table 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.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa... |
[
{
"role": "user",
"content": "List the names and symbols of all assets that have at least one associated metadata entry in the metadata table."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.name, T1.symbol FROM trading_platform.assets AS T1 JOIN trading_platform.metadata AS T2 ON T1.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.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ... |
[
{
"role": "user",
"content": "Show me the top 5 narratives by market cap, along with their top 3 coins and 24-hour trading volume."
},
{
"role": "assistant",
"content": "SELECT narrative, top_3_coins, volume_24h FROM narrative_info ORDER BY market_cap DESC LIMIT 5;"
},
{
"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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative top_3_coins text, -- the top 3 token... |
[
{
"role": "user",
"content": "What are the environmental impact assessments for the production of the Airbus A350 model?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to data regarding the environmental impact assessments for the production of specific aircraft models... | 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 manufacturing.aircraft_mod... |
[
{
"role": "user",
"content": "Show me pairs of claims filed for the same policy, including the claim IDs and incident dates for both claims."
},
{
"role": "assistant",
"content": "SELECT\n c1.claim_id AS claim1_id,\n c1.incident_date AS claim1_incident_date,\n c2.claim_id AS claim2_id,\n c2.... | You are an SQL statement expert. Given the table 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 top 5 largest PDF documents in claim_documents, showing document_id, claim_id, file_name, and file_size_bytes."
},
{
"role": "assistant",
"content": "SELECT document_id,\n claim_id,\n file_name,\n file_size_bytes\nFROM insurance.claim_docu... | You are an SQL statement expert. Given the table 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 ERC20 tokens where the price is greater than $10, including their names, symbols, and contract addresses."
},
{
"role": "assistant",
"content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest tpl ON tm.contract_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_... |
[
{
"role": "user",
"content": "How many routes start and end in the same city?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS same_city_routes\nFROM transportation.routes AS r\nJOIN transportation.locations AS o ON r.origin_location_id = o.location_id\nJOIN transportation.locations AS ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id character varying(64) NOT NULL UNIQUE, f... |
[
{
"role": "user",
"content": "List pairs of partners in the same firm, showing each partner's full name and hire_date."
},
{
"role": "assistant",
"content": "SELECT p1.first_name || ' ' || p1.last_name AS partner1_name,\n p1.hire_date AS partner1_hire,\n p2.first_name || ' ' || p2.la... | You are an SQL statement expert. Given the table 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": "Which exchanges hold the highest total USD value of tokens on the Ethereum chain, and what are their top 3 tokens by USD value?"
},
{
"role": "assistant",
"content": "SELECT exchange, token_symbol, usd_value FROM cex_token_balance WHERE chain = 'Ethereum' ORDER BY u... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE cex_token_balance ( snapshot_time text, chain text, address text, exchange text, token_address text, token_symbol text,... |
[
{
"role": "user",
"content": "I want to know each player's username, country code, number of unique items they own, and total quantity of items in their inventory."
},
{
"role": "assistant",
"content": "SELECT p.username, p.country_code,\n COUNT(DISTINCT pi.item_id) AS unique_items,\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 NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player
... |
[
{
"role": "user",
"content": "Show me all items of rarity 'Epic', displaying the item's name and type, along with the title of the game it is part of."
},
{
"role": "assistant",
"content": "SELECT igi.item_name, igi.item_type, g.title FROM gaming_technology.in_game_items igi JOIN gaming_technolo... | You are an SQL statement expert. Given the table 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 NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for... |
[
{
"role": "user",
"content": "For narratives listed in `narrative_info`, find the total USD value held by CEXes for tokens that are among their top 3 listed coins. Show the narrative and the total CEX USD value."
},
{
"role": "assistant",
"content": "SELECT T2.narrative, SUM(T1.usd_value) AS Tot... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.