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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "List all tokens on the 'BSC' chain with a trend rank between 6 and 20 (inclusive), along with their symbol, price, and liquidity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.token_symbol, t.price, d.liquidity\nFROM token_basic_info t\nJOIN token... |
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": "Show me all clients along with their email addresses who registered in the year 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM legal_services.clients WHERE EXTRACT(YEAR FROM date_registered) = 2023;",
"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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS ca... |
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": "Show all users who have no wallets yet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT k.user_id\nFROM trading_platform.kyc_audit k\nLEFT JOIN trading_platform.wallets w ON k.user_id = w.user_id\nWHERE w.wallet_id IS NULL;",
"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.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List all reservations made by guests from 'US', showing the reservation ID, guest first name, last name, and the property name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.reservation_id, T2.first_name, T2.last_name, T3.property_name FROM hospi... |
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 PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "Can you show me the number of unique doctors by specialty who were created after January 1st, 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT specialty, COUNT(DISTINCT doctor_id) AS doctor_count\nFROM healthcare.doctors\nWHERE created_at > '2024... |
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, -- fundraising reco... | [
{
"role": "user",
"content": "List tokens in DEX pools with a 24-hour trading volume greater than $500,000 and a price less than $1. Show their symbol, chain, volume, and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain, volume_24h, price FROM token_dexpo... |
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, first_name charact... | [
{
"role": "user",
"content": "Show me the first and last names of all customers and the agency name of the agent who sold their policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, a.agency_name\nFROM insurance.policies p\nJOIN insurance.customers c O... |
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 had prescriptions for a medication named 'Metformin', including their full name, prescription date, and prescribing doctor's ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, pr.... |
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.assets ( asset_id text PRIMARY KEY, name text, symbol text, type te... | [
{
"role": "user",
"content": "List all asset symbols where the asset type is 'token'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol FROM trading_platform.assets WHERE type = 'token';",
"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.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Find the total number of distinct lawyers and distinct documents in the database.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT (SELECT COUNT(DISTINCT lawyer_id) FROM legal_services.lawyers) AS distinct_lawyer_count, (SELECT COUNT(DISTINCT document_... |
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 all failed transactions (status = 'FAILED') that involved US dollars, along with the account_id, amount, and transaction_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, account_id, amount, transaction_date\nFROM financial... |
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 player, show their username and the number of distinct servers they have played sessions on.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, COUNT(DISTINCT gs.server_id) AS server_count\nFROM gaming_technology.players p\nJOIN gami... |
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.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "List the product ID and product name for all insurance products where the coverage details mention 'warranty'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name FROM insurance.insurance_products WHERE coverage_details LIKE '%war... |
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, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "Which developers founded after 2010 have published games using the 'Unreal Engine'? List the developer's name, country, game title, and the release year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name, d.country, g.title AS g... |
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": "List the full names and email addresses of all lawyers who have handled at least one appointment for a client from the company 'Innovatech Ltd', along with the company name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT l.first_name, l.last... |
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, national_i... | [
{
"role": "user",
"content": "Could you list each service location's name, city, and the total number of appointments scheduled there, only for accessible locations?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sl.location_name, sl.city, COUNT(a.appointment_id) AS appointment_c... |
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": "Which room types have the highest average base_rate? Return type_name and avg_rate, sorted descending, limit 5.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rt.type_name,\n AVG(rt.base_rate) AS avg_rate\nFROM hospitality_technology.room_types... |
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.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Could you show me each employee's full name along with their manager's full name?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.employee_id,\n e.first_name || ' ' || e.last_name AS employee_name,\n m.employee_id AS manager_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.reviews ( review_id text PRIMARY KEY, property_id text, reser... | [
{
"role": "user",
"content": "For each overall rating level (1-5), count how many reviews received that rating.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rating_overall, COUNT(*) FROM reviews GROUP BY rating_overall ORDER BY rating_overall;",
"sql": null
},
{
"ro... |
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": "Which nodes have not been seen in the last 24 hours?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port, last_seen\nFROM blockchain.nodes\nWHERE last_seen < now() - INTERVAL '24 hours';",
"sql": null
},
{
"role": "us... |
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 character varying(64) NOT NULL, customer_id... | [
{
"role": "user",
"content": "Which customers have more than one account? Please include customer_id and the number of accounts they hold.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, COUNT(account_id) AS account_count FROM financial_services.accounts GROUP BY cust... |
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": "How many agents were hired in the year 2023?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS agents_hired_2023 FROM insurance.agents WHERE hire_date BETWEEN '2023-01-01' AND '2023-12-31';",
"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 character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "For each fuel type, show the number of unique vehicles that have used it and the total quantity refueled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.fuel_type, COUNT(DISTINCT f.vehicle_id) AS vehicle_count, SUM(f.quantity) AS total_quantity\nFR... |
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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "List the full names and contact emails of citizens who have been assigned to applications for services offered by agencies with a jurisdiction_level of 'State'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name || ' ' || c.last_nam... |
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, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "List all claims along with the corresponding policy number and the full names of all beneficiaries associated with each policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.policy_id, p.policy_number, b.first_name || ' ' || b.last_nam... |
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": "Which users have participated in the highest number of unique conversations? Show their usernames and the count of unique conversations they joined.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(DISTINCT cp.conversation_id) AS conv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id... | [
{
"role": "user",
"content": "我想查询某个构建ID下的所有检查记录,包括检查类型、检查结果和检查时间,同时关联到对应的步骤信息。",
"sql": null
},
{
"role": "assistant",
"content": "db.inspections.aggregate([\n {\n $match: {\n build_id: 'specific_build_id'\n }\n },\n {\n $lookup: {\n from: 'steps',\n localField: '... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "Give me a list of developers and how many unique games they have created. Show developer name and total_games.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name, COUNT(DISTINCT g.game_id) AS total_games\nFROM gaming_technology.d... |
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 character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "List all contracts along with the username of the deployer, showing contract_id, contract address, deployed_at, and the username. Order by deployed_at descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.contract_id,\n c.address AS cont... |
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.applications ( application_id text PRIMARY KEY, citizen_id text,... | [
{
"role": "user",
"content": "List the application ID, submitted date, and assigned employee ID for all applications that are currently in 'Processing' status and were submitted before January 1st, 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT application_id, submitted_at,... |
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": "Find pairs of citizens who have the same last name but different national_id_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c1.citizen_id AS citizen_id_1, c1.first_name AS first_name_1, c1.last_name AS last_name_1, c1.national_id_number AS na... |
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.insurance_products (
product_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "How many insurance products have a base premium greater than 2000?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM insurance.insurance_products\nWHERE base_premium > 2000;",
"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 social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "How many public posts has each verified user created since 2024-01-01? Please list their username and post_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(p.post_id) AS post_count FROM social_media.users u LEFT JOIN social_med... |
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": "Show a list of patients along with their most recent diagnoses, including patient ID, diagnosis description, and the diagnosis date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.patient_id, d.description AS diagnosis_description, d.diagnosis_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 trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, mes... | [
{
"role": "user",
"content": "For each user, list their user_id along with their first and last notification messages and the sent_at timestamps.",
"sql": null
},
{
"role": "assistant",
"content": "WITH firsts AS (\n SELECT user_id, notification_id AS first_id, message AS first_message, sen... |
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, -- unique ... | [
{
"role": "user",
"content": "Show me the total number of bookings and total fare collected per trip. Only include trips that have collected more than 500 in total fare.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, COUNT(*) AS booking_count, SUM(fare) AS total_fare\nFR... |
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.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, crea... | [
{
"role": "user",
"content": "For each group chat, retrieve the conversation_id, group_name, and the timestamp of the latest like on any comment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id,\n c.group_name,\n MAX(l.created_at) AS latest_comment_li... |
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, policy_id text, customer_id text, incident_date ti... | [
{
"role": "user",
"content": "Show me all claims with police reports that were handled by agents hired in the last 2 years, along with the agent's full name and agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.policy_id, c.incident_date, c.police_report_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 healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, ... | [
{
"role": "user",
"content": "List the plan ID, name, provider, and type for all insurance plans from 'Healthcare Partners' with a plan type of 'PPO'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT plan_id, plan_name, insurance_provider, plan_type FROM healthcare.insurance_plans ... |
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 text PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "List all agents who have a commission rate above 0.1, showing their full names and agency names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agent_id, first_name, last_name, agency_name, commission_rate FROM insurance.agents WHERE commission_rate ... |
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": "List law firm names and the full name and specialization of all lawyers hired after 2020.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.firm_name, T2.first_name || ' ' || T2.last_name AS lawyer_full_name, T2.specialization FROM law_firms AS T1 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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "What is the average and maximum standard fee for services in each category?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT category, AVG(standard_fee) AS avg_standard_fee, MAX(standard_fee) AS max_standard_fee FROM government_services.services GROUP ... |
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": "Find pairs of cases that share the same client and have the same status, but are different cases. Display the case name and case number for both cases in the pair, along with the shared client ID and shared status.",
"sql": null
},
{
"role": "assistant",
"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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Give me all unspent UTXOs for address '1A2b3C4d5E', sorted by amount descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT utxo_id, transaction_id, output_index, address, amount\nFROM trading_platform.utxos\nWHERE address = '1A2b3C4d5E' AND spen... |
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.conversations ( conversation_id character varying(64) NOT NULL, created... | [
{
"role": "user",
"content": "For each group chat, list its ID, name, creation time, and the creation time of the next group chat created after it, ordered by creation time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT conversation_id, group_name, created_at, LEAD(created_at) O... |
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.insurance_products (
product_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Retrieve the product_id, product_name, base_premium, and created_at for all active insurance products with a base_premium greater than 1000, ordered by base_premium descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n product_id,\n product_... |
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": "Find the total transaction amount and total trade volume for each currency for today.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.currency, SUM(t.amount) AS total_transaction_amount, SUM(md.volume) AS total_trade_volume\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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Which ERC20 tokens have a total supply between 1,000,000 and 5,000,000? List their symbol, name, and contract address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol, name, contract_address FROM token_metas WHERE is_erc20 = 1 AND CAST(total_su... |
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": "List each game title along with the number of servers currently online for that game, only include games that have more than 3 online servers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, COUNT(s.server_id) AS online_server_count\nFROM gam... |
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.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "For each chain in the smart money token inflow data, calculate the total number of addresses involved in buy transactions and the total number of addresses involved in sell transactions. Display the chain, total buy addresses, and total sell addresses.",
"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.rooms ( room_id text, property_id text, room_number text, roo... | [
{
"role": "user",
"content": "List all available services in the 'Housekeeping' department that cost less than 20.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_id, service_name, price\nFROM hospitality_technology.services\nWHERE department = 'Housekeeping' AND is_availa... |
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 PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "List all items in the player_inventory table along with the game title each item belongs to.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.inventory_id, pi.player_id, pi.item_id, i.item_name, g.title AS game_title\nFROM gaming_technology.player_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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "Show me the user ID and the total count of wallets associated with each user who owns at least one wallet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.user_id, COUNT(T2.wallet_id) FROM trading_platform.users AS T1 JOIN trading_platform.wallets ... |
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.likes ( like_id text, user_id text, post_id text, comment_id text, crea... | [
{
"role": "user",
"content": "Show me the conversation ID and creation time for group chats that have received at least one message.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.conversation_id, T1.created_at FROM social_media.conversations AS T1 INNER JOIN social_m... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE smart_money_token_inflow (",
"token_address character varying(100) NOT NULL, ... | [
{
"role": "user",
"content": "Which token has the highest net USD value difference between buys and sells? Show token_symbol, chain, narrative, average buy price, average sell price, and the net difference.",
"sql": null
},
{
"role": "assistant",
"content": "WITH buys AS (\n SELECT token_ad... |
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, -- unique identif... | [
{
"role": "user",
"content": "Find the total amount paid for all premium payments made in the last 30 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(amount_paid) FROM insurance.premium_payments WHERE payment_date >= CURRENT_DATE - INTERVAL '30 day';",
"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 gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"role": "user",
"content": "List all game titles and corresponding server names for servers that are located in the same region as 'us-central-1'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, s.server_name\nFROM gaming_technology.servers s\nJOIN gaming_technology.gam... |
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 all staff members who have an access level greater than 3, showing their staff ID, first name, and last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT staff_id, first_name, last_name FROM hospitality_technology.staff WHERE access_level > 3... |
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, -- unique iden... | [
{
"role": "user",
"content": "List each patient's first and last name along with their total number of appointments in 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, COUNT(a.appointment_id) AS appointment_count\nFROM healthcare.patients p\nLEFT 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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "Which rooms on the 4th floor are non-smoking, along with their property IDs and type IDs?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT room_id, property_id, room_number, room_type_id FROM hospitality_technology.rooms WHERE floor = 4 AND is_smoking ... |
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": "For all appointments scheduled after '2024-07-01', list the appointment ID, the full name of the citizen, the location name, and the city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id,\n CONCAT(c.first_name, ' ', c.last_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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "For each user, show their user ID and the count of unread notifications they have received.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT recipient_user_id, COUNT(*) AS unread_notification_count\nFROM social_media.notifications\nWHERE read_at IS NUL... |
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": "How many reservations does each property have?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_id,\n COUNT(*) AS reservation_count\nFROM hospitality_technology.reservations\nGROUP BY property_id;",
"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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Find all pairs of citizens who share the same last name but have different dates of birth. Display both full names, the shared last name, and each date of birth.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c1.first_name || ' ' || c1.last_name 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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"role": "user",
"content": "How many distinct token symbols are recorded for each chain in the smart money performance data?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, COUNT(DISTINCT token_symbol) FROM smart_money_token_performance GROUP BY chain",
"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.prescriptions (
prescription_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Can you show a list of all distinct medication IDs along with the count of prescriptions for each medication, including only medications that have been prescribed more than 50 times? Also, please display the total quantity dispensed for each medication.",
"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.users ( user_id text, username text, email text, password_hash text, created_at... | [
{
"role": "user",
"content": "Find pairs of users who registered on the same weekday but in different years. List the user ID and registration date for both users, and the weekday name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u1.user_id, u1.created_at AS user1_created_at, ... |
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, route_number.text, description.text, origin_l... | [
{
"role": "user",
"content": "Find all pairs of routes where one starts where the other ends and vice versa. List their route numbers, origin and destination IDs for each.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.route_number AS route_number_1, r1.origin_location_id AS o... |
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, -- unique identifie... | [
{
"role": "user",
"content": "Count the total number of public posts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.posts WHERE visibility = 'public';",
"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
// Node Label: :Station
// Properties:
// station_id: String (Constraint: UNIQUE)
// station_... | [
{
"role": "user",
"content": "Can you help me find all bookings made by passengers from a specific city, say 'Boston', including the passenger details and the scheduled trip information?",
"sql": null
},
{
"role": "assistant",
"content": "MATCH (p:Passenger)-[:MADE_BOOKING]->(b:Booking)-[:FO... |
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 text, property_name text, address_li... | [
{
"role": "user",
"content": "Show me staff members who were hired after the property they work at was created. List their first name, last name, hire date, the property name, and the property creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_na... |
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.trades (
trade_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "I want a summary for each user showing their total buy value and total sell value across all trades.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n COALESCE(b.user_id, s.user_id) AS user_id,\n COALESCE(b.total_buy, 0) AS total_buy_value,\n COALE... |
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, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "List policy_number, customer_id, and product_name for policies that are currently active.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.customer_id, ip.product_name\nFROM insurance.policies p\nJOIN insurance.insurance_products ip ... |
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": "Show the booking ID and seat number for all bookings that have a fare equal to 50.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT booking_id, seat_number\nFROM transportation.bookings\nWHERE fare = 50;",
"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 gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ... | [
{
"role": "user",
"content": "I’d like to see how many achievements each player has unlocked and the date of their first unlock.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pa.player_id, COUNT(pa.achievement_id) AS achievement_count, MIN(pa.unlocked_at) AS first_unlocked\nFROM... |
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": "Show each player's username and the number of distinct games they have played sessions on.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n p.username,\n COUNT(DISTINCT gs.game_id) AS games_played\nFROM gaming_technology.players p\nJOIN gaming_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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam... | [
{
"role": "user",
"content": "For each driver, show their driver_id, email, and the number of days until their license expires.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, email, (license_expiry_date - CURRENT_DATE) AS days_until_expiry\nFROM transportation.drivers;... |
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.reviews ( review_id text PRIMARY KEY, property_id text, reser... | [
{
"role": "user",
"content": "Show me the full names of guests who reviewed property 'P005' and gave an overall rating of 5.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name FROM guests AS T1 JOIN reviews AS T2 ON T1.guest_id = T2.guest_id WHERE T2.prope... |
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.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_... | [
{
"role": "user",
"content": "What's the average session duration for each player for a given server?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, server_id, AVG(duration_seconds) AS avg_session_duration FROM gaming_technology.game_sessions GROUP BY player_id, server... |
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": "Which rooms have not been cleaned in over 14 days? Show the room number, property ID, last cleaned date, and status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT room_number, property_id, last_cleaned_at, status\nFROM hospitality_technology.rooms\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.patient_insurance ( patient_insurance_id text, patient_id text, plan_id t... | [
{
"role": "user",
"content": "Show me all primary insurance policies along with their policy numbers and effective dates for patient with ID 'patient_555'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_insurance_id, policy_number, effective_date FROM healthcare.patient_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 blockchain.blocks (
block_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Find all smart contract IDs and the block IDs that were mined within 5 minutes before or after the contract deployment timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.contract_id, T2.block_id FROM blockchain.smart_contracts AS T1 JOIN bl... |
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": "List all time entries for lawyers specializing in 'Criminal Law'. Show the entry ID, the date worked, hours spent, and the first and last name of the lawyer who performed the work.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT te.entry_id, te.date_w... |
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": "Show me the usernames of all verified users who have liked any comment and the like creation time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, l.created_at\nFROM social_media.likes l\nJOIN social_media.users u ON l.user_id = u.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 healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id t... | [
{
"role": "user",
"content": "Find all pairs of different insurance records that share the same group_number, and show group_number, the patient_insurance_id of both records, and their corresponding patient_ids.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.group_number,\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 blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character vary... | [
{
"role": "user",
"content": "Find all pairs of node IDs that share the same IP address but operate on different ports.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.node_id AS node1, b.node_id AS node2, a.ip_address, a.port AS port1, b.port AS port2 FROM blockchain.nodes a 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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Show me the full name of all partner lawyers and the total hours they have spent on all time entries.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, SUM(te.hours_spent) AS total_hours FROM legal_services.lawyers l JOIN lega... |
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, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "List the product_id, product_name, and base_premium for all products that are currently inactive.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, base_premium\nFROM insurance.insurance_products\nWHERE is_active = false;",
... |
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": "List the first and last names of all drivers along with the names of locations where they have completed trips as the origin.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, l.name AS origin_location_name\nFROM transportatio... |
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.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"role": "user",
"content": "Show the count of invoices for each case ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_id, COUNT(invoice_id) AS invoice_count FROM legal_services.invoices WHERE case_id IS NOT NULL GROUP BY case_id ORDER BY invoice_count DESC",
"sql": 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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "Find posts that have been liked by users the author of the post is following. List the post_id and the user_id of the post author.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.user_id AS post_author_user_id FROM social_media.posts AS 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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "Could you list projects that have completed more than one fundraising round, showing the project name and the number of rounds?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, COUNT(*) AS round_count FROM project_fundraising_record GROUP... |
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_inflow ( token_address.text, token_symbol.text, token_amount.numer... | [
{
"role": "user",
"content": "List the top 5 tokens by total USD inflow and outflow, including net flow, sorted by net flow descending.",
"sql": null
},
{
"role": "assistant",
"content": "WITH inflow AS (\n SELECT token_symbol, chain, SUM(usd_value) AS usd_in\n FROM smart_money_token_inflo... |
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": "Show me all customers who were created in the current year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, first_name, last_name, created_at FROM financial_services.customers WHERE EXTRACT(YEAR FROM created_at) = EXTRACT(YEAR FROM CURREN... |
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.claim_documents (
document_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me all PDF documents uploaded by agent 'AG456', along with their claim IDs and file sizes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id, file_size_bytes FROM insurance.claim_documents WHERE mime_type = 'application/pdf' AND uploaded_b... |
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, title text, developer_id uuid, publisher_id ... | [
{
"role": "user",
"content": "Show total session duration and average score for each player across all their sessions. Display the player ID, total duration, and average score.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(duration_seconds) AS total_duration, AVG(... |
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 text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "What is the average number of appointments assigned per employee for each job title?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.job_title, CAST(COUNT(a.appointment_id) AS REAL) / COUNT(DISTINCT e.employee_id) AS average_appointments_per_employe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.