system stringlengths 288 7.8k | conversations listlengths 2 8 |
|---|---|
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d... | [
{
"role": "user",
"content": "List all insurance products that have a base premium greater than 1000 and are currently active, showing product name, type, and base premium."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WH... |
You are an SQL statement expert. Given the table 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": "Summarize the total principal amount for loans, grouped by customer and their account type. Include the customer's full name."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.account_type, SUM(T3.principal_amount) FROM financial_services... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... | [
{
"role": "user",
"content": "List the email and full name of all users whose account was updated in June 2024."
},
{
"role": "assistant",
"content": "SELECT email, full_name\nFROM social_media.users\nWHERE updated_at >= '2024-06-01' AND updated_at < '2024-07-01';"
}
] |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... | [
{
"role": "user",
"content": "Show me all claims and the file names of documents uploaded for each claim."
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T2.file_name FROM insurance.claims AS T1 JOIN insurance.claim_documents AS T2 ON T1.claim_id = T2.claim_id;"
},
{
"role": "... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add... | [
{
"role": "user",
"content": "Show all SUI coin types with more than 6 decimals and status 'exists' in the metadata table."
},
{
"role": "assistant",
"content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nWHERE status = 'exists' AND decimals > 6;"
},
{
"role": "us... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.messages (
message_id character varying(64) NOT NULL, -- unique identifier for the message
convers... | [
{
"role": "user",
"content": "List the usernames of users who have sent messages containing the word 'urgent', along with the message content and sent time."
},
{
"role": "assistant",
"content": "SELECT u.username, m.content, m.sent_at FROM social_media.messages m JOIN social_media.users u ON m.... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text... | [
{
"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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... | [
{
"role": "user",
"content": "List all documents along with the document type and the case name they are associated with."
},
{
"role": "assistant",
"content": "SELECT d.document_name, d.document_type, c.case_name\nFROM legal_services.documents d\nJOIN legal_services.cases c ON d.case_id = c.cas... |
You are an SQL statement expert. Given the table 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": "How many medications does each manufacturer have?"
},
{
"role": "assistant",
"content": "SELECT manufacturer, COUNT(*) AS med_count\nFROM healthcare.medications\nGROUP BY manufacturer;"
},
{
"role": "user",
"content": "Only include manufacturers with 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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... | [
{
"role": "user",
"content": "Show me the average investment value for projects that completed fundraising in the last 6 months, grouped by round name."
},
{
"role": "assistant",
"content": "SELECT rounds_name, AVG(investment_value) as avg_investment FROM project_fundraising_record WHERE investm... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... | [
{
"role": "user",
"content": "Show all payments made for reservations that had more than 2 adults. Include the payment ID, amount, currency, reservation ID, guest full name, and the number of adults in the reservation."
},
{
"role": "assistant",
"content": "SELECT T1.payment_id, T1.amount, T1.cu... |
You are an SQL statement expert. Given the table 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": "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 financial_services.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
... | [
{
"role": "user",
"content": "Show me all employees (employee_id, first_name, last_name) in the 'Wealth Management' department who have processed trades for securities with a currency of 'EUR', along with the count of such trades for each employee."
},
{
"role": "assistant",
"content": "SELECT 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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,... | [
{
"role": "user",
"content": "Find tokens with positive ROI and a positive net flow from smart money addresses. For these tokens, show their symbol, chain, ROI, net flow, and the total USD value from buy transactions."
},
{
"role": "assistant",
"content": "SELECT T1.token_symbol, T1.chain, T1.ro... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... | [
{
"role": "user",
"content": "List all citizens who registered in the last 90 days but haven't scheduled any appointments. Display their citizen_id, full name, and registration_date."
},
{
"role": "assistant",
"content": "SELECT c.citizen_id,\n c.first_name || ' ' || c.last_name AS full_na... |
You are an SQL statement expert. Given the table 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 vehicle, retrieve the date of its most recent maintenance service and the date of its last completed trip."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id,\n ml.max_service_date,\n tr.max_trip_date\nFROM transportation.vehicles v\nLEF... |
You are an SQL statement expert. Given the table 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 all active insurance products with a base premium less than $200, sorted by product type."
},
{
"role": "assistant",
"content": "SELECT * FROM insurance.insurance_products WHERE is_active = true AND base_premium < 200 ORDER BY product_type;"
},
{
"ro... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... | [
{
"role": "user",
"content": "List all vehicles that use diesel fuel, showing their make, model, and year."
},
{
"role": "assistant",
"content": "SELECT make, model, year FROM transportation.vehicles WHERE fuel_type = 'diesel';"
},
{
"role": "user",
"content": "Now include only vehic... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... | [
{
"role": "user",
"content": "Give me the number of active customers grouped by city."
},
{
"role": "assistant",
"content": "SELECT city, COUNT(*) AS customer_count FROM financial_services.customers WHERE status = 'Active' GROUP BY city;"
},
{
"role": "user",
"content": "Actually, on... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... | [
{
"role": "user",
"content": "List all public reviews that have a staff response, showing the review ID, overall rating, and the full name of the staff member who responded."
},
{
"role": "assistant",
"content": "SELECT T1.review_id, T1.rating_overall, T2.first_name, T2.last_name FROM hospitalit... |
You are an SQL statement expert. Given the table 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": "List all claim documents uploaded by agent 'AG789', showing their document types and upload dates."
},
{
"role": "assistant",
"content": "SELECT document_id, document_type, uploaded_at FROM insurance.claim_documents WHERE uploaded_by = 'AG789';"
},
{
"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 hospitality_technology.staff ( staff_id text, property_id text, first_name text, last_name text, position text, work_em... | [
{
"role": "user",
"content": "For each service order, list the order_id, reservation_id, the full name of the staff who ordered it as ordered_by, and the full name of the staff who delivered it as delivered_by."
},
{
"role": "assistant",
"content": "SELECT so.order_id,\n so.reservation_id,... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text, claim_id text, document_type text, file_name text, file_path text, file_s... | [
{
"role": "user",
"content": "Show me all medical report documents with their claim IDs and descriptions, sorted by upload date."
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, description, uploaded_at FROM insurance.claim_documents WHERE document_type = 'medical_report' ORD... |
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": "List all smart money token inflows, showing the token symbol, chain, and USD value."
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain, usd_value FROM smart_money_token_inflow;"
},
{
"role": "user",
"content": "Filter that list to only sho... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... | [
{
"role": "user",
"content": "List the names and types of all properties, along with the full names and positions of their managers."
},
{
"role": "assistant",
"content": "SELECT p.property_name, p.property_type, s.first_name || ' ' || s.last_name AS manager_full_name, s.position AS manager_posi... |
You are an SQL statement expert. Given the table 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 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 gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id uuid, genre text, release_date date... | [
{
"role": "user",
"content": "List all in-game items with their name, type, and rarity."
},
{
"role": "assistant",
"content": "SELECT item_name, item_type, rarity FROM gaming_technology.in_game_items;"
},
{
"role": "user",
"content": "Filter this list to include only items with 'Rare... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.maintenance_logs (
log_id character varying(64) NOT NULL, -- unique identifier for the maintenance ... | [
{
"role": "user",
"content": "Show me all maintenance logs for 'Oil Change' services performed in the last 3 months, including the vehicle ID, service date, and cost."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE service_t... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin... | [
{
"role": "user",
"content": "List the email addresses and phone numbers of all active customers."
},
{
"role": "assistant",
"content": "SELECT email, phone_number\nFROM insurance.customers\nWHERE status = 'Active';"
}
] |
You are an SQL statement expert. Given the table 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": "Show me all accounts (account_id, account_number, balance) that have a balance greater than $50,000 and are in USD currency, along with the security details (ticker_symbol, security_name) for securities traded on the same exchange as the account's last_updated_at 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 healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointment_id text, doctor_id text, record_d... | [
{
"role": "user",
"content": "For each medical record, find the number of diagnoses it has and display record_id, patient_id, and diagnosis_count, but include only records with at least two diagnoses."
},
{
"role": "assistant",
"content": "SELECT m.record_id,\n m.patient_id,\n COUNT(... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id text, first_name text, last_name text, bar_number text, firm_id text, email text, ph... | [
{
"role": "user",
"content": "Retrieve document names and the uploader's full name for all documents with version greater than 1."
},
{
"role": "assistant",
"content": "SELECT d.document_name,\n l.first_name || ' ' || l.last_name AS uploader\nFROM legal_services.documents d\nJOIN legal_ser... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE 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": "Find pairs of cases that belong to the same client, listing the case number, case name, and the shared client ID for each pair."
},
{
"role": "assistant",
"content": "SELECT c1.case_number AS case_number_1, c1.case_name AS case_name_1, c2.case_number AS case_number_... |
You are an SQL statement expert. Given the table 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": "Which day had the highest number of service orders? Show the date and order count."
},
{
"role": "assistant",
"content": "SELECT DATE(order_timestamp) AS order_date,\n COUNT(*) AS order_count\nFROM hospitality_technology.service_orders\nGROUP BY DATE(order_tim... |
You are an SQL statement expert. Given the table 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 me all staff members along with their positions and the names of the properties they work at."
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name\nFROM hospitality_technology.staff s\nJOIN 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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... | [
{
"role": "user",
"content": "Find claims where the estimated loss is greater than the average estimated loss for claims with a status of 'Closed'. Show the claim ID, incident date, estimated loss, and status."
},
{
"role": "assistant",
"content": "SELECT claim_id, incident_date, estimated_loss,... |
You are an SQL statement expert. Given the table 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": "Count the total number of unique insurance providers in the system."
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT insurance_provider) 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 transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati... | [
{
"role": "user",
"content": "List every booking together with the route number and description for the trip being booked."
},
{
"role": "assistant",
"content": "SELECT b.booking_id, b.passenger_id, b.trip_id, r.route_number, r.description\nFROM transportation.bookings b\nJOIN transportation.rou... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.securities ( security_id text, ticker_symbol text, isin_code text, cusip_code text, security_name te... | [
{
"role": "user",
"content": "List all pairs of securities that are issued by the same issuer but trade on different exchanges. Show the ticker symbols and exchanges for both securities as symbol_a, exchange_a, symbol_b, exchange_b, and include issuer_name."
},
{
"role": "assistant",
"content": ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t... | [
{
"role": "user",
"content": "Retrieve the top 5 Avalanche tokens by total transfer volume in the last 7 days. Include tick, total_volume, and creator from token_info_avalanche."
},
{
"role": "assistant",
"content": "SELECT\n a.tick,\n SUM(a.amt) AS total_volume,\n i.creator\nFROM token_activ... |
You are an SQL statement expert. Given the table 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.trips ( trip_id text, route_id text, vehicle_id text, driver_id text, scheduled_departure timestamp, act... | [
{
"role": "user",
"content": "Show the earliest scheduled_departure and the latest actual_arrival for each route_id."
},
{
"role": "assistant",
"content": "SELECT route_id, MIN(scheduled_departure) AS earliest_scheduled_departure, MAX(actual_arrival) AS latest_actual_arrival FROM transportation.... |
You are an SQL statement expert. Given the table 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... | [
{
"role": "user",
"content": "Show me all patients who have both primary and non-primary insurance plans from the same provider, including their policy numbers and expiration dates."
},
{
"role": "assistant",
"content": "SELECT pi1.patient_id, pi1.policy_number AS primary_policy, pi1.expiration_... |
You are an SQL statement expert. Given the table 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.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume... | [
{
"role": "user",
"content": "For narratives listed in `narrative_info`, find the total USD value held by CEXes for tokens that are among their top 3 listed coins. Show the narrative and the total CEX USD value."
},
{
"role": "assistant",
"content": "SELECT T2.narrative, SUM(T1.usd_value) AS Tot... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,... | [
{
"role": "user",
"content": "List all transactions together with the event names they triggered (if any), showing transaction id, value, and event name. If a transaction does not have events, include it with a NULL event name."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.va... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch... | [
{
"role": "user",
"content": "Find all peers that haven't been seen in the last 30 days, along with their IP addresses and ports."
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address, port FROM trading_platform.peers WHERE last_seen < CURRENT_DATE - INTERVAL '30 days';"
},
{
... |
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
// Use Hashes for platform details. Key format: platform:<platform_id>
// HSET platform:plat_123 ... | [
{
"role": "user",
"content": "Can you provide the total number of cars associated with a specific train with train_id 'train_789'?"
},
{
"role": "assistant",
"content": "SCARD train:train_789:cars"
}
] |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... | [
{
"role": "user",
"content": "List all maintenance logs for vehicles acquired in the year 2023. Include log ID, vehicle make, model, service date, and cost."
},
{
"role": "assistant",
"content": "SELECT ml.log_id, v.make, v.model, ml.service_date, ml.cost FROM transportation.maintenance_logs 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 legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case_id.text, issue_date.date, due_date... | [
{
"role": "user",
"content": "Find pairs of invoices belonging to the same client and having the same status, excluding pairs with the same invoice ID. Show the client ID, shared status, and both invoice numbers."
},
{
"role": "assistant",
"content": "SELECT T1.client_id, T1.status, T1.invoice_n... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,... | [
{
"role": "user",
"content": "What is the total transaction amount for each transaction_type in the last 30 days, considering only 'Completed' status transactions?"
},
{
"role": "assistant",
"content": "SELECT transaction_type, SUM(amount) as total_amount FROM financial_services.transactions WHE... |
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
// Use Hashes to store station details. Key format: station:<station_id>
// Example:
// HSET stat... | [
{
"role": "user",
"content": "能否帮我查询特定路线(route_id 为 'route_ne_corr')上的所有车站信息,并包含每个车站的平台数量?"
},
{
"role": "assistant",
"content": "ZRANGE route:route_ne_corr:stops 0 -1\nHGETALL route_station:<route_station_id> for each route_station_id in result\nHGETALL station:<station_id> for each station_id ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, custo... | [
{
"role": "user",
"content": "Show me the total premium amount paid by each customer, grouped by customer_id and payment_method."
},
{
"role": "assistant",
"content": "SELECT customer_id, payment_method, SUM(amount_paid) AS total_paid\nFROM insurance.premium_payments\nGROUP BY customer_id, payme... |
You are an SQL statement expert. Given the table 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": "Find pairs of time entries for the same invoice where one entry is billed and the other is not."
},
{
"role": "assistant",
"content": "SELECT a.invoice_id,\n a.entry_id AS billed_entry,\n b.entry_id AS unbilled_entry\nFROM legal_services.time_entries a\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.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... | [
{
"role": "user",
"content": "List group conversation names and the number of messages sent in each conversation after January 1, 2023."
},
{
"role": "assistant",
"content": "SELECT c.group_name, COUNT(m.message_id) FROM social_media.conversations c JOIN social_media.messages m ON c.conversation... |
You are an SQL statement expert. Given the table 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": "List all beneficiaries who have a percentage share greater than 75%. Show their first name, last name, and percentage share."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.percentage_share FROM insurance.policy_beneficiaries AS T1 WHER... |
You are an SQL statement expert. Given the table 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 unique document types along with the count of documents for each type."
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) AS document_count FROM legal_services.documents GROUP BY document_type;"
},
{
"role": "user",
"content":... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... | [
{
"role": "user",
"content": "Show me all employees (employee_id, first_name, last_name) in the 'Investment' department who have processed trades for securities in the 'Technology' sector, along with the count of such trades for each employee."
},
{
"role": "assistant",
"content": "SELECT e.empl... |
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.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonc... | [
{
"role": "user",
"content": "Provide a list of user ID, wallet ID, and details (contract ID, creator address, timestamp) for smart contracts created by addresses associated with wallets."
},
{
"role": "assistant",
"content": "SELECT w.user_id, w.wallet_id, sc.contract_id, sc.creator_address, sc... |
You are an SQL statement expert. Given the table 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 text, wallet_address text, amount text, pk text )
CREATE TABLE n... | [
{
"role": "user",
"content": "Show me all transfer activities for the token tick 'PEPE', including the sender, receiver, and amount."
},
{
"role": "assistant",
"content": "SELECT from_address, to_address, amt FROM token_activities WHERE tick = 'PEPE' AND type = 'transfer'"
},
{
"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 insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l... | [
{
"role": "user",
"content": "List all agents and their managers' full names."
},
{
"role": "assistant",
"content": "SELECT a.first_name, a.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name FROM insurance.agents a LEFT JOIN insurance.agents m ON a.manager_id = m.age... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.transactions ( transaction_id text, block_id text, sender_address text, receiver_address text, amount numeri... | [
{
"role": "user",
"content": "Show me the average transaction amount per block, along with the block_id and the count of transactions in each block."
},
{
"role": "assistant",
"content": "SELECT block_id, AVG(amount) AS avg_amount, COUNT(*) AS transaction_count FROM blockchain.transactions GROUP... |
You are an SQL statement expert. Given the table 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": "Can you list each employee's first and last name along with the first and last name of their manager?"
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name\nFROM government_servi... |
You are an SQL statement expert. Given the table 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.hashtags (
hashtag_id character varying(64) NOT NULL, -- unique identifier for the hashtag
tag_nam... | [
{
"role": "user",
"content": "Show me all hashtags that were created in June 2024, and for each, display the hashtag ID, tag name, and when it was created."
},
{
"role": "assistant",
"content": "SELECT hashtag_id, tag_name, created_at FROM social_media.hashtags WHERE created_at >= '2024-06-01' 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": "List the names of agencies and their established dates, but only for agencies that offer at least one service."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.agency_name , T1.established_date FROM government_services.agencies AS T1 JOIN government_servic... |
You are an SQL statement expert. Given the table 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": "Show me all time entries, including the case name they are associated with."
},
{
"role": "assistant",
"content": "SELECT T1.*, T2.case_name FROM time_entries AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id"
},
{
"role": "user",
"content": "Only show m... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... | [
{
"role": "user",
"content": "Find all properties in California (state_province = 'California') that have a phone number and email address listed."
},
{
"role": "assistant",
"content": "SELECT property_name, city, phone_number, email_address FROM hospitality_technology.properties WHERE state_pro... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ... | [
{
"role": "user",
"content": "List smart money addresses with a realized ratio greater than 0.9 and a profit greater than 50000. Show the address, chain, realized ratio, and profit."
},
{
"role": "assistant",
"content": "SELECT address, chain, realized_ratio, profit FROM smart_money_profit WHERE... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth... | [
{
"role": "user",
"content": "Show the full name and contact email of citizens who have submitted at least one application for services that are currently inactive."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM 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 trading_platform.assets (
asset_id character varying(64) NOT NULL, -- unique identifier for the asset
name cha... | [
{
"role": "user",
"content": "Give me the list of DApp names and URLs whose description contains any asset symbol from the assets table."
},
{
"role": "assistant",
"content": "SELECT DISTINCT d.name, d.url\nFROM trading_platform.dapps d\nJOIN trading_platform.assets a ON d.description ILIKE '%' ... |
You are an SQL statement expert. Given the table 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": "Show me the first and last names of citizens and the number of appointments they have scheduled with the employee whose last name is 'Smith'."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, COUNT(a.appointment_id) AS appointment_count\nFROM ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth... | [
{
"role": "user",
"content": "Show me document_id, application_id, and verification_status for all documents submitted by citizen 'cit123'."
},
{
"role": "assistant",
"content": "SELECT document_id,\n application_id,\n verification_status\nFROM documents\nWHERE citizen_id = 'cit123';... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... | [
{
"role": "user",
"content": "Count the number of staff members for each position."
},
{
"role": "assistant",
"content": "SELECT\n position,\n COUNT(staff_id) AS staff_count\nFROM hospitality_technology.staff\nGROUP BY\n position;"
},
{
"role": "user",
"content": "Only show positi... |
You are an SQL statement expert. Given the table 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": "Could you list users who commented on posts tagged with hashtag 'H202', including each user’s email and the total number of comments they made?"
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, u.email, COUNT(c.comment_id) AS comment_count\nFROM 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 gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, achievement_id.uuid, unlocked_at.ti... | [
{
"role": "user",
"content": "Show me the earliest unlock date for each achievement along with the player_id who unlocked it."
},
{
"role": "assistant",
"content": "SELECT achievement_id, player_id, MIN(unlocked_at) AS earliest_unlock FROM gaming_technology.player_achievements GROUP BY achieveme... |
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add... | [
{
"role": "user",
"content": "Retrieve all transactions where the total value of token transfers in that transaction exceeds the Ether value of the transaction itself. Include transaction_id, ether_value, and total_token_value."
},
{
"role": "assistant",
"content": "SELECT\n t.transaction_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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... | [
{
"role": "user",
"content": "Retrieve all applications that have no assigned employee. Display the application_id, citizen_id, service_id, submitted_at, and status."
},
{
"role": "assistant",
"content": "SELECT\n application_id,\n citizen_id,\n service_id,\n submitted_at,\n status\nFROM go... |
You are an SQL statement expert. Given the table 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 PRIMARY KEY, firm_name text, address text, phone text, website text, founded_da... | [
{
"role": "user",
"content": "List all pairs of law firms founded in the same year, showing both firm names and their shared founding year."
},
{
"role": "assistant",
"content": "SELECT lf1.firm_name AS firm1, lf2.firm_name AS firm2, EXTRACT(YEAR FROM lf1.founded_date) AS founded_year\nFROM lega... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.securities ( security_id text, ticker_symbol text, isin_code text, cusip_code text, security_name te... | [
{
"role": "user",
"content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector, along with their last_updated timestamp."
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, securi... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
| [
{
"role": "user",
"content": "What is the average number of wallets each user owns?"
},
{
"role": "assistant",
"content": "SELECT\n AVG(wallet_count) AS avg_wallets_per_user\nFROM (\n SELECT user_id, COUNT(*) AS wallet_count\n FROM web3.wallets\n GROUP BY user_id\n) AS sub;"
},
{
"ro... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... | [
{
"role": "user",
"content": "List fuel log entries where the cost per unit is greater than 5.00, showing the log ID, vehicle ID, timestamp, quantity, unit, and cost per unit."
},
{
"role": "assistant",
"content": "SELECT fuel_log_id, vehicle_id, log_timestamp, quantity, unit, cost_per_unit 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 blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ... | [
{
"role": "user",
"content": "Retrieve all pairs of nodes where one node was last seen before '2023-06-01' and the other after '2023-06-01', and they share the same IP address."
},
{
"role": "assistant",
"content": "SELECT a.node_id AS node_before,\n b.node_id AS node_after,\n a.ip_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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... | [
{
"role": "user",
"content": "Give me each server's name, the region, and the maximum number of players that have been connected at once."
},
{
"role": "assistant",
"content": "SELECT s.server_id, s.server_name, s.region, MAX(s.current_players) AS max_players_seen\nFROM gaming_technology.servers... |
You are an SQL statement expert. Given the table 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 text, token_name text, token_symbol text, chain text, price numeric, price_change_per... | [
{
"role": "user",
"content": "What is the total USD value of tokens held by Binance exchange on the Ethereum chain according to the cex_token_balance table?"
},
{
"role": "assistant",
"content": "SELECT SUM(usd_value) AS total_usd_value FROM cex_token_balance WHERE exchange = 'Binance' AND chain... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id.text, property_name.text, address_line1.text, address_line2.text, city.... | [
{
"role": "user",
"content": "List all guests from California who are loyalty members and have provided their email addresses, ordered by last name."
},
{
"role": "assistant",
"content": "SELECT guest_id, first_name, last_name, email, phone_number FROM hospitality_technology.guests WHERE state_p... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... | [
{
"role": "user",
"content": "Show me each achievement name and the number of players who have unlocked it."
},
{
"role": "assistant",
"content": "SELECT a.name,\n COUNT(pa.player_id) AS unlock_count\nFROM gaming_technology.achievements a\nLEFT JOIN gaming_technology.player_achievements pa... |
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 text, block_id text, sender_address text, r... | [
{
"role": "user",
"content": "List the node ID, IP address, and port for all nodes last seen after '2024-06-01'."
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port FROM blockchain.nodes WHERE last_seen > '2024-06-01';"
},
{
"role": "user",
"content": "How many no... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "Find projects that have both fundraising records and basic token information. Display the project name, fundraising round name, investment value, and the token's current price."
},
{
"role": "assistant",
"content": "SELECT T1.project_name, T1.rounds_name, T1.investm... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,... | [
{
"role": "user",
"content": "Which user has created the most tokens? Please show the username and the number of tokens they have created."
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(*) AS token_count\nFROM web3.tokens t\nJOIN web3.contracts c ON t.contract_address = c.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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... | [
{
"role": "user",
"content": "For each citizen who has made at least one payment, list their full name and the total amount they've paid in each currency."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.currency, SUM(T2.amount) FROM government_services.citizens AS T... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c... | [
{
"role": "user",
"content": "Find all active policies with a coverage limit of at least 1,000,000. List the policy_id, policy_number, and coverage_limit."
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number, coverage_limit\nFROM insurance.policies\nWHERE status = 'active' 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.agencies (
agency_id character varying(64) NOT NULL, -- unique identifier for the agency
ag... | [
{
"role": "user",
"content": "Which agencies offer more than three services? List the agency ID and the total number of services they provide."
},
{
"role": "assistant",
"content": "SELECT agency_id, COUNT(service_id) AS total_services\nFROM government_services.services\nGROUP BY agency_id\nHAVI... |
You are an SQL statement expert. Given the table 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 vehicle, show the vehicle_id, license_plate, date of its most recent trip (actual_arrival), and the odometer_reading at its latest maintenance service."
},
{
"role": "assistant",
"content": "SELECT\n v.vehicle_id,\n v.license_plate,\n (\n SE... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad... | [
{
"role": "user",
"content": "Please list all trades for security with ticker symbol 'AAPL', showing the trade id, account number, trade type, quantity, and price per unit."
},
{
"role": "assistant",
"content": "SELECT t.trade_id, a.account_number, t.trade_type, t.quantity, t.price_per_unit\nFRO... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt... | [
{
"role": "user",
"content": "Which servers are currently 'online' and located in the 'us-west-2' region, and what is the title of the game each server is hosting?"
},
{
"role": "assistant",
"content": "SELECT s.server_id, s.server_name, s.region, g.title AS game_title\nFROM gaming_technology.se... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transaction_index.integer, transaction_hash.... | [
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 100 of any ERC1155 token, along with the token ID and amount, but only include tokens from collections with a floor price greater than 0.1 ETH."
},
{
"role": "assistant",
"content": "SELECT nh.wallet_address, nh.token... |
You are an SQL statement expert. Given the table 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": "Show me the driver first_name, last_name, and the name of the destination location for all trips scheduled to depart between '2024-05-01' and '2024-05-31'."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, l.name AS destination_name\nFROM tran... |
You are an SQL statement expert. Given the table 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 all SUI coins with 'active' status and their object_id, owner address, coin_type, and balance."
},
{
"role": "assistant",
"content": "SELECT object_id, owner, coin_type, balance FROM sui_coins WHERE status = 'active';"
},
{
"role": "user",
"content"... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri... | [
{
"role": "user",
"content": "List all trades, showing the trade ID, account ID, and the ticker symbol and security name of the traded security."
},
{
"role": "assistant",
"content": "SELECT t.trade_id, t.account_id, s.ticker_symbol, s.security_name FROM financial_services.trades AS t JOIN finan... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... | [
{
"role": "user",
"content": "For each guest who has left at least one review, show their full name, the total number of reviews they have submitted, and the most recent review_date."
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, COUNT(r.review_id) AS review_count, MAX(... |
You are an SQL statement expert. Given the table 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": "For each employee, show their first and last name and the number of documents they have verified."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(d.document_id) AS verified_documents_count\nFROM government_services.employees e\nJOIN go... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... | [
{
"role": "user",
"content": "I want to list each public post along with its content, the author's username, and the total number of comments it has received. Order the results by comment count descending."
},
{
"role": "assistant",
"content": "SELECT p.post_id,\n u.username,\n p.con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.