conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "Show me the total billable hours per lawyer from the time_entries table."
},
{
"role": "assistant",
"content": "SELECT lawyer_id, SUM(hours_spent) AS total_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\nGROUP BY lawyer_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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique identifier for the client
first_n... |
[
{
"role": "user",
"content": "Show me all servers and the total number of achievements available in the game they host. Include the server name and region."
},
{
"role": "assistant",
"content": "SELECT s.server_name, s.region, COUNT(a.achievement_id) AS total_achievements\nFROM gaming_technology... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id.uuid, name.text, country.text, founded_year.integer, website.text, created_... |
[
{
"role": "user",
"content": "List all doctors who don't have a hospital affiliation, including their full names and specialties."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, specialty FROM healthcare.doctors WHERE hospital_affiliation_id IS NULL;"
},
{
"role": "u... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors (
doctor_id character varying(64) NOT NULL, -- unique identifier for the doctor
first_name ... |
[
{
"role": "user",
"content": "Show me all active policies for customers who live in California, along with their total premium payments made so far."
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.policy_number, c.first_name, c.last_name, p.premium_amount, SUM(pp.amount_paid) AS tot... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
first_... |
[
{
"role": "user",
"content": "Show the total sum and average amount for all OUTGOING transactions within the last 30 days, grouped by transaction_type."
},
{
"role": "assistant",
"content": "SELECT transaction_type, SUM(amount) AS total_amount, AVG(amount) AS avg_amount FROM financial_services.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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... |
[
{
"role": "user",
"content": "Retrieve all public posts that have geolocation coordinates specified, showing post_id, user_id, location_lat, location_lon, ordered by created_at descending."
},
{
"role": "assistant",
"content": "SELECT post_id, user_id, location_lat, location_lon\nFROM social_med... | You are an SQL statement expert. Given the table 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 want to find all appointments from the past year for patients diagnosed with 'diabetes', including appointment time, patient full name, and doctor full name."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.appointment_time, CONCAT(p.first_name, '... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "What is the average ROI for smart money addresses on the Ethereum chain with a realized profit ratio above 50%?"
},
{
"role": "assistant",
"content": "SELECT AVG(roi) AS average_roi FROM smart_money_profit WHERE chain = 'Ethereum' AND realized_ratio > 50;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundraising record id",
"project_id ch... |
[
{
"role": "user",
"content": "Show me all accounts (account_id, account_number, account_type, balance, currency) for customers whose status is 'VIP'."
},
{
"role": "assistant",
"content": "SELECT a.account_id, a.account_number, a.account_type, a.balance, a.currency FROM financial_services.accoun... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac... |
[
{
"role": "user",
"content": "For each employee, retrieve their full name and the number of appointments scheduled for them in the next 7 days, including employees with no appointments."
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS full_name,\n COUNT(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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e... |
[
{
"role": "user",
"content": "Get the count of unread 'message' notifications per group chat, showing conversation_id, group_name, and unread_message_notifications."
},
{
"role": "assistant",
"content": "SELECT c.conversation_id,\n c.group_name,\n COUNT(n.notification_id) AS unread_m... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.conversations ( conversation_id.text, created_at.timestamp, last_message_at.timestamp, is_group_chat.boole... |
[
{
"role": "user",
"content": "Which wallets currently have the largest ERC20 balances? Show the wallet address, contract address, and amount, sorted by amount descending."
},
{
"role": "assistant",
"content": "SELECT wallet_address, contract_address, CAST(amount AS DECIMAL) as amount FROM erc20_... | You are an SQL statement expert. Given the table 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 ... |
[
{
"role": "user",
"content": "List all users whose usernames start with the letter 'B'."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, created_at FROM trading_platform.users WHERE username LIKE 'B%';"
},
{
"role": "user",
"content": "Can you make it case-inse... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username ch... |
[
{
"role": "user",
"content": "Show me a list of all users who have participated in any trade (either as a buyer or a seller), including their username and the total number of trades they were involved in."
},
{
"role": "assistant",
"content": "SELECT T1.username , count(T2.trade_id) FROM trading... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "Show me all active policies with coverage limits above $1,000,000, along with their customer IDs and agent IDs, sorted by coverage limit in descending order."
},
{
"role": "assistant",
"content": "SELECT policy_id, customer_id, agent_id, coverage_limit FROM insuranc... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ... |
[
{
"role": "user",
"content": "For each ERC20 token, how many unique wallets currently hold them? Show the contract address and unique wallet count."
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(DISTINCT wallet_address) AS unique_wallet_count FROM erc20_balances GROUP BY c... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "For each manager, count how many agents they manage. Show manager_id and agent_count."
},
{
"role": "assistant",
"content": "SELECT manager_id,\n COUNT(*) AS agent_count\nFROM insurance.agents\nGROUP BY manager_id;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state... |
[
{
"role": "user",
"content": "Show me the top 5 users by the total number of trades they participated in as sellers, along with their wallet addresses."
},
{
"role": "assistant",
"content": "SELECT t.seller_id, w.address, COUNT(t.trade_id) AS total_trades FROM trading_platform.trades t JOIN trad... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch... |
[
{
"role": "user",
"content": "Show the full names and job titles of employees who work in the same department as at least one other employee."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, job_title\nFROM government_services.employees\nWHERE department IN (\n SELECT depa... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.employees ( employee_id text, agency_id text, first_name text, last_name text, job_title text, depa... |
[
{
"role": "user",
"content": "Show me the average number of current players per server for each region."
},
{
"role": "assistant",
"content": "SELECT region, AVG(current_players) AS avg_current_players\nFROM gaming_technology.servers\nGROUP BY region;"
},
{
"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 gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "List all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector."
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, security_name\nFROM financial_services.securities\... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... |
[
{
"role": "user",
"content": "Show me the top 3 peers by the number of active days (days they were last seen) in the last month, along with their IP addresses."
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address, COUNT(DISTINCT DATE(last_seen)) AS active_days FROM trading_platform.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "For each player, show their total score across all game sessions."
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(score) AS total_score\nFROM gaming_technology.game_sessions\nGROUP BY player_id;"
},
{
"role": "user",
"content": "Include only... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea... |
[
{
"role": "user",
"content": "List the service names and the count of completed payments for each service."
},
{
"role": "assistant",
"content": "SELECT s.service_id, s.service_name, COUNT(p.payment_id) AS completed_payment_count\nFROM government_services.services s\nLEFT JOIN government_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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "List all messages sent in group chats, including the sender's username, the group name, and the message content."
},
{
"role": "assistant",
"content": "SELECT T1.username , T3.group_name , T2.content FROM users AS T1 JOIN messages AS T2 ON T1.user_id = T2.sender... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.messages (
message_id character varying(64) NOT NULL, -- unique identifier for the message
convers... |
[
{
"role": "user",
"content": "Show all available services and their categories that have an average processing time above 7 days."
},
{
"role": "assistant",
"content": "SELECT service_name, category\nFROM government_services.services\nWHERE is_active = true AND average_processing_time_days > 7;"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services (
service_id character varying(64) NOT NULL, -- unique identifier for the service
... |
[
{
"role": "user",
"content": "List all loans originated after '2023-01-01' with a loan type of 'Auto'."
},
{
"role": "assistant",
"content": "SELECT * FROM financial_services.loans WHERE origination_date > '2023-01-01' AND loan_type = 'Auto'"
},
{
"role": "user",
"content": "Sort the... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.loans ( loan_id.text, account_id.text, loan_type.text, principal_amount.numeric, current_principal_b... |
[
{
"role": "user",
"content": "Provide a count of players for each registered country."
},
{
"role": "assistant",
"content": "SELECT country_code, COUNT(*) FROM gaming_technology.players GROUP BY country_code;"
},
{
"role": "user",
"content": "Filter the results to only show countries... | You are an SQL statement expert. Given the table 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": "List all NFT collections from the sui_nfts table where the owner is not null, including their name and collection_type."
},
{
"role": "assistant",
"content": "SELECT name, collection_type FROM sui_nfts WHERE owner IS NOT NULL;"
},
{
"role": "user",
"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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"role": "user",
"content": "List the first and last names of customers who have filed claims that were subsequently settled, along with the claim ID and the settlement amount."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.claim_id, T2.settlement_amount FROM insu... | You are an SQL statement expert. Given the table 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": "Generate a summary for each account showing the total commissions from trades and total fees from completed transactions in April 2024."
},
{
"role": "assistant",
"content": "SELECT t.account_id,\n SUM(COALESCE(t.commission,0)) AS total_trade_commission,\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 financial_services.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
... |
[
{
"role": "user",
"content": "Give me all unspent UTXOs for address '1A2b3C4d5E', sorted by amount descending."
},
{
"role": "assistant",
"content": "SELECT utxo_id, transaction_id, output_index, address, amount\nFROM trading_platform.utxos\nWHERE address = '1A2b3C4d5E' AND spent = FALSE\nORDER ... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the wallet
user_... |
[
{
"role": "user",
"content": "What is the total number of employees for each status that is not 'Active'?"
},
{
"role": "assistant",
"content": "SELECT status, COUNT(employee_id) AS employee_count FROM financial_services.employees WHERE status != 'Active' GROUP BY status;"
},
{
"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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h... |
[
{
"role": "user",
"content": "List the total number of items acquired by each player, grouped by rarity, for items that have been acquired at least twice."
},
{
"role": "assistant",
"content": "SELECT pi.player_id, igi.rarity, SUM(pi.quantity) AS total_acquired\nFROM gaming_technology.player_inv... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ... |
[
{
"role": "user",
"content": "Show me all appointments booked online in April 2024. List their ID, scheduled start time, and purpose."
},
{
"role": "assistant",
"content": "SELECT appointment_id, scheduled_start_time, purpose FROM government_services.appointments WHERE booking_method = 'Online' ... | You are an SQL statement expert. Given the table 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.appointments ( appointment_id character varying(64) NOT NULL, citizen_id character varying(64) NOT ... |
[
{
"role": "user",
"content": "Show me all accounts (account_id, account_number, balance) that have a balance greater than $50,000 and were opened in the last year, along with the market data (security_id, close_price, volume) for securities traded on the same day as the account was last updated."
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac... |
[
{
"role": "user",
"content": "List usernames and updated_at timestamps for users updated after June 1, 2024."
},
{
"role": "assistant",
"content": "SELECT username, updated_at FROM social_media.users WHERE updated_at > '2024-06-01';"
},
{
"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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "List the names and cities of all locations that have at least one fuel log entry recorded."
},
{
"role": "assistant",
"content": "SELECT DISTINCT l.name, l.city\nFROM transportation.locations l\nJOIN transportation.fuel_logs f ON l.location_id = f.location_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 transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id character varying(64) NOT NULL UNIQUE, f... |
[
{
"role": "user",
"content": "What is the average balance of all addresses in the database?"
},
{
"role": "assistant",
"content": "SELECT AVG(balance) as average_balance FROM blockchain.addresses;"
},
{
"role": "user",
"content": "Can you break this down by the first 3 characters of ... | You are an SQL statement expert. Given the table 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.addresses ( address_id.text, public_key.text, balance.numeric )
|
[
{
"role": "user",
"content": "What proportion of posts have received at least one like? Return the ratio as a decimal between 0 and 1."
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT CASE WHEN l.post_id IS NOT NULL THEN p.post_id END)::float / COUNT(DISTINCT p.post_id) AS like_ratio... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, content text, medi... |
[
{
"role": "user",
"content": "特定の材料を使用しているコンポーネントの組み立て手順を確認したいです。材料IDと材料名、組み立て手順のステップ名と説明を含めてください。"
},
{
"role": "assistant",
"content": "SELECT m.material_id, m.material_name, s.step_name, s.description\nFROM manufacturing.materials m\nJOIN manufacturing.assembly_steps s ON m.material_id = s.st... | 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.materials (
material_id character varying(64) NOT NULL, -- unique... |
[
{
"role": "user",
"content": "For each transaction, find the next transaction initiated by the same sender. List the original transaction_id, the next transaction_id, the sender address, and the time difference in hours between them."
},
{
"role": "assistant",
"content": "SELECT t1.transaction_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 web3.transactions ( transaction_id text, from_address text, to_address text, value numeric, gas_used integer, gas_price... |
[
{
"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 employees who are currently active and were hired before 2022. Show employee_id, first_name, last_name, job_title, department, and hire_date."
},
{
"role": "assistant",
"content": "SELECT\n employee_id,\n first_name,\n last_name,\n job_title,\n departm... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad... |
[
{
"role": "user",
"content": "Could you get the total spend on rare items for each player along with the player's username?"
},
{
"role": "assistant",
"content": "SELECT p.player_id,\n p.username,\n SUM(pi.quantity * i.cost_amount) AS total_spend\nFROM gaming_technology.player_invent... | You are an SQL statement expert. Given the table 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": "Show the subject and start time of appointments, along with the full name of the lawyer assigned to each appointment."
},
{
"role": "assistant",
"content": "SELECT T1.subject, T1.start_time, T2.first_name, T2.last_name FROM legal_services.appointments AS T1 JOIN leg... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph... |
[
{
"role": "user",
"content": "Find all ERC20 tokens with a total supply greater than 1 billion, including their names, symbols, and contract addresses."
},
{
"role": "assistant",
"content": "SELECT name, symbol, contract_address FROM token_metas WHERE is_erc20 = 1 AND CAST(total_supply AS decima... | You are an SQL statement expert. Given the table 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": "Show me all room types with 'King' in the bed_type field, along with their property IDs and base rates."
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, type_name, bed_type, base_rate FROM hospitality_technology.room_types WHERE bed_type LIKE... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text, type_name text, description text, ... |
[
{
"role": "user",
"content": "Retrieve appointment IDs along with the names of the firms where the appointment is with the managing partner."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, f.firm_name\nFROM legal_services.appointments a\nJOIN legal_services.law_firms f ON a.lawye... | You are an SQL statement expert. Given the table 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": "Show me the user ID, username, and email for all users."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email FROM blockchain.users;"
},
{
"role": "user",
"content": "Now, only show the users whose username starts with 'alpha'."
},
{... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.users ( user_id.text, username.text, email.text, password_hash.text )
|
[
{
"role": "user",
"content": "Show photo claim documents uploaded in the last 7 days, including document_id, claim_id, file_name, uploaded_at, and the customer's full name."
},
{
"role": "assistant",
"content": "SELECT cd.document_id,\n cd.claim_id,\n cd.file_name,\n cd.uploade... | You are an SQL statement expert. Given the table 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": "Find transactions that triggered events and whose to_address matches the contract_id of the emitted event. List the transaction ID, the to_address, and the count of such events for that transaction."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.t... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for the event
contract_id characte... |
[
{
"role": "user",
"content": "List the agent ID, first name, last name, and commission rate for all agents with a commission rate between 0.08 and 0.15."
},
{
"role": "assistant",
"content": "SELECT agent_id, first_name, last_name, commission_rate FROM insurance.agents WHERE commission_rate BETW... | You are an SQL statement expert. Given the table 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": "What is the current address of the employee with ID 'EMP234'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the current address of an employee as this information is not stored in the database table."
}
] | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE manufacturing.employees ( ... |
[
{
"role": "user",
"content": "Retrieve the distinct generic_name values and the number of medications for each generic_name, sorted by the count descending."
},
{
"role": "assistant",
"content": "SELECT generic_name,\n COUNT(*) AS medication_count\nFROM healthcare.medications\nGROUP BY gen... | You are an SQL statement expert. Given the table 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 text, medication_name text, generic_name text, manufacturer text, ndc_code text,... |
[
{
"role": "user",
"content": "For each property, show the count of rooms and the count of active staff members working at that property. Display the property ID, room count, and active staff count."
},
{
"role": "assistant",
"content": "SELECT r.property_id, COUNT(DISTINCT r.room_id) AS room_cou... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, room_type_id text, floor integer, stat... |
[
{
"role": "user",
"content": "Show me the balance history of wallet '0xdeadbeef' for token at contract '0xaaaa...' ."
},
{
"role": "assistant",
"content": "SELECT block_number, amount\nFROM erc20_balances_historical\nWHERE wallet_address = '0xdeadbeef'\n AND contract_address = '0xaaaa...';"
}... | You are an SQL statement expert. Given the table 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": "For each wallet, list its address, the associated user_id, and the contract address if the wallet's address was also used to deploy any contracts."
},
{
"role": "assistant",
"content": "SELECT w.address AS wallet_address, w.user_id, c.address AS contract_address\nFR... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,... |
[
{
"role": "user",
"content": "Find 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": "特定の組み立てラインに割り当てられた従業員とそのラインの手順情報を取得したいです。従業員ID、名前、職種と手順名、手順番号を含めてください。"
},
{
"role": "assistant",
"content": "db.employees.aggregate([\n { $match: { assigned_line_id: '<specific_line_id>' } },\n { $lookup: {\n from: 'assembly_steps',\n localField... | 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
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... |
[
{
"role": "user",
"content": "Can you help me retrieve a list of all aircraft builds for a specific model, including their assembly line details and current status?"
},
{
"role": "assistant",
"content": "SELECT ab.build_id, ab.serial_number, ab.model_id, ab.current_status, al.line_name, al.locat... | 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
Index 'aircraft_models'. Mapping: { properties: { model_id: { type: 'keyword' }, model_name: { ty... |
[
{
"role": "user",
"content": "List each lawyer's full name with the full name of the partner at the same firm."
},
{
"role": "assistant",
"content": "SELECT l.lawyer_id,\n CONCAT(l.first_name, ' ', l.last_name) AS lawyer_name,\n CONCAT(p.first_name, ' ', p.last_name) AS partner_name\... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer
first_n... |
[
{
"role": "user",
"content": "List the property_name and the total number of rooms that are designated as smoking rooms for each property."
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(*) AS smoking_room_count\nFROM hospitality_technology.rooms r\nJOIN hospitality_technolo... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... |
[
{
"role": "user",
"content": "List all trades, showing the trade ID, account ID, and the ticker symbol and security name of the traded security."
},
{
"role": "assistant",
"content": "SELECT t.trade_id, t.account_id, s.ticker_symbol, s.security_name FROM financial_services.trades AS t JOIN finan... | You are an SQL statement expert. Given the table 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": "Provide the insurance_provider along with pairs of plan IDs and plan names for providers that offer multiple plans. Join the table to itself to find providers with at least two plans."
},
{
"role": "assistant",
"content": "SELECT p1.insurance_provider,\n p1.pl... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_provider text, plan_type text, contact... |
[
{
"role": "user",
"content": "List all users who have multiple wallets with the same address."
},
{
"role": "assistant",
"content": "SELECT user_id, address, COUNT(*) AS duplicate_count FROM trading_platform.wallets GROUP BY user_id, address HAVING COUNT(*) > 1;"
},
{
"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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet
user_... |
[
{
"role": "user",
"content": "List pairs of policies for the same customer that have the same premium amount but different coverage limits. Show customer ID, policy ID 1, policy ID 2, the premium amount, and the two coverage limits."
},
{
"role": "assistant",
"content": "SELECT T1.customer_id, T... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c... |
[
{
"role": "user",
"content": "Display all invoices along with the associated case name and the full name of the client."
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, cs.case_name, c.first_name || ' ' || c.last_name AS client_full_name\nFROM legal_services.invoices i\nLEFT JOIN ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam... |
[
{
"role": "user",
"content": "For each doctor specialty, count the total number of prescriptions issued by doctors in that specialty. Show the specialty and the prescription count."
},
{
"role": "assistant",
"content": "SELECT T2.specialty, COUNT(T1.prescription_id) FROM healthcare.prescriptions... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "I want to find all patients who have scheduled appointments with a doctor specializing in 'Neurology', including the patient's full name, appointment_time, and the doctor's full name."
},
{
"role": "assistant",
"content": "SELECT p.first_name || ' ' || p.last_name 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 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 trips along with the vehicle make and the route distance in km."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, v.make, r.distance_km\nFROM transportation.trips t\nJOIN transportation.vehicles v ON t.vehicle_id = v.vehicle_id\nJOIN transportatio... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
[
{
"role": "user",
"content": "List all maintenance logs for vehicles that are currently active, showing the vehicle ID and service type."
},
{
"role": "assistant",
"content": "SELECT m.vehicle_id, m.service_type FROM transportation.maintenance_logs m JOIN transportation.vehicles v ON m.vehicle_i... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text... |
[
{
"role": "user",
"content": "What is the total amount paid across all premium payments for payments marked as 'Failed'?"
},
{
"role": "assistant",
"content": "SELECT sum(amount_paid) FROM insurance.premium_payments WHERE status = 'Failed';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... |
[
{
"role": "user",
"content": "List the names and types of all in-game items that have a rarity of 'Epic'."
},
{
"role": "assistant",
"content": "SELECT item_name, item_type FROM gaming_technology.in_game_items WHERE rarity = 'Epic';"
},
{
"role": "user",
"content": "Further restrict ... | You are an SQL statement expert. Given the table 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, username text, email text, password_hash text, registration_date timestamp ... |
[
{
"role": "user",
"content": "What is the latest adjusted_close_price and its timestamp for each security?"
},
{
"role": "assistant",
"content": "SELECT s.security_id, s.security_name, m.adjusted_close_price, m.data_timestamp\nFROM financial_services.market_data m\nJOIN financial_services.securi... | You are an SQL statement expert. Given the table 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.transactions ( transaction_id character varying(64) NOT NULL, account_id character varying(64) NOT N... |
[
{
"role": "user",
"content": "List all unique wallet addresses present in the system."
},
{
"role": "assistant",
"content": "SELECT DISTINCT address FROM trading_platform.wallets;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"role": "user",
"content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector, along with their last_updated timestamp."
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, securi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.securities ( security_id character varying(64) NOT NULL, ticker_symbol character varying(20) NOT NUL... |
[
{
"role": "user",
"content": "List all reviews that have a staff response, including the review comment, staff response text, and the ID of the staff who responded."
},
{
"role": "assistant",
"content": "SELECT comment, staff_response, response_staff_id FROM hospitality_technology.reviews WHERE ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.room_types (
room_type_id character varying(64) NOT NULL, -- unique identifier for the room ... |
[
{
"role": "user",
"content": "Find all transactions (by transaction_id) that contain more than 3 token transfers, along with the count of transfers for each transaction."
},
{
"role": "assistant",
"content": "SELECT transaction_id, COUNT(*) as transfer_count FROM web3.token_transfers GROUP BY 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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ... |
[
{
"role": "user",
"content": "Count the number of patients whose address includes the word 'Street' and are male."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM healthcare.patients WHERE address LIKE '%Street%' AND gender = 'Male';"
}
] | You are an SQL statement expert. Given the table 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 the full name and email of all drivers who have an expired license (license_expiry_date before today)."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email\nFROM transportation.drivers\nWHERE license_expiry_date < CURRENT_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.drivers ( driver_id character varying(64) NOT NULL, employee_id character varying(64) NOT NULL UNIQUE, f... |
[
{
"role": "user",
"content": "Which citizens have made payments but have not uploaded any documents? Please show their first and last names and contact emails."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name, c.last_name, c.contact_email\nFROM government_services.citizens c\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, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "List the citizen IDs for individuals who have both uploaded documents and made payments."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.citizen_id FROM documents AS T1 JOIN payments AS T2 ON T1.citizen_id = T2.citizen_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 government_services.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz... |
[
{
"role": "user",
"content": "I want to identify pairs of bookings that share the same payment_transaction_id, showing both booking IDs and the payment_transaction_id."
},
{
"role": "assistant",
"content": "SELECT b1.booking_id AS booking1, b2.booking_id AS booking2, b1.payment_transaction_id\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 transportation.bookings ( booking_id.text, passenger_id.text, trip_id.text, seat_number.text, booking_time.timestamp, s... |
[
{
"role": "user",
"content": "Show policy numbers, start dates, and the type of the insurance product for policies with a deductible greater than 500."
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T1.start_date, T2.product_type FROM insurance.policies AS T1 JOIN insurance.insur... | You are an SQL statement expert. Given the table 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 the total hours each lawyer has spent on 'Criminal' cases, displaying the lawyer's full name and the total hours."
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, SUM(t.hours_spent) AS total_hours\nFROM legal_services.time_entries t\nJOI... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text, bar_number text UNIQUE, firm_id t... |
[
{
"role": "user",
"content": "Retrieve the contract_id, creator_address, and deployment timestamp for all contracts where the contract code contains the word 'token'."
},
{
"role": "assistant",
"content": "SELECT contract_id, creator_address, timestamp\nFROM blockchain.smart_contracts\nWHERE cod... | You are an SQL statement expert. Given the table 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": "For each user, what is the average time difference in days between their wallet creations? Return user_id and avg_diff_days."
},
{
"role": "assistant",
"content": "WITH diffs AS (\n SELECT\n user_id,\n EXTRACT(EPOCH FROM (created_at - LAG(created_at) OVER (PA... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"role": "user",
"content": "How many total documents are recorded in the system?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM government_services.documents;"
},
{
"role": "user",
"content": "Show me the count of documents for each verification_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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Can you tell me the average and maximum session duration for each player and server combination?"
},
{
"role": "assistant",
"content": "SELECT player_id, server_id, AVG(duration_seconds) AS avg_duration, MAX(duration_seconds) AS max_duration\nFROM gaming_technology.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id.uuid, player_id.uuid, game_id.uuid, server_id.uuid, start_time.timestamptz... |
[
{
"role": "user",
"content": "I need the average capacity of vehicles for each fuel_type."
},
{
"role": "assistant",
"content": "SELECT fuel_type,\n AVG(capacity) AS avg_capacity\nFROM transportation.vehicles\nGROUP BY fuel_type;"
},
{
"role": "user",
"content": "Only include f... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text... |
[
{
"role": "user",
"content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and have a daily trading volume exceeding 1 million shares, along with the account details (account_id, account_number, balance) of customers who hold these securities in 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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri... |
[
{
"role": "user",
"content": "List all beneficiaries added to any policy in March 2024, including their beneficiary_id, policy_id, first and last name."
},
{
"role": "assistant",
"content": "SELECT beneficiary_id, policy_id, first_name, last_name\nFROM insurance.policy_beneficiaries\nWHERE added... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... |
[
{
"role": "user",
"content": "List the description and diagnosis date for all diagnoses that are marked as chronic and were made in the year 2023."
},
{
"role": "assistant",
"content": "SELECT description, diagnosis_date FROM healthcare.diagnoses WHERE is_chronic = true AND diagnosis_date BETWEE... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the doctor
first_name ... |
[
{
"role": "user",
"content": "Can you show me all policy numbers along with their product names for policies that have a deductible higher than 2000, and where the associated product is currently active?"
},
{
"role": "assistant",
"content": "SELECT p.policy_number, ip.product_name\nFROM insuran... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d... |
[
{
"role": "user",
"content": "Show me the full name and email of clients whose status is 'prospect' and who registered before 2023-01-01."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM legal_services.clients WHERE status = 'prospect' AND date_registered < '2023-0... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients (
client_id character varying(64) NOT NULL, -- unique identifier for the client
first_n... |
[
{
"role": "user",
"content": "Show the usernames and registration dates for all users whose email ends with '@gmail.com'."
},
{
"role": "assistant",
"content": "SELECT username, created_at FROM web3.users WHERE email LIKE '%@gmail.com';"
},
{
"role": "user",
"content": "Actually, can... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
|
[
{
"role": "user",
"content": "Find all pairs of developers who share the exact same founded_year but are from different countries. Show both developer names, their countries, and the founded_year."
},
{
"role": "assistant",
"content": "SELECT d1.name AS developer1_name, d1.country AS country1, 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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_... |
[
{
"role": "user",
"content": "Show me a list of all bus routes, including their route numbers, type, and the names of both the origin and destination locations."
},
{
"role": "assistant",
"content": "SELECT r.route_number, r.type, lo.name AS origin_name, ld.name AS destination_name\nFROM transpo... | You are an SQL statement expert. Given the table 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": "Compute for each narrative the average ROI from smart_money_token_performance and the total usd_value of buy transactions (type=1) from smart_money_token_inflow. Show narrative, avg_roi, total_buy_usd_value, and chain."
},
{
"role": "assistant",
"content": "SELECT 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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.