system stringlengths 315 17.3k | 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 cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"content": "For each exchange, compute the percentage change in total USD value of its holdings between snapshots '2023-01-01 00:00:00' and '2023-02-01 00:00:00'. Show exchange, chain, value_jan, value_feb, and pct_change.",
"role": "user",
"sql": null
},
{
"content": "SELECT t1.exchange,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"content": "For each agent, show their agent_id, first and last name, and the total estimated loss for all claims they have handled as a claim handler.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.agent_id, a.first_name, a.last_name, SUM(c.estimated_loss) AS total_estimated_loss\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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"content": "List the contact phone and website for all insurance plans provided by 'Continental Health'.",
"role": "user",
"sql": null
},
{
"content": "SELECT plan_name, contact_phone, website\nFROM healthcare.insurance_plans\nWHERE insurance_provider = 'Continental Health';",
"role": "ass... |
You are an expert in writing database language. You can write a corresponding 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.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time... | [
{
"content": "Calculate the monthly total quantity of fuel consumed and the average cost_per_unit for each fuel_type in 2023.",
"role": "user",
"sql": null
},
{
"content": "SELECT date_trunc('month', log_timestamp) AS month,\n fuel_type,\n SUM(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 hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"content": "For each property in the 'USA' country, list the property name and the total count of services that cost more than 50.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.property_name, COUNT(T2.service_id) FROM hospitality_technology.properties AS T1 JOIN 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 hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text,... | [
{
"content": "Show me all room types with 'King' in the bed_type field, along with their property IDs and base rates.",
"role": "user",
"sql": null
},
{
"content": "SELECT room_type_id, property_id, type_name, bed_type, base_rate FROM hospitality_technology.room_types WHERE bed_type LIKE '%King%... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, claim_id text, document_ty... | [
{
"content": "List pairs of documents uploaded by the same user for the same claim. Return uploaded_by, claim_id, document_id AS doc1_id, and the paired document_id AS doc2_id.",
"role": "user",
"sql": null
},
{
"content": "SELECT cd1.uploaded_by,\n cd1.claim_id,\n cd1.document_id AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"content": "List all services, showing the service name, category, and the name of the property where it is offered.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.service_name, T1.category, T2.property_name FROM hospitality_technology.services AS T1 JOIN hospitality_technology.prope... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"content": "Show me all staff members along with their positions and the names of the properties they work at.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name\nFROM hospitality_technology.staff s\nJOIN hospitality_technol... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.kyc_audit ( kyc_audit_id.text, user_id.text, status.text, reviewed_... | [
{
"content": "Show me all users who had their KYC rejected along with when their review was completed.",
"role": "user",
"sql": null
},
{
"content": "SELECT user_id, reviewed_at FROM trading_platform.kyc_audit WHERE status = 'rejected';",
"role": "assistant",
"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, ... | [
{
"content": "List all reservations made by guests from the 'CAN' country code. Include the reservation ID, guest's first name, last name, and the guest's country code.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.reservation_id, T2.first_name, T2.last_name, T2.country_code FROM hosp... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"content": "Show the total amount of payments processed by each payment_method.",
"role": "user",
"sql": null
},
{
"content": "SELECT payment_method,\n SUM(amount) AS total_amount\nFROM hospitality_technology.payments\nGROUP BY payment_method;",
"role": "assistant",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers (
developer_id uuid NOT NULL DEFAULT gen_random_uui... | [
{
"content": "Show for each developer and inventory item combination the number of times that item appears in player inventories.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.developer_id, d.name AS developer_name, pi.item_id, COUNT(pi.inventory_id) AS inventory_count FROM gaming_tech... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"content": "List the names of active services and their categories provided by agencies with a 'Federal' jurisdiction level.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.service_name, T1.category FROM government_services.services AS T1 JOIN government_services.agencies AS T2 ON T1.... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List all drivers.",
"role": "user",
"sql": null
},
{
"content": "SELECT driver_id, first_name, last_name FROM transportation.drivers;",
"role": "assistant",
"sql": null
},
{
"content": "Can you also include their hire date and status?",
"role": "user",
"sql"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"content": "List the names of all insurance providers who offer at least one plan of type 'EPO'.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT insurance_provider\nFROM healthcare.insurance_plans\nWHERE plan_type = 'EPO';",
"role": "assistant",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"content": "List all appointments and all diagnoses made by the *same doctor*. Show the appointment ID, doctor ID, appointment time, and diagnosis ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.appointment_id, a.doctor_id, a.appointment_time, d.diagnosis_id FROM healthcare.appoint... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show all cases with at least one billed and billable time entry, including case number, case name, total billed amount, and billed hours.",
"role": "user",
"sql": null
},
{
"content": "SELECT cs.case_number, cs.case_name, SUM(te.hours_spent * te.billing_rate) AS total_billed_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 insurance.insurance_products ( product_id character varying(64) NOT NULL, product_na... | [
{
"content": "Show product_id, product_name, and base_premium for the five most recently created active insurance products.",
"role": "user",
"sql": null
},
{
"content": "SELECT product_id, product_name, base_premium\nFROM insurance.insurance_products\nWHERE is_active = true\nORDER BY 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 project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... | [
{
"content": "Find tokens that had a net positive USD value from smart money buy transactions (type=1) in smart_money_token_inflow and also have a 24-hour trading volume above $1,000,000 from token_dexpool_info. Show the token symbol, chain, smart money total buy value, and DEX 24h volume.",
"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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"content": "List the full names and dates of birth for all patients who do not have a phone number on record.",
"role": "user",
"sql": null
},
{
"content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE phone_number IS NULL OR TRIM(phone_number) = '';",
"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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"content": "Which hashtags appear on the most posts? Return hashtag_id, tag_name, and the number of posts each hashtag is used in, sorted descending, limited to the top 3.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n h.hashtag_id,\n h.tag_name,\n COUNT(ph.post_id) AS post_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
Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c... | [
{
"content": "I need to get the inventory quantity and location for a specific batch number. Can you help with that?",
"role": "user",
"sql": null
},
{
"content": "HGETALL inv:<inventory_record_id>",
"role": "assistant",
"sql": null
},
{
"content": "Can you also show me the compo... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show each property's name, the number of available rooms, and the number of available services it currently offers.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.property_name,\n COUNT(DISTINCT r.room_id) AS available_rooms,\n COUNT(DISTINCT s.service_id) 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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"content": "Show me the top 5 hashtags by number of distinct public posts they're used in. Return tag_name and post_count.",
"role": "user",
"sql": null
},
{
"content": "SELECT h.tag_name,\n COUNT(DISTINCT ph.post_id) AS post_count\nFROM social_media.hashtags AS h\nJOIN social_media.post... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Find pairs of distinct locations in the same city that have different types. Include location IDs, names, city, and type for both locations.",
"role": "user",
"sql": null
},
{
"content": "SELECT l1.location_id AS location1_id, l1.name AS location1_name, l1.city, l1.type AS location... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List all rooms that have not been cleaned in the last 7 days, showing their room number, property ID, and last cleaned date.",
"role": "user",
"sql": null
},
{
"content": "SELECT room_number, property_id, last_cleaned_at FROM hospitality_technology.rooms WHERE last_cleaned_at < NOW... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.securities (
security_id character varying(64) NOT NULL, -- u... | [
{
"content": "Show the number of securities per exchange and the average length of their ticker symbols, including only exchanges that have more than 5 securities.",
"role": "user",
"sql": null
},
{
"content": "SELECT exchange, COUNT(*) AS securities_count, AVG(LENGTH(ticker_symbol)) AS avg_tick... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.payments (
payment_id character varying(64) NOT NULL, --... | [
{
"content": "Identify duplicate transaction_ref values and list each reference with the pair of payment_ids that share it.",
"role": "user",
"sql": null
},
{
"content": "SELECT p1.transaction_ref, p1.payment_id AS payment_id_1, p2.payment_id AS payment_id_2\nFROM hospitality_technology.payments... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List usernames of users who participate in any group chat and also have a private profile. Include the name of the group chat.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT\n U.username,\n C.group_name\nFROM\n social_media.users AS U\nJOIN\n social_medi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i... | [
{
"content": "What is the total amount paid by each customer? Show the customer_id and the sum of amount_paid.",
"role": "user",
"sql": null
},
{
"content": "SELECT customer_id, SUM(amount_paid) FROM insurance.premium_payments GROUP BY customer_id;",
"role": "assistant",
"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... | [
{
"content": "For each relationship type among policy beneficiaries, show the average percentage_share and the count of unique beneficiaries. Please order the results with the highest average percentage_share first.",
"role": "user",
"sql": null
},
{
"content": "SELECT relationship, AVG(percenta... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"content": "List the names of properties and the room number for every room at each property.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.property_name , T2.room_number FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.rooms AS T2 ON T1.property_id = T2.p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"content": "How many projects raised funds in 2023?",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) AS project_count\nFROM project_fundraising_record\nWHERE investment_date LIKE '2023-%';",
"role": "assistant",
"sql": null
},
{
"content": "Also provide the averag... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me all lawyers' full names, their bar number, and if they are partners, the full name of another partner from their firm.",
"role": "user",
"sql": null
},
{
"content": "SELECT l1.first_name || ' ' || l1.last_name AS lawyer_full_name, l1.bar_number,\n CASE WHEN l1.is_part... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty... | [
{
"content": "특정 국가의 모든 공급업체 정보를 조회하고 싶습니다. 국가 이름, 공급업체 이름, 주소, 품질 등급을 포함해 주세요.",
"role": "user",
"sql": null
},
{
"content": "GET suppliers/_search\n{\n \"query\": {\n \"term\": {\n \"country\": \"Korea\"\n }\n },\n \"_source\": [\"supplier_name\", \"address\", \"country\", \"qual... |
You are an expert in writing database language. You can write a corresponding 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.text, tag_name.text, created_at.timestamp )
| [
{
"content": "List all pairs of hashtags created within the same hour, including both hashtag IDs and their creation timestamps.",
"role": "user",
"sql": null
},
{
"content": "SELECT h1.hashtag_id AS hashtag1_id, h1.created_at AS created1, h2.hashtag_id AS hashtag2_id, h2.created_at AS created2 ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.kyc_audit (
kyc_audit_id character varying(64) NOT NULL, -- un... | [
{
"content": "Show me the top 5 users with the most KYC audits, along with their latest audit status.",
"role": "user",
"sql": null
},
{
"content": "SELECT user_id, status, COUNT(*) as audit_count FROM trading_platform.kyc_audit GROUP BY user_id, status ORDER BY audit_count DESC LIMIT 5;",
"... |
You are an expert in writing database language. You can write a corresponding 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, patient_id.text, doctor_id.text, appo... | [
{
"content": "For each location, what is the average appointment duration? Show location_id and the average duration.",
"role": "user",
"sql": null
},
{
"content": "SELECT location_id, AVG(duration_minutes) FROM healthcare.appointments GROUP BY location_id;",
"role": "assistant",
"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 cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"content": "For the latest snapshot time, list the total `usd_value` held by CEXes for each distinct `token_symbol` across all chains. Order the results by total value descending.",
"role": "user",
"sql": null
},
{
"content": "WITH latest_snapshot AS (\n SELECT max(snapshot_time) as max_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.rooms ( room_id text, property_id text, room_number text, roo... | [
{
"content": "List the names and prices of all services ordered by guests from 'Texas', along with the guest's full name.",
"role": "user",
"sql": null
},
{
"content": "SELECT g.first_name, g.last_name, s.service_name, s.price\nFROM hospitality_technology.guests g\nJOIN hospitality_technology.re... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List customers who have active 'Auto' policies, showing their first name, last name, the policy number, and the product name.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.first_name, T1.last_name, T2.policy_number, T3.product_name FROM insurance.customers AS T1 JOIN ins... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "How many total records are there in the `erc20_approval` table?",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM erc20_approval",
"role": "assistant",
"sql": null
},
{
"content": "And how many records are in the `erc1155_approval_for_all` table?",... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c... | [
{
"content": "I need to get the inventory quantity and location for a specific batch number. Can you help with that?",
"role": "user",
"sql": null
},
{
"content": "HGETALL inv:<inventory_record_id>",
"role": "assistant",
"sql": null
},
{
"content": "Can you also show me the compo... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, product_name text, produ... | [
{
"content": "Give me the product name and description of all insurance products that have been updated in the last 30 days.",
"role": "user",
"sql": null
},
{
"content": "SELECT product_name, description FROM insurance.insurance_products WHERE updated_at >= NOW() - INTERVAL '30 days';",
"ro... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir... | [
{
"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.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.policy_number,\n c.first_name || ' ' || c.last_name AS customer_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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"content": "Please provide a list of all driver and passenger pairs who were hired and registered on the same date. Show the driver's full name, the passenger's full name, and the shared date.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.first_name AS driver_first_name, d.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 legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "Show me the total hours spent by each lawyer on billable time entries in 2024.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n lawyer_id,\n SUM(hours_spent) AS total_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\n AND EXTRACT(YEAR FROM date_worked) = ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_... | [
{
"content": "List for each game the server with the highest current player count and also show how many sessions that server has hosted. Include game_id, server_name, current_players, and session_count.",
"role": "user",
"sql": null
},
{
"content": "WITH session_counts AS ( SELECT s.server_id, ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.te... | [
{
"content": "List public reviews whose comment contains the word 'slow'.",
"role": "user",
"sql": null
},
{
"content": "SELECT review_id, comment, review_date, rating_overall, property_id FROM hospitality_technology.reviews WHERE is_public = TRUE AND LOWER(comment) LIKE '%slow%';",
"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 erc20_balances_historical (
block_number bigint NOT NULL, -- Block number contai... | [
{
"content": "Show me the total historical ERC20 balances for wallet '0xAAA...' and include each token's symbol and latest price.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n h.contract_address,\n SUM(CAST(h.amount AS numeric)) AS total_balance,\n p.symbol,\n p.price\nFROM erc20_b... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"content": "Find all pairs of routes where one starts where the other ends and vice versa. List their route numbers, origin and destination IDs for each.",
"role": "user",
"sql": null
},
{
"content": "SELECT r1.route_number AS route_number_1, r1.origin_location_id AS origin_1, r1.destination_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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"content": "List all insurance plan names and their associated insurance provider.",
"role": "user",
"sql": null
},
{
"content": "SELECT plan_name, insurance_provider FROM healthcare.insurance_plans;",
"role": "assistant",
"sql": null
},
{
"content": "Only show plans where the ... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Give me each server's name, the region, and the maximum number of players that have been connected at once.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.server_id, s.server_name, s.region, MAX(s.current_players) AS max_players_seen\nFROM gaming_technology.servers s\nGROU... |
You are an expert in writing database language. You can write a corresponding 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.... | [
{
"content": "Show the number of inactive services offered by agencies in each jurisdiction level.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.jurisdiction_level, COUNT(s.service_id) FROM government_services.agencies a JOIN government_services.services s ON a.agency_id = s.agency_id ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id ... | [
{
"content": "Show all maintenance logs where the 'next_service_due_date' is before the current date, including the log ID, service date, service type, and the overdue next service date.",
"role": "user",
"sql": null
},
{
"content": "SELECT log_id, service_date, service_type, next_service_due_da... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me the top 3 narratives by total USD value of token inflows where smart money was buying (type = 1).",
"role": "user",
"sql": null
},
{
"content": "SELECT narrative, SUM(usd_value) as total_usd_value\nFROM smart_money_token_inflow\nWHERE type = 1\nGROUP BY narrative\nORDER 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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"content": "List each player's ID, username, and the count of items of type 'Consumable' in their inventory. Only include players who have any consumable items.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.player_id, p.username, COUNT(pi.item_id) AS consumable_count\nFROM gaming_tec... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me invoices with a null `payment_date`. Include invoice number, total amount, and due date.",
"role": "user",
"sql": null
},
{
"content": "SELECT invoice_number, total_amount, due_date FROM invoices WHERE payment_date IS NULL;",
"role": "assistant",
"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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"content": "Show me the total transfer volume and number of transfers for each Avalanche token in the past 7 days.",
"role": "user",
"sql": null
},
{
"content": "SELECT tick,\n SUM(amt) AS total_volume,\n COUNT(*) AS transfer_count\nFROM token_activities_avalanche\nWHERE block_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 insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agenc... | [
{
"content": "List all agents and their managers' full names.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.first_name, a.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name FROM insurance.agents a LEFT JOIN insurance.agents m ON a.manager_id = m.agent_id;",... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text... | [
{
"content": "Find all patients who have both primary and non-primary insurance plans from the same provider, showing their patient IDs and provider details.",
"role": "user",
"sql": null
},
{
"content": "SELECT pi1.patient_id, pi1.plan_id, pi1.policy_number, pi1.is_primary FROM healthcare.patie... |
You are an expert in writing database language. You can write a corresponding 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.service_locations ( location_id character varying(64) NOT NULL, ... | [
{
"content": "List the number of appointments for each booking method.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n a.booking_method,\n COUNT(*) AS appointment_count\nFROM appointments a\nGROUP BY a.booking_method;",
"role": "assistant",
"sql": null
},
{
"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 government_services.applications ( application_id text PRIMARY KEY, citizen_id text,... | [
{
"content": "List the application ID, submitted date, and assigned employee ID for all applications that are currently in 'Processing' status and were submitted before January 1st, 2024.",
"role": "user",
"sql": null
},
{
"content": "SELECT application_id, submitted_at, assigned_employee_id FRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,... | [
{
"content": "List group conversation names and the count of messages sent in each conversation after '2024-06-01'.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.group_name, COUNT(T2.message_id) FROM social_media.conversations AS T1 JOIN social_media.messages AS T2 ON T1.conversation_... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "I need a report showing each security's ticker_symbol along with the total sum of trade total_amount and the count of trades executed in the last three months.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.ticker_symbol, SUM(t.total_amount) AS total_trade_amount, 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.prescriptions ( prescription_id text PRIMARY KEY, record_id text, patient... | [
{
"content": "List all distinct medication IDs that have been prescribed with more than 5 refills allowed.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT medication_id FROM healthcare.prescriptions WHERE refills_allowed > 5;",
"role": "assistant",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"content": "Count how many diagnoses were recorded each month in 2024. Show the month (as the first day of the month) and the count.",
"role": "user",
"sql": null
},
{
"content": "SELECT DATE_TRUNC('month', diagnosis_date)::date AS diagnosis_month, COUNT(*) FROM healthcare.diagnoses WHERE diag... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 4