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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,...
[ { "role": "user", "content": "List the first name, last name, and city for all customers who live in the state 'NY'.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, city FROM insurance.customers WHERE state = 'NY';", "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 character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "List all appointments with their subject and associated case number for appointments that have both a case_id and a non-null location.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id, a.subject, a.case_id, c.case_number\nFROM legal_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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character...
[ { "role": "user", "content": "I want to see pairs of fundraising rounds for projects that have at least two rounds. Please list project_name, earlier_round, earlier_investment, later_round, and later_investment.", "sql": null }, { "role": "assistant", "content": "SELECT\n earlier.project_na...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a...
[ { "role": "user", "content": "Find all failed transactions along with the token transfers involved in those transactions, showing the transaction details and token information.", "sql": null }, { "role": "assistant", "content": "SELECT t.transaction_id, t.from_address, t.to_address, t.status...
You are an expert in writing database language. You can write a corresponding 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": "For each application where the total payments exceed 100, show the application ID, the citizen's full name, the total payment amount, and the currency.", "sql": null }, { "role": "assistant", "content": "SELECT a.application_id,\n c.first_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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par...
[ { "role": "user", "content": "Show me all comments that have non-empty content, including their ID, post ID, user ID, and content.", "sql": null }, { "role": "assistant", "content": "SELECT comment_id, post_id, user_id, content FROM social_media.comments WHERE content IS NOT NULL AND 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 healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Which patients have both a primary and at least one secondary insurance policy and how many of each do they have?", "sql": null }, { "role": "assistant", "content": "SELECT\n p.patient_id,\n SUM(CASE WHEN p.is_primary THEN 1 ELSE 0 END) AS primary_count,\n SU...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id ...
[ { "role": "user", "content": "List all staff members along with their direct manager's first and last names.", "sql": null }, { "role": "assistant", "content": "SELECT s.staff_id,\n s.first_name AS staff_first_name,\n s.last_name AS staff_last_name,\n m.first_name AS manage...
You are an expert in writing database language. You can write a corresponding 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": "List the name, type, and city for all properties located in 'Canada'.", "sql": null }, { "role": "assistant", "content": "SELECT property_name, property_type, city FROM hospitality_technology.properties WHERE country_code = 'CAN';", "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.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,...
[ { "role": "user", "content": "Find all agents hired after '2021-01-01', including their first_name, last_name, hire_date, and their manager's full name.", "sql": null }, { "role": "assistant", "content": "SELECT a.agent_id,\n a.first_name,\n a.last_name,\n a.hire_date,\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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text...
[ { "role": "user", "content": "Show me the usernames of users who have bought or sold assets classified as 'token', along with the name and symbol of the asset they traded.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T3.name, T3.symbol FROM users AS T1 JOI...
You are an expert in writing database language. You can write a corresponding 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": "List the customer ID, first_name, last_name, city, and the number of active policies each customer has, but only include customers who live in 'CA' and have at least 2 active policies.", "sql": null }, { "role": "assistant", "content": "SELECT cu.customer_id, cu...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.te...
[ { "role": "user", "content": "Could you provide a count of services available within each department?", "sql": null }, { "role": "assistant", "content": "SELECT department, COUNT(*) FROM hospitality_technology.services GROUP BY department;", "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.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w...
[ { "role": "user", "content": "Retrieve each managing partner who oversees more than one firm, showing the managing_partner_id and the count of firms they manage.", "sql": null }, { "role": "assistant", "content": "SELECT managing_partner_id, COUNT(*) AS firm_count\nFROM legal_services.law_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.agencies ( agency_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "List the number of documents submitted by each citizen, showing their citizen ID and only include those citizens who have submitted more than 5 documents.", "sql": null }, { "role": "assistant", "content": "SELECT citizen_id, COUNT(*) AS document_count\nFROM gov...
You are an expert in writing database language. You can write a corresponding 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, -- unique id...
[ { "role": "user", "content": "Show me all failed transactions where the gas_used is greater than 100,000, including the transaction_id and timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, timestamp FROM web3.transactions WHERE status = 'failed' AND gas_us...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text...
[ { "role": "user", "content": "Show me each product_type along with the count of products for that type, but only include types where the average base_premium exceeds 500. Order the results by the product count in descending order.", "sql": null }, { "role": "assistant", "content": "SELECT pr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character vary...
[ { "role": "user", "content": "List all beneficiaries who hold more than 25% of a policy, showing their beneficiary ID, full name, and contact information.", "sql": null }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name, last_name, contact_info\nFROM insurance.policy_ben...
You are an expert in writing database language. You can write a corresponding 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.locations ( location_id.text, name.text, type.text, address_line1.tex...
[ { "role": "user", "content": "List booking ID, booking time, and the name of the origin location for all bookings made from 'Airport' locations.", "sql": null }, { "role": "assistant", "content": "SELECT b.booking_id, b.booking_time, ol.name AS origin_location_name FROM transportation.bookin...
You are an expert in writing database language. You can write a corresponding 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 the full name of patients who have prescriptions ending within the next 30 days, along with the medication ID and the prescription end date.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.medication_id, T2.end_dat...
You are an expert in writing database language. You can write a corresponding 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": "Show all contracts that share the same deployment date, along with their contract IDs and the corresponding deployment date.", "sql": null }, { "role": "assistant", "content": "SELECT a.contract_id AS contract_id_1, b.contract_id AS contract_id_2, a.deployed_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 financial_services.customers ( customer_id character varying(64) NOT NULL, first_nam...
[ { "role": "user", "content": "Summarize the total principal amount for loans, grouped by customer and their account type. Include the customer's full name.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.account_type, SUM(T3.principal_amount) FROM f...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam...
[ { "role": "user", "content": "For each fueling event, show the fuel_log_id, vehicle_id, the full name of the assigned driver for the trip during that fueling event, and the log_timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT fl.fuel_log_id, fl.vehicle_id, d.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 financial_services.transactions ( transaction_id text PRIMARY KEY, account_id text, ...
[ { "role": "user", "content": "I want to find pairs of transactions where one transaction’s related_account_id matches the other’s account_id, indicating reciprocal transfers between accounts.", "sql": null }, { "role": "assistant", "content": "SELECT t1.transaction_id AS outgoing_txn, t2.tra...
You are an expert in writing database language. You can write a corresponding 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": "For each policy, find its immediate predecessor policy for the same customer. Return customer_id, predecessor policy_number, current policy_number, predecessor end_date, and current start_date.", "sql": null }, { "role": "assistant", "content": "WITH ranked 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number...
[ { "role": "user", "content": "Find all pairs of lawyers who were hired on the exact same date but have different specializations. Return each lawyer's name, hire_date, and both specializations.", "sql": null }, { "role": "assistant", "content": "SELECT a.lawyer_id AS lawyer1_id,\n 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.law_firms ( firm_id text, firm_name text, address text, phone text, w...
[ { "role": "user", "content": "I want each law firm's name, the total number of cases they have, and the total amount invoiced for those cases.", "sql": null }, { "role": "assistant", "content": "SELECT f.firm_name,\n COUNT(c.case_id) AS case_count,\n COALESCE(SUM(i.total_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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "For each booking, list the booking_id, trip_id, origin city, destination city, and fare.", "sql": null }, { "role": "assistant", "content": "SELECT b.booking_id, b.trip_id, lo.city AS origin_city, ld.city AS destination_city, b.fare\nFROM transportation.bookings...
You are an expert in writing database language. You can write a corresponding 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 appointment IDs, patient first and last names, and their chief complaint for appointments that have an associated medical record.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id, p.first_name, p.last_name, mr.chief_complaint\nFRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w...
[ { "role": "user", "content": "List all law firms whose address contains 'Avenue'.", "sql": null }, { "role": "assistant", "content": "SELECT firm_id, firm_name, address FROM legal_services.law_firms WHERE address LIKE '%Avenue%';", "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.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "Show me all public reviews with an overall rating of at least 4.", "sql": null }, { "role": "assistant", "content": "SELECT review_id,\n property_id,\n guest_id,\n rating_overall,\n comment,\n review_date\nFROM hospitality_technolog...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "Retrieve each employee's first and last name along with the count of applications they've been assigned that are currently in the 'Under Review' status.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name,\n e.last_name,\n 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 healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, ...
[ { "role": "user", "content": "I want to list pairs of insurance plans from the same provider, showing both plan IDs and names alongside the provider.", "sql": null }, { "role": "assistant", "content": "SELECT p1.plan_id, p1.plan_name, p2.plan_id AS plan_id_2, p2.plan_name AS plan_name_2, p1....
You are an expert in writing database language. You can write a corresponding 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, -- unique id...
[ { "role": "user", "content": "List the name of each law firm along with the first and last name of its managing partner.", "sql": null }, { "role": "assistant", "content": "SELECT T1.firm_name, T2.first_name, T2.last_name FROM law_firms AS T1 JOIN lawyers AS T2 ON T1.managing_partner_id = T2...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "List all claim documents for claims handled by the claim handler with ID 'HANDLER_007'. Show document ID, file name, upload time, and claim ID.", "sql": null }, { "role": "assistant", "content": "SELECT cd.document_id, cd.file_name, cd.uploaded_at, cd.claim_id F...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, route_id character va...
[ { "role": "user", "content": "What is the count of trips for each status?", "sql": null }, { "role": "assistant", "content": "SELECT\n status,\n COUNT(*) AS trip_count\nFROM transportation.trips\nGROUP BY\n status;", "sql": null }, { "role": "user", "content": "Only includ...
You are an expert in writing database language. You can write a corresponding 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 a contact email ending with '@yahoo.com' and have received at least one notification? Show their first name, last name, and email.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name, c.last_name, c.contact_email\...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_i...
[ { "role": "user", "content": "How many reservations does each property have?", "sql": null }, { "role": "assistant", "content": "SELECT property_id,\n COUNT(*) AS reservation_count\nFROM hospitality_technology.reservations\nGROUP BY property_id;", "sql": null }, { "role": "...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id.text, customer_id.text, account_number.text...
[ { "role": "user", "content": "Show me the total principal_amount of all loans for each loan_type.", "sql": null }, { "role": "assistant", "content": "SELECT loan_type, SUM(principal_amount) AS total_principal\nFROM financial_services.loans\nGROUP BY loan_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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "Show me all pairs of active policies for the same customer where their coverage periods overlap. Return customer_id, policy1_id, policy2_id, overlap_start, overlap_end.", "sql": null }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_...
You are an expert in writing database language. You can write a corresponding 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_uuid()...
[ { "role": "user", "content": "Can you provide the total number of sessions and the average session duration in seconds for each game_id and server_id pair?", "sql": null }, { "role": "assistant", "content": "SELECT game_id, server_id, COUNT(*) AS total_sessions, AVG(duration_seconds) AS avg_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id ch...
[ { "role": "user", "content": "Show me the record_id, patient_id, prescription_id, medication_id, start_date, and the systolic blood pressure from the associated medical record for all prescriptions.", "sql": null }, { "role": "assistant", "content": "SELECT p.prescription_id,\n p.medic...
You are an expert in writing database language. You can write a corresponding 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 each player and the total number of game sessions they have participated in.", "sql": null }, { "role": "assistant", "content": "SELECT T1.player_id, T1.username, count(T2.session_id) FROM gaming_technology.players AS T1 LEFT JOIN gaming_technology.game_ses...
You are an expert in writing database language. You can write a corresponding 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, -- unique identifi...
[ { "role": "user", "content": "List all users and the total value of all transactions they have initiated. Show user_id, username, and total_transaction_value.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COALESCE(SUM(t.value), 0) AS total_transaction_valu...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL,...
[ { "role": "user", "content": "Show all reviews made by guests along with the guest_id, guest's reservation_id, and the related property's property_id and review_date.", "sql": null }, { "role": "assistant", "content": "SELECT r.review_id, r.guest_id, r.reservation_id, r.property_id, r.review...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "List each chronic active diagnosis along with the prescribed medication details, showing diagnosis_id, diagnosis_code, medication_id, dosage, and diagnosis_date.", "sql": null }, { "role": "assistant", "content": "SELECT d.diagnosis_id, d.diagnosis_code, p.medic...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id ...
[ { "role": "user", "content": "List appointments with a duration longer than 45 minutes where the 'reason' includes the word 'follow-up'. Show the appointment ID, patient ID, duration, and reason.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, duration_...
You are an expert in writing database language. You can write a corresponding 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.trades ( trade_id character varying(64) NOT NULL, account_id char...
[ { "role": "user", "content": "Find pairs of BUY and SELL trades from the trades table for the same account that occurred on the same settlement_date and had matching quantities.", "sql": null }, { "role": "assistant", "content": "SELECT\n a.trade_id AS buy_trade_id,\n b.trade_id AS sell_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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "Show me a list of patients along with their latest prescription's medication name, prescription date, and the prescribing doctor's ID.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pr.medication_id, m.medicat...
You are an expert in writing database language. You can write a corresponding 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": "How many guests are there in each city? Show the city and the guest count.", "sql": null }, { "role": "assistant", "content": "SELECT city, COUNT(guest_id) FROM hospitality_technology.guests GROUP BY city;", "sql": null }, { "role": "user", "cont...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "Show me all notifications that are related to posts created by users who have a verified profile. Include the notification type, the recipient username, and the post ID.", "sql": null }, { "role": "assistant", "content": "SELECT\n n.notification_type,\n u_reci...
You are an expert in writing database language. You can write a corresponding 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": "For each player, count how many unique games they have played.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, COUNT(DISTINCT game_id) AS unique_games_played FROM gaming_technology.game_sessions GROUP 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 web3.users ( user_id character varying(64) NOT NULL, username character varying(128)...
[ { "role": "user", "content": "How many users registered in each month?", "sql": null }, { "role": "assistant", "content": "SELECT date_trunc('month', created_at) AS month,\n COUNT(*) AS registrations\nFROM web3.users\nGROUP BY month\nORDER BY month;", "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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ...
[ { "role": "user", "content": "How many distinct token symbols are recorded for each chain in the smart money performance data?", "sql": null }, { "role": "assistant", "content": "SELECT chain, COUNT(DISTINCT token_symbol) FROM smart_money_token_performance GROUP BY chain", "sql": null ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reviews ( review_id text PRIMARY KEY, property_id text, reser...
[ { "role": "user", "content": "Find all review comments that have a staff response, showing the comment and the staff response date.", "sql": null }, { "role": "assistant", "content": "SELECT comment, response_date FROM reviews WHERE response_date 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 token_dexpool_info (", "pair_address character varying(512) NOT NULL, -- the ...
[ { "role": "user", "content": "List the top 5 tokens by liquidity on the Ethereum chain. Show token_symbol, liquidity, and price.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, liquidity, price\nFROM token_dexpool_info\nWHERE chain = 'Ethereum'\nORDER BY liquidity DE...
You are an expert in writing database language. You can write a corresponding 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 text, from_address text, to_address text, value n...
[ { "role": "user", "content": "List all pairs of transactions within the same block where the from_address of one transaction is the to_address of another transaction. Show both transaction_ids, the block_number, from_address, and to_address.", "sql": null }, { "role": "assistant", "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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "List the five most recent claims with their claim_id, incident_date, customer's full name, and estimated_loss, sorted by reported_date descending.", "sql": null }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date,\n cu.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 hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "Show me the full name of guests who have left reviews along with the overall rating they gave.", "sql": null }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, r.rating_overall FROM hospitality_technology.reviews r JOIN hospitality_technolog...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, first_name ...
[ { "role": "user", "content": "List the full name of all guests who have submitted a review.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM hospitality_technology.guests AS T1 JOIN hospitality_technology.reviews AS T2 ON T1.guest_id = T2.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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "List the contract ID, address, and deployer address for all contracts deployed on the 'mainnet' network.", "sql": null }, { "role": "assistant", "content": "SELECT contract_id, address, deployer_address FROM web3.contracts WHERE network_id = 'mainnet';", "sq...
You are an expert in writing database language. You can write a corresponding 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, token_name charac...
[ { "role": "user", "content": "What is the average market cap and average 24-hour trading volume for tokens on each chain?", "sql": null }, { "role": "assistant", "content": "SELECT chain, AVG(market_cap) AS average_market_cap, AVG(volume_24h) AS average_volume_24h FROM token_dexpool_info GRO...
You are an expert in writing database language. You can write a corresponding 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": "For each service category, count the number of appointments scheduled in the next 7 days. Return the category and appointment count.", "sql": null }, { "role": "assistant", "content": "SELECT s.category, COUNT(a.appointment_id) AS upcoming_appointments\nFROM gov...
You are an expert in writing database language. You can write a corresponding 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": "For each achievement, list how many unique players have unlocked it.", "sql": null }, { "role": "assistant", "content": "SELECT achievement_id, COUNT(DISTINCT player_id) AS unique_players FROM gaming_technology.player_achievements GROUP BY achievement_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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ...
[ { "role": "user", "content": "Which token on each chain has the highest ROI and what is its associated PNL and net_flow?", "sql": null }, { "role": "assistant", "content": "SELECT a.chain,\n a.token_symbol,\n a.roi,\n a.pnl,\n a.net_flow\nFROM smart_money_token_perfor...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "List all unspent UTXOs with an amount greater than 10.", "sql": null }, { "role": "assistant", "content": "SELECT utxo_id, transaction_id, address, amount FROM utxos WHERE spent = FALSE AND amount > 10;", "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.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te...
[ { "role": "user", "content": "List all beneficiaries who have a relationship of 'Parent' and a percentage_share less than 25%. Show their beneficiary_id, first_name, last_name, relationship, and percentage_share.", "sql": null }, { "role": "assistant", "content": "SELECT beneficiary_id, firs...
You are an expert in writing database language. You can write a corresponding 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 projects that raised funds in 2022 and have a corresponding token held by CEXes on the 'Ethereum' chain. Display the project name, fundraising round name, investment value, the associated token symbol, and the total USD value of that token held by CEXes on Ethereum.", ...
You are an expert in writing database language. You can write a corresponding 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": "Identify agents who have sold overlapping policies. Return agent_id, policy_number1, policy_number2, and their coverage dates.", "sql": null }, { "role": "assistant", "content": "SELECT p1.agent_id,\n p1.policy_number AS policy_number1,\n p2.policy_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.agencies ( agency_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Which agencies have at least one service location in a city named 'Austin', and what are their agency names and main phone numbers?", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT a.agency_id, a.agency_name, a.main_phone_number\nFROM governme...
You are an expert in writing database language. You can write a corresponding 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.room_types ( room_type_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "Show each staff member's first name, last name, and the average base rate of room types available at the property where they work.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.avg_base_rate FROM hospitality_technolog...
You are an expert in writing database language. You can write a corresponding 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 each wallet with its wallet_id, user_id, and the total amount of unspent UTXOs associated with that wallet.", "sql": null }, { "role": "assistant", "content": "SELECT\n w.wallet_id,\n w.user_id,\n COALESCE(SUM(u.amount), 0) AS unspent_total\nFROM trading...
You are an expert in writing database language. You can write a corresponding 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": "Find all beneficiaries added in the last 7 days, include beneficiary_id, policy_id, and percentage_share, sorted by percentage_share descending.", "sql": null }, { "role": "assistant", "content": "SELECT beneficiary_id, policy_id, percentage_share\nFROM insuranc...
You are an expert in writing database language. You can write a corresponding 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 list each player and the title of the games for which they have acquired items?", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT pi.player_id, g.title FROM gaming_technology.player_inventory pi JOIN gaming_technology.games g ON pi.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 healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id ch...
[ { "role": "user", "content": "Show me all medical records created in the last 6 months.", "sql": null }, { "role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE record_date >= CURRENT_DATE - INTERVAL '6 months';", "sql": null }, { "role": "user", "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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "List all medications whose manufacturer field is not null.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name, generic_name, manufacturer, ndc_code, description\nFROM healthcare.medications\nWHERE manufacturer IS NOT 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.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "List the policy number, premium amount, and the product name for each policy, but only for policies where the associated insurance product is active and has a base premium greater than 1200.", "sql": null }, { "role": "assistant", "content": "SELECT p.policy_num...
You are an expert in writing database language. You can write a corresponding 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 the contract ID, address, and deployer address for all contracts that have not emitted any events.", "sql": null }, { "role": "assistant", "content": "SELECT c.contract_id, c.address, c.deployer_address FROM web3.contracts AS c LEFT JOIN web3.events AS e ON...
You are an expert in writing database language. You can write a corresponding 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": "Show me all pairs of routes where both routes have the same origin_location_id but different destination_location_id values. For each pair, display the first route's route_number, the second route's route_number, and their origin_location_id.", "sql": null }, { "rol...
You are an expert in writing database language. You can write a corresponding 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": "Show the top 10 most expensive fuel log entries including fuel_log_id, vehicle make and model, location name and city, and total_cost.", "sql": null }, { "role": "assistant", "content": "SELECT f.fuel_log_id,\n v.make,\n v.model,\n loc.name 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.text, token_symbol.text, pnl.numeric, ...
[ { "role": "user", "content": "List all token symbols on the 'Ethereum' chain with a Realized Ratio greater than 0.9. Show the symbol and realized ratio.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, realized_ratio FROM smart_money_token_performance WHERE chain = 'E...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case...
[ { "role": "user", "content": "Show me all invoices for case_id 'case_777', including the invoice number, total amount, and status.", "sql": null }, { "role": "assistant", "content": "SELECT invoice_number, total_amount, status FROM legal_services.invoices WHERE case_id = 'case_777';", "s...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "Show for each game_id the total hidden achievements as hidden_count and total visible achievements as visible_count.", "sql": null }, { "role": "assistant", "content": "SELECT achievement.game_id,\n SUM(CASE WHEN achievement.hidden THEN 1 ELSE 0 END) 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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash...
[ { "role": "user", "content": "List each game's title along with the name of the developer and the total number of servers currently hosting that game.", "sql": null }, { "role": "assistant", "content": "SELECT g.title, g.developer_id, COUNT(s.server_id) AS total_servers\nFROM gaming_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "Show the average maintenance cost for each service type per vehicle.", "sql": null }, { "role": "assistant", "content": "SELECT vehicle_id,\n service_type,\n AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nGROUP BY vehicle_id, service_ty...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h...
[ { "role": "user", "content": "Show me the usernames and full names of all users who have updated their profile after April 1, 2024, and have specified a location.", "sql": null }, { "role": "assistant", "content": "SELECT username, full_name FROM social_media.users WHERE updated_at > '2024-0...
You are an expert in writing database language. You can write a corresponding 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": "Find all pairs of developers in the same country but founded in different years. Show each developer's name, their founded_year, and the shared country.", "sql": null }, { "role": "assistant", "content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri...
[ { "role": "user", "content": "Show narratives with a 24-hour trading volume greater than $10,000,000 and a positive 24-hour price change percentage. List the narrative name, volume_24h, and price_change_percentage_24h.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, vol...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Show me a list of all users who have participated in any trade (either as a buyer or a seller), including their username and the total number of trades they were involved in.", "sql": null }, { "role": "assistant", "content": "SELECT T1.username , count(T2.trade...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_i...
[ { "role": "user", "content": "List properties where actual check-in occurred later than the scheduled check-in date. Show the property ID and the count of such reservations.", "sql": null }, { "role": "assistant", "content": "SELECT property_id, COUNT(*) FROM reservations WHERE actual_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 character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "Show me a list of all patients and the doctors who have made diagnoses for them. For each, include patient ID, patient full name, doctor ID, and doctor full name.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name AS patient_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 hospitality_technology.properties ( property_id text, property_name text, address_li...
[ { "role": "user", "content": "Show the number of reservations and the sum total_amount for each property.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, COUNT(r.reservation_id) AS reservation_count, SUM(r.total_amount) AS total_revenue \nFROM hospi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str...
[ { "role": "user", "content": "Can you help me retrieve the details of all aircraft builds for a specific aircraft model, including the build start date, estimated completion date, and the assembly line they are built on?", "sql": null }, { "role": "assistant", "content": "MATCH (ab:AircraftB...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id charact...
[ { "role": "user", "content": "Count the number of metadata entries for each asset.", "sql": null }, { "role": "assistant", "content": "SELECT asset_id, COUNT(*) AS metadata_count\nFROM trading_platform.metadata\nGROUP BY asset_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 erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, am...
[ { "role": "user", "content": "List each Avalanche token tick with its creator from token_info and the total transfer volume over the past 7 days.", "sql": null }, { "role": "assistant", "content": "SELECT ta.tick,\n ti.creator,\n SUM(ta.amt) AS total_volume\nFROM token_activities...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco...
[ { "role": "user", "content": "List projects that have raised funds and also have an associated token, showing their name, fundraising amount, and current token price.", "sql": null }, { "role": "assistant", "content": "SELECT T1.project_name, T1.investment_value, T2.price FROM project_fundra...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id.text, user_id.text, message.text, s...
[ { "role": "user", "content": "For each user, show their username and the timestamp of their most recent notification. Include users who have never received notifications.", "sql": null }, { "role": "assistant", "content": "SELECT T1.username, max(T2.sent_at) FROM users AS T1 LEFT JOIN tradin...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var...
[ { "role": "user", "content": "List the agent ID, first name, last name, hire date, and commission rate for all agents hired in the year 2023 with a commission rate less than 0.06.", "sql": null }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, hire_date, commissio...
You are an expert in writing database language. You can write a corresponding 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 all prescriptions made in 2024 for medications prescribed during appointments scheduled at location 'LOC001', including prescription_id, patient_id, medication_id, and appointment_time.", "sql": null }, { "role": "assistant", "content": "SELECT pr.prescript...
You are an expert in writing database language. You can write a corresponding 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 each room's number and the total amount of payments processed for that room.", "sql": null }, { "role": "assistant", "content": "SELECT r.room_number, SUM(p.amount) AS total_payments\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.payme...