conversations listlengths 2 8 | system stringlengths 288 8.08k |
|---|---|
[
{
"content": "For each trade in the past 14 days, show the trade_id, account_id, security_id, and the latest close_price for that security from market_data.",
"role": "user"
},
{
"content": "SELECT tr.trade_id, tr.account_id, tr.security_id, md.close_price AS latest_close_price, md.data_timestamp\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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri... |
[
{
"content": "What is the current operational status of the train car with car_id 'CAR123'?",
"role": "user"
},
{
"content": "I'm sorry, but I can't provide information on the current operational status of the train car with car_id 'CAR123'. The data in the train_cars table does not include real-tim... | 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... |
[
{
"content": "Show me the top 5 users with the most wallet addresses, along with the count of their wallets.",
"role": "user"
},
{
"content": "SELECT user_id, COUNT(wallet_id) AS wallet_count FROM blockchain.wallets WHERE user_id IS NOT NULL GROUP BY user_id ORDER BY wallet_count DESC LIMIT 5;",
... | You are an SQL statement expert. Given the table 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 text, user_id text, address_id text, private_key text )
|
[
{
"content": "For each location, what is the average appointment duration? Show location_id and the average duration.",
"role": "user"
},
{
"content": "SELECT location_id, AVG(duration_minutes) FROM healthcare.appointments GROUP BY location_id;",
"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 healthcare.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appointment_time.timestamp, duration_mi... |
[
{
"content": "What is the fuel consumption rate of train number T1234?",
"role": "user"
},
{
"content": "I'm sorry, but I don't have information on the fuel consumption rate of train number T1234. The data available in the system only includes details such as train ID, model, manufacturer, year manu... | 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... |
[
{
"content": "List all users and the total value of all transactions they have initiated. Show user_id, username, and total_transaction_value.",
"role": "user"
},
{
"content": "SELECT u.user_id, u.username, COALESCE(SUM(t.value), 0) AS total_transaction_value\nFROM web3.users u\nLEFT JOIN web3.walle... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the contract
address cha... |
[
{
"content": "What is the ticket price for a journey on train number T4321?",
"role": "user"
},
{
"content": "I'm sorry, but I don't have access to information about ticket prices for specific trains. The data I have is limited to train details such as model, manufacturer, 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... |
[
{
"content": "Find maintenance log pairs for the same vehicle where the odometer reading is significantly higher in the second log compared to the first. Show the vehicle ID, service date and odometer for both logs in the pair, for increases greater than 50,000.",
"role": "user"
},
{
"content": "WIT... | You are an SQL statement expert. Given the table 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, vehicle_id character varying(64) NOT NULL, ser... |
[
{
"content": "List the first_name, last_name, and email of all clients whose email domain is 'lawfirm.com'.",
"role": "user"
},
{
"content": "SELECT first_name,\n last_name,\n email\nFROM legal_services.clients\nWHERE split_part(email, '@', 2) = 'lawfirm.com';",
"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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"content": "List all transactions along with the user_id of the sender when the sender’s address matches a wallet. Return transaction_id, from_address, and user_id.",
"role": "user"
},
{
"content": "SELECT t.transaction_id, t.from_address, w.user_id FROM web3.transactions t JOIN web3.wallets w ON ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the contract
address cha... |
[
{
"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.10.",
"role": "user"
},
{
"content": "SELECT tm.name, tm.contract_address, tm.total_supply FROM token_metas tm WHERE t... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas (
block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded
... |
[
{
"content": "How many distinct token symbols are recorded for each chain in the smart money performance data?",
"role": "user"
},
{
"content": "SELECT chain, COUNT(DISTINCT token_symbol) FROM smart_money_token_performance GROUP BY chain",
"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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, net_flow.numeric, avg_cost.numeric,... |
[
{
"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": "user"
},
{
"content": "SELECT p.patient_id, p.first_name, p.last_name, pr.dosage, pr.medication_id, pr.start_date, doc.fir... | You are an SQL statement expert. Given the table 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, ... |
[
{
"content": "What is the average number of appointments assigned per employee for each job title?",
"role": "user"
},
{
"content": "SELECT e.job_title, CAST(COUNT(a.appointment_id) AS REAL) / COUNT(DISTINCT e.employee_id) AS average_appointments_per_employee FROM government_services.employees e LEF... | You are an SQL statement expert. Given the table 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... |
[
{
"content": "Give me the total number of reservations and the sum of total_amount by month for the year 2023.",
"role": "user"
},
{
"content": "SELECT DATE_TRUNC('month', check_in_date) AS month,\n COUNT(*) AS reservation_count,\n SUM(total_amount) ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r... |
[
{
"content": "How many notifications have been sent per channel?",
"role": "user"
},
{
"content": "SELECT channel,\n COUNT(*) AS notification_count\nFROM government_services.notifications\nGROUP BY channel;",
"role": "assistant"
},
{
"content": "Exclude any notifications with statu... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.notifications ( notification_id text PRIMARY KEY, citizen_id text, application_id text, message_sub... |
[
{
"content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses.",
"role": "user"
},
{
"content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest tpl ON tm.contract_address = tpl.contract_a... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"content": "Show me all wallet addresses that belong to user_id 'U1001', along with their private keys.",
"role": "user"
},
{
"content": "SELECT address_id, private_key FROM blockchain.wallets WHERE user_id = 'U1001';",
"role": "assistant"
},
{
"content": "Now join this with another ta... | You are an SQL statement expert. Given the table 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 text, user_id text, address_id text, private_key text )
|
[
{
"content": "For each service location, find its nearest accessible location by geographic distance.",
"role": "user"
},
{
"content": "SELECT sl.location_id,\n sl.location_name,\n nearest.location_id AS nearest_location_id,\n nearest.location_name AS nearest_location_name\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 government_services.service_locations ( location_id.text, agency_id.text, location_name.text, address.text, city.text, ... |
[
{
"content": "List the group chat names and the creation dates for all group chats that have a last message sent in 2024.",
"role": "user"
},
{
"content": "SELECT group_name, created_at FROM social_media.conversations WHERE is_group_chat = TRUE AND last_message_at >= '2024-01-01';",
"role": "ass... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp, last_message_at timestamp, is_grou... |
[
{
"content": "List all staff members who have responded to at least one review in the last 6 months, including their first and last names and the count of responses.",
"role": "user"
},
{
"content": "SELECT s.staff_id, s.first_name, s.last_name, COUNT(r.review_id) AS response_count\nFROM hospitality... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... |
[
{
"content": "Show the contract address, symbol, and current total supply for all Avalanche tokens from token_balances_avalanche.",
"role": "user"
},
{
"content": "SELECT tick AS contract_address, tick AS symbol, SUM(total_supply) AS current_total_supply\nFROM token_balances_avalanche\nGROUP BY tick... | You are an SQL statement expert. Given the table 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... |
[
{
"content": "List each branch_id, the number of employees in that branch, and the number of securities that trade on that branch's exchange.",
"role": "user"
},
{
"content": "SELECT e.branch_id,\n COUNT(DISTINCT e.employee_id) AS employee_count,\n COUNT(s.security_id) AS security_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 financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, isin_code text, cusip_code text, secu... |
[
{
"content": "List all ERC20 tokens where the total supply is between 1 million and 10 million, including their names, symbols, and contract addresses.",
"role": "user"
},
{
"content": "SELECT ti.tick as name, ti.tick as symbol, tb.tick as contract_address FROM token_info ti JOIN token_balances tb 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 erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transaction_index.integer, transaction_hash.... |
[
{
"content": "Give me a list of transactions for the past 14 days for accounts that are currently Open. Include the transaction_id, amount, account_number, and transaction_date.",
"role": "user"
},
{
"content": "SELECT t.transaction_id, t.amount, a.account_number, t.transaction_date\nFROM financial_... | You are an SQL statement expert. Given the table 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... |
[
{
"content": "For each account, show account_number, customer_id, and the count of other accounts the same customer has.",
"role": "user"
},
{
"content": "SELECT a.account_number, a.customer_id, COUNT(b.account_id) AS other_account_count FROM financial_services.accounts a LEFT JOIN financial_service... | You are an SQL statement expert. Given the table 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... |
[
{
"content": "Show me all active managers along with their property IDs and the number of staff members they supervise, ordered by the number of supervised staff in descending order.",
"role": "user"
},
{
"content": "SELECT s.staff_id, s.property_id, s.first_name, s.last_name, COUNT(s2.staff_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.staff (
staff_id character varying(64) NOT NULL, -- unique identifier for the staff member
... |
[
{
"content": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own.",
"role": "user"
},
{
"content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.users AS u\nLEFT JOIN\n bloc... | You are an SQL statement expert. Given the table 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... |
[
{
"content": "Show the full names and job titles of employees who work in the same department as at least one other employee.",
"role": "user"
},
{
"content": "SELECT first_name, last_name, job_title\nFROM government_services.employees\nWHERE department IN (\n SELECT department FROM government_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 government_services.employees ( employee_id text, agency_id text, first_name text, last_name text, job_title text, depa... |
[
{
"content": "Which citizens have had both applications and appointments for services in the 'Healthcare' category? List their full name, application ID, and appointment ID.",
"role": "user"
},
{
"content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, a.application_id, appt.appo... | You are an SQL statement expert. Given the table 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... |
[
{
"content": "Find all patients who have both an emergency contact and a phone number, and show their full names along with the emergency contact name and phone number.",
"role": "user"
},
{
"content": "SELECT first_name, last_name, emergency_contact_name, emergency_contact_phone FROM healthcare.pat... | You are an SQL statement expert. Given the table 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, ... |
[
{
"content": "Can you list each user's theme setting along with the number of likes they have given to posts?",
"role": "user"
},
{
"content": "SELECT us.user_id, us.theme, COUNT(l.like_id) AS like_count FROM social_media.user_settings us LEFT JOIN social_media.likes l ON us.user_id = l.user_id 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 social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, created_at.timestamp )
CREATE TABLE soc... |
[
{
"content": "List all managers (employees who have other employees reporting to them) along with the count of their direct reports, showing only those with more than 5 reports.",
"role": "user"
},
{
"content": "SELECT e.employee_id, e.first_name, e.last_name, COUNT(r.employee_id) as direct_reports_... | You are an SQL statement expert. Given the table 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.employees ( employee_id text PRIMARY KEY, first_name text, last_name text, job_title text, departmen... |
[
{
"content": "List all beneficiaries who have a null contact_info. Return beneficiary_id, first_name, last_name, policy_id.",
"role": "user"
},
{
"content": "SELECT beneficiary_id, first_name, last_name, policy_id\nFROM insurance.policy_beneficiaries\nWHERE contact_info IS NULL;",
"role": "assis... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la... |
[
{
"content": "List the usernames and email addresses of users who have participated in any conversation.",
"role": "user"
},
{
"content": "SELECT DISTINCT T1.username, T1.email FROM social_media.users AS T1 JOIN social_media.conversation_participants AS T2 ON T1.user_id = T2.user_id;",
"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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"content": "How many secondary insurance policies are there in the system?",
"role": "user"
},
{
"content": "SELECT COUNT(*) AS secondary_policy_count\nFROM healthcare.patient_insurance\nWHERE is_primary = FALSE;",
"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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"content": "Count the number of servers for each possible status recorded in the servers table.",
"role": "user"
},
{
"content": "SELECT status, COUNT(server_id) AS server_count FROM gaming_technology.servers GROUP BY status;",
"role": "assistant"
},
{
"content": "Only include statuses... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"content": "Find, for each token, how many unique recipient addresses it has. Show token_symbol, contract_address, and recipient_count, ordered by recipient_count descending.",
"role": "user"
},
{
"content": "SELECT t.token_symbol,\n t.contract_address,\n COUNT(DISTINCT tt.to_address) ... | You are an SQL statement expert. Given the table 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... |
[
{
"content": "List all pairs of token transfers occurring within the same transaction where one transferred value is greater than the other, showing both transfer IDs, the transaction ID, and both values.",
"role": "user"
},
{
"content": "SELECT t1.transaction_id,\n t1.transfer_id AS transfer_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ... |
[
{
"content": "Show me all the unique item names, their types, and rarities, along with their cost amount.",
"role": "user"
},
{
"content": "SELECT item_name, item_type, rarity, cost_amount\nFROM gaming_technology.in_game_items;",
"role": "assistant"
},
{
"content": "Now only include item... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.in_game_items ( item_id uuid PRIMARY KEY, game_id uuid, item_name text, item_type text, description t... |
[
{
"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": "user"
},
{
"content": "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 financial_services.loans ( loan_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL UNIQUE, lo... |
[
{
"content": "Show the first name, last name, and email of customers who have filed a claim, along with the status and estimated loss of each claim.",
"role": "user"
},
{
"content": "SELECT T1.first_name, T1.last_name, T1.email, T2.status, T2.estimated_loss FROM insurance.customers AS T1 INNER 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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... |
[
{
"content": "Find pairs of trades that share the same order_id but have different trade_types.",
"role": "user"
},
{
"content": "SELECT a.order_id, a.trade_id AS trade_a, a.trade_type AS type_a, b.trade_id AS trade_b, b.trade_type AS type_b\nFROM financial_services.trades a\nJOIN financial_services... | You are an SQL statement expert. Given the table 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.... |
[
{
"content": "Show the document ID, document type, and upload timestamp for all documents uploaded by citizens who registered after January 1st, 2023.",
"role": "user"
},
{
"content": "SELECT d.document_id, d.document_type, d.upload_timestamp FROM government_services.documents d JOIN citizens c ON d... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.documents ( document_id text, application_id text, citizen_id text, document_type text, file_refere... |
[
{
"content": "Calculate the average price for services within each category.",
"role": "user"
},
{
"content": "SELECT category, AVG(price) FROM hospitality_technology.services GROUP BY category;",
"role": "assistant"
},
{
"content": "Only include categories where the calculated average p... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.text, description.text, category.text... |
[
{
"content": "For each achievement, can you list its name, the corresponding game's title, and the total number of players who have unlocked it?",
"role": "user"
},
{
"content": "SELECT a.name AS achievement_name, g.title AS game_title, COUNT(pa.player_id) AS unlock_count\nFROM gaming_technology.ach... | You are an SQL statement expert. Given the table 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, title text, developer_id uuid, publisher_id uuid, genre text, release_date date... |
[
{
"content": "Could you list the route number and description for any routes that have a fuel log entry associated with their origin or destination location?",
"role": "user"
},
{
"content": "SELECT DISTINCT T1.route_number, T1.description FROM transportation.routes AS T1 JOIN transportation.fuel_lo... | You are an SQL statement expert. Given the table 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, -- unique identifier for the driver
employe... |
[
{
"content": "Find all users along with another user who shares their email domain.",
"role": "user"
},
{
"content": "SELECT u1.user_id, u1.username, u2.user_id AS other_user_id, u2.username AS other_username\nFROM web3.users u1\nJOIN web3.users u2 ON split_part(u1.email, '@', 2) = split_part(u2.ema... | You are an SQL statement expert. Given the table 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, -- unique identifier for the user
username character vary... |
[
{
"content": "I need a report that shows, for each account status and loan type, how many loans there are and the average principal amount.",
"role": "user"
},
{
"content": "SELECT a.status,\n l.loan_type,\n COUNT(*) AS total_loans,\n AVG(l.principal_amount) AS average_principal\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 financial_services.loans (
loan_id character varying(64) NOT NULL, -- unique identifier for the loan, could be same... |
[
{
"content": "List all patients who have active chronic diagnoses, including their diagnosis descriptions and dates.",
"role": "user"
},
{
"content": "SELECT p.first_name, p.last_name, d.description, d.diagnosis_date FROM healthcare.patients p JOIN healthcare.diagnoses d ON p.patient_id = d.patient_... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.