system stringlengths 315 8.44k | conversations listlengths 2 8 |
|---|---|
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 financial_services.transactions ( transaction_id.text, account_id.text, related_acco... | [
{
"role": "user",
"content": "Show me the number of market data points and average adjusted close price per source.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT source, COUNT(*) AS data_point_count, AVG(adjusted_close_price) AS avg_adjusted_close_price\nFROM financial_services.... |
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.wallets ( wallet_id text, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "List all orders, showing order ID, type, quantity, and the asset name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT o.order_id, o.order_type, o.quantity, a.name FROM trading_platform.orders o JOIN trading_platform.assets a ON o.asset_id = a.asset_i... |
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 insurance.premium_payments ( payment_id text, policy_id text, customer_id text, paym... | [
{
"role": "user",
"content": "What is the total amount paid and number of payments grouped by payment_method for payments between January 1, 2023 and December 31, 2023?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_method,\n COUNT(*) AS payment_count,\n SUM(a... |
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.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "I need to get the total trading volume for each asset along with the asset name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, SUM(t.quantity * t.price) AS total_volume\nFROM trading_platform.trades t\nJOIN trading_platform.asset... |
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 insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "List all agents who have sold at least one policy for an insurance product of type 'Health'. For each agent, show their full name, agency name, and the product name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.first_name || ' ' || a.las... |
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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "Show the full name (first and last name) of employees who are assigned to applications with a status of 'Completed'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.employees AS T1 INNER JO... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Find all patients along with the number of unique diagnoses each has received. Only include patients who have at least two diagnoses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, COUNT(DISTINCT d.diagnosis_i... |
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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Show the usernames of users who have used any hashtag in their posts, along with the tag name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username, T4.tag_name FROM social_media.users AS T1 JOIN posts AS T2 ON T1.user_id = T2.user_id ... |
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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, COUNT(te.entry_id) AS entry_count FROM l... |
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 insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "Calculate the average number of days between when an incident occurred and when the claim was reported, but only for claims that were settled in the year 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n AVG(EXTRACT(EPOCH FROM (reported_date - ... |
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 healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "I need a list of patients' policy numbers along with their insurance plan names and the plan's website. Return patient_id, policy_number, plan_name, and website.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.patient_id, pi.policy_number, ip.plan_... |
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 healthcare.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_pro... | [
{
"role": "user",
"content": "Find all insurance providers that offer both HMO and PPO plans and list the provider name along with the corresponding HMO and PPO plan IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h.insurance_provider,\n h.plan_id AS hmo_plan_id,\n ... |
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 erc20_balances ( block_number bigint, contract_address varchar, wallet_address varch... | [
{
"role": "user",
"content": "List all active SUI coins showing coin_type, balance, and owner from sui_coins.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT coin_type, balance, owner\nFROM sui_coins\nWHERE status = 'exists';",
"sql": null
},
{
"role": "user",
"con... |
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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_nam... | [
{
"role": "user",
"content": "List all future reservations (where check_in_date > current_date) including guest full name, room_id, property_id, and the number of days until check-in.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, r.property_id, r.room_id, \n ... |
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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_i... | [
{
"role": "user",
"content": "List pairs of overlapping reservations for the same room, including both reservation IDs, room_id, and each reservation's check-in and check-out dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id AS reservation_id_1,\n r2.r... |
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 legal_services.cases ( case_id text, case_number text, case_name text, client_id tex... | [
{
"role": "user",
"content": "List the number of cases for each case type that are currently marked as 'Open'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_type, COUNT(*) FROM legal_services.cases WHERE status = 'Open' GROUP BY case_type;",
"sql": null
}
] |
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 hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id ... | [
{
"role": "user",
"content": "What is the number of active staff members in each position?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT position,\n COUNT(*) AS staff_count\nFROM hospitality_technology.staff\nWHERE is_active = true\nGROUP BY position;",
"sql": null
}... |
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 web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_a... | [
{
"role": "user",
"content": "How many contracts are deployed each month for each status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT TO_CHAR(deployed_at, 'YYYY-MM') AS deploy_month,\n status,\n COUNT(*) AS contract_count\nFROM web3.contracts\nGROUP BY TO_CHAR(depl... |
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 web3.token_transfers ( transfer_id text, token_id text, from_address text, to_addres... | [
{
"role": "user",
"content": "Which addresses have both sent and received tokens? List them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT t1.from_address FROM web3.token_transfers t1 INNER JOIN web3.token_transfers t2 ON t1.from_address = t2.to_address;",
"sql": nu... |
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_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "Show me the total transfer volume and number of transfers for each token tick on Bitcoin in the past 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tick, SUM(amt) AS total_volume, COUNT(*) AS transfer_count\nFROM token_activities_bitcoin\nWHE... |
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.kyc_audit ( kyc_audit_id.text, user_id.text, status.text, reviewed_... | [
{
"role": "user",
"content": "Show me all users who had their KYC rejected along with when their review was completed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, reviewed_at FROM trading_platform.kyc_audit WHERE status = 'rejected';",
"sql": null
}
] |
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": "For each user, show their username and the total number of 'sell' orders they've placed, including users who haven't placed any.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username,\n COUNT(o.order_id) FILTER (WHERE o.order_type = 'sell')... |
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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "List all policies sold by agents licensed in 'CA', showing the policy number, start date, and the agent's first and last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T1.start_date, T2.first_name, T2.last_name FROM insurance.... |
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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List pairs of citizens who share the same gender but registered in different years. Show each citizen’s full name and their registration year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c1.first_name || ' ' || c1.last_name AS name1,\n c2.fi... |
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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "List all securities along with their latest close price and volume from the market data.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.security_id, s.security_name, m.close_price, m.volume\nFROM financial_services.market_data m\nJOIN (\n SELECT s... |
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 legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "How many lawyers who are partners were hired in each year? Show the hire year and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT strftime('%Y', hire_date) AS hire_year , count(lawyer_id) FROM legal_services.lawyers WHERE is_partner = tr... |
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the names of services available at service locations that are accessible and located in the state of 'California'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T2.location_name FROM government_services.services AS T1 JOIN gove... |
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 hospitality_technology.services ( service_id.text, property_id.text, service_name.te... | [
{
"role": "user",
"content": "List all unavailable services along with their names, prices, and the departments they belong to.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_name, price, department FROM hospitality_technology.services WHERE is_available = false;",
"s... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Find patients whose emergency_contact_phone matches another patient's phone_number and show both patients' IDs, full names, and the shared phone number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.patient_id AS contact_of_id,\n p1.first_n... |
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 hospitality_technology.payments ( payment_id text PRIMARY KEY, reservation_id text, ... | [
{
"role": "user",
"content": "Show me all payments along with the currency code and payment method for each payment, and include the amount and status. Group the results by payment method and currency code, and order by total payment amount descending.",
"sql": null
},
{
"role": "assistant",
... |
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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "For each player, show their username and the total number of unique in-game items they have in their inventory.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, COUNT(DISTINCT pi.item_id) AS unique_items\nFROM gaming_technology.players p\nJ... |
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the first name and last name of each citizen and the scheduled start time for their appointments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.scheduled_start_time FROM government_services.citizens AS T1 JOIN go... |
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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show the full names and emails of staff members who have delivered at least one service order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT s.first_name, s.last_name, s.work_email\nFROM hospitality_technology.staff s\nJOIN hospitality_tech... |
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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"role": "user",
"content": "How many documents were uploaded in the year 2023?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT count(*) FROM government_services.documents WHERE date_part('year', upload_timestamp) = 2023;",
"sql": null
}
] |
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 legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id tex... | [
{
"role": "user",
"content": "Show me all time entries for case ID 'case_abc', including the entry ID, date worked, hours spent, and the first and last name of the lawyer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT te.entry_id, te.date_worked, te.hours_spent, l.first_name, l.... |
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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "List the first name, last name, and specialization of all lawyers who have uploaded at least one document.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.specialization FROM legal_services.lawyers AS T1 JOIN legal_serv... |
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 transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "What is the total quantity and total cost of fuel consumed for each fuel type recorded in the fuel logs?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fuel_type, SUM(quantity) AS total_quantity, SUM(total_cost) AS total_cost FROM transportation.fuel... |
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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Retrieve the names and upload timestamps of all documents of type 'Contract' that were uploaded between '2024-03-01' and '2024-03-31'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name, upload_timestamp\nFROM legal_services.documents\nWHER... |
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 insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,... | [
{
"role": "user",
"content": "List each agent along with their manager's contact_email. Include agent_id, first_name, last_name, manager_id, and manager's contact_email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agent_id,\n a.first_name,\n a.last_name,\n ... |
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 insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, cu... | [
{
"role": "user",
"content": "Show me all policy beneficiaries associated with customer ID 'CUST100'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM insurance.policy_beneficiaries WHERE customer_id = 'CUST100';",
"sql": null
},
{
"role": "user",
"content": ... |
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_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "Show the symbol, name, and total supply for all SUI coins with status 'active'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT scm.symbol, scm.name, scm.coin_type, scm.total_supply\nFROM sui_coins_metadata scm\nWHERE scm.status = 'active';",
"sql... |
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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"role": "user",
"content": "Show the ticker_symbol, security_name, and the number of loans that have that ticker_symbol as their collateral_description.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, COUNT(l.loan_id) AS collateral_loan_count\nF... |
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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "For each ERC1155 NFT on Ethereum, can you show the contract address, token ID, and the total number of unique wallet holders?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nh.contract_address, nh.token_id, COUNT(DISTINCT nh.wallet_address) AS unique... |
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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "For each booking, show the booking_id, passenger's first name and last name, the trip_id, and the route_number associated with the trip.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name, p.last_name, b.trip_id, r.route_number... |
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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "List the employee ID, first name, last name, and hire date for all employees who were hired in the year 2022.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT employee_id, first_name, last_name, hire_date FROM government_services.employees WHERE EXTRAC... |
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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "Find pairs of law firms that share the same managing partner. List the names of both firms and the managing partner ID, but only show pairs where the managing partner ID is not null.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n t1.firm_name AS f... |
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 healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List the record_id, record_date, and treatment_plan for all medical records where the treatment_plan field is not null.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT record_id, record_date, treatment_plan\nFROM healthcare.medical_records\nWHERE trea... |
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 web3.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created... | [
{
"role": "user",
"content": "List all pairs of wallet IDs where both wallets were created on the same day but belong to different users, showing the user IDs and the creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet_id_1, w2.wallet_id AS wallet... |
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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "For each employee, show their full name, job title, and department, along with the job title and department of their manager.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, e.job... |
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_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "List all SUI NFT objects with the status 'exists', showing the object_id, name, and owner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT object_id, name, owner\nFROM sui_nfts\nWHERE status = 'exists';",
"sql": null
},
{
"role": "user",
... |
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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"role": "user",
"content": "List all customers (customer_id) who have both an active checking account (account_type = 'Checking' and status = 'Open') and a home loan (loan_type = 'Home' and status = 'Active'), along with their total account balance and total loan principal amount.",
"sql": null
},
... |
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_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Get the number of distinct wallet holders and total amount held for each NFT collection on Ethereum. Include collection name and contract_address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nc.contract_address, nc.name, COUNT(DISTINCT nh.wallet_a... |
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": "I want each user with the date and action of their most recent log entry, along with how many log entries they have in the last 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "WITH recent_logs AS (\n SELECT user_id, action, logged_at,\n ROW_... |
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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "How many reservations are there per status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) FROM hospitality_technology.reservations GROUP BY status;",
"sql": null
},
{
"role": "user",
"content": "Only count reservatio... |
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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"role": "user",
"content": "List service orders placed in the last 7 days, showing order_id, service_name, guest full name, and order_timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT so.order_id, s.service_name, g.first_name || ' ' || g.last_name AS guest_name, so.orde... |
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 healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"role": "user",
"content": "For each diagnosis code_type, calculate the average number of refills_allowed for prescriptions linked to chronic diagnoses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n d.code_type,\n AVG(p.refills_allowed) AS avg_refills_allowed\nFROM healthc... |
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 government_services.notifications ( notification_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "For each citizen, how many notifications have a status of 'Read'? Please show the citizen_id and their corresponding count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT citizen_id, COUNT(*) AS read_notification_count\nFROM government_services.notif... |
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 insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i... | [
{
"role": "user",
"content": "For each customer, calculate the average number of days between their consecutive premium payments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.customer_id,\n AVG(t.days_diff) AS avg_days_between\nFROM (\n SELECT p1.customer_id,\n ... |
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 hospitality_technology.services ( service_id.text, property_id.text, service_name.te... | [
{
"role": "user",
"content": "Show me all services grouped by category, including the minimum and maximum price in each category, and the total number of services.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT category, MIN(price) AS min_price, MAX(price) AS max_price, COUNT(*) ... |
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 government_services.services ( service_id character varying(64) NOT NULL, agency_id ... | [
{
"role": "user",
"content": "List all services with an average processing time greater than the overall average processing time for all services. Show the service name, average processing time, and the overall average processing time.",
"sql": null
},
{
"role": "assistant",
"content": "SELE... |
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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Show me all patients who have scheduled appointments with doctors specializing in Cardiology, along with their appointment times and reasons, ordered by appointment time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, a.app... |
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Provide a list of all unique genders present in the citizens table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT gender FROM government_services.citizens;",
"sql": null
},
{
"role": "user",
"content": "How many citizens bel... |
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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ... | [
{
"role": "user",
"content": "What is the average ROI and average realized_ratio for each chain?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain,\n AVG(roi) AS avg_roi,\n AVG(realized_ratio) AS avg_realized_ratio\nFROM smart_money_token_performance\nGROUP BY chai... |
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 gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "List all server names and their statuses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_name, status FROM gaming_technology.servers;",
"sql": null
},
{
"role": "user",
"content": "Can you also include the region and current_pl... |
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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "Find each driver_id, first_name, last_name, and count of trips they have driven where the origin city is 'Los Angeles'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.driver_id, d.first_name, d.last_name, COUNT(t.trip_id) AS trip_count\nFROM transp... |
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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te... | [
{
"role": "user",
"content": "Who are the beneficiaries (first and last names) with a percentage_share over 40% for each policy? I would also like the policy_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, first_name, last_name\nFROM insurance.policy_beneficiaries\n... |
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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "List each patient along with the number of active diagnoses they have. Return patient_id, first_name, last_name, and active_diagnoses_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, COUNT(d.diagnosis_id)... |
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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Which customers have filed claims that are currently under review, and what are the details of those claims?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name, c.last_name, cl.claim_id, cl.incident_date, cl.description, cl.st... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id... | [
{
"role": "user",
"content": "List all diagnoses, including the description, diagnosis date, the patient's full name, and the doctor's full name who made the diagnosis.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.description, d.diagnosis_date, p.first_name AS patient_first_n... |
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 transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Please show me the first name, last name, and date of birth for all passengers born before January 1, 1990.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth FROM transportation.passengers WHERE date_of_birth < '1990... |
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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "For each game, find the hidden achievement with the highest points and show the game title, achievement name, and points.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title AS game_title,\n a.name AS achievement_name,\n a.points\nFRO... |
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 legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, p... | [
{
"role": "user",
"content": "Which law firms were founded in the same year and share the same managing partner? Show the firm names, founding year, and managing partner ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.firm_name AS firm_name_1, f2.firm_name AS firm_name_2, E... |
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 cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"role": "user",
"content": "List each blockchain (chain) and the centralized exchange that holds the highest total USD value of tokens, as well as the exchange with the lowest total USD value of tokens. Show chain, max_exchange, max_value, min_exchange, and min_value.",
"sql": null
},
{
"role"... |
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 healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text... | [
{
"role": "user",
"content": "Can you show me all doctors affiliated with hospital ID 'HOSP1001', including their doctor ID, full name, and specialty?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id, first_name, last_name, specialty FROM healthcare.doctors WHERE hospital... |
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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Show me the full name of every lawyer, their specialization, and the number of cases they are the lead lawyer for.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT CONCAT(l.first_name, ' ', l.last_name) AS lawyer_name, l.specialization, COUNT(c.case_id... |
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.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "For each user, list their user_id, username, the count of log entries in the last 30 days, and the count of unread notifications.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id,\n u.username,\n COUNT(l.log_id) FILTER (WHERE l.lo... |
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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "List the product ID, product name, and base premium for all insurance products created in 2022.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, base_premium\nFROM insurance.insurance_products\nWHERE EXTRACT(YEAR FROM created_... |
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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te... | [
{
"role": "user",
"content": "List the first name, last name, and relationship for all beneficiaries whose percentage share is between 10 and 50, inclusive.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, relationship FROM insurance.policy_beneficiaries WHER... |
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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "List all insurance plan names and their associated insurance provider.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT plan_name, insurance_provider FROM healthcare.insurance_plans;",
"sql": null
},
{
"role": "user",
"content": "Only s... |
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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Could you list games developed by companies founded in 'Germany' and show the game title, platform, and the developer's name?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.title, T1.platform, T2.name FROM gaming_technology.games AS T1 JOIN gaming... |
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.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, p... | [
{
"role": "user",
"content": "Show each user ID with the date of their first created wallet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, MIN(created_at) AS first_wallet_date\nFROM trading_platform.wallets\nGROUP BY user_id;",
"sql": null
}
] |
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 healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id ... | [
{
"role": "user",
"content": "List all appointments with status 'Completed' and location 'LOC001' that occurred in December 2023. Show appointment ID, time, duration, and notes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, appointment_time, duration_minutes, not... |
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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "For each player and game pair, please show the total number of achievements unlocked by the player in that game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT gs.player_id, gs.game_id, COUNT(pa.achievement_id) AS achievements_unlocked\nFROM gaming_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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Provide the total number of vehicles for each fuel_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fuel_type, COUNT(*) AS vehicle_count\nFROM transportation.vehicles\nGROUP BY fuel_type;",
"sql": null
},
{
"role": "user",
"conten... |
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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Get me a list of all clients along with the website of their law firm, matching on company_name = firm_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.client_id, c.first_name, c.last_name, f.firm_name, f.website\nFROM legal_services.clients AS... |
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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "How many rooms are there on each floor?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT floor, COUNT(*) FROM hospitality_technology.rooms GROUP BY floor",
"sql": null
},
{
"role": "user",
"content": "Only show floors with more than 10 ... |
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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Provide the total number of reservations made for each property, including the property name and reservation count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(r.reservation_id) AS reservation_count\nFROM hospitality_technol... |
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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "List all notifications of type 'like' where the target_entity_type is 'post'. For each notification, return notification_id, sender_user_id, target_entity_id (as post_id), and the notification creation time.",
"sql": null
},
{
"role": "assistant",
"content": "SE... |
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 transportation.bookings ( booking_id character varying(64) NOT NULL, passenger_id ch... | [
{
"role": "user",
"content": "Show the total number of bookings made for each seat_number. Include only seat numbers which have more than one booking.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT seat_number, COUNT(*) AS booking_count\nFROM transportation.bookings\nWHERE seat_n... |
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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "What is the sum of the amounts for all payments that have a status of 'Completed'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sum(amount) FROM government_services.payments WHERE status = 'Completed'",
"sql": null
}
] |
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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List maintenance logs including vehicle make, model, service_date, cost, and next_service_due_date for vehicles that are currently 'Active'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ml.log_id,\n v.make,\n v.model,\n ml.service... |
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 erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, am... | [
{
"role": "user",
"content": "Which wallets currently hold more than 200 units of ERC1155 NFTs on the Ethereum blockchain? Show the contract address, token ID, wallet address, and amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nh.contract_address, nh.token_id, nh.wallet_a... |
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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Which law firms have handled appointments with clients who registered in 2024? Please provide the law firm name, the client’s first and last name, and the appointment subject.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lf.firm_name, c.first_name,... |
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": "Show me the top 3 peers by the number of active days (days they were last seen) in the last month, along with their IP addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address, COUNT(DISTINCT DATE(last_seen)) AS active_days FROM ... |
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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "Find all patients who have more than two primary active insurance policies, showing their patient ID and the count of such policies. Also, list the plan names for these policies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.patient_id, COUNT(*) ... |
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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"role": "user",
"content": "Show me all documents and the appointments scheduled by the same citizen. List the document ID, upload timestamp, document type, the corresponding appointment ID, and its scheduled start time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.documen... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List all insurance plans and the number of patients associated with each plan.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, COUNT(pi.patient_id) FROM healthcare.insurance_plans ip JOIN healthcare.patient_insurance pi ON ip.plan_id = p... |
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 gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "Can you provide a list of each game's title along with the total quantity of all items players have in their inventory for that game?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, SUM(pi.quantity) AS total_item_quantity\nFROM gaming_technol... |
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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "How many users have verified profiles and private profiles enabled?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) \nFROM social_media.users u\nJOIN social_media.user_settings s ON u.user_id = s.user_id\nWHERE u.is_verified = true AND s.priv... |
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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List each verified user's username and their total number of public posts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(p.post_id) AS post_count\nFROM social_media.users u\nLEFT JOIN social_media.posts p ON u.user_id = p.user_id A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.