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 blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp tim... | [
{
"role": "user",
"content": "List all smart contracts created by addresses that have a balance greater than 1000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sc.* FROM blockchain.smart_contracts sc JOIN blockchain.addresses a ON sc.creator_address = a.address_id WHERE a.balan... |
You are an expert in writing database language. You can write a corresponding 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": "List the first and last names of clients whose client_id matches a lawyer_id in the time_entries table, along with the corresponding entry_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, te.entry_id FROM legal_services.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.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "List each username with how many users they follow and how many users follow them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username,\n COALESCE(following.following_count, 0) AS following_count,\n COALESCE(followers.followers_coun... |
You are an expert in writing database language. You can write a corresponding 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 each notification sent through the 'SMS' channel, list the notification ID, message subject, and the full name of the citizen who received it.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.message_subject, c.first_name || ' ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.dapps ( dapp_id.text, name.text, description.text, url.text )
| [
{
"role": "user",
"content": "Show all DApps whose name starts with the letter 'C'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM trading_platform.dapps WHERE name ILIKE 'C%';",
"sql": null
},
{
"role": "user",
"content": "Could you instead make it case-se... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "Show me the total number of trades and the total traded value for each customer, including their first and last names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name, c.last_name, COUNT(t.trade_id) AS trade_count, SUM(t.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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "Which projects raised funds in January 2022?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, rounds_name, investment_value, investment_date FROM project_fundraising_record WHERE investment_date >= '2022-01-01' AND investment_date < '2022... |
You are an expert in writing database language. You can write a corresponding 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.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List all tokens with a total supply greater than 1,000,000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_id, token_name, token_symbol, contract_address, total_supply\nFROM web3.tokens\nWHERE total_supply > 1000000;",
"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": "Which citizens have submitted applications for services that belong to the 'Education' category? List the citizen's full name, the service name, and the application ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT 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 hospitality_technology.services ( service_id character varying(64) NOT NULL, propert... | [
{
"role": "user",
"content": "List all services provided by the property named 'Grand Plaza Hotel' and include their category and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T1.category, T1.price FROM hospitality_technology.services AS T1 JOIN hospitali... |
You are an expert in writing database language. You can write a corresponding 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": "Which clients have had at least one case led by a lawyer who is a partner? Show the client name, the case name, and the name of the lead lawyer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cl.first_name || ' ' || cl.last_name AS client_name, ca.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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the service_id, service_name, and agency_id for all active services that have an online application URL provided.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_id,\n service_name,\n agency_id\nFROM government_services.servic... |
You are an expert in writing database language. You can write a corresponding 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": "Show me policies that have at least one overdue premium payment, including policy_number, customer full name, agent_id, due_date, and days overdue.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number,\n c.first_name || ' ' || c.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 insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "List all cancelled policies, with their policy number, end date, and cancellation reason.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_number, end_date, cancellation_reason \nFROM insurance.policies \nWHERE status = 'Cancelled';",
"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 insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date ti... | [
{
"role": "user",
"content": "I want a list of all claims where at least one document is larger than 2 megabytes. Include the claim ID, incident date, and the file name of such documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, d.file_name\nFRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Count the number of assets for each asset type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT type, COUNT(*) FROM trading_platform.assets GROUP BY type;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "Which citizens have had both applications and appointments for services in the 'Healthcare' category? List their full name, application ID, and appointment ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Can you list medical records along with the full name of the patient and their age at the time the record was created? Include record ID, record date, patient full name, and age in years.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT mr.record_id, 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 gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ... | [
{
"role": "user",
"content": "Can you show me how many achievements each player unlocks per day? Return player_id, unlock_date, and achievement_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id,\n CAST(unlocked_at AS date) AS unlock_date,\n COUNT(*) AS a... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case... | [
{
"role": "user",
"content": "Calculate the average total amount for invoices issued in each calendar year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM issue_date) AS issue_year, AVG(total_amount) AS average_total_amount FROM legal_services.invoices GROUP 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
CREATE TABLE social_media.user_settings ( setting_id text PRIMARY KEY, user_id text, theme text, ... | [
{
"role": "user",
"content": "Which users have disabled both email and push notifications? Please provide their user IDs and whether their profiles are private.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, private_profile FROM social_media.user_settings WHERE email_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 web3.tokens ( token_id text PRIMARY KEY, contract_address text, token_name text, tok... | [
{
"role": "user",
"content": "Show all tokens where the total_supply is less than 10000, listing the token_id, token_symbol, and decimals.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_id, token_symbol, decimals FROM web3.tokens WHERE total_supply < 10000;",
"sql": 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 social_media.messages (
message_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Find the fastest reply for each conversation, showing conversation_id, initial_message_id, reply_message_id, and response_time in seconds.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m1.conversation_id,\n m1.message_id AS initial_message_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 PRIMARY KEY, agency_name text, jurisdi... | [
{
"role": "user",
"content": "List the application IDs and statuses for applications assigned to employees in the 'Customer Service' department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.application_id, a.status\nFROM government_services.applications a\nJOIN government_ser... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each hashtag, show its tag name and the number of unique users who have ever commented on posts associated with that hashtag.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h.tag_name, COUNT(DISTINCT c.user_id) AS unique_commenters\nFROM 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 blockchain.transactions (
transaction_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "List all sender and receiver address pairs that have exchanged more than 2 transactions with each other, along with the total amount transferred between them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sender_address, receiver_address, COUNT(*) A... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show the total billed hours and total billed amount for each case that has at least one billed and billable time entry.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.case_id, c.case_number, SUM(t.hours_spent) AS total_billed_hours, SUM(t.hours_spe... |
You are an expert in writing database language. You can write a corresponding 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.maintenance_logs ( log_id text, vehicle_id text, service_date date, o... | [
{
"role": "user",
"content": "List each vehicle and the date of its most recent maintenance, including the service type and cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_type, cost, service_date FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY vehicle_id... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir... | [
{
"role": "user",
"content": "I need a list of customer pairs living in the same city, showing both customers' full names and the city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c1.first_name || ' ' || c1.last_name AS customer1_name, c2.first_name || ' ' || c2.last_name AS 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": "What is the total revenue generated for each department from delivered service orders? Return department and total_revenue.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.department,\n SUM(so.total_price) AS total_revenue\nFROM hospitality_te... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "Show me the top 5 NFT collections on Ethereum with the highest number of unique owners, along with their names and floor prices.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nc.name, nc.floor_price, COUNT(DISTINCT nh.wallet_address) AS unique_owner... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me the total number of time entries for each case.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_id, COUNT(*) AS entry_count\nFROM legal_services.time_entries\nGROUP BY case_id;",
"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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Show me each law firm's ID, name, managing_partner_id, and the number of appointments scheduled with that managing partner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.firm_id, \n f.firm_name, \n f.managing_partner_id, \n COUNT... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List all prescriptions with medication details. Return prescription_id, patient full name, medication_name, and prescription_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pr.prescription_id,\n p.first_name || ' ' || p.last_name AS patien... |
You are an expert in writing database language. You can write a corresponding 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": "For each reservation in the last three months, show the reservation ID, check-in date, number of adults, and the corresponding room type name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, r.check_in_date, r.num_adults, rt.type_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.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all partners who have provided a phone number, showing their full name and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM legal_services.lawyers WHERE is_partner = TRUE AND phone IS NOT NULL;",
"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 web3.tokens ( token_id text PRIMARY KEY, contract_address text, token_name text, tok... | [
{
"role": "user",
"content": "What is the average total_supply for each decimals value?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT decimals, AVG(total_supply) AS avg_supply\nFROM web3.tokens\nGROUP BY decimals;",
"sql": null
},
{
"role": "user",
"content": "Ac... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 6 months, along with their narrative information if available.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.rounds_name, pfr.valuation, pfr.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.transactions (
transaction_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "List all transactions with an amount greater than 10000, showing transaction_id, block_id, sender_address, receiver_address, and amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, block_id, sender_address, receiver_address, amount... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "How many insurance policies have no expiration_date specified?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM healthcare.patient_insurance\nWHERE expiration_date 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 social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me the usernames of users who have commented on posts that were created in group chat conversations, along with the names of those group chats.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name\nFROM social_media.comments 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 web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "Find all users who have at least two wallets with different private keys. Show user_id and the count of distinct private keys for those users.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(DISTINCT private_key) AS distinct_private_key... |
You are an expert in writing database language. You can write a corresponding 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 each patient's first_name, last_name, and the time of their next scheduled appointment occurring after the current timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, MIN(a.appointment_time) AS next_appointment_t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id.uuid, name.text, country.text, founded_y... | [
{
"role": "user",
"content": "List all developer names and their websites.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, website FROM gaming_technology.developers;",
"sql": null
},
{
"role": "user",
"content": "Can you only include developers whose website ... |
You are an expert in writing database language. You can write a corresponding 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": "For each contract, list the contract address, the number of different tokens deployed on that address, and the sum of total_supply of those tokens.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.address AS contract_address, COUNT(DISTINCT t.token_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 PRIMARY KEY, username text, email text, passwo... | [
{
"role": "user",
"content": "List users and their latest wallet address if they have one, ordered by username.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, w.address FROM users u JOIN wallets w ON u.user_id = w.user_id WHERE w.created_at = (SELECT MAX(w2.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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "Find all pairs of token transfers where one transfer's sender and recipient are swapped with another transfer's sender and recipient, showing both transfer IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.from_address AS sender,\n t1.to_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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "List all premium payments made via credit card in the last 30 days, showing their policy IDs and payment amounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, amount_paid FROM insurance.premium_payments WHERE payment_method = 'credit car... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "I want to list all insurance plans along with the number of medical records that have a record_date in 2024. Display plan_id, plan_name, and the total medical records.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.plan_id, ip.plan_name, COUNT(mr.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Can you list all group conversations and the number of participants in each?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id, c.group_name, COUNT(cp.user_id) AS participant_count\nFROM social_media.conversations c\nJOIN social_media.... |
You are an expert in writing database language. You can write a corresponding 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, license_plate c... | [
{
"role": "user",
"content": "Show me the make and model of vehicles along with the route number and description for routes where the vehicle's capacity is 60 or less.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.make, v.model, r.route_number, r.description\nFROM transportati... |
You are an expert in writing database language. You can write a corresponding 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 character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "Which narratives saw the highest average net flow from smart money performance this year, and what is the average roi for those narratives along with the total number of tokens in each?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tbi.narrative, AV... |
You are an expert in writing database language. You can write a corresponding 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": "For each loan, show the loan_id, the account_id, the principal_amount, and the ticker_symbol and security_name of any associated collateral, if the collateral_description matches a security's ticker_symbol.",
"sql": null
},
{
"role": "assistant",
"content": "SEL... |
You are an expert in writing database language. You can write a corresponding 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": "Can you show me, for each account type, the total transaction amount and the number of transactions, including the customer full name for each account type?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.account_type, c.first_name || ' ' || c.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 hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, emai... | [
{
"role": "user",
"content": "List all guests who have placed service orders for services in the 'Transportation' department, along with their full names and the service names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.guest_id, g.first_name, g.last_name, s.service_name\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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "For each patient, show their full name and the count of insurance plans they are enrolled in, as well as their earliest policy effective date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, COUNT(pi.plan_id) AS plan_count, ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "I would like to see a list of all medical records where the chief complaint contains the word 'cough' along with the doctor's ID and the date of the record.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT record_id, doctor_id, record_date, chief_compl... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, customer_id text, account... | [
{
"role": "user",
"content": "Can you provide a list of all trades in the past 90 days, including the security_id, account_id, trade_type, quantity, total_amount, and the current balance of the involved account?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trade_id, t.securit... |
You are an expert in writing database language. You can write a corresponding 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.service_orders ( order_id text PRIMARY KEY, reservation_id te... | [
{
"role": "user",
"content": "Show me the total quantity and total revenue for each service, along with the number of unique guests who ordered each service.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_id, SUM(quantity) AS total_quantity, SUM(total_price) AS total_reve... |
You are an expert in writing database language. You can write a corresponding 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": "Find the average session duration in minutes for players from each country.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.country_code, AVG(gs.duration_seconds) / 60 AS avg_duration_minutes FROM gaming_technology.players p JOIN gaming_technology.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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "Count the total number of employees who have a direct manager assigned.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(employee_id) FROM government_services.employees WHERE manager_employee_id IS NOT 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 healthcare.prescriptions ( prescription_id character varying(64) NOT NULL, record_id... | [
{
"role": "user",
"content": "List prescription_id, policy_number, plan_name, and quantity_dispensed for all ongoing prescriptions (end_date IS NULL) where the associated insurance plan_type is 'PPO'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.prescription_id,\n pi.po... |
You are an expert in writing database language. You can write a corresponding 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 each doctor and the total number of unique patients for appointments that have been completed. Return doctor_id, first_name, last_name, and patient_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.doctor_id,\n d.first_name,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Show me the total traded volume and the average price per security for trades executed last month.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol,\n SUM(t.quantity) AS total_volume,\n AVG(t.price_per_unit) AS avg_price\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.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id... | [
{
"role": "user",
"content": "How many users currently have their profile set to private?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.user_settings WHERE private_profile = true;",
"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.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Provide a summary of transactions by transaction_type, showing the count and the total amount for each type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_type, COUNT(transaction_id) AS transaction_count, SUM(amount) AS total_amount FROM... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.hashtags (
hashtag_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Can you provide all pairs of hashtags created on the same date, including both hashtag_id values and their creation timestamps?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h1.hashtag_id AS hashtag1, h2.hashtag_id AS hashtag2, h1.created_at AS time... |
You are an expert in writing database language. You can write a corresponding 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 properties that are listed as type 'Hotel' and are located in 'Canada'. List the property name, city, and postal code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_name, city, postal_code FROM hospitality_technology.properties WHER... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, name character va... | [
{
"role": "user",
"content": "List all UTXO IDs, addresses, and amounts for unspent UTXOs with an amount between 200 and 800.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT utxo_id, address, amount FROM trading_platform.utxos WHERE spent = false AND amount BETWEEN 200 AND 800;",
... |
You are an expert in writing database language. You can write a corresponding 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": "For each customer, show their full name, email, and the total trade amount they have made, joining customers to trades via account_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name, c.last_name, c.email, SUM(t.total_amoun... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id text PRIMARY KEY, property_id text, ser... | [
{
"role": "user",
"content": "Which available services in the 'Wellness' category are offered by each property? Please show property_id, service_name, and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_id, service_name, price FROM hospitality_technology.services 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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "For Sui coins, can you show the coin_type and owner address for each coin where the balance is greater than 100000?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT coin_type, owner FROM sui_coins WHERE CAST(balance AS NUMERIC) > 100000;",
"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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "List all open cases with case_number, case_name, and the client's email and phone.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number,\n c.case_name,\n cl.email,\n cl.phone\nFROM legal_services.cases c\nJOIN legal_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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "How many tokens had a net positive flow according to smart_money_token_performance, and what is their average ROI?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS token_count, AVG(roi) AS avg_roi\nFROM smart_money_token_performance\nWHERE ... |
You are an expert in writing database language. You can write a corresponding 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": "I want a list of group conversations with at least one unread message, including the conversation_id, group_name, and the count of unread messages, joining messages and conversations tables.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversati... |
You are an expert in writing database language. You can write a corresponding 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 each citizen's first and last name along with the first and last name of another citizen who shares the same last name. Show each pair only once.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c1.first_name || ' ' || c1.last_name AS citizen_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 healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_i... | [
{
"role": "user",
"content": "I need to identify overlapping appointments for each doctor. Return doctor_id, the first appointment_id, the overlapping appointment_id, and the overlap start time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT A.doctor_id,\n A.appointment_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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "For all chains, which token held by centralized exchanges (CEX) has the highest ROI according to smart money token performance? Show token symbol, chain, exchange, total USD value held on CEX, and the smart money ROI.",
"sql": null
},
{
"role": "assistant",
"con... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Show all cases with at least one billed and billable time entry, including case number, case name, total billed amount, and billed hours.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cs.case_number, cs.case_name, SUM(te.hours_spent * te.billing_rat... |
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 number of passengers at station with ID 'ST123' right now?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the current number of passengers at a station. The data I have access to only include... |
You are an expert in writing database language. You can write a corresponding 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": "Provide the monthly reservation count and total revenue for reservations made through 'Online Travel Agency' in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', check_in_date) AS month,\n COUNT(*) AS reservation_count,\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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.genre, COUNT(gs.session_id) AS session_co... |
You are an expert in writing database language. You can write a corresponding 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 games that have servers deployed in more than one geographical region. Show the game title and the count of regions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, count(DISTINCT s.region) AS region_count FROM games AS g JOIN servers 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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me all users and the posts they have created, including the user's username and the post content.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, p.post_id, p.content\nFROM social_media.users u\nJOIN social_media.posts p ON 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 hospitality_technology.properties ( property_id.text, property_name.text, address_li... | [
{
"role": "user",
"content": "Show me all spa service orders (service_id LIKE 'SPA%') in the last month with their guest names and total prices, ordered by total price in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT so.order_id, g.first_name, g.last_name, so.t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "List all drivers hired after January 1, 2021, with their driver_id, full name, and hire_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name || ' ' || last_name AS full_name, hire_date FROM transportation.drivers WHERE hire_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 hospitality_technology.reviews ( review_id text, property_id text, reservation_id te... | [
{
"role": "user",
"content": "Give me a breakdown of the number of reviews per day for the last 14 days, including the review_date and review count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE(review_date) AS review_day, COUNT(*) AS review_count\nFROM hospitality_technolo... |
You are an expert in writing database language. You can write a corresponding 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": "For each loan, show the loan ID, principal amount, interest rate, and the balance and currency of the associated account.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.loan_id, l.principal_amount, l.interest_rate, a.balance, a.currency FROM financ... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Can you list all chronic diagnoses made in January 2024, showing diagnosis_id, diagnosis_code, and status, along with the doctor_id who made each diagnosis?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT diagnosis_id, diagnosis_code, status, doctor_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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "Find all prescriptions for patients who have at least one appointment scheduled in the future. Show the prescription ID, patient ID, medication name, and the earliest future appointment time for that patient.",
"sql": null
},
{
"role": "assistant",
"content": "S... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "Show me all agencies established after 2020 and their jurisdiction level.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agency_id, agency_name, jurisdiction_level, established_date\nFROM government_services.agencies\nWHERE established_date > '2020-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 gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "List all games and the servers hosting them, showing the game title, server name, region, and status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, s.server_name, s.region, s.status FROM gaming_technology.games g JOIN gaming_technology.serv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "Show the total number of notifications sent per service category for applications submitted in 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.category, COUNT(n.notification_id) AS notification_count FROM government_services.notifications n 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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a... | [
{
"role": "user",
"content": "For each user, list their order_id, order_type, and any log messages they have generated.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n o.user_id,\n o.order_id,\n o.order_type,\n l.action AS log_message\nFROM trading_platform.orders o\nJOIN tr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex... | [
{
"role": "user",
"content": "Show me all active policies with coverage limits above $1,000,000, along with the customer names and agent names, sorted by coverage limit in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.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.reviews ( review_id text, property_id text, reservation_id te... | [
{
"role": "user",
"content": "Show me the top 5 guests who have submitted the most reviews. Include guest_id and review_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY guest_id\nORDER BY revie... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Calculate the total fuel quantity and total cost consumed for each trip where passenger_count > 50. List trip_id, total_quantity, and total_cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.trip_id,\n SUM(f.quantity) AS total_quantity,\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.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "Find all medications where the generic name includes the text 'hydrochloride'. Display the medication name and generic name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_name, generic_name FROM healthcare.medications WHERE generic_name L... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Get the total number and total amount of invoices issued in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS invoice_count,\n SUM(total_amount) AS total_amount\nFROM legal_services.invoices\nWHERE issue_date BETWEEN '2023-01-01'... |
You are an expert in writing database language. You can write a corresponding 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.messages (
message_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List the last 20 messages that have a media_url, showing message_id, sender_user_id, media_type, and sent_at, ordered by sent_at descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT message_id,\n sender_user_id,\n media_type,\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.