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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "Show all documents uploaded in 2024 along with the citizen's full name and the reference number of the associated application.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_id, d.upload_timestamp, c.first_name || ' ' || c.last_name AS cit... |
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": "List all insurance plans along with their provider, plan type, and the contact phone number. Also, for each plan, show how many doctors have their hospital affiliation ID matching the plan ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.plan_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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "List each payment method, the total amount paid, and the number of payments for each method for services in the 'Education' category.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.payment_method, SUM(p.amount) AS total_amount, COUNT(p.payment_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 government_services.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List the first name and last name of each employee, along with the first and last name of their manager.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, m.first_name AS manager_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 government_services.services ( service_id text, agency_id text, service_name text, d... | [
{
"role": "user",
"content": "List all pairs of active services in the same category where one service’s standard fee is higher than the other’s. Display the category, the higher-fee service name with its fee, and the lower-fee service name with its fee.",
"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 hospitality_technology.reviews ( review_id character varying(64) NOT NULL, property_... | [
{
"role": "user",
"content": "Show me the property_id and property_name along with the average overall rating for public reviews.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.review... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. 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
CREA... | [
{
"role": "user",
"content": "What is the current salary of employee with ID 'EMP123'?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about an employee's salary as it is not included in the data available in the 'employees' table.",
"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 government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ... | [
{
"role": "user",
"content": "Which citizens have received notifications for applications processed by employees from the 'Legal' department? List the citizen ID, full name, and notification ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.citizen_id, CONCAT(e.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 blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonc... | [
{
"role": "user",
"content": "Show me the average transaction amount per block, along with the block timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.block_id, b.timestamp as block_timestamp, AVG(t.amount) as avg_transaction_amount FROM blockchain.blocks b JOIN blockch... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, is... | [
{
"role": "user",
"content": "Can you provide a summary of how many securities exist for each combination of exchange and sector?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT exchange, sector, COUNT(*) AS total_count\nFROM financial_services.securities\nGROUP BY exchange, secto... |
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.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text )
C... | [
{
"role": "user",
"content": "List all unread notifications for group conversations, including the conversation name, sender_user_id, and notification creation time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.group_name, n.sender_user_id, n.created_at\nFROM social_media.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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "Retrieve the passenger_id, first_name, last_name, and total number of bookings each passenger has made in 2023, including only those with at least one booking.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.passenger_id, p.first_name, p.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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "I need a report showing each security's ticker_symbol along with the total sum of trade total_amount and the count of trades executed in the last three months.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, SUM(t.total_amount) AS tot... |
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": "I want to list all claims with their claim_id, incident_date, and the customer's full name for claims where estimated_loss is above 10000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cl.claim_id, cl.incident_date, 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 legal_services.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Calculate the average number of days cases stay open before being closed, grouped by case type. Only consider cases that have a date closed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_type, AVG(DATE_PART('day', date_closed - date_opened)) 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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me all customers who have missing contact information (either phone number or email is null), along with their state and city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, state, city FROM insurance.customers WHERE phone... |
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, -- fundrai... | [
{
"role": "user",
"content": "Show me the total USD value of tokens held by each centralized exchange on the 'Polygon' chain for the most recent snapshot time. List the exchange name and the total USD value.",
"sql": null
},
{
"role": "assistant",
"content": "WITH LatestSnapshot AS ( SELECT ... |
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.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri... | [
{
"role": "user",
"content": "Give me all trips where the trip status is 'Completed' with their trip ID, vehicle ID, and number of passengers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, passenger_count FROM transportation.trips WHERE status = 'Completed';... |
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.events ( event_id text PRIMARY KEY, contract_id text, event_name text, data tex... | [
{
"role": "user",
"content": "Show me all token transfers where the corresponding transaction also emitted an event named 'Transfer', along with the transfer value and event data.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tt.transfer_id, tt.value, e.data FROM web3.token_tran... |
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": "Provide a list of all drivers and for each, show their driver_id, full name, the total number of completed trips they've driven, and the sum of all fares from bookings on those completed trips. Include drivers even if they have no completed trips. Order by total_fares descendin... |
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 NOT NULL DEFAULT gen_random_uu... | [
{
"role": "user",
"content": "I want to see, for each player, the total score they have accumulated on each server, along with the server_id and player_id. Only include sessions where the server_id is not null.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, server_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 transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "For each passenger, list their email along with the total amount spent on fares across all their bookings.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.passenger_id, p.email, SUM(b.fare) AS total_fare_spent\nFROM transportation.passengers p\nJOIN... |
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 top 5 hashtags by number of distinct public posts they're used in. Return tag_name and post_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h.tag_name,\n COUNT(DISTINCT ph.post_id) AS post_count\nFROM social_media.hashtags 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.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all reservations for rooms on the 3rd floor, including guest_id, reservation_id, room_number, property_name, and check_in_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, r.guest_id, ro.room_number, p.property_name, r.check... |
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": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_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 social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all users who have made comments that are replies to other comments. Show their user IDs, the comment ID, and the parent comment ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, comment_id, parent_comment_id\nFROM social_media.comment... |
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 me the names of all employees along with the names of the agencies they work for, and the number of appointments each employee has scheduled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, a.agency_name, COUNT(appt.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.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List all distinct job titles present in the organization.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT job_title FROM government_services.employees;",
"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 PRIMARY KEY, username text, email text, password_hash text... | [
{
"role": "user",
"content": "Show me all users whose username contains 'dev', including their user_id and email address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, username, email FROM web3.users WHERE username ILIKE '%dev%';",
"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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Find properties located in 'California' and list their room_id and room_number for rooms last cleaned more than 30 days ago.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, r.room_id, r.room_number, r.last_cleaned_at\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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Show me every guest along with their country code and the number of reviews they have submitted.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, g.country_code, COUNT(r.review_id) AS review_count\nFROM hospitality_technology... |
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.securities ( security_id text PRIMARY KEY, ticker_symbol text, is... | [
{
"role": "user",
"content": "List all securities (security_id, ticker_symbol, security_name) that have a currency of 'EUR' and were last updated within the last 30 days, along with their exchange and sector information.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT security_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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "Find all addresses that have only sent tokens (appear in from_address) but have never received any (do not appear in to_address).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT from_address FROM web3.token_transfers WHERE from_address NOT IN... |
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": "Show customers who have made a premium payment greater than $1000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.customer_id, T1.first_name, T1.last_name FROM insurance.customers AS T1 JOIN insurance.premium_payments AS T2 ON T1.customer... |
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": "Which fundraising round type had the highest total valuation across all projects, and which projects are in that round?",
"sql": null
},
{
"role": "assistant",
"content": "WITH round_valuations AS (\n SELECT\n rounds_name,\n SUM(valuation) AS to... |
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 varch... | [
{
"role": "user",
"content": "List the top 5 ERC20 tokens by total supply, showing their symbol, contract_address, name, and total_supply.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol, contract_address, name, total_supply\nFROM token_metas\nWHERE is_erc20 = 1\nORDER BY 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 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
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Show me each developer's name and the number of different games they have published on each platform.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name, g.platform, COUNT(DISTINCT g.game_id) AS game_count\nFROM gaming_technology... |
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": "Could you show each in-game item's name, its rarity, and the total quantity acquired by all players?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.item_name, i.rarity, SUM(pi.quantity) AS total_quantity\nFROM gaming_technology.in_game_items i\nJOI... |
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 the first name and last name of citizens who have scheduled appointments at accessible service locations, along with the scheduled start time of the appointment and the location name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT 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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "For each ERC20 token, show the contract address, symbol, and the total number of unique wallet holders based on the current erc20_balances table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.contract_address, t.symbol, COUNT(DISTINCT e.wallet_add... |
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": "Please list the first name, last name, and specialty for all doctors in the system.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, specialty FROM healthcare.doctors;",
"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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "List all group conversations that have at least one unread notification, include the conversation ID, group name, and the count of unread notifications as unread_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id, c.group_name, 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 insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "How many agents are currently active in each license state?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT license_state, COUNT(*) AS active_agent_count\nFROM insurance.agents\nWHERE status = 'Active'\nGROUP BY license_state;",
"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.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "Show the distribution of cases by their current status, listing each status and the total count of cases in that status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS case_count FROM legal_services.cases GROUP BY status ORDER BY ... |
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": "能否帮我统计特定车站(station_id 为 'station_xyz')的所有工作人员数量?",
"sql": null
},
{
"role": "assistant",
"content": "MATCH (s:Station {station_id: 'station_xyz'})<-[:BASED_AT]-(staff:Staff)\nRETURN COUNT(staff) AS total_staff",
"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 smart_money_profit ( address.text, rank.numeric, profit.numeric, roi.numeric, realiz... | [
{
"role": "user",
"content": "What is the average ROI and total profit for smart money addresses on the Arbitrum chain?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(roi) AS avg_roi, SUM(profit) AS total_profit\nFROM smart_money_profit\nWHERE chain = 'Arbitrum';",
"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 healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t... | [
{
"role": "user",
"content": "List the patient_id and policy_number for all policies belonging to patients who have more than one insurance policy record in the system.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.patient_id, T1.policy_number FROM healthcare.patient... |
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 the top 5 ERC20 tokens by total_supply along with their latest USD price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tm.symbol, tm.contract_address, tm.total_supply, tpl.price\nFROM token_metas tm\nJOIN token_prices_latest tpl ON tm.contract... |
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, invoice_number text, client_id text, case... | [
{
"role": "user",
"content": "Show all invoices for a specific client ID, say 'client_101'. Include the invoice number, total amount, status, and the client's name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, i.total_amount, i.status, 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 token_basic_info ( coin_id text, token_name text, token_symbol text, token_address t... | [
{
"role": "user",
"content": "List tokens that have a 24-hour trading volume greater than $10,000,000 and a negative price change percentage over the last 24 hours. Show the token symbol, chain, total volume, and the 24-hour price change percentage.",
"sql": null
},
{
"role": "assistant",
"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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "I need a list of each case_number and case_name with the total hours spent on each case based on time_entries, but only include cases where the total hours is greater than 10.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number, c.case_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 financial_services.accounts (
account_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "List all pairs of employees who work in the same department but at different branches. For each pair, show the employee_id and branch_id for both members.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.employee_id AS employee_id_a, a.branch_id AS 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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Please list all buses acquired after 2022-01-01 along with their depot name and city, sorted by acquisition date descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.license_plate, v.type, v.acquisition_date, l.name AS depot_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 smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "Show the tokens with a negative net flow this month on all chains.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain, net_flow FROM smart_money_token_performance WHERE net_flow < 0 AND date_trunc('month', CURRENT_DATE) = date_trunc('... |
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": "Find all users who have set their bio to a non-empty value, showing their username and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, email\nFROM social_media.users\nWHERE bio IS NOT NULL AND TRIM(bio) != '';",
"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.guests ( guest_id text PRIMARY KEY, first_name text, last_nam... | [
{
"role": "user",
"content": "Show me all guests from 'CA' along with their full name and email address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id, CONCAT(first_name, ' ', last_name) AS full_name, email FROM hospitality_technology.guests WHERE country_code = '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 legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case... | [
{
"role": "user",
"content": "Count the total number of invoices issued in each calendar year and month. Show the year, month, and the count, ordered chronologically.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM issue_date) AS issue_year, EXTRACT(MONTH FROM is... |
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.transactions ( transaction_id character varying(64) NOT NULL, from_address char... | [
{
"role": "user",
"content": "For each block that contains more than 5 transactions, list the block number, the total sum of values transferred within that block, and the average gas used per transaction in that block.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT block_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.services ( service_id character varying(64) NOT NULL, agency_id ... | [
{
"role": "user",
"content": "Find pairs of active services within the same category provided by the same agency, where one service has an average processing time more than double the other's. Display the agency ID, category, the first service name and its processing time, and the second service name and it... |
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": "Display each product alongside the most recently updated product of the same type. Return original_id, original_updated_at, recent_id, recent_updated_at, and product_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.product_id AS original_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.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser... | [
{
"role": "user",
"content": "For each player, show the total number of achievements they have unlocked and their total game session count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id, COUNT(pa.achievement_id) AS total_achievements_unlocked, COUNT(gs.session_id) 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 smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "For each blockchain (chain), which token symbol has the highest Return on Investment (ROI)? Show the chain, token symbol, and the highest ROI.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, token_symbol, roi FROM ( SELECT chain, token_symbol, ... |
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.player_achievements ( player_achievement_id uuid, player_id uuid, ... | [
{
"role": "user",
"content": "Can you show me all achievement unlock records where the same player unlocked two different achievements within the same day? Please show player_id, achievement_id_1, achievement_id_2, and the unlock dates for each.",
"sql": null
},
{
"role": "assistant",
"conte... |
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_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp... | [
{
"role": "user",
"content": "Find tokens that have a positive price change percentage over the last 1 hour, 6 hours, and 24 hours. Display their symbol and chain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain FROM token_dexpool_info WHERE price_change_percen... |
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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "Find all tokens with their contract addresses and the number of wallets that hold each token, sorted by wallet count in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.token_id, t.contract_address, COUNT(DISTINCT w.wallet_id) AS wa... |
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 pairs of patients who registered on the same day. Show patient1_id, patient1_name, patient2_id, patient2_name, and the shared registration date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.patient_id AS patient1_id, p1.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 transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"role": "user",
"content": "List all pairs of routes where the origin location of one route is the destination location of the other, showing both route numbers and their types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.route_number AS route_number_1, r1.type AS type_1,... |
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": "List all beneficiaries added in the last 6 months with a percentage share greater than 25%. Include their beneficiary ID, policy ID, customer ID, first name, last name, relationship, and percentage share. Order the results by the date they were added, oldest first.",
"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 government_services.documents ( document_id text, application_id text, citizen_id te... | [
{
"role": "user",
"content": "How many documents have a file reference assigned?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM government_services.documents WHERE file_reference IS NOT NULL AND file_reference <> '';",
"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 financial_services.market_data (
data_point_id bigserial NOT NULL, -- auto-incre... | [
{
"role": "user",
"content": "For each security issuer, show the count of market data points and the average close price for their securities.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T2.issuer_name, COUNT(T1.*) AS data_point_count, AVG(T1.close_price) AS avg_close_price FR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "Show me the number of law firms founded per year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM founded_date) AS year, COUNT(*) AS firm_count FROM law_firms GROUP BY year;",
"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 hospitality_technology.staff (
staff_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "List all staff who report directly to a manager with access_level 5. Include staff full name, position, and the name of their manager.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name AS staff_first_name, s.last_name AS staff_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List every maintenance log for each vehicle, including the vehicle's license plate and the mechanic's name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ml.log_id, ml.vehicle_id, v.license_plate, ml.service_date, ml.service_type, ml.description, ml... |
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
CREATE TABLE gaming_technology.player_inventory (
inventory_id uuid NOT NULL DEFAULT gen_rand... | [
{
"role": "user",
"content": "Can you show the total quantity of all in-game items held by each player?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player_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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the first and last names of citizens who have made 'Completed' payments for services belonging to the 'Healthcare' category, along with the amount paid and the service name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_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": "Which citizens have made the highest total payments in USD? Show their full name and total payment amount, ordered by total in descending order, limited to the top 3.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name || ' ' || c.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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List each passenger's first_name, last_name, and booking_id along with the total quantity of fuel consumed on their trip for July 1, 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n p.first_name,\n p.last_name,\n b.booking_id,\n SUM(fl.quan... |
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": "Please provide each follow relationship, including the follower's username, the followed user's username, and the follow creation timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n u1.username AS follower_username,\n u2.username AS followi... |
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.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "Find users who have at least one wallet created before their user registration date. List their username and the address of any such wallet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, w.address AS wallet_address FROM web3.users AS u J... |
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.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), g... | [
{
"role": "user",
"content": "I need to list all pairs of in-game items in the same game where one item is Epic and the other is Legendary, showing game_id, epic_item, and legendary_item.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.game_id,\n a.item_name AS epic_item,\... |
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 me all non-smoking rooms on the first floor, including their room number and the property name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_number, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.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 healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"role": "user",
"content": "Show the diagnosis codes, descriptions, and their corresponding insurance plan names for all chronic diagnoses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.diagnosis_code, d.description, ip.plan_name\nFROM healthcare.diagnoses d\nJOIN healthcare... |
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, ... | [
{
"role": "user",
"content": "Retrieve, for each room type, the total number of services offered by its property, including the property_name, type_name, and service_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name,\n rt.type_name,\n COUNT(s.servi... |
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": "Find all pairs of contracts deployed by the same deployer on the same day, showing the deployer_address, the deployment date, and both contract IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c1.deployer_address,\n DATE(c1.deployed_at) AS 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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash... | [
{
"role": "user",
"content": "Can you list each player along with the number of rare items they currently have in their inventory, and also show the total quantity of these rare items?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, COUNT(DISTINCT pi.item_id) AS num_ra... |
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": "Show me all active staff including their staff_id, first_name, last_name, position, and work_email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT staff_id,\n first_name,\n last_name,\n position,\n work_email\nFROM hospitality... |
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, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "For each insurance product, can you list its product name, the number of unique agents who have sold policies for that product, and the total premium paid across those policies?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.product_name, COUNT(DI... |
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(), -... | [
{
"role": "user",
"content": "Show the usernames and registration dates for all players whose status is 'inactive'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, registration_date FROM players WHERE status = 'inactive';",
"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 government_services.documents ( document_id text PRIMARY KEY, application_id text, c... | [
{
"role": "user",
"content": "How many documents are in each verification_status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT verification_status, COUNT(*) AS document_count\nFROM government_services.documents\nGROUP BY verification_status;",
"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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List each vehicle's ID, make, and model along with the count of trips scheduled to depart in the next 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.make, v.model, COUNT(t.trip_id) AS trip_count\nFROM transportation.vehicles v... |
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": "What is the total payment amount for each currency recorded in the payments table?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT currency , sum(amount) FROM government_services.payments GROUP BY currency",
"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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "List all pairs of lawyers from the same firm who were hired in the same month and year. Include each lawyer's first_name, last_name, firm_id, and the shared hire_month_year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.first_name AS lawyer1_first... |
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 employees who are currently active and were hired before 2022. Show employee_id, first_name, last_name, job_title, department, and hire_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n employee_id,\n first_name,\n last_name,\n 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 legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List each lawyer's full name with the full name of the partner at the same firm.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.lawyer_id,\n CONCAT(l.first_name, ' ', l.last_name) AS lawyer_name,\n CONCAT(p.first_name, ' ', p.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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Find the total payment amount and payment count made by citizen with national ID number 'A123456789'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(p.amount) AS total_amount, COUNT(p.payment_id) AS payment_count\nFROM government_services.citizen... |
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 IDs and policy numbers for policies that have a null cancellation reason.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number FROM insurance.policies WHERE cancellation_reason 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 insurance.insurance_products ( product_id text, product_name text, product_type text... | [
{
"role": "user",
"content": "List all active products, showing their product ID, name, and type, ordered by their creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, product_type FROM insurance.insurance_products WHERE is_active = TRUE ORDER B... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.