system
stringlengths
315
11.5k
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 gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ...
[ { "role": "user", "content": "Can you provide a list of all players who have acquired at least one item, along with the item name, its type, and the title of the game that item belongs to?", "sql": null }, { "role": "assistant", "content": "SELECT pi.player_id, items.item_name, items.item_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 insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty...
[ { "role": "user", "content": "Show the top 5 largest documents by file size, including document_id, claim_id, file_name, and file_size_bytes.", "sql": null }, { "role": "assistant", "content": "SELECT document_id,\n claim_id,\n file_name,\n file_size_bytes\nFROM insurance.c...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "List all room numbers with their room type name and property name for rooms that have a Jacuzzi feature.", "sql": null }, { "role": "assistant", "content": "SELECT r.room_number, rt.type_name, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitalit...
You are an expert in writing database language. You can write a corresponding 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 // PUT /stations { "mappings": { "properties": { "station_id": { "type": "keyword" },...
[ { "role": "user", "content": "Can you provide the total capacity of all train cars for a specific train with train_id 'TR789'?", "sql": null }, { "role": "assistant", "content": "SELECT SUM(capacity) AS total_capacity\nFROM train_cars\nWHERE train_id = 'TR789';", "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 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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text...
[ { "role": "user", "content": "Retrieve the average base premium of insurance products for each product_type, including only types that have more than 5 products.", "sql": null }, { "role": "assistant", "content": "SELECT product_type, AVG(base_premium) AS avg_premium\nFROM insurance.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 project_fundraising_record ( id text, project_id text, project_name text, rounds_nam...
[ { "role": "user", "content": "For each narrative in token_basic_info, calculate the total net_flow and average ROI from smart_money_token_performance. List narrative, total_net_flow, avg_roi, ordered by total_net_flow descending.", "sql": null }, { "role": "assistant", "content": "SELECT tbi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List all partners who have provided a phone number, showing their full name and email.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM legal_services.lawyers WHERE is_partner = TRUE AND phone IS NOT NULL;", "sql":...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "List all pairs of patients who registered on the same day. Show patient1_id, patient1_name, patient2_id, patient2_name, and the shared registration date.", "sql": null }, { "role": "assistant", "content": "SELECT p1.patient_id AS patient1_id, p1.first_name || ' ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, ...
[ { "role": "user", "content": "List all insurance providers along with the total number of plans they offer.", "sql": null }, { "role": "assistant", "content": "SELECT insurance_provider, COUNT(*) AS plan_count\nFROM healthcare.insurance_plans\nGROUP BY insurance_provider;", "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.clients ( client_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "Show all cases with at least one billed and billable time entry, including case number, case name, total billed amount, and billed hours.", "sql": null }, { "role": "assistant", "content": "SELECT cs.case_number, cs.case_name, SUM(te.hours_spent * te.billing_rat...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, ci...
[ { "role": "user", "content": "List the reference number and status for all applications, including the registration date of the citizen who submitted it.", "sql": null }, { "role": "assistant", "content": "SELECT a.reference_number, a.status, c.registration_date FROM government_services.appl...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_...
[ { "role": "user", "content": "Can you help me find all staff members based at a specific station with station_id 'station_xyz', including the station details and platform information they are associated with?", "sql": null }, { "role": "assistant", "content": "MATCH (stf:Staff)-[:BASED_AT]->...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the detailed repair history of equipment u...
You are an expert in writing database language. You can write a corresponding 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": "List the name and symbol for all assets that do not have a corresponding entry with the key 'website' in the metadata table.", "sql": null }, { "role": "assistant", "content": "SELECT T1.name , T1.symbol FROM trading_platform.assets AS T1 LEFT JOIN trading_platf...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Find all invoices with status 'Paid' where the total amount is between 2000 and 5000. Show invoice number, total amount, issue date, and due date. Sort the results by issue date descending.", "sql": null }, { "role": "assistant", "content": "SELECT invoice_numbe...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "List all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange (exchange = 'NASDAQ') and belong to the 'Technology' sector.", "sql": null }, { "role": "assistant", "content": "SELECT security_id, ticker_symbol, security_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 government_services.services ( service_id.text, agency_id.text, service_name.text, d...
[ { "role": "user", "content": "Show me all services, their names, and their online application URLs for services that are both active and have an online application available.", "sql": null }, { "role": "assistant", "content": "SELECT service_name, online_application_url FROM government_servi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid, player_id uuid, item_id uuid...
[ { "role": "user", "content": "List each unique item ID and the total number of inventory entries for that item.", "sql": null }, { "role": "assistant", "content": "SELECT item_id, COUNT(*) AS entry_count FROM gaming_technology.player_inventory GROUP BY item_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 smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the tok...
[ { "role": "user", "content": "Which token symbols have the highest number of addresses buying them on the Ethereum chain? Show the top 3 symbols, their total address_amount, and narrative.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, narrative, SUM(address_amount)...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char...
[ { "role": "user", "content": "Find the top 5 transactions with the highest gas prices that were successful, including the from_address, to_address, and block_number.", "sql": null }, { "role": "assistant", "content": "SELECT from_address, to_address, block_number, gas_price FROM web3.transac...
You are an expert in writing database language. You can write a corresponding 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...
[ { "role": "user", "content": "List all insurance products along with their type and base premium. Also, show whether each product is active.", "sql": null }, { "role": "assistant", "content": "SELECT product_id, product_name, product_type, base_premium, is_active FROM insurance.insurance_pro...
You are an expert in writing database language. You can write a corresponding 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": "Can you show me the number of lawyers grouped by specialization?", "sql": null }, { "role": "assistant", "content": "SELECT specialization, COUNT(*) AS lawyer_count FROM lawyers GROUP BY specialization;", "sql": null }, { "role": "user", "content...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Which law firms have handled appointments with clients who registered in 2024? Please provide the law firm name, the client’s first and last name, and the appointment subject.", "sql": null }, { "role": "assistant", "content": "SELECT lf.firm_name, c.first_name,...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text...
[ { "role": "user", "content": "List the names and contact phone numbers of all insurance plans whose website is not null.", "sql": null }, { "role": "assistant", "content": "SELECT plan_name, contact_phone\nFROM healthcare.insurance_plans\nWHERE website 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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_...
[ { "role": "user", "content": "What is the average and maximum standard fee for services in each category?", "sql": null }, { "role": "assistant", "content": "SELECT category, AVG(standard_fee) AS avg_standard_fee, MAX(standard_fee) AS max_standard_fee FROM government_services.services GROUP ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Node Label ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St...
[ { "role": "user", "content": "I need to check the inventory status of components, including their batch details and warehouse location.", "sql": null }, { "role": "assistant", "content": "MATCH (i:InventoryBatch)-[:IS_INSTANCE_OF]->(c:Component)\nRETURN c.component_id, c.component_name, i.in...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "List all time entries where the description includes the word 'email', showing the entry ID, date worked, hours spent, and description.", "sql": null }, { "role": "assistant", "content": "SELECT entry_id, date_worked, hours_spent, description FROM legal_services...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "List the patient_id, first_name, last_name, and phone_number for all patients whose gender is 'Female', and whose emergency_contact_name is not null. Also, only include patients who have an email address.", "sql": null }, { "role": "assistant", "content": "SELEC...
You are an expert in writing database language. You can write a corresponding 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, case_number character...
[ { "role": "user", "content": "Show me the document_id, document_name, and upload_timestamp for all documents uploaded by lawyer with ID 'lawyer_456'.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, document_name, upload_timestamp\nFROM legal_services.documents\nWHERE ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.applications ( application_id text PRIMARY KEY, citizen_id text,...
[ { "role": "user", "content": "Find all applications that were submitted in 2023 but received a decision ('Approved' or 'Rejected') in 2024. List the application ID, submitted date, decision date, and status.", "sql": null }, { "role": "assistant", "content": "SELECT application_id, submitted...
You are an expert in writing database language. You can write a corresponding 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 pairs of overlapping reservations for the same room, including both reservation IDs, room_id, and each reservation's check-in and check-out dates.", "sql": null }, { "role": "assistant", "content": "SELECT r1.reservation_id AS reservation_id_1,\n r2.r...
You are an expert in writing database language. You can write a corresponding 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": "Find narrative pairs where the sum of their price_change_percentage_1h is greater than 5. Show narrative1, change1, narrative2, change2, and the sum as total_change.", "sql": null }, { "role": "assistant", "content": "SELECT n1.narrative AS narrative1, n1.price_...
You are an expert in writing database language. You can write a corresponding 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": "What is the total balance and the number of accounts for each currency, including only accounts opened in the last 2 years?", "sql": null }, { "role": "assistant", "content": "SELECT currency , SUM(balance) AS total_balance , COUNT(*) AS account_count FROM fin...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ...
[ { "role": "user", "content": "Can you show me a list of all agencies along with their parent agency names?", "sql": null }, { "role": "assistant", "content": "SELECT a.agency_id, a.agency_name, pa.agency_name AS parent_agency_name\nFROM government_services.agencies a\nLEFT JOIN government_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 web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "Show all contracts deployed on 'testnet', including the contract_id, address, deployer_address, and deployed_at.", "sql": null }, { "role": "assistant", "content": "SELECT contract_id, address, deployer_address, deployed_at\nFROM web3.contracts\nWHERE network_id...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.token_transfers ( transfer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Find cases where an address received tokens in one transfer and then sent tokens in another. List the receive transfer_id, the send transfer_id, the address, and both transfer values.", "sql": null }, { "role": "assistant", "content": "SELECT recv.transfer_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 insurance.premium_payments ( payment_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Calculate the average and maximum payment amount grouped by payment status.", "sql": null }, { "role": "assistant", "content": "SELECT status,\n AVG(amount_paid) AS avg_amount,\n MAX(amount_paid) AS max_amount\nFROM insurance.premium_payments\nGROUP ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "Show usernames of players who own items of 'Legendary' rarity.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.username FROM players AS T1 JOIN player_inventory AS T2 ON T1.player_id = T2.player_id JOIN in_game_items AS T3 ON T2.item_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 train_station_management.platforms ( platform_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "Can you provide the total number of active trains in the database?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM train_station_management.trains\nWHERE status = 'Active';", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media...
[ { "role": "user", "content": "List each user along with how many image-type posts they've made, showing user_id and image_post_count, sorted by the count descending.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) AS image_post_count\nFROM social_media.posts\nWHE...
You are an expert in writing database language. You can write a corresponding 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...
[ { "role": "user", "content": "For each patient, show the total number of diagnoses they have received, along with their patient ID and the ID of their latest diagnosis. Join with the diagnoses table.", "sql": null }, { "role": "assistant", "content": "SELECT patient_id, COUNT(diagnosis_id) 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 trading_platform.trades ( trade_id text, order_id text, buyer_id text, seller_id tex...
[ { "role": "user", "content": "List all unspent UTXOs, including their utxo_id, address, amount, and transaction_id.", "sql": null }, { "role": "assistant", "content": "SELECT utxo_id, address, amount, transaction_id \nFROM trading_platform.utxos \nWHERE spent = false;", "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.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(...
[ { "role": "user", "content": "For every game, can you provide the count of unique item types and the average item cost?", "sql": null }, { "role": "assistant", "content": "SELECT game_id, COUNT(DISTINCT item_type) AS num_unique_types, AVG(cost_amount) AS avg_item_cost FROM gaming_technology....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // PUT /schedules { "mappings": { "properties": { "schedule_id": { "type": "keyword" ...
[ { "role": "user", "content": "能否帮我查询特定路线(route_id 为 'RT001')的所有行程信息,并关联到乘客的联系方式?", "sql": null }, { "role": "assistant", "content": "SELECT s.schedule_id, s.train_id, s.route_id, s.departure_datetime, s.arrival_datetime, s.status, p.passenger_id, p.first_name, p.last_name, p.phone_number, 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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number contain...
[ { "role": "user", "content": "Which ERC1155 NFT contracts have received approval-for-all events, and for each contract, how many total approval events were recorded?", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Show me all users and the posts they have created, including the user's username and the post content.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, p.post_id, p.content\nFROM social_media.users u\nJOIN social_media.posts p ON u.user_id ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "Show me the name of each law firm and the full 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.lawyer_id;", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "For each document type, how many documents were uploaded by each user? Show the uploaded_by, document_type, and document count, ordered by document_type and count descending.", "sql": null }, { "role": "assistant", "content": "SELECT uploaded_by, document_type, ...
You are an expert in writing database language. You can write a corresponding 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 for each user how many conversations they've participated in, include their email and conversation count, only for those who have participated in more than five conversations.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name...
[ { "role": "user", "content": "List the full name of employees and the names of the agencies they work for, but only for employees who are currently employed.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, a.agency_name\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 hospitality_technology.properties ( property_id text, property_name text, address_li...
[ { "role": "user", "content": "For each property, list the names of all available services in the 'Wellness' category. Show property name and service name.", "sql": null }, { "role": "assistant", "content": "SELECT T1.property_name, T2.service_name FROM hospitality_technology.properties AS 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "List the medication_id and medication_name for all medications with a generic name that starts with 'Amox'.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name\nFROM healthcare.medications\nWHERE generic_name ILIKE 'Amox%';"...
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT ...
[ { "role": "user", "content": "Generate a report showing the total number of achievement unlocks broken down by the calendar day they occurred. Show the date and the total number of unlocks for that day.", "sql": null }, { "role": "assistant", "content": "SELECT DATE(unlocked_at) AS unlock_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 transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id ...
[ { "role": "user", "content": "List the log ID, vehicle ID, service date, and cost for all maintenance logs where the cost exceeds 2000 and the odometer reading is greater than 100,000.", "sql": null }, { "role": "assistant", "content": "SELECT log_id, vehicle_id, service_date, cost FROM tran...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "For each account, show the account number, currency, and the sum of all incoming transaction amounts, where an incoming transaction is one where the account appears as related_account_id.", "sql": null }, { "role": "assistant", "content": "SELECT a.account_numbe...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "List all in-game items' names, types, and rarity along with their total cost in USD, for items that belong to games released on or after 2021-01-01.", "sql": null }, { "role": "assistant", "content": "SELECT i.item_name, i.item_type, i.rarity, i.cost_amount\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 healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id...
[ { "role": "user", "content": "For each diagnosis code_type, calculate the average number of refills_allowed for prescriptions linked to chronic diagnoses.", "sql": null }, { "role": "assistant", "content": "SELECT\n d.code_type,\n AVG(p.refills_allowed) AS avg_refills_allowed\nFROM healthc...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "List all appointments showing the scheduled time, the name of the service, and the name of the location.", "sql": null }, { "role": "assistant", "content": "SELECT T1.scheduled_start_time, T2.service_name, T3.location_name FROM government_services.appointments 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "List the symbol, name, and total supply for all ERC20 tokens.", "sql": null }, { "role": "assistant", "content": "SELECT symbol, name, total_supply FROM token_metas WHERE is_erc20 = 1;", "sql": null }, { "role": "user", "content": "Include the 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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "I want to list the top 5 ERC20 tokens by number of distinct wallet holders, showing their symbol, name, and holder_count.", "sql": null }, { "role": "assistant", "content": "SELECT tm.symbol,\n tm.name,\n COUNT(DISTINCT eb.wallet_address) AS holder_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 transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show all fuel logs for vehicle_id 'VH123', including the timestamp, fuel type, quantity, and the location_id. Sort the list by timestamp descending.", "sql": null }, { "role": "assistant", "content": "SELECT fuel_log_id, log_timestamp, fuel_type, quantity, locat...
You are an expert in writing database language. You can write a corresponding 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": "How many users have non-empty full_name and bio fields? Return only the count.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM social_media.users\nWHERE full_name IS NOT NULL\n AND full_name <> ''\n AND bio IS NOT NULL\n AND bio <> '...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What is the maintenance schedule for platform 3 at station DEF for the next month?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the maintenance schedule for platforms. The data I have only includes static information ...
You are an expert in writing database language. You can write a corresponding 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.medications ( medication_id character varying(64) NOT NULL, medication_na...
[ { "role": "user", "content": "Show the medication_id, medication_name, and manufacturer for all medication entries.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications;", "sql": null }, { "role": "use...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // PUT /stations { "mappings": { "properties": { "station_id": { "type": "keyword" },...
[ { "role": "user", "content": "Can you provide the total capacity of all train cars for a specific train with train_id 'TR789'?", "sql": null }, { "role": "assistant", "content": "SELECT SUM(capacity) AS total_capacity\nFROM train_cars\nWHERE train_id = 'TR789';", "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.customers ( customer_id text, first_name text, last_name text, date_of_bir...
[ { "role": "user", "content": "I need a list of all documents associated with claims, showing the document ID, file name, document type, and the status of the claim it belongs to.", "sql": null }, { "role": "assistant", "content": "SELECT\n cd.document_id,\n cd.file_name,\n cd.document_typ...
You are an expert in writing database language. You can write a corresponding 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 distinct plan types available in the insurance_plans table.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT plan_type FROM healthcare.insurance_plans;", "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.services ( service_id character varying(64) NOT NULL, propert...
[ { "role": "user", "content": "Show me each department in each property, along with the total number of available services and their combined price.", "sql": null }, { "role": "assistant", "content": "SELECT property_id, department, COUNT(*) AS service_count, SUM(price) AS total_price FROM ho...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "For each player, list their username and the total number of unique servers they have played on, only including players who have played on two or more different servers. Also show the titles of all games they've played sessions on.", "sql": null }, { "role": "assist...
You are an expert in writing database language. You can write a corresponding 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 policy number, start date, product name, and base premium for policies where the base premium of the associated product is greater than 1000.", "sql": null }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.start_date, T2.product_name, 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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp...
[ { "role": "user", "content": "List distinct patient IDs who have received a diagnosis from a doctor with 'Cardiology' specialty.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.patient_id FROM healthcare.diagnoses AS T1 JOIN healthcare.doctors AS T2 ON T1.doctor_id = T...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Show the top 5 properties by average overall review rating.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.reviews r\n ON p.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 legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex...
[ { "role": "user", "content": "Show me the number of cases for each case_type that were closed in 2023.", "sql": null }, { "role": "assistant", "content": "SELECT case_type,\n COUNT(*) AS case_count\nFROM legal_services.cases\nWHERE date_closed BETWEEN '2023-01-01' AND '2023-12-31'\nGRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "How many customers are there in each risk_profile and what is their average age?", "sql": null }, { "role": "assistant", "content": "SELECT risk_profile, COUNT(*) AS customer_count, AVG(EXTRACT(YEAR FROM AGE(current_date, date_of_birth))) AS average_age FROM fin...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "For all maintenance records, can you show the vehicle's make, model, the odometer reading, and the mechanic's name?", "sql": null }, { "role": "assistant", "content": "SELECT v.make, v.model, m.odometer_reading, m.mechanic_name FROM transportation.maintenance_lo...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What are the training programs or certifications completed by a staff member with the role of Platform Supervisor?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the training programs or certifications...
You are an expert in writing database language. You can write a corresponding 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 narratives that have a 24-hour trading volume exceeding $50,000,000 and include at least 100 distinct tokens. Show the narrative name, volume, and token count.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, volume_24h, token_num FROM ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "List the usernames of users who have created posts associated with any hashtag, and the name of the hashtag.", "sql": null }, { "role": "assistant", "content": "SELECT\n u.username,\n h.tag_name\nFROM social_media.users AS u\nJOIN social_media.posts AS p\n 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 web3.tokens ( token_id character varying(64) NOT NULL, contract_address character va...
[ { "role": "user", "content": "List all pairs of tokens (show token_id for both) that share the same contract address, excluding pairs where the token_id is the same.", "sql": null }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id1, t2.token_id AS token_id2, t1.contract_add...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.prescriptions ( prescription_id.text, record_id.text, patient_id.text, do...
[ { "role": "user", "content": "What is the average quantity_dispensed per route for prescriptions with start_date in 2024? Return route and avg_quantity.", "sql": null }, { "role": "assistant", "content": "SELECT route,\n AVG(quantity_dispensed) AS avg_quantity\nFROM healthcare.prescrip...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.dapps ( dapp_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "List the names of all DApps whose description contains the word 'auction' along with the user IDs of anyone who has had a KYC audit.", "sql": null }, { "role": "assistant", "content": "SELECT d.name AS dapp_name, k.user_id\nFROM trading_platform.dapps d\nJOIN tr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "I want to see pairs of customers living in the same state but having different risk profiles. Show their customer_ids, states, and risk_profiles.", "sql": null }, { "role": "assistant", "content": "SELECT a.customer_id AS customer_a, a.state, a.risk_profile AS r...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash...
[ { "role": "user", "content": "List all game titles and corresponding server names for servers that are located in the same region as 'us-central-1'.", "sql": null }, { "role": "assistant", "content": "SELECT g.title, s.server_name\nFROM gaming_technology.servers s\nJOIN gaming_technology.gam...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_i...
[ { "role": "user", "content": "What is the total revenue (sum of total_amount) and total amount_paid for each booking_source?", "sql": null }, { "role": "assistant", "content": "SELECT booking_source,\n SUM(total_amount) AS total_revenue,\n SUM(amount_paid) AS total_paid\nFROM res...
You are an expert in writing database language. You can write a corresponding 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, claim_id text, document_type text, fil...
[ { "role": "user", "content": "For each claim, retrieve the document_id, file_name, and uploaded_at of the earliest and the latest uploaded document.", "sql": null }, { "role": "assistant", "content": "SELECT\n c1.claim_id,\n c1.document_id AS earliest_document_id,\n c1.file_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 web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a...
[ { "role": "user", "content": "Show all token transfers where the token_symbol contains 'ETH' and include the transfer id, value, transaction id, and the contract address where the token was created.", "sql": null }, { "role": "assistant", "content": "SELECT tt.transfer_id, tt.value, tt.trans...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id text, reservation_id text, guest_id...
[ { "role": "user", "content": "How many service orders were placed by each staff member (staff_id_ordered)? Show the staff ID and the count.", "sql": null }, { "role": "assistant", "content": "SELECT staff_id_ordered, COUNT(*) FROM hospitality_technology.service_orders GROUP BY staff_id_order...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "Show me the count of available rooms for each property.", "sql": null }, { "role": "assistant", "content": "SELECT T1.property_name, count(T2.room_id) FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.rooms AS T2 ON T1.property_id = T2.pro...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What is the current market price of a Boeing 737 MAX aircraft?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and gener...
You are an expert in writing database language. You can write a corresponding 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 offer more than three services? List the agency ID and the total number of services they provide.", "sql": null }, { "role": "assistant", "content": "SELECT agency_id, COUNT(service_id) AS total_services\nFROM government_services.services\nGROUP 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...
[ { "role": "user", "content": "Can you show me all routes where the origin_location_id is the same as the destination_location_id? List their route_id, route_number, and type.", "sql": null }, { "role": "assistant", "content": "SELECT route_id, route_number, type\nFROM transportation.routes\n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Count the number of comments that have been updated since they were first created.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.comments WHERE updated_at > created_at;", "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.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "Show each token's symbol, token_name, and the deployer_address and status of the contract where that token was created.", "sql": null }, { "role": "assistant", "content": "SELECT t.token_symbol,\n t.token_name,\n c.deployer_address,\n c.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 hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex...
[ { "role": "user", "content": "For each payment, list its payment_id, guest_id, payment_timestamp, and the next payment_id and next payment_timestamp made by the same guest.", "sql": null }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.guest_id,\n p.payment_timestam...
You are an expert in writing database language. You can write a corresponding 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": "For each guest, list reservation_id, guest_id, check_in_date, and the next reservation_id and its check_in_date.", "sql": null }, { "role": "assistant", "content": "SELECT r1.reservation_id,\n r1.guest_id,\n r1.check_in_date,\n r2.reservation_i...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case...
[ { "role": "user", "content": "Which clients have appointments scheduled for a case that also has at least one invoice issued? Please show the client_id, appointment_id, appointment start_time, related case_id, and invoice_number.", "sql": null }, { "role": "assistant", "content": "SELECT a.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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "Show me the top 5 NFT collections with the highest token count, along with their names, symbols, and floor prices, but only include collections with a floor price greater than 0.5 ETH.", "sql": null }, { "role": "assistant", "content": "SELECT nc.name, nc.symbol...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.orders ( order_id.text, user_id.text, wallet_id.text, asset_id.text...
[ { "role": "user", "content": "Show each order with its previous order timestamp for the same user.", "sql": null }, { "role": "assistant", "content": "SELECT o.order_id, o.user_id, o.created_at AS current_time, MAX(prev.created_at) AS previous_time\nFROM trading_platform.orders o\nLEFT JOIN ...