conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "Show me the top 3 narratives by total token inflow amount where smart money was buying (type = 1)."
},
{
"role": "assistant",
"content": "SELECT narrative, SUM(token_amount) AS total_inflow_amount FROM smart_money_token_inflow WHERE type = 1 GROUP BY narrative ORDER... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the token's address token_symbol character... |
[
{
"role": "user",
"content": "List all passengers along with their ages and loyalty program membership status."
},
{
"role": "assistant",
"content": "SELECT passenger_id, first_name, last_name, date_of_birth, loyalty_program_id, DATE_PART('year', AGE(current_date, date_of_birth)) AS age FROM tra... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.passengers (
passenger_id character varying(64) NOT NULL, -- unique identifier for the passenger
... |
[
{
"role": "user",
"content": "List the diagnosis_id, patient_id, and doctor_id for all diagnoses with status 'Pending' and is_chronic set to TRUE."
},
{
"role": "assistant",
"content": "SELECT diagnosis_id, patient_id, doctor_id FROM healthcare.diagnoses WHERE status = 'Pending' AND is_chronic =... | You are an SQL statement expert. Given the table 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.text, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty... |
[
{
"role": "user",
"content": "For each server, find the maximum score achieved on that server along with its region and game_id."
},
{
"role": "assistant",
"content": "SELECT s.server_id, s.region, s.game_id, MAX(gs.score) AS max_score FROM gaming_technology.servers s JOIN gaming_technology.game... | You are an SQL statement expert. Given the table 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": "Show me all creator addresses that deployed smart contracts exactly on February 14th, 2023."
},
{
"role": "assistant",
"content": "SELECT DISTINCT creator_address\nFROM blockchain.smart_contracts\nWHERE timestamp::date = '2023-02-14';"
},
{
"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 blockchain.smart_contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the smart contra... |
[
{
"role": "user",
"content": "What is the schedule of trains arriving at station with ID 'ST789' tomorrow?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the train schedule for station ID 'ST789' as this information is not available in the current database. The table only ... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.s... |
[
{
"role": "user",
"content": "Show me the earliest created smart contract for each creator address."
},
{
"role": "assistant",
"content": "SELECT sc1.contract_id, sc1.creator_address, sc1.timestamp\nFROM blockchain.smart_contracts sc1\nWHERE sc1.timestamp = (\n SELECT MIN(sc2.timestamp)\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.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
|
[
{
"role": "user",
"content": "Show me all smart contracts created by addresses that have created more than 3 contracts, along with the count of contracts each creator has made."
},
{
"role": "assistant",
"content": "SELECT creator_address, COUNT(*) AS contract_count FROM blockchain.smart_contrac... | You are an SQL statement expert. Given the table 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.smart_contracts ( contract_id text PRIMARY KEY, creator_address text, code text, timestamp timestamp )
|
[
{
"role": "user",
"content": "Which cities have more than 10 active customers in the state of Texas? Provide the city name and the customer count."
},
{
"role": "assistant",
"content": "SELECT city, COUNT(*) AS customer_count\nFROM insurance.customers\nWHERE state = 'TX' AND status = 'Active'\nG... | You are an SQL statement expert. Given the table 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 policies that expired in the last 30 days, along with their customer IDs and product IDs."
},
{
"role": "assistant",
"content": "SELECT policy_id, customer_id, product_id, end_date FROM insurance.policies WHERE end_date BETWEEN DATE_SUB(CURRENT_DATE(), 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 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 all fuel logs where the location is 'LOC456', including the vehicle ID, fuel type, and quantity."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, fuel_type, quantity FROM transportation.fuel_logs WHERE location_id = 'LOC456';"
},
{
"role": "... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu... |
[
{
"role": "user",
"content": "Show me each department in each property, along with the total number of available services and their combined price."
},
{
"role": "assistant",
"content": "SELECT property_id, department, COUNT(*) AS service_count, SUM(price) AS total_price FROM hospitality_technol... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL... |
[
{
"role": "user",
"content": "Which patients have a primary insurance policy and are subscribed to a plan provided by 'Cigna'? List patient ID, full name, policy number, plan ID, and insurance provider."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, pi.pol... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "I want to see a list of followers and the usernames of the users they are following, along with when they followed."
},
{
"role": "assistant",
"content": "SELECT u_f.username AS follower_username,\n u_t.username AS following_username,\n f.created_at\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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "For each employee who acts as a manager, please show the number of employees directly reporting to them."
},
{
"role": "assistant",
"content": "SELECT m.first_name || ' ' || m.last_name AS manager_name, COUNT(e.employee_id) AS direct_report_count FROM financial_serv... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri... |
[
{
"role": "user",
"content": "Show me the top 5 NFT collections on Ethereum with the highest number of unique owners, along with their names and floor prices."
},
{
"role": "assistant",
"content": "SELECT nc.name, nc.floor_price, COUNT(DISTINCT nh.wallet_address) AS unique_owners FROM nft_collec... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add... |
[
{
"role": "user",
"content": "Show the payment_id and amount_paid for all premium payments where the status is 'pending'."
},
{
"role": "assistant",
"content": "SELECT payment_id, amount_paid\nFROM insurance.premium_payments\nWHERE status = 'pending';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_name character varying(150) NOT NULL,... |
[
{
"role": "user",
"content": "Can you show me all achievement unlock records where the same player unlocked two different achievements within the same day? Please show player_id, achievement_id_1, achievement_id_2, and the unlock dates for each."
},
{
"role": "assistant",
"content": "SELECT pa1.... | You are an SQL statement expert. Given the table 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_achievements ( player_achievement_id uuid, player_id uuid, achievement_id uuid, unlocked_at ti... |
[
{
"role": "user",
"content": "List policy IDs and policy numbers for policies that have a null cancellation reason."
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number FROM insurance.policies WHERE cancellation_reason IS NULL;"
}
] | You are an SQL statement expert. Given the table 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 pairs of drivers who share the same license_expiry_date."
},
{
"role": "assistant",
"content": "SELECT d1.driver_id AS driver1_id,\n d1.first_name AS driver1_first_name,\n d1.last_name AS driver1_last_name,\n d2.driver_id AS driver2_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.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens... |
[
{
"role": "user",
"content": "List all property pairs that share the same postal_code, showing each pair's property IDs, names, and the postal_code."
},
{
"role": "assistant",
"content": "SELECT a.property_id AS property_id_1,\n a.property_name AS property_name_1,\n b.property_id 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "List all games along with the count of in-game items they have. Only include games with more than 10 items and sort by the item count in descending order."
},
{
"role": "assistant",
"content": "SELECT g.game_id, g.title, COUNT(i.item_id) AS item_count\nFROM gaming_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(), title character varying(200) NOT NULL, devel... |
[
{
"role": "user",
"content": "Find all developers founded before the year 2000 and show their name and country."
},
{
"role": "assistant",
"content": "SELECT name, country FROM gaming_technology.developers WHERE founded_year < 2000;"
},
{
"role": "user",
"content": "Now, for the 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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... |
[
{
"role": "user",
"content": "Which users have joined private conversations (not group chats), and what are the conversation IDs and join times?"
},
{
"role": "assistant",
"content": "SELECT u.username, cp.conversation_id, cp.joined_at\nFROM social_media.conversation_participants cp\nJOIN social... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, full_name.text, profile_picture_url.t... |
[
{
"role": "user",
"content": "List the full names and email addresses of citizens who have submitted an application but have not uploaded any documents for that application. Display the citizen's full name, application_id, and submitted_at."
},
{
"role": "assistant",
"content": "SELECT c.first_n... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "List each property along with the count of available rooms grouped by bed type."
},
{
"role": "assistant",
"content": "SELECT rt.property_id, p.property_name, rt.bed_type, COUNT(r.room_id) AS available_count\nFROM hospitality_technology.rooms r\nJOIN hospitality_tec... | You are an SQL statement expert. Given the table 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": "Could you please list the first name, last name, and email address for all passengers in the system?"
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM transportation.passengers;"
},
{
"role": "user",
"content": "Now, refine ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.passengers (
passenger_id character varying(64) NOT NULL, -- unique identifier for the passenger
... |
[
{
"role": "user",
"content": "Show me the top 5 NFT collections with the highest number of unique owners, along with their names and contract addresses."
},
{
"role": "assistant",
"content": "SELECT nc.name, nc.contract_address, COUNT(DISTINCT nh.wallet_address) AS unique_owners FROM nft_collect... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc20_balances_historical ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk i... |
[
{
"role": "user",
"content": "For token transfers, list total transfer volume and number of transfers per token tick in the last 7 days."
},
{
"role": "assistant",
"content": "WITH agg AS (\n SELECT tick,\n SUM(amt) AS total_volume,\n COUNT(*) AS transfer_count\n FROM token_act... | You are an SQL statement expert. Given the table 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 the name of each agency and whether it operates at least one service location marked as accessible."
},
{
"role": "assistant",
"content": "SELECT T1.agency_name FROM government_services.agencies AS T1 JOIN government_services.service_locations AS T2 ON T1.agenc... | You are an SQL statement expert. Given the table 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, -- unique identifier for the agency
ag... |
[
{
"role": "user",
"content": "List all guests with country code 'US'."
},
{
"role": "assistant",
"content": "SELECT guest_id, first_name, last_name, email, country_code\nFROM hospitality_technology.guests\nWHERE country_code = 'US';"
},
{
"role": "user",
"content": "Actually, only in... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.room_types (
room_type_id character varying(64) NOT NULL, -- unique identifier for the room ... |
[
{
"role": "user",
"content": "List all agents who have a commission rate above 0.1, showing their full names and agency names."
},
{
"role": "assistant",
"content": "SELECT agent_id, first_name, last_name, agency_name, commission_rate FROM insurance.agents WHERE commission_rate > 0.1 AND 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.policies (
policy_id character varying(64) NOT NULL, -- unique identifier for the policy
customer_id ... |
[
{
"role": "user",
"content": "List the full names and hire dates of all employees who report directly to a manager with the job title 'Director'."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, e.hire_date\nFROM government_services.employees e\nJOIN government_services.e... | You are an SQL statement expert. Given the table 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": "For each ERC20 token, find the count of distinct historical holders and the sum of balances using erc20_balances_historical."
},
{
"role": "assistant",
"content": "SELECT contract_address,\n COUNT(DISTINCT wallet_address) AS holder_count,\n SUM(CAST(amou... | You are an SQL statement expert. Given the table 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": "List the names of citizens who have submitted applications for services with a standard fee greater than 50."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 JOIN government_services.applicati... | You are an SQL statement expert. Given the table 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, national_id_number text, first_name text, last_name text, date_of_birth... |
[
{
"role": "user",
"content": "How many users registered in each month?"
},
{
"role": "assistant",
"content": "SELECT date_trunc('month', created_at) AS month,\n COUNT(*) AS registrations\nFROM web3.users\nGROUP BY month\nORDER BY month;"
},
{
"role": "user",
"content": "Actuall... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email character varying(... |
[
{
"role": "user",
"content": "List each property and the number of public reviews it has received."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, COUNT(r.review_id) AS public_review_count\nFROM hospitality_technology.properties p\nLEFT JOIN hospitality_technology.r... | You are an SQL statement expert. Given the table 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 all servers that have zero current players. Show their server name, region, and status."
},
{
"role": "assistant",
"content": "SELECT server_name, region, status FROM gaming_technology.servers WHERE current_players = 0;"
},
{
"role": "user",
"conten... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p... |
[
{
"role": "user",
"content": "Which five license states have the highest count of active agents? Return the license_state and agent_count."
},
{
"role": "assistant",
"content": "SELECT license_state,\n COUNT(*) AS agent_count\nFROM insurance.agents\nWHERE status = 'Active'\nGROUP BY licens... | You are an SQL statement expert. Given the table 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": "What is the average number of appointments assigned per employee for each job title?"
},
{
"role": "assistant",
"content": "SELECT e.job_title, CAST(COUNT(a.appointment_id) AS REAL) / COUNT(DISTINCT e.employee_id) AS average_appointments_per_employee FROM government... | You are an SQL statement expert. Given the table 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": "List the names of active services and their categories provided by agencies with a 'Federal' jurisdiction level."
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T1.category FROM government_services.services AS T1 JOIN government_services.agencies AS T... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Find all users who registered with a Yahoo email address, along with their registration dates."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, password_hash FROM blockchain.users WHERE email LIKE '%@yahoo.com';"
},
{
"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 blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic... |
[
{
"role": "user",
"content": "Show me each wallet address along with the number of unread notifications for the user who owns that wallet."
},
{
"role": "assistant",
"content": "SELECT w.address, COUNT(n.notification_id) AS unread_count\nFROM trading_platform.wallets w\nJOIN trading_platform.not... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
CREATE ... |
[
{
"role": "user",
"content": "Find pairs of claims filed by the same customer where the incident dates are within 7 days of each other. Return customer_id, both claim IDs, and their incident dates."
},
{
"role": "assistant",
"content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_id,\... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier for the claim
policy_id charac... |
[
{
"role": "user",
"content": "Show me all insurance plans where the website includes 'secure'."
},
{
"role": "assistant",
"content": "SELECT * FROM healthcare.insurance_plans WHERE website ILIKE '%secure%';"
}
] | You are an SQL statement expert. Given the table 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 ERC20 tokens from the `token_metas` table that have a total supply greater than 1 followed by 21 zeros. Show their contract address, symbol, name, and total supply."
},
{
"role": "assistant",
"content": "SELECT contract_address, symbol, name, total_supply 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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add... |
[
{
"role": "user",
"content": "Show me projects that completed a fundraising round in 2023 and have an associated token held by centralized exchanges. Display the project name, fundraising amount, the associated token symbol, and the total USD value of that token held by CEXes across all chains and snapshots... | You are an SQL statement expert. Given the table 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": "Find agents whose commission_rate is higher than their manager's commission_rate. Show agent_id, agent first_name, agent last_name, commission_rate, manager_id, and the manager's commission_rate."
},
{
"role": "assistant",
"content": "SELECT a.agent_id,\n a.fi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l... |
[
{
"role": "user",
"content": "Could you list each service’s name together with its agency’s name and the total number of active employees working at that agency?"
},
{
"role": "assistant",
"content": "SELECT\n s.service_name,\n a.agency_name,\n COUNT(e.employee_id) AS active_employee_count\nF... | You are an SQL statement expert. Given the table 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": "Find pairs of user IDs (A, B) such that user A follows user B, and user B also follows user A (mutual follows). List user A's ID and user B's ID."
},
{
"role": "assistant",
"content": "SELECT T1.follower_user_id AS user_a, T1.following_user_id AS user_b FROM social_... | You are an SQL statement expert. Given the table 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.follows ( follow_id text, follower_user_id text, following_user_id text, created_at timestamp )
|
[
{
"role": "user",
"content": "Show me all vehicles that are due for their next service before the end of this month, along with their last service type and date."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_type, service_date FROM transportation.maintenance_logs WHERE next_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 transportation.maintenance_logs (
log_id character varying(64) NOT NULL, -- unique identifier for the maintenance ... |
[
{
"role": "user",
"content": "Count the number of trips for each route type."
},
{
"role": "assistant",
"content": "SELECT R.type, COUNT(T.trip_id) FROM transportation.trips AS T JOIN transportation.routes AS R ON T.route_id = R.route_id GROUP BY R.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 transportation.routes ( route_id.text, route_number.text, description.text, origin_location_id.text, destination_locati... |
[
{
"role": "user",
"content": "List the notification message and sent timestamp for all notifications that were sent before '2024-07-01'."
},
{
"role": "assistant",
"content": "SELECT message, sent_at FROM trading_platform.notifications WHERE sent_at < '2024-07-01';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.notifications ( notification_id text, user_id text, message text, sent_at timestamp, read_at timestamp... |
[
{
"role": "user",
"content": "List all unique document types along with the count of documents for each type."
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) AS document_count FROM legal_services.documents GROUP BY document_type;"
},
{
"role": "user",
"content":... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u... |
[
{
"role": "user",
"content": "List all invoices, showing the invoice number, issue date, total amount, and the payment status."
},
{
"role": "assistant",
"content": "SELECT invoice_number, issue_date, total_amount, status FROM invoices"
},
{
"role": "user",
"content": "Only include 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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "Which staff members processed payments for guests who live in California? I need their names and the corresponding guest names."
},
{
"role": "assistant",
"content": "SELECT DISTINCT st.first_name AS staff_first_name, st.last_name AS staff_last_name, g.first_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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "Show me the count of law firms grouped by the year they were founded. Include the founding year and the number of firms."
},
{
"role": "assistant",
"content": "SELECT\n EXTRACT(YEAR FROM founded_date) AS founding_year,\n COUNT(firm_id) AS firm_count\nFROM legal_se... | You are an SQL statement expert. Given the table 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.law_firms ( firm_id character varying(64) NOT NULL, firm_name character varying(200) NOT NULL, address t... |
[
{
"role": "user",
"content": "Find the day with the highest total game session count. Show the date and the total session count."
},
{
"role": "assistant",
"content": "SELECT DATE(start_time) AS session_date, COUNT(*) AS total_sessions\nFROM gaming_technology.game_sessions\nGROUP BY session_date... | You are an SQL statement expert. Given the table 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": "List the username and full name of all users who have set their profile to private."
},
{
"role": "assistant",
"content": "SELECT u.username, u.full_name FROM social_media.users u JOIN social_media.user_settings us ON u.user_id = us.user_id WHERE us.private_profile ... | You are an SQL statement expert. Given the table 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": "For each application that has pending documents, list the application's reference_number and the corresponding service_name. Only include documents with verification_status = 'Pending'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.reference_number, s.ser... | You are an SQL statement expert. Given the table 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": "Which fundraising round in 2022 had the highest single investment amount, and what is the name and introduction of the associated project?"
},
{
"role": "assistant",
"content": "SELECT rounds_name, project_name, introduction, investment_value FROM project_fundraisin... | You are an SQL statement expert. Given the table 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": "Can you show a list of securities with their ticker symbol, instrument type, and the total number of trades for each security?"
},
{
"role": "assistant",
"content": "SELECT s.security_id, s.ticker_symbol, s.security_type, COUNT(t.transaction_id) AS trade_count\nFROM... | You are an SQL statement expert. Given the table 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": "Show me the total fuel quantity and cost for each route, grouped by route number, only for trips that have associated fuel logs."
},
{
"role": "assistant",
"content": "SELECT r.route_number, SUM(f.quantity) AS total_quantity, SUM(f.total_cost) AS total_cost\nFROM tr... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati... |
[
{
"role": "user",
"content": "List all vehicles where the capacity is less than or equal to 30. Include vehicle_id, make, model, and type."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, make, model, type FROM transportation.vehicles WHERE capacity <= 30;"
},
{
"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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU... |
[
{
"role": "user",
"content": "Find projects that have both fundraising records and basic token information. Display the project name, fundraising round name, investment value, and the token's current price."
},
{
"role": "assistant",
"content": "SELECT T1.project_name, T1.rounds_name, T1.investm... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character... |
[
{
"role": "user",
"content": "Retrieve all billable but not yet billed time entries, showing entry_id, lawyer_id, case_id, hours_spent, and billing_rate."
},
{
"role": "assistant",
"content": "SELECT entry_id, lawyer_id, case_id, hours_spent, billing_rate\nFROM legal_services.time_entries\nWHERE... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, case_number text UNIQUE, case_name text, client_id text, lead_lawyer_i... |
[
{
"role": "user",
"content": "Find all players who unlocked between 5 and 10 achievements in the year 2023. List their player ID and the count of achievements unlocked in 2023."
},
{
"role": "assistant",
"content": "SELECT player_id, COUNT(*) AS achievement_count_2023 FROM gaming_technology.play... | You are an SQL statement expert. Given the table 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_achievements (
player_achievement_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique id... |
[
{
"role": "user",
"content": "For each service location, find its nearest accessible location by geographic distance."
},
{
"role": "assistant",
"content": "SELECT sl.location_id,\n sl.location_name,\n nearest.location_id AS nearest_location_id,\n nearest.location_name AS nea... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.service_locations ( location_id.text, agency_id.text, location_name.text, address.text, city.text, ... |
[
{
"role": "user",
"content": "How many patients are there for each gender?"
},
{
"role": "assistant",
"content": "SELECT gender, COUNT(*) AS patient_count\nFROM healthcare.patients\nGROUP BY gender;"
}
] | You are an SQL statement expert. Given the table 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 claims that were settled for more than $50,000, along with the policy details and agent information."
},
{
"role": "assistant",
"content": "SELECT c.*, p.*, a.first_name || ' ' || a.last_name AS agent_name FROM insurance.claims c JOIN insurance.policies ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d... |
[
{
"role": "user",
"content": "List all address IDs with a balance under 50, along with the count of transactions they have received."
},
{
"role": "assistant",
"content": "SELECT a.address_id, a.balance, COUNT(t.transaction_id) AS received_count\nFROM blockchain.addresses a\nLEFT JOIN blockchain... | You are an SQL statement expert. Given the table 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 all notifications sent through the 'Email' channel, showing all columns."
},
{
"role": "assistant",
"content": "SELECT notification_id, citizen_id, application_id, message_subject, message_body, channel, sent_at, status, related_entity_type, related_entity_id F... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.notifications ( notification_id text, citizen_id text, application_id text, message_subject text, m... |
[
{
"role": "user",
"content": "Show me all documents uploaded in 2024 that do not have a description."
},
{
"role": "assistant",
"content": "SELECT document_id, file_name, uploaded_at\nFROM insurance.claim_documents\nWHERE uploaded_at >= '2024-01-01'\n AND uploaded_at < '2025-01-01'\n AND (desc... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id character varying(64) NOT NULL, docume... |
[
{
"role": "user",
"content": "Show me all customers who have active policies with coverage limits over $1,000,000, along with their policy details and the product names."
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_id, p.policy_number, p.start_... | You are an SQL statement expert. Given the table 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": "How many verified users are there?"
},
{
"role": "assistant",
"content": "SELECT COUNT(user_id) FROM social_media.users WHERE is_verified = 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 social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "I need to compare consecutive daily close_prices for each security to find when the close_price increased compared to the previous day."
},
{
"role": "assistant",
"content": "SELECT a.security_id, b.data_timestamp AS prev_date, b.close_price AS prev_close, a.data_ti... | You are an SQL statement expert. Given the table 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.market_data ( data_point_id bigint, security_id text, data_timestamp timestamp, open_price numeric, ... |
[
{
"role": "user",
"content": "Show me all properties in California with a star rating above 4.0, along with the names of their managers and the count of active staff members at each property."
},
{
"role": "assistant",
"content": "SELECT p.property_name, p.star_rating, s.first_name || ' ' || s.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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "List all staff members along with their direct manager's first and last names."
},
{
"role": "assistant",
"content": "SELECT s.staff_id,\n s.first_name AS staff_first_name,\n s.last_name AS staff_last_name,\n m.first_name AS manager_first_name,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, fir... |
[
{
"role": "user",
"content": "List all SUI coins, showing object ID, owner address, and balance."
},
{
"role": "assistant",
"content": "SELECT object_id, owner, balance FROM sui_coins;"
},
{
"role": "user",
"content": "Include the coin symbol and name by joining with the metadata tab... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t... |
[
{
"role": "user",
"content": "Show the first and last names, email, and phone number for all patients who were added to the system in the last 90 days along with their emergency contact name."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email, phone_number, emergency_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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ... |
[
{
"role": "user",
"content": "Find all doctors created in the last year who have both a phone number and email listed, showing their full name and contact details."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, phone_number, email FROM healthcare.doctors WHERE 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 healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number... |
[
{
"role": "user",
"content": "Show me the date of birth and email for all passengers."
},
{
"role": "assistant",
"content": "SELECT date_of_birth, email FROM transportation.passengers;"
},
{
"role": "user",
"content": "Can you also include their phone number and creation date?"
},
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"role": "user",
"content": "List the license number and specialty for all doctors who have a phone number on record."
},
{
"role": "assistant",
"content": "SELECT license_number, specialty FROM healthcare.doctors WHERE phone_number 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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "Calculate the average market cap and average 24-hour trading volume for tokens belonging to each narrative category."
},
{
"role": "assistant",
"content": "SELECT narrative, AVG(market_cap) AS average_market_cap, AVG(CAST(REPLACE(total_volume, ',', '') AS NUMERIC)) ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri... |
[
{
"role": "user",
"content": "Show all fuel refueling logs with the fuel_log_id, fuel_type, total_cost, and the name and city of the location where the fueling occurred."
},
{
"role": "assistant",
"content": "SELECT f.fuel_log_id,\n f.fuel_type,\n f.total_cost,\n 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.drivers ( driver_id character varying(64) NOT NULL, employee_id character varying(64) NOT NULL UNIQUE, f... |
[
{
"role": "user",
"content": "Find the total number of distinct manufacturers listed in the medications table."
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT manufacturer) FROM healthcare.medications;"
}
] | You are an SQL statement expert. Given the table 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, medication_name character varying(255) NOT NULL,... |
[
{
"role": "user",
"content": "Display the username and the total number of wallets for each user."
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(w.wallet_id) AS wallet_count FROM trading_platform.users u LEFT JOIN trading_platform.wallets w ON u.user_id = w.user_id GROUP BY u.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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "How many service locations do we have in each state?"
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) AS location_count FROM government_services.service_locations GROUP BY state;"
},
{
"role": "user",
"content": "Only show states where there... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.service_locations (
location_id character varying(64) NOT NULL, -- unique identifier for the ph... |
[
{
"role": "user",
"content": "List all Sui NFTs with 'exists' status from the 'Gaming' collection type. Show the object_id, name, and owner."
},
{
"role": "assistant",
"content": "SELECT object_id, name, owner FROM sui_nfts WHERE status = 'exists' AND collection_type = 'Gaming'"
},
{
"ro... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_... |
[
{
"role": "user",
"content": "List each service_type and the number of maintenance logs performed for that type, only including service_types with more than 10 records."
},
{
"role": "assistant",
"content": "SELECT service_type,\n COUNT(*) AS log_count\nFROM transportation.maintenance_logs... | You are an SQL statement expert. Given the table 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 top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their price and 24-hour price change percentage."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, price_change_percentage_24h, volume_24h FROM token_de... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, token_name character varying(100) NOT NULL, token_sy... |
[
{
"role": "user",
"content": "Show pairs of customers who live in the same state but different cities. Include their IDs, full names, and state."
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_a_id, a.first_name AS customer_a_first_name, a.last_name AS customer_a_last_nam... | You are an SQL statement expert. Given the table 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": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens where the price is greater than $0.1."
},
{
"role": "assistant",
"content": "SELECT tm.name, tm.contract_address, tm.total_supply, tp... | You are an SQL statement expert. Given the table 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": "List all trades (trade_id, security_id, quantity) where the settlement_date is within the last 30 days and the trade_type is 'Sell', along with the account_id and total_amount."
},
{
"role": "assistant",
"content": "SELECT trade_id, security_id, quantity, account_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 financial_services.trades ( trade_id.text, account_id.text, security_id.text, order_id.text, trade_type.text, quantity.... |
[
{
"role": "user",
"content": "Show pairs of fundraising records for the same project, including the round names and their investment values."
},
{
"role": "assistant",
"content": "SELECT T1.project_name, T1.rounds_name AS round1, T1.investment_value AS value1, T2.rounds_name AS round2, T2.invest... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... |
[
{
"role": "user",
"content": "What is the total balance across all savings accounts in USD currency?"
},
{
"role": "assistant",
"content": "SELECT SUM(balance) AS total_savings_balance FROM financial_services.accounts WHERE account_type = 'Savings' AND currency = 'USD';"
}
] | You are an SQL statement expert. Given the table 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": "Retrieve a list of beneficiaries who are assigned to more than one policy. Show customer_id, first_name, last_name, and the number of policies they are beneficiaries on."
},
{
"role": "assistant",
"content": "SELECT pb.customer_id, pb.first_name, pb.last_name, 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 insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara... |
[
{
"role": "user",
"content": "What is the average ROI for smart money addresses on the Binance chain?"
},
{
"role": "assistant",
"content": "SELECT AVG(roi) FROM smart_money_profit WHERE chain = 'Binance';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri... |
[
{
"role": "user",
"content": "我想了解某个组件的库存情况,包括库存数量、仓库位置和接收日期。"
},
{
"role": "assistant",
"content": "SELECT ci.quantity, ci.location_warehouse, ci.received_date\nFROM manufacturing.component_inventory ci\nWHERE ci.component_id = 'specific_component_id';"
},
{
"role": "user",
"content... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE manufacturing.components (
component_id character varying(64) NOT NULL, -- uniqu... |
[
{
"role": "user",
"content": "For each user, show their username and how many unique conversations they have sent at least one message in where the conversation is a group chat."
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(DISTINCT m.conversation_id) AS group_chats_messaged_in... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.