conversations listlengths 2 8 | system stringlengths 288 8.23k |
|---|---|
[
{
"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": "Find all documents of type 'Correspondence' uploaded in 2023. Show the document name, upload timestamp, and the name of the case it belongs to."
},
{
"role": "assistant",
"content": "SELECT T1.document_name, T1.upload_timestamp, T2.case_name FROM legal_services.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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "Retrieve all documents uploaded in 2024, showing document_id, uploaded_by, and uploaded_at."
},
{
"role": "assistant",
"content": "SELECT document_id,\n uploaded_by,\n uploaded_at\nFROM insurance.claim_documents\nWHERE uploaded_at >= '2024-01-01'\n AND ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, file_name.text, file_path.text, file_s... |
[
{
"role": "user",
"content": "How many lawyers who are partners were hired in each year? Show the hire year and the count."
},
{
"role": "assistant",
"content": "SELECT strftime('%Y', hire_date) AS hire_year , count(lawyer_id) FROM legal_services.lawyers WHERE is_partner = true GROUP BY hire_... | You are an SQL statement expert. Given the table 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, -- unique identifier for the lawyer
first_n... |
[
{
"role": "user",
"content": "List all node pairs that operate on the same port and were last_seen within 30 minutes of each other, showing both node_ids, the port, and the time difference in minutes."
},
{
"role": "assistant",
"content": "SELECT n1.node_id AS node1_id, n2.node_id AS node2_id, 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 blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
|
[
{
"role": "user",
"content": "Provide the total count of unique users who have created wallets."
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT user_id) FROM web3.wallets;"
},
{
"role": "user",
"content": "Now, refine that to show the number of users who own *more than 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 web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"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": "Find all medical records where the vitals JSON field contains a blood pressure reading with systolic higher than 140, and show the patient_id, record_date, and vitals."
},
{
"role": "assistant",
"content": "SELECT patient_id, record_date, vitals FROM healthcare.medi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- unique identifier for the medical record... |
[
{
"role": "user",
"content": "Show the symbol, name, and total supply for all SUI coins with status 'active'."
},
{
"role": "assistant",
"content": "SELECT scm.symbol, scm.name, scm.coin_type, scm.total_supply\nFROM sui_coins_metadata scm\nWHERE scm.status = 'active';"
},
{
"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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add... |
[
{
"role": "user",
"content": "How many documents were uploaded in the year 2023?"
},
{
"role": "assistant",
"content": "SELECT count(*) FROM government_services.documents WHERE date_part('year', upload_timestamp) = 2023;"
}
] | You are an SQL statement expert. Given the table 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, application_id character varying(64), citiz... |
[
{
"role": "user",
"content": "List all room types showing their type name, base rate, and the name of the property where they are offered."
},
{
"role": "assistant",
"content": "SELECT T1.type_name, T1.base_rate, T2.property_name FROM hospitality_technology.room_types AS T1 JOIN hospitality_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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... |
[
{
"role": "user",
"content": "Show the number of employees in each department."
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS employee_count\nFROM financial_services.employees\ngroup BY department;"
},
{
"role": "user",
"content": "Exclude departments that have... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba... |
[
{
"role": "user",
"content": "What is the total revenue generated by ticket sales at the station with ID 'ST101' for the past month?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the revenue generated by ticket sales as this data is not available in the cur... | 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": "Show me all reviews with ratings of 5 stars, including the property name and review date."
},
{
"role": "assistant",
"content": "SELECT r.review_id, p.property_name, r.review_date FROM hospitality_technology.reviews r JOIN hospitality_technology.properties p ON r.pr... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... |
[
{
"role": "user",
"content": "Retrieve each prescription's id, patient's full name, medication_name, and prescription_date for prescriptions where dosage contains 'tablet'."
},
{
"role": "assistant",
"content": "SELECT pr.prescription_id, CONCAT(p.first_name, ' ', p.last_name) AS patient_name, m... | You are an SQL statement expert. Given the table 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 pairs of passengers who share the same loyalty program, including their IDs, first and last names, and the loyalty_program_id."
},
{
"role": "assistant",
"content": "SELECT p1.passenger_id AS passenger1_id, p1.first_name AS first1, p1.last_name AS last1, p2.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.passengers ( passenger_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te... |
[
{
"role": "user",
"content": "List all wallets holding the NFT with contract_address '0xabc123' and token_id '100' and the amount held."
},
{
"role": "assistant",
"content": "SELECT wallet_address, amount\nFROM nft_holders\nWHERE contract_address = '0xabc123'\n AND token_id = '100';"
},
{
... | You are an SQL statement expert. Given the table 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": "For each game_id, calculate the average points of achievements that have been unlocked at least once."
},
{
"role": "assistant",
"content": "SELECT a.game_id, AVG(a.points) AS average_unlocked_points FROM gaming_technology.achievements a JOIN gaming_technology.playe... | You are an SQL statement expert. Given the table 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": "For each manager, count how many agents they manage. Show manager_id and agent_count."
},
{
"role": "assistant",
"content": "SELECT manager_id,\n COUNT(*) AS agent_count\nFROM insurance.agents\nGROUP BY manager_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.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state... |
[
{
"role": "user",
"content": "List the first and last names of employees and the full name of the citizens for whom they have scheduled appointments."
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , T3.first_name , T3.last_name FROM government_services.employees 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 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 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": "Find guests who have made at least one payment using a 'CreditCard'. List their full name (first and last name) and email address."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.email FROM hospitality_technology.guests AS T1 J... | You are an SQL statement expert. Given the table 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": "What is the average, minimum, and maximum interest_rate for each loan_type among active loans?"
},
{
"role": "assistant",
"content": "SELECT loan_type,\n AVG(interest_rate) AS avg_interest_rate,\n MIN(interest_rate) AS min_interest_rate,\n MAX(inte... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.loans (
loan_id character varying(64) NOT NULL, -- unique identifier for the loan, could be same... |
[
{
"role": "user",
"content": "List all events and any token transfers that occurred in the same transaction, showing event_id, event_name, transfer_id, and token_symbol."
},
{
"role": "assistant",
"content": "SELECT\n e.event_id,\n e.event_name,\n tt.transfer_id,\n tk.token_symbol\nFROM web3... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "Show a list of all fuel refueling events for each trip, including the trip ID, fuel type, quantity, total cost, and the name of the refueling location."
},
{
"role": "assistant",
"content": "SELECT fl.trip_id, fl.fuel_type, fl.quantity, fl.total_cost, l.name AS loca... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text... |
[
{
"role": "user",
"content": "List all peer logs, showing the user_id and the action taken, ordered by the most recent log entry."
},
{
"role": "assistant",
"content": "SELECT user_id, action, logged_at\nFROM trading_platform.logs\nORDER BY logged_at 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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp )
CREATE TAB... |
[
{
"role": "user",
"content": "What is the average age of customers created in the last year?"
},
{
"role": "assistant",
"content": "SELECT AVG(DATE_PART('year', CURRENT_DATE) - DATE_PART('year', date_of_birth)) FROM financial_services.customers WHERE created_at >= CURRENT_DATE - INTERVAL '1 year... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h... |
[
{
"role": "user",
"content": "What are the specific tools or equipment used during the maintenance with record_id 'REC456'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the specific tools or equipment used during a maintenance record. The data in the ma... | 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.m... |
[
{
"role": "user",
"content": "Show me the top 5 NFT collections with the highest floor price on Ethereum, along with their names and contract addresses."
},
{
"role": "assistant",
"content": "SELECT name, contract_address, floor_price FROM nft_collections WHERE blockchain = 'ethereum' ORDER BY C... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "What is the reason behind the cost variation for maintenance of asset_id 'ASSET456' over the past year?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the reasons behind cost variations for maintenance. The data in the maintenan... | 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.m... |
[
{
"role": "user",
"content": "How many users have non-empty full_name and bio fields? Return only the count."
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM social_media.users\nWHERE full_name IS NOT NULL\n AND full_name <> ''\n AND bio IS NOT NULL\n AND bio <> '';"
}
] | You are an SQL statement expert. Given the table 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": "What is the average investment value for projects that completed Series A funding rounds?"
},
{
"role": "assistant",
"content": "SELECT AVG(investment_value) AS average_investment FROM project_fundraising_record WHERE rounds_name = 'Series 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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... |
[
{
"role": "user",
"content": "List the first name, last name, email, and phone number of all clients who have a case of type 'Bankruptcy', along with the name of the case."
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , T1.email , T1.phone , T2.case_name FROM leg... | You are an SQL statement expert. Given the table 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": "Can you narrow this down to only show cases where the case type is 'Criminal'?"
},
{
"role": "assistant",
"content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Crimin... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t... |
[
{
"role": "user",
"content": "How many distinct ports have been used by peers in the system?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT port) AS distinct_port_count\nFROM trading_platform.peers;"
}
] | You are an SQL statement expert. Given the table 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": "Find all contracts where the deployer address is the same as the contract address, indicating self-deployed contracts, and show their network IDs and deployment timestamps."
},
{
"role": "assistant",
"content": "SELECT address, network_id, deployed_at FROM web3.cont... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "Show me all active staff including their staff_id, first_name, last_name, position, and work_email."
},
{
"role": "assistant",
"content": "SELECT staff_id,\n first_name,\n last_name,\n position,\n work_email\nFROM hospitality_technology.staff... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, fir... |
[
{
"role": "user",
"content": "List the first name, last name, and hire date of all lawyers who are partners."
},
{
"role": "assistant",
"content": "SELECT first_name , last_name , hire_date FROM legal_services.lawyers WHERE is_partner = TRUE"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer
first_n... |
[
{
"role": "user",
"content": "Show me all patients who have been prescribed medications with dosage greater than 100mg, along with their full names and the medication details, including the prescribing doctor's last name."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, m... | You are an SQL statement expert. Given the table 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": "能否帮我查询特定路线(route_id 为 'route_ne_corr')上的所有车站信息,并包含每个车站的平台数量?"
},
{
"role": "assistant",
"content": "ZRANGE route:route_ne_corr:stops 0 -1\nHGETALL route_station:<route_station_id> for each route_station_id in result\nHGETALL station:<station_id> for each station_id ... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// Use Hashes to store station details. Key format: station:<station_id>
// Example:
// HSET stat... |
[
{
"role": "user",
"content": "List all insurance products that have a base premium greater than 1000 and are currently active, showing product name, type, and base premium."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WH... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d... |
[
{
"role": "user",
"content": "Find all patients who have been prescribed medications with dosage greater than 50mg, along with their medication details and prescribing doctor's name."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, pr.dosage, pr.medication_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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ... |
[
{
"role": "user",
"content": "Identify all instances where a vehicle's odometer_reading increased by more than 500 miles between two consecutive fuel log entries."
},
{
"role": "assistant",
"content": "SELECT a.vehicle_id,\n a.fuel_log_id AS previous_log_id,\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.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_timestamp.timestamp, fuel_type.text, qu... |
[
{
"role": "user",
"content": "List all auto loans (loan_id, principal_amount, interest_rate) where the current principal balance is less than 40% of the original principal amount, along with the account_id and the difference between principal_amount and current_principal_balance."
},
{
"role": "assi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.loans ( loan_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL UNIQUE, lo... |
[
{
"role": "user",
"content": "For each developer, can you find the next developer in the same country using a self join, returning developer_ids and names?"
},
{
"role": "assistant",
"content": "SELECT d1.developer_id AS current_dev,\n d1.name AS current_name,\n d2.develo... | You are an SQL statement expert. Given the table 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.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ... |
[
{
"role": "user",
"content": "Show me the top 5 users by the total number of trades they participated in as buyers, along with their wallet addresses."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, w.address, COUNT(t.trade_id) AS trade_count FROM trading_platform.users u JO... | You are an SQL statement expert. Given the table 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": "List all users whose email contains the word 'block', along with their username and registration timestamp."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, created_at\nFROM web3.users\nWHERE email ILIKE '%block%';"
},
{
"role": "user"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
|
[
{
"role": "user",
"content": "List all services with an average processing time greater than the overall average processing time for all services. Show the service name, average processing time, and the overall average processing time."
},
{
"role": "assistant",
"content": "SELECT service_name, ... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, agency_id character varying(64) NOT NULL, ser... |
[
{
"role": "user",
"content": "What are the fuel consumption rates per hour for the Boeing 747-8 model?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the fuel consumption rates for the Boeing 747-8 model as this data is not included in the aircraft_models ta... | 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": "List all clients along with their case_number and case_type for cases that are currently 'Open'."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, c.email, cs.case_number, cs.case_type\nFROM legal_services.clients AS c\nJOIN legal_services.cas... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam... |
[
{
"role": "user",
"content": "Which narrative from narrative_info has the highest token_num, and what is the total market cap and 24h volume for that narrative?"
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap, volume_24h, token_num\nFROM narrative_info\nORDER BY token_num DES... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... |
[
{
"role": "user",
"content": "List pairs of citizens who share the same email domain."
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first1,\n c1.last_name AS last1,\n c2.first_name AS first2,\n c2.last_name AS last2,\n SPLIT_PART(c1.contact_email, '@', 2)... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Show a list of all game developers with their name and founded year."
},
{
"role": "assistant",
"content": "SELECT\n name,\n founded_year\nFROM gaming_technology.developers;"
},
{
"role": "user",
"content": "Please filter the list to only include devel... | You are an SQL statement expert. Given the table 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": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs."
},
{
"role": "assistant",
"content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS case_id_2 FROM lega... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u... |
[
{
"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 character varying(64) NOT NULL, -- unique identifier for the customer
first_... |
[
{
"role": "user",
"content": "What are the safety ratings or crash statistics for the Boeing 787 Dreamliner?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to safety ratings or crash statistics for specific aircraft models like the Boeing 787 Dreamliner. My data is lim... | 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 all time entries from the last 90 days, including the entry description, hours spent, the name of the case, and the name of the client."
},
{
"role": "assistant",
"content": "SELECT T1.description, T1.hours_spent, T2.case_name, T3.first_name, T3.last_name FR... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- unique identifier for the time entry
... |
[
{
"role": "user",
"content": "Show me all documents uploaded by lawyers from law firms located in 'New York'. Include the document name, upload timestamp, the first and last name of the uploading lawyer, and the firm name."
},
{
"role": "assistant",
"content": "SELECT d.document_name, d.upload_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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "What is the current market price of a Boeing 737 MAX aircraft?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and general information ab... | 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": "Can you provide the total number of maintenance records for a specific train with train_id 'train_789'?"
},
{
"role": "assistant",
"content": "MATCH (t:Train {train_id: 'train_789'})<-[:PERFORMED_ON]-(mr:MaintenanceRecord)\nRETURN COUNT(mr) AS total_maintenance_reco... | 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
// Node Label: :Platform
// Properties:
// platform_id: String (Constraint: UNIQUE)
// platfo... |
[
{
"role": "user",
"content": "Show me the top 5 narratives by market cap, along with their 24-hour trading volume and 7-day price change percentage."
},
{
"role": "assistant",
"content": "SELECT narrative.text, volume_24h.numeric, price_change_percentage_7d.numeric FROM narrative_info ORDER BY m... | You are an SQL statement expert. Given the table 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... |
[
{
"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_name, base_premium FROM insurance.insurance_products WHERE product_type LI... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara... |
[
{
"role": "user",
"content": "List all NFT collections where the floor price is greater than 0.5 ETH, including their names and contract addresses."
},
{
"role": "assistant",
"content": "SELECT name, contract_address FROM nft_collections WHERE CAST(floor_price AS decimal) > 0.5 AND floor_price_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 token_metas (
block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded
... |
[
{
"role": "user",
"content": "Show me the number of game servers in each region and the average maximum number of players they can accommodate. Exclude any servers that are currently offline."
},
{
"role": "assistant",
"content": "SELECT region, COUNT(server_id) AS server_count, AVG(max_players)... | You are an SQL statement expert. Given the table 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 the average capacity of vehicles for each fuel_type."
},
{
"role": "assistant",
"content": "SELECT fuel_type,\n AVG(capacity) AS avg_capacity\nFROM transportation.vehicles\nGROUP BY fuel_type;"
},
{
"role": "user",
"content": "Only include 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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text... |
[
{
"role": "user",
"content": "Show me the first and last names of citizens along with their dates of birth and contact emails for all citizens who registered after January 1, 2023."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth, contact_email FROM government_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 text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "List the latest version of each document (identified by case_id and document_name), showing the version number and its upload_timestamp."
},
{
"role": "assistant",
"content": "SELECT d.case_id,\n d.document_name,\n d.version AS latest_version,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u... |
[
{
"role": "user",
"content": "For each player, list the total number of 'Legendary' rarity items they have in their inventory, along with the titles of the respective games those items belong to."
},
{
"role": "assistant",
"content": "SELECT pi.player_id, g.game_id, g.title, COUNT(*) AS legendar... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time... |
[
{
"role": "user",
"content": "Find all pairs of distinct appointments for the same case that overlap in time. Show both appointment IDs, the case_id, and the start_time and end_time of each appointment."
},
{
"role": "assistant",
"content": "SELECT a1.appointment_id AS appointment_id_1,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ... |
[
{
"role": "user",
"content": "For each citizen who has made at least one payment, show the citizen's full name, number of payments, and total amount paid, grouped by currency."
},
{
"role": "assistant",
"content": "SELECT\n c.first_name || ' ' || c.last_name AS full_name,\n p.currency,\n COUN... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "What is the average ROI and average realized_ratio for each chain?"
},
{
"role": "assistant",
"content": "SELECT chain,\n AVG(roi) AS avg_roi,\n AVG(realized_ratio) AS avg_realized_ratio\nFROM smart_money_token_performance\nGROUP BY chain;"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,... |
[
{
"role": "user",
"content": "List all wallets that were created during the hour of the day which saw the highest number of wallet creations. Show the wallet ID, user ID, address, and creation timestamp."
},
{
"role": "assistant",
"content": "WITH HourlyCounts AS (\n SELECT EXTRACT(HOUR FROM ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"role": "user",
"content": "Show me all claims along with the related customer's full name and the policy number for incidents that occurred in 2024."
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, c.description, cu.first_name || ' ' || cu.last_name AS customer_full_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
first_... |
[
{
"role": "user",
"content": "Find the total number of documents uploaded by each citizen along with their first and last names."
},
{
"role": "assistant",
"content": "SELECT c.citizen_id, c.first_name, c.last_name, COUNT(d.document_id) AS document_count\nFROM government_services.citizens c\nLEF... | You are an SQL statement expert. Given the table 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": "What is the average number of days by which paid invoices were paid late? Calculate the average of (payment_date - due_date) for invoices with status 'Paid'."
},
{
"role": "assistant",
"content": "SELECT AVG((payment_date::date - due_date)) AS average_late_days\nFRO... | You are an SQL statement expert. Given the table 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, invoice_number character varying(100) UNIQUE NOT N... |
[
{
"role": "user",
"content": "List all active SUI coins with status 'exists' in metadata, showing coin_type, symbol, name, balance, and description."
},
{
"role": "assistant",
"content": "SELECT sc.coin_type, sm.symbol, sm.name, sc.balance, sm.description\nFROM sui_coins sc\nJOIN sui_coins_metad... | You are an SQL statement expert. Given the table 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": "Which vehicles have a total maintenance cost exceeding 10000 across all their maintenance logs?"
},
{
"role": "assistant",
"content": "SELECT vehicle_id, SUM(cost) AS total_maintenance_cost FROM transportation.maintenance_logs GROUP BY vehicle_id HAVING SUM(cost) > ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU... |
[
{
"role": "user",
"content": "I need to find all components associated with a specific supplier. Can you help with that?"
},
{
"role": "assistant",
"content": "HGETALL component:<component_id>\nIF HGET component:<component_id> supplier_id = 'sup:ACME_AERO' THEN INCLUDE"
},
{
"role": "use... | 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
Use Hashes. Key pattern: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_numbe... |
[
{
"role": "user",
"content": "What are the training programs or certifications completed by a staff member with the role of Platform Supervisor?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about the training programs or certifications completed by sta... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.s... |
[
{
"role": "user",
"content": "Show the total number of policies in each status."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) FROM insurance.policies 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.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin... |
[
{
"role": "user",
"content": "For each agency, how many services are currently inactive? Return the agency_id and the count of inactive services."
},
{
"role": "assistant",
"content": "SELECT\n agency_id,\n COUNT(*) AS inactive_service_count\nFROM government_services.services\nWHERE is_active ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli... |
[
{
"role": "user",
"content": "List all pairs of clients who registered on the same day, showing each client's first_name, last_name, and the registration date."
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first_name_1, c1.last_name AS last_name_1, c2.first_name AS first_name_2,... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad... |
[
{
"role": "user",
"content": "Could you show me the usernames of users who have received likes on their posts, along with the total number of likes each user's posts have received?"
},
{
"role": "assistant",
"content": "SELECT T1.username, count(T3.like_id) AS total_likes_received FROM social_me... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"role": "user",
"content": "Return the count of comments for each hashtag."
},
{
"role": "assistant",
"content": "SELECT ph.hashtag_id,\n h.tag_name,\n COUNT(c.comment_id) AS comment_count\nFROM social_media.post_hashtags ph\nJOIN social_media.hashtags h\n ON ph.hashtag_id = h.has... | You are an SQL statement expert. Given the table 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": "Find all wallets that were created on the same day and list their wallet IDs, addresses, and the creation date."
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id, w1.address, w1.created_at::date AS creation_date FROM web3.wallets w1 JOIN (SELECT created_at:... | You are an SQL statement expert. Given the table 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.wallets (
wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet
user_id character... |
[
{
"role": "user",
"content": "List all locations of type 'depot' in the United States, showing their name, state, and city."
},
{
"role": "assistant",
"content": "SELECT name, state_province, city FROM transportation.locations WHERE country = 'United States' AND type = 'depot';"
},
{
"ro... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ... |
[
{
"role": "user",
"content": "What is the current location of train number Acela 2151?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to real-time location data for trains. The database only contains static information such as train ID, model, capacity, and maintenance... | 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.t... |
[
{
"role": "user",
"content": "Show me all events emitted by contracts where the event name contains 'Approval', along with the contract ID and transaction ID, sorted by emitted timestamp in descending order."
},
{
"role": "assistant",
"content": "SELECT event_id, contract_id, event_name, 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.events (
event_id character varying(64) NOT NULL, -- unique identifier for the event
contract_id characte... |
[
{
"role": "user",
"content": "List each transaction along with its status and the names of any events that were emitted during that transaction."
},
{
"role": "assistant",
"content": "SELECT tr.transaction_id, tr.status, e.event_name\nFROM web3.transactions tr\nLEFT JOIN web3.events e ON tr.tran... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "List all agencies that do not have a website URL specified. Return their agency_id, agency_name, and main_phone_number."
},
{
"role": "assistant",
"content": "SELECT agency_id, agency_name, main_phone_number FROM government_services.agencies WHERE website_url 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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count."
},
{
"role": "assistant",
"content": "SELECT g.genre, COUNT(gs.session_id) AS session_count, COUNT(DISTIN... | You are an SQL statement expert. Given the table 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": "For each vehicle, list its vehicle_id, license_plate, and any older vehicle of the same type (showing older_vehicle_id and older year)."
},
{
"role": "assistant",
"content": "SELECT cur.vehicle_id,\n cur.license_plate,\n old.vehicle_id AS older_vehicle_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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
[
{
"role": "user",
"content": "I want to list all employees who currently manage at least one other employee, showing their full name, email, and the total number of direct reports for each manager."
},
{
"role": "assistant",
"content": "SELECT e.employee_id, e.first_name || ' ' || e.last_name 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 financial_services.accounts (
account_id character varying(64) NOT NULL, -- unique identifier for the account
c... |
[
{
"role": "user",
"content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount, sorted by amount in descending order."
},
{
"role": "assistant",
"content": "SELECT b.wallet_address, t.symbol, b.amount FROM erc20_balances b JOIN sui_coin... | You are an SQL statement expert. Given the table 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 the service_id, service_name, and agency_id for all active services that have an online application URL provided."
},
{
"role": "assistant",
"content": "SELECT service_id,\n service_name,\n agency_id\nFROM government_services.services\nWHERE is_acti... | You are an SQL statement expert. Given the table 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": "List all female patients born before 1990 who have a phone number listed, showing their full names and contact information."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, phone_number, email, emergency_contact_name, emergency_contact_phone FROM... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "I need to identify pairs of verified documents submitted by the same citizen. For each pair, display the citizen_id, the earlier document_id with its verification timestamp, and the later document_id with its verification timestamp."
},
{
"role": "assistant",
"conte... | You are an SQL statement expert. Given the table 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, application_id character varying(64), citiz... |
[
{
"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": "Show me all claims with police reports that were handled by agents hired in the last 2 years, along with the agent's full name and agency."
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.policy_id, c.incident_date, c.police_report_number, CONCAT(a.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 insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d... |
[
{
"role": "user",
"content": "Give a list of all policies where the deductible is less than 1000. Show policy_id, policy_number, start_date, and deductible."
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number, start_date, deductible\nFROM insurance.policies\nWHERE deductible <... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
first_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.