conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "List vehicle_id, make, model, and capacity for all vehicles acquired in 2023."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, make, model, capacity\nFROM transportation.vehicles\nWHERE acquisition_date >= '2023-01-01'\n AND acquisition_date <= '2023-12-31... | You are an SQL statement expert. Given the table 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": "Could you find all pairs of fueling events for the same vehicle that occurred within 24 hours of each other? Please show vehicle_id, first fuel_log_id, second fuel_log_id, and their log_timestamps."
},
{
"role": "assistant",
"content": "SELECT l1.vehicle_id,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry... |
[
{
"role": "user",
"content": "For each loan, show the loan ID, principal amount, interest rate, and the balance and currency of the associated account."
},
{
"role": "assistant",
"content": "SELECT l.loan_id, l.principal_amount, l.interest_rate, a.balance, a.currency FROM financial_services.loan... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac... |
[
{
"role": "user",
"content": "List pairs of documents uploaded by the same lawyer but for different cases, showing both document names, their case IDs, and the lawyer ID."
},
{
"role": "assistant",
"content": "SELECT t1.document_name AS document1_name, t1.case_id AS document1_case_id, t2.documen... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u... |
[
{
"role": "user",
"content": "List all premium payments for policy 'POL123'. Show payment ID, payment date, amount paid, and status."
},
{
"role": "assistant",
"content": "SELECT payment_id, payment_date, amount_paid, status FROM insurance.premium_payments WHERE policy_id = 'POL123';"
},
{
... | You are an SQL statement expert. Given the table 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.premium_payments (
payment_id character varying(64) NOT NULL, -- unique identifier for the payment
po... |
[
{
"role": "user",
"content": "List all cases opened in the 'State Court' jurisdiction in the year 2023, including their name, number, and client ID."
},
{
"role": "assistant",
"content": "SELECT case_name, case_number, client_id FROM legal_services.cases WHERE court_jurisdiction = 'State Court' ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t... |
[
{
"role": "user",
"content": "List all assets that have metadata entries for both 'category' and 'blockchain_network', along with their corresponding values."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, m1.value AS category, m2.value AS blockchain_network FROM trading_platfo... | You are an SQL statement expert. Given the table 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": "List the first name and last name of employees who were hired in the year 2023, along with the name of the agency they work for."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, a.agency_name FROM government_services.employees AS e JOIN gover... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "List all public review comments along with the full name of the guest who submitted the review."
},
{
"role": "assistant",
"content": "SELECT T1.review_id, T2.first_name, T2.last_name, T1.comment FROM hospitality_technology.reviews AS T1 JOIN hospitality_technology.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... |
[
{
"role": "user",
"content": "Show all peers whose last_seen timestamp is before '2023-01-01' and whose port number is less than 1000, listing their peer_id and ip_address."
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address FROM trading_platform.peers WHERE last_seen < '2023-01-01... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.peers ( peer_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port intege... |
[
{
"role": "user",
"content": "List all inactive insurance products that were created more than 5 years ago."
},
{
"role": "assistant",
"content": "SELECT * FROM insurance.insurance_products WHERE is_active = false AND created_at < CURRENT_DATE - INTERVAL '5 years';"
},
{
"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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu... |
[
{
"role": "user",
"content": "Show me the top 5 transactions by value along with the token names transferred in those transactions."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.value, tok.token_name FROM web3.transactions t JOIN web3.token_transfers tt ON t.transaction_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 web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for the event
contract_id characte... |
[
{
"role": "user",
"content": "Show me all properties in California with a star rating above 4.0, along with their room types and base rates."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, p.star_rating, r.room_type_id, r.features FROM hospitality_technology.propert... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... |
[
{
"role": "user",
"content": "Show the count of applications assigned to employees, grouped by the job title of the assigned employee."
},
{
"role": "assistant",
"content": "SELECT e.job_title, COUNT(a.application_id) AS application_count FROM government_services.applications AS a JOIN governmen... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "List all pairs of service orders for the same reservation, including both order IDs, the staff who ordered and delivered each, and the reservation ID."
},
{
"role": "assistant",
"content": "SELECT so1.reservation_id,\n so1.order_id AS order1_id,\n so1.st... | You are an SQL statement expert. Given the table 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.service_orders ( order_id text, reservation_id text, guest_id text, service_id text, staff_id_or... |
[
{
"role": "user",
"content": "I need a report showing each case's first and last time entry dates, and the duration between them."
},
{
"role": "assistant",
"content": "SELECT f.case_id,\n f.first_date,\n l.last_date,\n l.last_date - f.first_date AS duration\nFROM (\n SELECT 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 legal_services.time_entries ( entry_id text, case_id text, lawyer_id text, date_worked date, hours_spent numeric, billi... |
[
{
"role": "user",
"content": "Get each user's total 'buy' order value (quantity * price) as total_buy_value."
},
{
"role": "assistant",
"content": "SELECT u.user_id, SUM(o.quantity * o.price) AS total_buy_value\nFROM trading_platform.users u\nJOIN trading_platform.orders o ON u.user_id = o.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.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp )
CREATE TAB... |
[
{
"role": "user",
"content": "Which customers have more than one account? Please include customer_id and the number of accounts they hold."
},
{
"role": "assistant",
"content": "SELECT customer_id, COUNT(account_id) AS account_count FROM financial_services.accounts GROUP BY customer_id HAVING CO... | You are an SQL statement expert. Given the table 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": "Find any two claims made by the same customer on the same day. Return customer_id, the two claim IDs, and the incident date."
},
{
"role": "assistant",
"content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_id,\n c2.claim_id AS claim2_id,\n DAT... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d... |
[
{
"role": "user",
"content": "Can you list all appointments along with the scheduled start time, purpose, and booking method, as well as the employee ID and location ID for each appointment?"
},
{
"role": "assistant",
"content": "SELECT appointment_id, scheduled_start_time, purpose, booking_meth... | You are an SQL statement expert. Given the table 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 text, citizen_id text, employee_id text, location_id text, service_id... |
[
{
"role": "user",
"content": "Show me all insurance plans that have more than 3 patients enrolled as their primary insurance, along with the provider name and count of patients, sorted by patient count in descending order."
},
{
"role": "assistant",
"content": "SELECT ip.insurance_provider, COUN... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad... |
[
{
"role": "user",
"content": "List all unspent UTXOs, including their utxo_id, address, amount, and transaction_id."
},
{
"role": "assistant",
"content": "SELECT utxo_id, address, amount, transaction_id \nFROM trading_platform.utxos \nWHERE spent = false;"
}
] | You are an SQL statement expert. Given the table 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.trades ( trade_id text, order_id text, buyer_id text, seller_id text, asset_id text, quantity numeric,... |
[
{
"role": "user",
"content": "Retrieve the number of claim documents uploaded by each user. Show uploaded_by and the document count."
},
{
"role": "assistant",
"content": "SELECT uploaded_by, COUNT(document_id) AS document_count\nFROM insurance.claim_documents\nGROUP BY uploaded_by;"
},
{
... | You are an SQL statement expert. Given the table 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": "Retrieve the application_id, citizen_id, service_id, and service_name for all applications with status = 'Pending'."
},
{
"role": "assistant",
"content": "SELECT a.application_id, a.citizen_id, a.service_id, s.service_name\nFROM government_services.applications a\nJ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services ( service_id.text, agency_id.text, service_name.text, description.text, category.text, eli... |
[
{
"role": "user",
"content": "Return the count of comments for each hashtag."
},
{
"role": "assistant",
"content": "SELECT ph.hashtag_id,\n h.tag_name,\n COUNT(c.comment_id) AS comment_count\nFROM social_media.post_hashtags ph\nJOIN social_media.hashtags h\n ON ph.hashtag_id = h.has... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "Show me all users who are participants in conversations that are group chats, including the group name and the date they joined the group."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, c.conversation_id, conv.group_name, cp.joined_at\nFROM soc... | You are an SQL statement expert. Given the table 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": "How many inactive insurance products are there?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM insurance.insurance_products WHERE is_active = false;"
}
] | You are an SQL statement expert. Given the table 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": "Which doctors have both a listed email address and a license number that starts with the letter 'A'? Show their ID, full name, specialty, and email."
},
{
"role": "assistant",
"content": "SELECT doctor_id, first_name, last_name, specialty, email\nFROM healthcare.doc... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number... |
[
{
"role": "user",
"content": "What is the total count of game sessions recorded?"
},
{
"role": "assistant",
"content": "SELECT count(*) FROM gaming_technology.game_sessions;"
},
{
"role": "user",
"content": "Now, only count sessions that lasted longer than 1 hour."
},
{
"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 gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "Show me all active policies with coverage limits above $1,000,000, along with the customer names and agent names."
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.coverage_limit, c.first_name || ' ' || c.last_name AS customer_name, a.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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d... |
[
{
"role": "user",
"content": "I need a report of all notification messages sent to users who have at least one wallet, showing the notification message and the address of one wallet for each user."
},
{
"role": "assistant",
"content": "SELECT n.message, w.address\nFROM trading_platform.notificat... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ... |
[
{
"role": "user",
"content": "List all pairs of token IDs that share the same decimals value, and show the shared decimals."
},
{
"role": "assistant",
"content": "SELECT t1.token_id AS token1_id,\n t2.token_id AS token2_id,\n t1.decimals\nFROM web3.tokens t1\nJOIN web3.tokens t2\n O... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for the token
contract_address cha... |
[
{
"role": "user",
"content": "Show me all users who have made at least one comment and have their profiles set to private. I want their user IDs and the time their settings were last updated."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.user_id, us.updated_at\nFROM social_media.comme... | You are an SQL statement expert. Given the table 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.comments (
comment_id character varying(64) NOT NULL, -- unique identifier for the comment
post_id... |
[
{
"role": "user",
"content": "For each payment method, show the total number of completed payments and the total amount paid."
},
{
"role": "assistant",
"content": "SELECT payment_method, COUNT(*) AS completed_count, SUM(amount) AS total_paid FROM government_services.payments WHERE status = 'Com... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.payments ( payment_id character varying(64) NOT NULL, application_id character varying(64), citizen... |
[
{
"role": "user",
"content": "List all servers that are currently online and have a player count greater than their average player count across all servers in the same region."
},
{
"role": "assistant",
"content": "SELECT s.server_id, s.server_name, s.region, s.current_players\nFROM gaming_techn... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time... |
[
{
"role": "user",
"content": "List all peers who were last seen after July 10, 2024, along with their IP address and port."
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address, port, last_seen\nFROM trading_platform.peers\nWHERE last_seen > '2024-07-10'\nORDER BY last_seen DESC;"
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username ch... |
[
{
"role": "user",
"content": "Provide a count of payments for each unique currency type recorded in the system."
},
{
"role": "assistant",
"content": "SELECT currency, COUNT(*) AS payment_count FROM government_services.payments GROUP BY currency;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "Find the total amount paid for all premium payments made in the last 30 days."
},
{
"role": "assistant",
"content": "SELECT SUM(amount_paid) FROM insurance.premium_payments WHERE payment_date >= CURRENT_DATE - INTERVAL '30 day';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identifier for the policy
customer_id ... |
[
{
"role": "user",
"content": "List all usernames and their respective group chat names where they are participants."
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name \nFROM social_media.conversation_participants cp\nJOIN social_media.users u ON cp.user_id = u.user_id\nJOIN 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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"role": "user",
"content": "I need a list of all SUI coins with their object ID, coin type, and balance."
},
{
"role": "assistant",
"content": "SELECT object_id, coin_type, balance FROM sui_coins;"
},
{
"role": "user",
"content": "Only include coins where status is 'exists'."
},
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ... |
[
{
"role": "user",
"content": "Show me the total market cap and the total smart money inflow USD value for each narrative. Join the `token_basic_info` and `smart_money_token_inflow` tables based on narrative."
},
{
"role": "assistant",
"content": "WITH Narratives AS ( SELECT DISTINCT narrative FR... | 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 token_basic_info ( coin_id text, token_name text, token_symbol text, token_address t... |
[
{
"role": "user",
"content": "Show me the total amount held and number of unique wallets for each ERC20 token with a symbol ending in 'X'."
},
{
"role": "assistant",
"content": "SELECT tm.symbol, SUM(CAST(ebh.amount AS DECIMAL)) AS total_amount, COUNT(DISTINCT ebh.wallet_address) AS unique_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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"role": "user",
"content": "List pairs of routes where one route’s origin matches another route’s destination. Show both route numbers."
},
{
"role": "assistant",
"content": "SELECT r1.route_number AS route1, r2.route_number AS route2\nFROM transportation.routes r1\nJOIN transportation.routes ... | You are an SQL statement expert. Given the table 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": "For each agent, show their agent_id, first and last name, and the total estimated loss for all claims they have handled as a claim handler."
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name, a.last_name, SUM(c.estimated_loss) AS total_estimated_... | You are an SQL statement expert. Given the table 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": "Show me the full names and phone numbers of customers living in Chicago who registered after January 1, 2023, along with their current status."
},
{
"role": "assistant",
"content": "SELECT customer_id, first_name, last_name, phone_number, status\nFROM insurance.cust... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name... |
[
{
"role": "user",
"content": "Retrieve the service name and the count of applications currently in 'Under Review' status for each service."
},
{
"role": "assistant",
"content": "SELECT s.service_name, COUNT(a.application_id) AS under_review_count\nFROM government_services.services s\nLEFT JOIN g... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth... |
[
{
"role": "user",
"content": "Show me the full names of all patients who have received a diagnosis for 'hypertension', along with the appointment time and the doctor's full name for each related appointment."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, a.appointment_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "Can you show me the count of players from each country who have unlocked at least one achievement developed by studios based in France?"
},
{
"role": "assistant",
"content": "SELECT p.country_code, COUNT(DISTINCT p.player_id) AS player_count\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.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... |
[
{
"role": "user",
"content": "I want to see for each group chat the count of unread 'mention' notifications received by its recipients. Include conversation_id, group_name, and unread_mentions."
},
{
"role": "assistant",
"content": "SELECT c.conversation_id,\n c.group_name,\n COUNT(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 social_media.conversations ( conversation_id.text, created_at.timestamp, last_message_at.timestamp, is_group_chat.boole... |
[
{
"role": "user",
"content": "Show the total fare collected from bookings, grouped by the state/province of the destination location of the trip, for bookings made in May 2024."
},
{
"role": "assistant",
"content": "SELECT\n l.state_province,\n SUM(b.fare) AS total_fare_collected\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.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"role": "user",
"content": "List all unique hashtag IDs present in the system."
},
{
"role": "assistant",
"content": "SELECT DISTINCT hashtag_id FROM social_media.post_hashtags;"
},
{
"role": "user",
"content": "And how many users have chosen the 'dark' theme?"
},
{
"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.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id character varying(64) NOT NULL, ha... |
[
{
"role": "user",
"content": "Show me each guest's full name and the number of unique properties they have made reservations for."
},
{
"role": "assistant",
"content": "SELECT g.first_name || ' ' || g.last_name AS full_name,\n COUNT(DISTINCT r.property_id) AS property_count\nFROM hospitali... | You are an SQL statement expert. Given the table 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": "Find the security name and ticker symbol for all securities that have a market data entry with a trading volume greater than 5,000,000."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.security_name, T1.ticker_symbol FROM financial_services.securities AS T1... | You are an SQL statement expert. Given the table 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 text, account_id text, related_account_id text, transaction_type text,... |
[
{
"role": "user",
"content": "For each game session, list session_id, player_id, and the number of achievements that the player had unlocked before the session start_time."
},
{
"role": "assistant",
"content": "```sql\nSELECT\n gs.session_id,\n gs.player_id,\n COUNT(pa.achievement_id) AS achi... | You are an SQL statement expert. Given the table 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 tokens on the 'Polygon' chain held by CEX addresses. Show token_symbol and total USD value held."
},
{
"role": "assistant",
"content": "SELECT token_symbol, SUM(usd_value) AS total_usd_value\nFROM cex_token_balance\nWHERE chain = 'Polygon'\nGROUP BY token_symbo... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... |
[
{
"role": "user",
"content": "List the name and location ID for all locations where the postal code is missing."
},
{
"role": "assistant",
"content": "SELECT name, location_id FROM transportation.locations WHERE postal_code IS NULL;"
},
{
"role": "user",
"content": "Also include 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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro... |
[
{
"role": "user",
"content": "Return the customer_id, full name, policy_id, and start date of all policies sold by agents whose commission_rate is less than 0.08. Please also include the product_name of the related insurance product."
},
{
"role": "assistant",
"content": "SELECT p.customer_id, 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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... |
[
{
"role": "user",
"content": "Count the number of agents for each status."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) FROM insurance.agents GROUP BY status;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin... |
[
{
"role": "user",
"content": "Show me all trips along with the city name of their origin and the scheduled departure time."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, l.name AS origin_city, t.scheduled_departure\nFROM transportation.trips t\nJOIN transportation.locations l ON t.orig... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text... |
[
{
"role": "user",
"content": "Show me the property ID, name, and creation date for all properties created after January 1, 2022."
},
{
"role": "assistant",
"content": "SELECT property_id, property_name, created_at FROM hospitality_technology.properties WHERE created_at >= '2022-01-01';"
},
{... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... |
[
{
"role": "user",
"content": "Find the product type that has the lowest average base premium among all product types that have at least 5 active products. Display the product type and its average base premium."
},
{
"role": "assistant",
"content": "SELECT product_type, AVG(base_premium) AS avera... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu... |
[
{
"role": "user",
"content": "Count the total number of group chats."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = true;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.likes ( like_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, post_id character ... |
[
{
"role": "user",
"content": "Can you list the top 5 addresses by total profit in the smart_money_profit table for the Polygon chain, along with their ROI, rank, and the most profitable token?"
},
{
"role": "assistant",
"content": "SELECT address, profit, roi, rank, most_profit_token\nFROM smart... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id text, project_id text, project_name text, rounds_name text, investment_value numeric, i... |
[
{
"role": "user",
"content": "List all lawyers who have never had a time entry that was billed, showing lawyer_id, first_name, and last_name."
},
{
"role": "assistant",
"content": "SELECT l.lawyer_id, l.first_name, l.last_name \nFROM legal_services.lawyers l \nLEFT JOIN legal_services.time_ent... | You are an SQL statement expert. Given the table 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": "List all service orders for spa services with their guest names and total prices, ordered by total price in descending order."
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, so.order_id, so.total_price FROM hospitality_technology.service_ord... | You are an SQL statement expert. Given the table 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, property_id character varying(64) NOT ... |
[
{
"role": "user",
"content": "Show me all police report documents with their claim IDs and file sizes, sorted by file size in descending order."
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, file_size_bytes FROM insurance.claim_documents WHERE document_type = 'police report... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_type text, file_name text, file_path ... |
[
{
"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 all guests who have communication consent enabled along with their email addresses."
},
{
"role": "assistant",
"content": "SELECT guest_id,\n first_name || ' ' || last_name AS full_name,\n email\nFROM guests\nWHERE communication_consent = TRUE;"
}... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la... |
[
{
"role": "user",
"content": "What is 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": "Now include 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 transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text... |
[
{
"role": "user",
"content": "Can you give me the total number of appointments grouped by status?"
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS total_appointments\nFROM healthcare.appointments\nGROUP BY status;"
},
{
"role": "user",
"content": "Filter 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 healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,... |
[
{
"role": "user",
"content": "How many participants are there in each conversation? Return conversation_id and participant_count."
},
{
"role": "assistant",
"content": "SELECT conversation_id,\n COUNT(*) AS participant_count\nFROM social_media.conversation_participants\nGROUP BY conversati... | You are an SQL statement expert. Given the table 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.conversation_participants ( participant_id text, conversation_id text, user_id text, joined_at timestamp, ... |
[
{
"role": "user",
"content": "Calculate the average number of days between when an incident occurred and when the claim was reported, but only for claims that were settled in the year 2023."
},
{
"role": "assistant",
"content": "SELECT\n AVG(EXTRACT(EPOCH FROM (reported_date - incident_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 insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier for the claim
policy_id charac... |
[
{
"role": "user",
"content": "Can you show me the document types submitted by citizens whose accounts are verified, and for each, the email of the citizen who uploaded it?"
},
{
"role": "assistant",
"content": "SELECT d.document_type, c.contact_email\nFROM government_services.documents d\nJOIN g... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth... |
[
{
"role": "user",
"content": "Which managers supervise employees in more than one department? Show the manager's first and last name and the distinct departments."
},
{
"role": "assistant",
"content": "SELECT m.first_name AS manager_first_name, m.last_name AS manager_last_name, COUNT(DISTINCT e.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa... |
[
{
"role": "user",
"content": "Show me all active vehicles with their make, model, and license plate, along with their depot_id."
},
{
"role": "assistant",
"content": "SELECT make, model, license_plate, depot_id FROM transportation.vehicles WHERE status = 'active';"
},
{
"role": "user",
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"role": "user",
"content": "For each player, show their username and the total number of achievements they have unlocked in games where they also own at least one item. Only include players who have unlocked at least one achievement."
},
{
"role": "assistant",
"content": "SELECT p.username, CO... | You are an SQL statement expert. Given the table 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": "Find players who acquired two different items within the same minute. List the player ID, and the inventory IDs of the two acquisitions."
},
{
"role": "assistant",
"content": "SELECT t1.player_id, t1.inventory_id AS inventory_id_1, t2.inventory_id AS inventory_id_2 ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid, player_id uuid, item_id uuid, quantity integer, acquired_at tim... |
[
{
"role": "user",
"content": "List all items that are currently owned by at least one player. Show the item ID and item name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT t1.item_id, t1.item_name FROM gaming_technology.in_game_items AS t1 JOIN gaming_technology.player_inventory AS t2 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 gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea... |
[
{
"role": "user",
"content": "What is the total revenue generated by ticket sales at the station with ID 'ST101' for the past month?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the revenue generated by ticket sales as this data is not available in the cur... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.s... |
[
{
"role": "user",
"content": "List the first name, last name, and city for all customers who live in the state 'NY'."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, city FROM insurance.customers WHERE state = 'NY';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,... |
[
{
"role": "user",
"content": "For each service category, show the category and the number of distinct citizens who have scheduled at least one appointment for a service in that category. Order the results by the number of citizens in descending order."
},
{
"role": "assistant",
"content": "SELEC... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "List the first and last names of passengers who share the same loyalty_program_id with at least one other passenger."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p1.first_name, p1.last_name\nFROM transportation.passengers p1\nJOIN transportation.passengers... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.passengers ( passenger_id text, first_name text, last_name text, email text, phone_number text, date_of_... |
[
{
"role": "user",
"content": "What is the most recent closing price for each security, along with its ticker symbol?"
},
{
"role": "assistant",
"content": "WITH LatestMarketData AS (\n SELECT\n security_id,\n close_price,\n data_timestamp,\n ROW_NUMBER() OVER(PARTI... | You are an SQL statement expert. Given the table 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, first_name character varying(100) NOT NULL, ... |
[
{
"role": "user",
"content": "List the service name and online application URL for all inactive services that have an online application URL specified."
},
{
"role": "assistant",
"content": "SELECT service_name, online_application_url FROM government_services.services WHERE is_active = FALSE 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 government_services.services ( service_id character varying(64) NOT NULL, agency_id character varying(64) NOT NULL, ser... |
[
{
"role": "user",
"content": "List all unread notifications, including the notification ID, type, creation time, and the username of the sender (if available)."
},
{
"role": "assistant",
"content": "SELECT T1.notification_id, T1.notification_type, T1.created_at, T2.username AS sender_username FR... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "Show the medication_id, medication_name, and manufacturer for all medication entries."
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications;"
},
{
"role": "user",
"content": "Filter to show... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.medications ( medication_id character varying(64) NOT NULL, medication_name character varying(255) NOT NULL,... |
[
{
"role": "user",
"content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses."
},
{
"role": "assistant",
"content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest tpl ON tm.contract... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add... |
[
{
"role": "user",
"content": "Show me all user IDs who changed their profile settings after June 1, 2024."
},
{
"role": "assistant",
"content": "SELECT user_id FROM social_media.user_settings WHERE updated_at > '2024-06-01';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.user_settings ( setting_id text PRIMARY KEY, user_id text, theme text, email_notifications_enabled bool, p... |
[
{
"role": "user",
"content": "What is the average profit and average ROI for smart money addresses ranked in the top 500?"
},
{
"role": "assistant",
"content": "SELECT AVG(profit), AVG(roi) FROM smart_money_profit WHERE rank <= 500"
}
] | You are an SQL statement expert. Given the table 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_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token... |
[
{
"role": "user",
"content": "List all medical records, showing the record ID, record date, and the full name of the doctor who created the record. Include the patient ID as well."
},
{
"role": "assistant",
"content": "SELECT mr.record_id, mr.record_date, mr.patient_id, d.first_name, d.last_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.medical_records (
record_id character varying(64) NOT NULL, -- unique identifier for the medical record... |
[
{
"role": "user",
"content": "List the full names of all employees who are currently employed (i.e., have no termination date)."
},
{
"role": "assistant",
"content": "SELECT first_name || ' ' || last_name AS full_name FROM government_services.employees WHERE termination_date IS NULL;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.employees (
employee_id character varying(64) NOT NULL, -- unique identifier for the government... |
[
{
"role": "user",
"content": "I want a list of DApp names and the asset symbols mentioned in their descriptions."
},
{
"role": "assistant",
"content": "SELECT d.name AS dapp_name,\n a.symbol AS asset_symbol\nFROM trading_platform.dapps d\nJOIN trading_platform.assets a\n ON d.description ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.assets (
asset_id character varying(64) NOT NULL, -- unique identifier for the asset
name cha... |
[
{
"role": "user",
"content": "List events from contract '0xContractA...' that occurred between '2023-01-01' and '2023-01-31'. Show the event ID, event name, and emitted timestamp."
},
{
"role": "assistant",
"content": "SELECT event_id, event_name, emitted_at FROM web3.events WHERE contract_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 web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for the event
contract_id characte... |
[
{
"role": "user",
"content": "Show me all reservations with their guest IDs and room IDs where the total amount is greater than $500 and the status is 'Confirmed', ordered by check-in date."
},
{
"role": "assistant",
"content": "SELECT reservation_id, guest_id, room_id, check_in_date, total_amou... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "List each player's most recent achievement unlock, showing the player_id, achievement_id, and unlocked_at timestamp."
},
{
"role": "assistant",
"content": "SELECT pa.player_id, pa.achievement_id, pa.unlocked_at FROM gaming_technology.player_achievements pa INNER JOI... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, achievement_id.uuid, unlocked_at.ti... |
[
{
"role": "user",
"content": "For each ERC1155 NFT on Ethereum, can you show the contract address, token ID, and the total number of unique wallet holders?"
},
{
"role": "assistant",
"content": "SELECT nh.contract_address, nh.token_id, COUNT(DISTINCT nh.wallet_address) AS unique_holders\nFROM 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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ... |
[
{
"role": "user",
"content": "Show me all guests who have the same last name and are from the same city, along with how many guests share that last name and city combination."
},
{
"role": "assistant",
"content": "SELECT last_name, city, COUNT(*) as guest_count FROM hospitality_technology.guests... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, email.text, phone_number.text, date_of_... |
[
{
"role": "user",
"content": "For each token, show its token name, token symbol, the address of the contract it was created on, and the deployer address of that contract."
},
{
"role": "assistant",
"content": "SELECT t.token_id, t.token_name, t.token_symbol, t.contract_address, c.deployer_addres... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "What is the average estimated_duration_minutes for each route type?"
},
{
"role": "assistant",
"content": "SELECT type, AVG(estimated_duration_minutes) AS average_duration FROM transportation.routes GROUP BY type;"
},
{
"role": "user",
"content": "Now fi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description text, origin_location_id text, destin... |
[
{
"role": "user",
"content": "List all beneficiaries associated with policy ID 'POL12345', including their full name and relationship."
},
{
"role": "assistant",
"content": "SELECT beneficiary_id, first_name, last_name, relationship FROM insurance.policy_beneficiaries WHERE policy_id = 'POL12345... | You are an SQL statement expert. Given the table 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.