conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "Provide a breakdown of the total number of conversations, showing how many are group chats and how many are not. Also, show the count of conversations that have a recorded last message time."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS total_conversatio... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, created_at timestamp NOT NULL DEFAULT CURR... |
[
{
"role": "user",
"content": "What is the total sum of amounts paid for all invoices?"
},
{
"role": "assistant",
"content": "SELECT SUM(amount_paid) FROM invoices;"
},
{
"role": "user",
"content": "Group this total by the status of the invoice."
},
{
"role": "assistant",
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, website text, founded_date date, man... |
[
{
"role": "user",
"content": "How many agents were hired in the current year and what is their average commission rate?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS hired_this_year, AVG(commission_rate) AS average_commission_rate FROM insurance.agents WHERE EXTRACT(YEAR FROM hire_da... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara... |
[
{
"role": "user",
"content": "How many users have non-empty full_name and bio fields? Return only the count."
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM social_media.users\nWHERE full_name IS NOT NULL\n AND full_name <> ''\n AND bio IS NOT NULL\n AND bio <> '';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "For each conversation, how many participants have joined before January 1, 2024?"
},
{
"role": "assistant",
"content": "SELECT conversation_id, COUNT(user_id) AS participant_count\nFROM social_media.conversation_participants\nWHERE joined_at < '2024-01-01'\nGROUP 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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ... |
[
{
"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 beneficiaries who have a contact_info field containing an email address, showing their full names and relationship to the policyholder."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, relationship FROM insurance.policy_beneficiaries WHE... | You are an SQL statement expert. Given the table 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, policy_id text, customer_id text, first_name text, last_name text... |
[
{
"role": "user",
"content": "Show the IDs and registration dates of all verified citizens who could be eligible for at least one active service. Display the citizen ID and registration date."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.citizen_id, c.registration_date\nFROM 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.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "Show me each player's last_login and the end_time of their most recent game session."
},
{
"role": "assistant",
"content": "SELECT p.player_id,\n p.username,\n p.last_login,\n gs.last_end_time\nFROM gaming_technology.players p\nLEFT JOIN (\n 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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player
... |
[
{
"role": "user",
"content": "List all ERC20 tokens along with their contract addresses and the wallet address holding the largest balance for each token."
},
{
"role": "assistant",
"content": "SELECT eb.contract_address, eb.wallet_address, eb.amount FROM erc20_balances eb WHERE (eb.contract_add... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc20_balances ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar )
CR... |
[
{
"role": "user",
"content": "Count the number of transactions for each status."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS tx_count\nFROM web3.transactions\nGROUP BY status;"
},
{
"role": "user",
"content": "Actually, only include statuses with more than 1000 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.transactions ( transaction_id text, from_address text, to_address text, value numeric, gas_used integer, gas_price... |
[
{
"role": "user",
"content": "For each narrative in smart_money_token_inflow, calculate the total usd_value and avg_price from buy transactions (type=1) and include the narrative's token count from narrative_info. Show narrative, chain, total_usd_value, avg_price, and token_num, ordered by total_usd_value 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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO... |
[
{
"role": "user",
"content": "Show me the top 3 tokens with the highest 7-day price change percentage. Display their symbol, chain, and 7d price change."
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain, price_change_percentage_7d\nFROM token_basic_info\nORDER BY price_change_per... | You are an SQL statement expert. Given the table 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": "Show me all managers (agents who have other agents reporting to them) along with their team size and average commission rate of their team members."
},
{
"role": "assistant",
"content": "SELECT m.agent_id, m.first_name, m.last_name, COUNT(r.agent_id) as team_size, 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 insurance.agents (
agent_id character varying(64) NOT NULL, -- unique identifier for the agent
first_name chara... |
[
{
"role": "user",
"content": "Find pairs of items from the same game, where one item is of type 'Weapon' and the other is of type 'Consumable'. List the game ID, the name of the weapon, and the name of the consumable."
},
{
"role": "assistant",
"content": "SELECT i1.game_id, i1.item_name AS weap... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_type.text, description.text, rarity.... |
[
{
"role": "user",
"content": "Show the total count of appointments for each unique status."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) FROM healthcare.appointments GROUP BY status;"
},
{
"role": "user",
"content": "Now, only show the statuses where the count is gre... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, patient_id character varying(64) NOT NULL, doc... |
[
{
"role": "user",
"content": "Show the first and last names, email, and phone number for all patients who were added to the system in the last 90 days along with their emergency contact name."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email, phone_number, emergency_cont... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ... |
[
{
"role": "user",
"content": "I want to list all claims with their claim_id, incident_date, and the customer's full name for claims where estimated_loss is above 10000."
},
{
"role": "assistant",
"content": "SELECT cl.claim_id, cl.incident_date, c.first_name || ' ' || c.last_name AS customer_nam... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name... |
[
{
"role": "user",
"content": "Could you list each developer along with the next developer founded after them in the same country? Return columns current_developer, next_developer, and years_difference."
},
{
"role": "assistant",
"content": "SELECT d1.name AS current_developer,\n d2.name AS... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_... |
[
{
"role": "user",
"content": "What is the fuel consumption rate of train number T1234?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have information on the fuel consumption rate of train number T1234. The data available in the system only includes details such as train ID, model... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.t... |
[
{
"role": "user",
"content": "Count the total number of public posts."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.posts WHERE visibility = 'public';"
}
] | You are an SQL statement expert. Given the table 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, -- unique identifier for the post
user_id characte... |
[
{
"role": "user",
"content": "List the first and last names of citizens who have appointments scheduled with the employee whose employee_id is 'emp123'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 JOIN government_serv... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "List the symbol, name, and total supply for all ERC20 tokens."
},
{
"role": "assistant",
"content": "SELECT symbol, name, total_supply FROM token_metas WHERE is_erc20 = 1;"
},
{
"role": "user",
"content": "Include the decimals and tell me if each token 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t... |
[
{
"role": "user",
"content": "Find all pairs of products that share the same product_type but have differing active statuses, listing both their product_ids, product_types, and is_active flags."
},
{
"role": "assistant",
"content": "SELECT p1.product_id AS product_id_1,\n p1.product_type,\... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, product_type text, description text, bas... |
[
{
"role": "user",
"content": "List the full names of employees who have verified 'Proof of Identity' documents."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.employees AS T1 JOIN government_services.documents AS T2 ON T1.employee_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 text, application_id text, citizen_id text, document_type text, file_refere... |
[
{
"role": "user",
"content": "Show me each staff member by response_staff_id and the number of unique guests whose reviews they have responded to."
},
{
"role": "assistant",
"content": "SELECT response_staff_id, COUNT(DISTINCT guest_id) AS unique_guest_count\nFROM hospitality_technology.reviews\... | You are an SQL statement expert. Given the table 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.reviews ( review_id text, property_id text, reservation_id text, guest_id text, rating_overall i... |
[
{
"role": "user",
"content": "Retrieve all room types with a base_rate above 150 for each property."
},
{
"role": "assistant",
"content": "SELECT property_id, type_name, base_rate\nFROM hospitality_technology.room_types\nWHERE base_rate > 150;"
},
{
"role": "user",
"content": "Also 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 hospitality_technology.room_types (
room_type_id character varying(64) NOT NULL, -- unique identifier for the room ... |
[
{
"role": "user",
"content": "List all customer_ids who have both a checking account and a savings account with a combined balance exceeding $50,000."
},
{
"role": "assistant",
"content": "SELECT c.customer_id FROM financial_services.accounts c JOIN financial_services.accounts s ON c.customer_id... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts (
account_id character varying(64) NOT NULL, -- unique identifier for the account
c... |
[
{
"role": "user",
"content": "Count the number of documents for each document type."
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) FROM government_services.documents GROUP BY document_type;"
},
{
"role": "user",
"content": "Only include document types that have... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "How many time entries does each client have? Provide the client's first and last name along with the count, sorted by count descending."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, COUNT(te.entry_id) AS entry_count FROM legal_services.cli... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad... |
[
{
"role": "user",
"content": "Show me the usernames of buyers along with the names of assets they have traded."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, a.name AS asset_name\nFROM trading_platform.trades t\nJOIN trading_platform.users u ON t.buyer_id = u.user_id\nJOIN 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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "Give me the max supply, creator, and current supply for all Avalanche tokens by their tick."
},
{
"role": "assistant",
"content": "SELECT tia.tick, tia.max_supply, tia.creator, tb.total_supply\nFROM token_info_avalanche tia\nLEFT JOIN token_balances tb ON tia.tick =... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_... |
[
{
"role": "user",
"content": "Find all pairs of tokens that have the same token name but different contract addresses, showing both token IDs, the shared token name, and each contract address."
},
{
"role": "assistant",
"content": "SELECT t1.token_id AS token_id_1, t2.token_id AS token_id_2, 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 web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for the token
contract_address cha... |
[
{
"role": "user",
"content": "Show me all active policies with coverage limits above $500,000, along with the customer names and agent names."
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.coverage_limit, c.name AS customer_name, a.name AS agent_name FROM... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ... |
[
{
"role": "user",
"content": "Provide a count of appointments grouped by the booking method."
},
{
"role": "assistant",
"content": "SELECT booking_method, COUNT(*) AS appointment_count FROM government_services.appointments GROUP BY booking_method;"
}
] | You are an SQL statement expert. Given the table 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, -- unique identifier for the document i... |
[
{
"role": "user",
"content": "Could you show me all scheduled appointments including appointment_id, scheduled_start_time, the citizen's full name, and the location name?"
},
{
"role": "assistant",
"content": "SELECT a.appointment_id,\n a.scheduled_start_time,\n c.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 government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth... |
[
{
"role": "user",
"content": "Show me all participants who joined any conversation before January 1st, 2024. Return participant_id, user_id, conversation_id and the joined_at timestamp."
},
{
"role": "assistant",
"content": "SELECT participant_id, user_id, conversation_id, joined_at FROM social_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.conversation_participants ( participant_id.text, conversation_id.text, user_id.text, joined_at.timestamp, ... |
[
{
"role": "user",
"content": "List all pairs of drivers whose license_expiry_date falls in the same month and year. Display the first and last names of both drivers as driver1_first, driver1_last, driver2_first, driver2_last, and the shared year and month as expiry_year and expiry_month."
},
{
"role... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ... |
[
{
"role": "user",
"content": "Count the number of users whose location is 'London'."
},
{
"role": "assistant",
"content": "SELECT count(*) FROM social_media.users WHERE location = 'London';"
}
] | You are an SQL statement expert. Given the table 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 me all reservations with their property IDs and the count of adults, grouped by property ID."
},
{
"role": "assistant",
"content": "SELECT property_id, SUM(num_adults) AS total_adults FROM hospitality_technology.reservations GROUP BY property_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 hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r... |
[
{
"role": "user",
"content": "List all services belonging to the 'Spa' category, showing their name and price."
},
{
"role": "assistant",
"content": "SELECT service_name, price FROM hospitality_technology.services WHERE category = 'Spa';"
},
{
"role": "user",
"content": "Now, also in... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "What are the top 5 tokens by 7-day price change percentage? Show token_symbol, token_name, narrative, and chain, ordered by price_change_percentage_7d descending."
},
{
"role": "assistant",
"content": "```sql\nSELECT\n token_symbol,\n token_name,\n narrative,\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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name... |
[
{
"role": "user",
"content": "How many games are available on each platform?"
},
{
"role": "assistant",
"content": "SELECT platform,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY platform;"
},
{
"role": "user",
"content": "Only include platforms that have mor... | You are an SQL statement expert. Given the table 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": "I want to retrieve the product_name, base_premium, and created_at from insurance_products where the description contains the word 'comprehensive'."
},
{
"role": "assistant",
"content": "SELECT product_name,\n base_premium,\n created_at\nFROM insurance.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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu... |
[
{
"role": "user",
"content": "List all insurance providers along with the total number of plans they offer."
},
{
"role": "assistant",
"content": "SELECT insurance_provider, COUNT(*) AS plan_count\nFROM healthcare.insurance_plans\nGROUP BY insurance_provider;"
},
{
"role": "user",
"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 healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, plan_type.text, contact_phone.text,... |
[
{
"role": "user",
"content": "Find all users who created accounts in the last 30 days and show their usernames and email addresses, along with any token transfers they might have initiated, sorted by creation date."
},
{
"role": "assistant",
"content": "SELECT u.username, u.email, u.created_at, ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_at.timestamp, transaction_id.text, l... |
[
{
"role": "user",
"content": "List all tokens with a positive 1-hour price change percentage in the 'DeFi' narrative."
},
{
"role": "assistant",
"content": "SELECT token_symbol FROM smart_money_token_inflow WHERE narrative = 'DeFi' AND type = 1 AND token_amount > 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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative top_3_coins text, -- the top 3 token... |
[
{
"role": "user",
"content": "Count the number of policies issued in each calendar year, and show the year and the count."
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM issued_at), COUNT(*) FROM insurance.policies WHERE issued_at IS NOT NULL GROUP BY 1 ORDER BY 1;"
}
] | You are an SQL statement expert. Given the table 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 each patient's first and last name along with the insurance plan name they are enrolled in, including only primary policies. Return patient_id, first_name, last_name, and plan_name."
},
{
"role": "assistant",
"content": "SELECT p.patient_id,\n p.first_nam... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "List all distinct bed types and their corresponding maximum occupancies for each property."
},
{
"role": "assistant",
"content": "SELECT property_id, bed_type, MAX(max_occupancy) AS max_occupancy FROM hospitality_technology.room_types GROUP BY property_id, bed_type;... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.room_types ( room_type_id.text, property_id.text, type_name.text, description.text, base_rate.nu... |
[
{
"role": "user",
"content": "For each sender and recipient pair, show the total number of transfers and the sum of value sent between them."
},
{
"role": "assistant",
"content": "SELECT from_address, to_address, COUNT(*) AS transfer_count, SUM(value) AS total_value\nFROM web3.token_transfers\nG... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id.text, token_id.text, from_address.text, to_address.text, value.numeric, transaction_... |
[
{
"role": "user",
"content": "List the names of services available at service locations that are accessible and located in the state of 'California'."
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T2.location_name FROM government_services.services AS T1 JOIN government_services.s... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "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": "List every client with another client who registered in the same calendar month, showing both full names and the month."
},
{
"role": "assistant",
"content": "SELECT TO_CHAR(c1.date_registered, 'YYYY-MM') AS reg_month, CONCAT(c1.first_name, ' ', c1.last_name) AS cli... | You are an SQL statement expert. Given the table 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": "Show me the notification ID, recipient user ID, and notification type for notifications received by users that user 'user123' is following."
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.recipient_user_id, n.notification_type FROM social_media.no... | You are an SQL statement expert. Given the table 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.text, post_id.text, user_id.text, parent_comment_id.text, content.text, created_at.t... |
[
{
"role": "user",
"content": "What are the qualifications or training history of the staff member who performed the maintenance with record_id 'REC123'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the qualifications or training history of staff members... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.m... |
[
{
"role": "user",
"content": "Show me all premium payments made by customer with ID 'CUST789'."
},
{
"role": "assistant",
"content": "SELECT * FROM insurance.premium_payments WHERE customer_id = 'CUST789';"
},
{
"role": "user",
"content": "From those payments, only include the ones w... | You are an SQL statement expert. Given the table 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, policy_id character varying(64) NOT NULL, custo... |
[
{
"role": "user",
"content": "Show the medication name, manufacturer, dosage, and frequency for all prescriptions issued by doctor with ID 'doctor_456'."
},
{
"role": "assistant",
"content": "SELECT m.medication_name, m.manufacturer, p.dosage, p.frequency FROM healthcare.prescriptions p JOIN hea... | You are an SQL statement expert. Given the table 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": "List all cryptocurrency assets that have been traded more than 100 times."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, a.symbol, COUNT(t.trade_id) AS trade_count FROM trading_platform.assets a JOIN trading_platform.trades t ON a.asset_id = t.ass... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username ch... |
[
{
"role": "user",
"content": "Could you list each game_id along with the count of hidden achievements and the count of visible achievements?"
},
{
"role": "assistant",
"content": "SELECT game_id,\n SUM(CASE WHEN hidden THEN 1 ELSE 0 END) AS hidden_count,\n SUM(CASE WHEN NOT hidden TH... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, description.text, icon_url.text, points.... |
[
{
"role": "user",
"content": "List pairs of documents uploaded by the same user for the same claim. Return uploaded_by, claim_id, document_id AS doc1_id, and the paired document_id AS doc2_id."
},
{
"role": "assistant",
"content": "SELECT cd1.uploaded_by,\n cd1.claim_id,\n cd1.docume... | You are an SQL statement expert. Given the table 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": "Find users with push_notifications_enabled set to false who have unread notifications. Show their username and the count of unread notifications."
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(n.notification_id) AS unread_count FROM social_media.use... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "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": "Show me the earliest created smart contract for each creator address."
},
{
"role": "assistant",
"content": "SELECT creator_address, MIN(timestamp) AS earliest_contract_timestamp FROM blockchain.smart_contracts GROUP BY creator_address;"
},
{
"role": "user",... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.smart_contracts ( contract_id character varying(64) NOT NULL, creator_address character varying(128) NOT NUL... |
[
{
"role": "user",
"content": "List all narratives with a negative 1-hour price change percentage and a trend rank below 50."
},
{
"role": "assistant",
"content": "SELECT narrative, price_change_percentage_1h, trend_rank FROM narrative_info WHERE price_change_percentage_1h < 0 AND trend_rank < 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 narrative_info (",
"narrative character varying(512) NOT NULL, -- the id of narrative",
"top_3_coins text, --... |
[
{
"role": "user",
"content": "Show all likes made by user 'U555' on comments, including the comment_id and like creation time."
},
{
"role": "assistant",
"content": "SELECT like_id, comment_id, created_at\nFROM social_media.likes\nWHERE user_id = 'U555' AND comment_id IS NOT NULL;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u... |
[
{
"role": "user",
"content": "List appointment IDs, times, patient full name, and doctor full name for all appointments scheduled in February 2024."
},
{
"role": "assistant",
"content": "SELECT T1.appointment_id, T1.appointment_time, T2.first_name, T2.last_name, T3.first_name, T3.last_name FROM ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"role": "user",
"content": "Show me the tag name and creation timestamp for all hashtags recorded in the system."
},
{
"role": "assistant",
"content": "SELECT tag_name, created_at FROM social_media.hashtags;"
}
] | You are an SQL statement expert. Given the table 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": "Find all patients who have been prescribed medications (recorded in medical records) along with their chief complaints and the medications mentioned in their treatment plans."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.patient_id, p.first_name, p.last_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "List all vehicles with a capacity greater than 20, including their make, model, and depot location details."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.make, v.model, v.capacity, v.depot_id FROM transportation.vehicles v WHERE v.capacity > 20;"
}... | You are an SQL statement expert. Given the table 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 policies along with the date and amount of their most recent premium payment."
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.policy_number, pp.payment_date AS most_recent_payment_date, pp.amount_paid AS most_recent_payment_amount\nFROM 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.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c... |
[
{
"role": "user",
"content": "Find all applications whose last update occurred on a weekend. Show application_id, citizen full name, last_updated_at, and status."
},
{
"role": "assistant",
"content": "SELECT\na.application_id,\n(c.first_name || ' ' || c.last_name) AS full_name,\na.last_updated_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.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "Show me the total quantity traded and the average trade price for each asset, including the asset's name and symbol."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name AS asset_name, a.symbol AS asset_symbol, SUM(t.quantity) AS total_quantity_traded, 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 trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch... |
[
{
"role": "user",
"content": "List all public reviews including the property name, guest full name, overall rating, and comment."
},
{
"role": "assistant",
"content": "SELECT T2.property_name, T3.first_name || ' ' || T3.last_name AS guest_full_name, T1.rating_overall, T1.comment FROM hospitality... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "Please show me all locations that do not have a state or province recorded. Include the location name, city, and country."
},
{
"role": "assistant",
"content": "SELECT name, city, country\nFROM transportation.locations\nWHERE state_province IS NULL OR state_province... | You are an SQL statement expert. Given the table 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": "I need a report of patients who have received prescriptions for medications manufactured by 'Pfizer'. Include patient ID, first name, last name, medication_name, and prescription_date."
},
{
"role": "assistant",
"content": "SELECT p.patient_id,\n 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": "I want to find all claim IDs that have both an 'Accident Report' and a 'Police Report' document."
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.claim_id\nFROM insurance.claim_documents a\nJOIN insurance.claim_documents b\n ON a.claim_id = b.claim_id\nWHER... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text, claim_id text, document_type text, file_name text, file_path text, file_s... |
[
{
"role": "user",
"content": "List all distinct plan types available in the insurance_plans table."
},
{
"role": "assistant",
"content": "SELECT DISTINCT plan_type FROM healthcare.insurance_plans;"
}
] | You are an SQL statement expert. Given the table 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": "List all transaction IDs, sender addresses, and amounts for transactions received by '0xFEDCBA9876543210FEDCBA9876543210FEDCBA98' between '2023-01-01' and '2023-03-31'."
},
{
"role": "assistant",
"content": "SELECT transaction_id, sender_address, amount FROM blockch... | 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.transactions (
transaction_id character varying(64) NOT NULL, -- uni... |
[
{
"role": "user",
"content": "List documents uploaded for cases of type 'Intellectual Property', showing the document name, upload timestamp, and the case number."
},
{
"role": "assistant",
"content": "SELECT T1.document_name, T1.upload_timestamp, T2.case_number FROM documents AS T1 JOIN cases 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam... |
[
{
"role": "user",
"content": "Show the application ID, status, and submitted date for all applications with the status 'Pending'."
},
{
"role": "assistant",
"content": "SELECT application_id, status, submitted_at\nFROM government_services.applications\nWHERE status = 'Pending';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE 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 content and creation time of comments made on posts authored by the user with ID 'user_X'."
},
{
"role": "assistant",
"content": "SELECT T1.content, T1.created_at FROM social_media.comments AS T1 JOIN social_media.posts AS T2 ON T1.post_id = T2.post_id W... | You are an SQL statement expert. Given the table 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 vehicle, find the vehicle in the same depot that was acquired immediately before it. Display the current vehicle_id, acquisition_date, previous vehicle_id, and its acquisition_date."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.acquisition_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"role": "user",
"content": "Show the usernames and registration dates of all players whose last_login is NULL."
},
{
"role": "assistant",
"content": "SELECT username, registration_date FROM gaming_technology.players WHERE last_login IS NULL;"
},
{
"role": "user",
"content": "Please... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"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": "List each port along with the count of distinct IP addresses observed on that port."
},
{
"role": "assistant",
"content": "SELECT port, COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes GROUP BY port;"
},
{
"role": "user",
"content": "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 blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ... |
[
{
"role": "user",
"content": "Show me the top 5 blocks with the highest difficulty, along with their timestamps and the public key of the address that created the merkle root (assuming merkle_root corresponds to an address_id)."
},
{
"role": "assistant",
"content": "SELECT b.block_id, b.timestam... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.blocks ( block_id character varying(64) NOT NULL, previous_block_id character varying(64), timestamp timesta... |
[
{
"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": "List each property and the number of available rooms. Only include properties with more than 10 available rooms."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, COUNT(r.room_id) AS available_rooms\nFROM hospitality_technology.properties... | You are an SQL statement expert. Given the table 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": "Retrieve the first and last names of passengers along with the total sum of fares they've paid for bookings with status 'Completed', ordered by the sum descending."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, SUM(b.fare) AS total_fare\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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU... |
[
{
"role": "user",
"content": "Show me the top 3 smart money addresses by PnL in the last month, along with their most profitable token and ROI."
},
{
"role": "assistant",
"content": "SELECT token_address, token_symbol, pnl, roi FROM smart_money_token_performance ORDER BY pnl DESC LIMIT 3;"
},
... | You are an SQL statement expert. Given the table 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, project_id character varying(32) NOT NULL, project_name... |
[
{
"role": "user",
"content": "List pairs of drivers where one driver was hired before another and both have the same status. Display the earlier driver's first_name as earlier_name and hire_date as earlier_hire_date, and the later driver's first_name as later_name and hire_date as later_hire_date, along wit... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ... |
[
{
"role": "user",
"content": "What is the total number of entries in the addresses table and the sum of all balances?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*), SUM(balance) FROM blockchain.addresses;"
},
{
"role": "user",
"content": "Instead of the sum, could you show m... | 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.addresses (
address_id character varying(128) NOT NULL, -- unique id... |
[
{
"role": "user",
"content": "Show the total fuel cost for each month in 2023 based on the log timestamp."
},
{
"role": "assistant",
"content": "SELECT\n EXTRACT(MONTH FROM log_timestamp) AS log_month,\n SUM(total_cost) AS monthly_total_cost\nFROM transportation.fuel_logs\nWHERE EXTRACT(YE... | You are an SQL statement expert. Given the table 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, vehicle_id character varying(64) NOT NULL, trip_... |
[
{
"role": "user",
"content": "List all cryptocurrency assets that have been traded at least 50 times, along with their average trade price."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, a.symbol, COUNT(t.trade_id) AS trade_count, AVG(t.price) AS avg_price FROM trading_platfor... | You are an SQL statement expert. Given the table 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 the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their price and 24-hour price change percentage."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, price_change_percentage_24h, volume_24h FROM token_de... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, token_name character varying(100) NOT NULL, token_sy... |
[
{
"role": "user",
"content": "List all rooms, including their room number, the name of the property they belong to, and their room type name, specifically for rooms with 'Maintenance' status."
},
{
"role": "assistant",
"content": "SELECT T1.room_number, T2.property_name, T3.type_name FROM rooms ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... |
[
{
"role": "user",
"content": "List all pairs of contracts that were deployed on the same calendar day but on different network IDs. Show the deployment date, the contract addresses, and the network IDs for both contracts in each pair."
},
{
"role": "assistant",
"content": "SELECT DATE(c1.deploye... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "List all unspent transaction outputs (UTXOs), showing their transaction ID and amount."
},
{
"role": "assistant",
"content": "SELECT transaction_id, amount FROM trading_platform.utxos WHERE spent = false;"
},
{
"role": "user",
"content": "Calculate the t... | 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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ... |
[
{
"role": "user",
"content": "List the full name of patients whose primary insurance plan is provided by 'BlueCross BlueShield', along with the plan name."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T3.plan_name FROM healthcare.patients AS T1 JOIN healthcare.patien... | You are an SQL statement expert. Given the table 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.patient_insurance (
patient_insurance_id character varying(64) NOT NULL, -- unique identifier for this p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.