system
stringlengths
315
8.44k
conversations
listlengths
2
8
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "Find the contract address and name for all NFT collections listed on the 'Ethereum' blockchain.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, name FROM nft_collections WHERE blockchain = 'Ethereum'", "sql": null }, { "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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi...
[ { "role": "user", "content": "Show conversations that are group chats and have more than 5 participants. List the conversation_id and group_name.", "sql": null }, { "role": "assistant", "content": "SELECT c.conversation_id, c.group_name FROM social_media.conversations AS c JOIN social_media....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,...
[ { "role": "user", "content": "I want to retrieve the agent ID, first and last name, along with their manager's contact email and phone number.", "sql": null }, { "role": "assistant", "content": "SELECT a.agent_id,\n a.first_name || ' ' || a.last_name AS agent_name,\n m.contact_em...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List all applications including the application reference number, the first and last name of the citizen who submitted it, and the name of the service the application is for.", "sql": null }, { "role": "assistant", "content": "SELECT T1.reference_number, T2.firs...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title cha...
[ { "role": "user", "content": "List all games along with the count of in-game items they have. Only include games with more than 10 items and sort by the item count in descending order.", "sql": null }, { "role": "assistant", "content": "SELECT g.game_id, g.title, COUNT(i.item_id) AS item_cou...
You are an expert in writing database language. You can write a corresponding 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 social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "List group conversation names and the number of messages sent in each conversation after January 1, 2023.", "sql": null }, { "role": "assistant", "content": "SELECT c.group_name, COUNT(m.message_id) FROM social_media.conversations c JOIN social_media.messages m ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_l...
[ { "role": "user", "content": "List the first and last names of all passengers along with their date of birth.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth\nFROM transportation.passengers;", "sql": null }, { "role": "user", "c...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.ti...
[ { "role": "user", "content": "List the claim ID, incident date, estimated loss, and the first and last name of the customer for all claims with an estimated loss greater than 5000.", "sql": null }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.incident_date, T1.estimated_loss, 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 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 web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a...
[ { "role": "user", "content": "List each contract along with the deployer address, and status for contracts deployed on network_id 'mainnet'.", "sql": null }, { "role": "assistant", "content": "SELECT contract_id, address, deployer_address, status FROM web3.contracts WHERE network_id = 'mainn...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ...
[ { "role": "user", "content": "Show each vehicle's ID along with another vehicle's ID where they share the same make but have different models. Sort by the first vehicle_id.", "sql": null }, { "role": "assistant", "content": "SELECT v1.vehicle_id AS vehicle_a, v2.vehicle_id AS vehicle_b\nFROM...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.trips ( trip_id text, route_id text, vehicle_id text, driver_id text,...
[ { "role": "user", "content": "List all trips with their trip_id, vehicle_id, and the corresponding origin_location_id and destination_location_id, but only where the origin and destination are not the same.", "sql": null }, { "role": "assistant", "content": "SELECT trip_id, vehicle_id, origi...
You are an expert in writing database language. You can write 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 retrieve the total number of train cars for each train in the database?", "sql": null }, { "role": "assistant", "content": "MATCH (t:Train)<-[:PART_OF_TRAIN]-(tc:TrainCar)\nRETURN t.train_id, t.train_number, COUNT(tc) AS total_cars\nORDER BY t.train_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 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 transportation.routes ( route_id text, route_number text, description text, origin_l...
[ { "role": "user", "content": "Show the route number, route type, and the names of the origin and destination locations for all routes.", "sql": null }, { "role": "assistant", "content": "SELECT r.route_number, r.type, l1.name AS origin_name, l2.name AS destination_name\nFROM transportation.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 erc20_balances ( block_number bigint, contract_address text, wallet_address text, am...
[ { "role": "user", "content": "Show me all NFT collections on the 'Ethereum' blockchain, listing their name, contract address, and ERC type.", "sql": null }, { "role": "assistant", "content": "SELECT name, contract_address, erc_type FROM nft_collections WHERE blockchain = 'Ethereum'", "sq...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.passengers ( passenger_id text, first_name text, last_name text, emai...
[ { "role": "user", "content": "List pairs of passengers where one registered before another, including both their first names, created_at timestamps, and loyalty_program_id.", "sql": null }, { "role": "assistant", "content": "SELECT p1.first_name AS earlier,\n p2.first_name AS later,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Find pairs of documents in the same case where one document is version 1 and the other is the highest version for that document_name, showing case_id, document_name, version1, latest_version, version1_upload_timestamp, and latest_upload_timestamp.", "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_performance ( token_address text, token_symbol text, pnl numeric, ...
[ { "role": "user", "content": "For each chain, which token symbol has the highest pnl and what are its roi and avg_cost?", "sql": null }, { "role": "assistant", "content": "SELECT t.chain, t.token_symbol, t.pnl, t.roi, t.avg_cost\nFROM smart_money_token_performance t\nINNER JOIN (\n SELECT c...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id text, first_name text, last_name text, agency_name text,...
[ { "role": "user", "content": "I need a list of agents along with their manager's contact email and phone number.", "sql": null }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name, a.last_name, m.contact_email AS manager_email, m.contact_phone AS manager_phone FROM insurance...
You are an expert in writing database language. You can write a corresponding 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": "How many patients have provided both a phone_number and emergency_contact_phone?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.patients WHERE phone_number IS NOT NULL AND emergency_contact_phone IS NOT NULL;", "sql": nul...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre...
[ { "role": "user", "content": "What is the average cost per unit for fuel at each location type? Show the location type and the average cost.", "sql": null }, { "role": "assistant", "content": "SELECT T2.type , AVG(T1.cost_per_unit) FROM transportation.fuel_logs AS T1 JOIN transportation.loc...
You are an expert in writing database language. You can write a corresponding 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.text, agency_id.text, location_n...
[ { "role": "user", "content": "List all service locations with their IDs, names, latitude, and longitude.", "sql": null }, { "role": "assistant", "content": "SELECT location_id,\n location_name,\n latitude,\n longitude\nFROM government_services.service_locations;", "sql"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t...
[ { "role": "user", "content": "How many insurance policies does each subscriber have? Please display the subscriber name and policy count.", "sql": null }, { "role": "assistant", "content": "SELECT subscriber_name, COUNT(*) AS policy_count FROM healthcare.patient_insurance GROUP BY subscriber...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_nam...
[ { "role": "user", "content": "Retrieve the first name, last name, and email for all guests.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM hospitality_technology.guests;", "sql": null }, { "role": "user", "content": "Can you also ...
You are an expert in writing database language. You can write a corresponding 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.logs ( log_id text PRIMARY KEY, user_id text, action text, details ...
[ { "role": "user", "content": "For each user, retrieve their most recent log entry, including the action and timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT l.user_id, l.action, l.logged_at FROM trading_platform.logs l JOIN (SELECT user_id, MAX(logged_at) AS max_time 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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "Show all cases that were opened and subsequently closed in the same calendar year. List the case name, case number, date opened, and date closed.", "sql": null }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened, date_closed FROM leg...
You are an expert in writing database language. You can write a corresponding 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.payments ( payment_id character varying(64) NOT NULL, applicatio...
[ { "role": "user", "content": "Can you show the total amount paid and number of payments per citizen in 2024?", "sql": null }, { "role": "assistant", "content": "SELECT citizen_id, SUM(amount) AS total_paid, COUNT(*) AS payment_count FROM government_services.payments WHERE payment_timestamp >...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex...
[ { "role": "user", "content": "Find any two policies for the same customer whose coverage dates overlap. Return the customer ID, both policy numbers, and their start and end dates.", "sql": null }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_number AS policy1_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 character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "For each department, list the total number of available services and the total combined price of those services.", "sql": null }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS service_count, SUM(price) AS total_price\nFROM 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 legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "List the invoice_number, total_amount, the full name of the client, and the case_number for all invoices.", "sql": null }, { "role": "assistant", "content": "SELECT i.invoice_number, i.total_amount, c.first_name || ' ' || c.last_name AS client_full_name, cs.case...
You are an expert in writing database language. You can write a corresponding 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": "How many patients are there in each gender category?", "sql": null }, { "role": "assistant", "content": "SELECT gender,\n COUNT(*) AS patient_count\nFROM healthcare.patients\nGROUP BY gender;", "sql": null }, { "role": "user", "content": "O...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam...
[ { "role": "user", "content": "Show a count of drivers per status.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS driver_count\nFROM transportation.drivers\nGROUP BY status;", "sql": null }, { "role": "user", "content": "Can you also list the ea...
You are an expert in writing database language. You can write a corresponding 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...
[ { "role": "user", "content": "List the ticker_symbol and average close price for all securities of type 'ETF'.", "sql": null }, { "role": "assistant", "content": "SELECT s.ticker_symbol, AVG(md.close_price) AS avg_close_price\nFROM financial_services.securities s\nJOIN financial_services.mar...
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, medication_name text, gener...
[ { "role": "user", "content": "List all medications with a description that includes the word 'antibiotic'.", "sql": null }, { "role": "assistant", "content": "SELECT * FROM healthcare.medications WHERE description ILIKE '%antibiotic%';", "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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "Compute the average and maximum cost of maintenance for each service_type in the maintenance_logs table.", "sql": null }, { "role": "assistant", "content": "SELECT service_type,\n AVG(cost) AS avg_cost,\n MAX(cost) AS max_cost\nFROM transportation.ma...
You are an expert in writing database language. You can write a corresponding 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 customer, could you list their full name, email, and the combined balance of all their accounts? Please also show the number of accounts they hold.", "sql": null }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name || ' ' || c.last_n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "List all appointments scheduled in the next 7 days along with the appointment_id, appointment_time, patient's full name, doctor's full name, and the patient's primary insurance plan_name.", "sql": null }, { "role": "assistant", "content": "SELECT ap.appointment_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "List each claim with its policy number and the selling agent's first and last name.", "sql": null }, { "role": "assistant", "content": "SELECT c.claim_id, p.policy_number, a.first_name, a.last_name\nFROM insurance.claims c\nJOIN insurance.policies p ON c.policy_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE nft_holders ( block_number bigint NOT NULL, contract_address varchar NOT NULL, walle...
[ { "role": "user", "content": "Show all SUI coins with 'exists' status and more than 8 decimal places. Display coin_type, symbol, name, and decimals.", "sql": null }, { "role": "assistant", "content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nWHERE status = 'exists' ...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve prescription_id, medication_name, and insurance plan_name for all prescriptions.", "sql": null }, { "role": "assistant", "content": "SELECT p.prescription_id,\n m.medication_name,\n ip.plan_name\nFROM healthcare.prescriptions p\nJOIN 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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Provide a summary for each user, showing their user_id, username, and the total number of orders they have placed overall.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(o.order_id) AS total_orders\nFROM trading_platform....
You are an expert in writing database language. You can write a corresponding 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": "List the names of all law firms along with the names (first and last) of lawyers who are partners in those firms.", "sql": null }, { "role": "assistant", "content": "SELECT lf.firm_name, l.first_name, l.last_name\nFROM legal_services.law_firms lf\nJOIN legal_ser...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "Show me the total billable hours and total billed amount for each lawyer who worked on 'Civil Litigation' cases in 2023, sorted by billed amount descending.", "sql": null }, { "role": "assistant", "content": "SELECT te.lawyer_id,\n SUM(te.hours_spent) AS 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, prop...
[ { "role": "user", "content": "List all services in the 'Concierge' department along with their names, price, and whether they are currently available. Include the property name as well.", "sql": null }, { "role": "assistant", "content": "SELECT s.service_name, s.price, s.is_available, p.prop...
You are an expert in writing database language. You can write a corresponding 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 each patient's first and last name along with the insurance plan name they are enrolled in, including only primary policies. Return patient_id, first_name, last_name, and plan_name.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id,\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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "Show me the top 5 NFT collections on Ethereum with the highest number of unique owners, along with their names and floor prices.", "sql": null }, { "role": "assistant", "content": "SELECT nc.name, nc.floor_price, COUNT(DISTINCT nh.wallet_address) AS unique_owner...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "For each appointment scheduled for '2024-08-15', return the patient's full name, the doctor's ID, and the appointment time.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, a.doctor_id, a.appointment_time\nFROM healthcare.app...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.market_data ( data_point_id bigserial NOT NULL, -- auto-incre...
[ { "role": "user", "content": "For each security sector, what is the average volume recorded in the market data?", "sql": null }, { "role": "assistant", "content": "SELECT T2.sector, AVG(T1.volume) FROM financial_services.market_data AS T1 JOIN financial_services.securities AS T2 ON T1.securi...
You are an expert in writing database language. You can write a corresponding 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...
[ { "role": "user", "content": "List all available services in the 'Housekeeping' department that cost less than 20.", "sql": null }, { "role": "assistant", "content": "SELECT service_id, service_name, price\nFROM hospitality_technology.services\nWHERE department = 'Housekeeping' AND is_availa...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id.text, first_name.text, last_name.text, company_na...
[ { "role": "user", "content": "Show the subject and start time for all appointments that are related to a case that also has an invoice. Include the case number and the invoice number.", "sql": null }, { "role": "assistant", "content": "SELECT T1.subject, T1.start_time, T2.case_number, T3.inv...
You are an expert in writing database language. You can write a corresponding 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...
[ { "role": "user", "content": "Calculate the monthly total quantity of fuel consumed and the average cost_per_unit for each fuel_type in 2023.", "sql": null }, { "role": "assistant", "content": "SELECT date_trunc('month', log_timestamp) AS month,\n fuel_type,\n SUM(quantity) ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.market_data ( data_point_id bigserial NOT NULL, security_id chara...
[ { "role": "user", "content": "Provide for each security its ticker_symbol, the most recent close_price and corresponding timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT s.ticker_symbol, md.close_price, md.data_timestamp\nFROM financial_services.market_data md\nJOIN fina...
You are an expert in writing database language. You can write a corresponding 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_timestamp timestamp(3...
[ { "role": "user", "content": "List NFTs on 'Ethereum' with name, contract address, token ID, and rarity score.", "sql": null }, { "role": "assistant", "content": "SELECT name, contract_address, token_id, rarity_score FROM nft_metadata WHERE blockchain = 'Ethereum';", "sql": null }, {...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "List accounts that were opened in the same month and year as another account for the same customer, but have a different account type. Show the account_id, customer_id, account_type, and opened_date for these accounts.", "sql": null }, { "role": "assistant", "co...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.peers ( peer_id character varying(64) NOT NULL, ip_address characte...
[ { "role": "user", "content": "List all peers whose IP address ends with '.255', showing their peer_id, ip_address, and last_seen timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT peer_id, ip_address, last_seen FROM trading_platform.peers WHERE ip_address LIKE '%.255';", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un...
[ { "role": "user", "content": "List each genre and the number of games in that genre.", "sql": null }, { "role": "assistant", "content": "SELECT genre,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY genre;", "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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam...
[ { "role": "user", "content": "List all drivers along with their status and license expiry date.", "sql": null }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, status, license_expiry_date\nFROM transportation.drivers;", "sql": null }, { "role": "user"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "For each route, list the route_number, origin city, destination city, and the total fare collected from completed bookings.", "sql": null }, { "role": "assistant", "content": "SELECT\n r.route_number,\n lo.city AS origin_city,\n ld.city AS desti...
You are an expert in writing database language. You can write a corresponding 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": "For projects that have completed more than one fundraising round, calculate the average investment value across all their recorded rounds. Display the project name and this average value.", "sql": null }, { "role": "assistant", "content": "SELECT project_name, A...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp...
[ { "role": "user", "content": "List all active prescriptions for medication 'ibuprofen' with dosage greater than 200mg, including patient ID and doctor details.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id, d.first_name, d.last_name, d.specialty, m.medication_name, ...
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 location of a specific train car with car_id 'TC123'?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide the current location of a specific train car as this information is not stored in the database table. 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 social_media.user_settings ( setting_id.text, user_id.text, theme.text, email_notifi...
[ { "role": "user", "content": "List the user ID, theme, and updated_at for users who have updated their settings in the last 90 days and have their theme set to 'dark'.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, theme, updated_at FROM social_media.user_settings WHERE ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci...
[ { "role": "user", "content": "List all insurance products with their product name and base premium, where the product description contains the word 'accident'.", "sql": null }, { "role": "assistant", "content": "SELECT product_name, base_premium FROM insurance.insurance_products WHERE descri...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all pairs of customers who live in the same zip_code. Show customer1_id, customer2_id, and zip_code.", "sql": null }, { "role": "assistant", "content": "SELECT\n c1.customer_id AS customer1_id,\n c2.customer_id AS customer2_id,\n c1.zip_code\nFROM insura...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Give me the list of DApp names and URLs whose description contains any asset symbol from the assets table.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT d.name, d.url\nFROM trading_platform.dapps d\nJOIN trading_platform.assets a ON d.descr...
You are an expert in writing database language. You can write a corresponding 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 patients who have had appointments with doctors specializing in 'Oncology', showing patient ID, patient first name, patient last name, doctor ID, doctor first name, and doctor last name.", "sql": null }, { "role": "assistant", "content": "SELECT\n p.pa...
You are an expert in writing database language. You can write a corresponding 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 total balance and number of distinct holders for each Avalanche token, including its tick and creator address.", "sql": null }, { "role": "assistant", "content": "SELECT ti.tick, ti.creator, SUM(tb.amount) AS total_balance, COUNT(DISTINCT tb.wallet_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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi...
[ { "role": "user", "content": "Count the number of active services provided by each agency. Return the agency_name and the count of active services for each.", "sql": null }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(*) AS active_service_count\nFROM government_services.ag...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, property_id t...
[ { "role": "user", "content": "List each reservation along with the next reservation for the same guest. Show the original reservation_id, its check_out_date, the next_reservation_id, and the next reservation's check_in_date.", "sql": null }, { "role": "assistant", "content": "SELECT r1.reser...
You are an expert in writing database language. You can write a corresponding 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.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "Can you help me find the total passenger capacity for each train car on a specific route with route_id 'RT123'?", "sql": null }, { "role": "assistant", "content": "SELECT tc.train_id, tc.car_id, tc.car_number, tc.capacity\nFROM train_station_management.train_car...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.payments ( payment_id.text, application_id.text, citizen_id.text...
[ { "role": "user", "content": "For each service ID, show the average and maximum payment amount for payments made in the last 90 days.", "sql": null }, { "role": "assistant", "content": "SELECT service_id, AVG(amount), MAX(amount) FROM government_services.payments WHERE payment_timestamp >= 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 smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz...
[ { "role": "user", "content": "How many addresses on the Ethereum chain have an ROI between 2 and 4?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS address_count FROM smart_money_profit WHERE chain = 'Ethereum' AND roi >= 2 AND roi <= 4;", "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 character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all agents along with the first and last name of their manager.", "sql": null }, { "role": "assistant", "content": "SELECT a1.first_name AS agent_first_name, a1.last_name AS agent_last_name, a2.first_name AS manager_first_name, a2.last_name AS manager_last_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "List all wallets created before '2024-01-01', including the wallet_id, user_id, and creation date.", "sql": null }, { "role": "assistant", "content": "SELECT wallet_id, user_id, created_at FROM wallets WHERE created_at < '2024-01-01';", "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.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,...
[ { "role": "user", "content": "Show me all group chats with their names and the time they were last active.", "sql": null }, { "role": "assistant", "content": "SELECT group_name, last_message_at FROM social_media.conversations WHERE is_group_chat = TRUE;", "sql": null }, { "role":...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_...
[ { "role": "user", "content": "Show me the number of direct replies each top-level comment has on post 'P200'.", "sql": null }, { "role": "assistant", "content": "SELECT c.comment_id, COUNT(r.comment_id) AS reply_count FROM comments AS c LEFT JOIN comments AS r ON r.parent_comment_id = c.comm...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.hashtags ( hashtag_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all hashtags created after '2024-06-01', showing hashtag_id and tag_name.", "sql": null }, { "role": "assistant", "content": "SELECT hashtag_id, tag_name\nFROM social_media.hashtags\nWHERE created_at > '2024-06-01';", "sql": null }, { "role": "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 transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "For each trip, provide the trip_id, the total fuel quantity refueled, and the number of refueling events that occurred during the trip.", "sql": null }, { "role": "assistant", "content": "SELECT trip_id, SUM(quantity) AS total_fuel_quantity, COUNT(*) AS refuel_e...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.passengers ( passenger_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Show the first and last name of each passenger along with the total number of bookings they have made.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, COUNT(b.booking_id) AS booking_count FROM transportation.passengers p LEF...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.staff ( staff_id text, property_id text, first_name text, las...
[ { "role": "user", "content": "Show the number of staff members in each position and the average access level, grouping by position.", "sql": null }, { "role": "assistant", "content": "SELECT position,\n COUNT(*) AS staff_count,\n AVG(access_level) AS avg_access_level\nFROM hospit...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "Show me the date of birth and email for all passengers.", "sql": null }, { "role": "assistant", "content": "SELECT date_of_birth, email FROM transportation.passengers;", "sql": null }, { "role": "user", "content": "Can you also include their phon...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "Show the policy number, policy start date, and the name and type of the insurance product for all active policies.", "sql": null }, { "role": "assistant", "content": "SELECT p.policy_number, p.start_date, ip.product_name, ip.product_type FROM insurance.policies ...
You are an expert in writing database language. You can write a corresponding 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 train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "Can you assist me in finding all staff members assigned to schedules for a specific route with route_id 'RT456', including the train details and schedule status?", "sql": null }, { "role": "assistant", "content": "SELECT st.staff_id, st.first_name, st.last_name,...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.employees ( employee_id.text, agency_id.text, first_name.text, l...
[ { "role": "user", "content": "For each access level, count the number of employees. Return access_level and the corresponding employee_count.", "sql": null }, { "role": "assistant", "content": "SELECT access_level, COUNT(*) AS employee_count FROM government_services.employees GROUP BY access...
You are an expert in writing database language. You can write a corresponding 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, --...
[ { "role": "user", "content": "List all reservations that have made multiple payment transactions. Return reservation_id and payment_id for each occurrence.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT p1.reservation_id, p1.payment_id\nFROM hospitality_technology.paymen...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_...
[ { "role": "user", "content": "I need to find users who follow both 'U100' and 'U200'. Show the follower_user_id and the creation dates of both follow events.", "sql": null }, { "role": "assistant", "content": "SELECT f1.follower_user_id,\n f1.created_at AS follow_u100_at,\n f2.cr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "Show the full name and contact email of citizens who have submitted at least one application for services that are currently inactive.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id.uuid, player_id.uuid, game_id.uuid, ser...
[ { "role": "user", "content": "How many servers are in each region, and what's the average number of current players for those servers?", "sql": null }, { "role": "assistant", "content": "SELECT\n region,\n COUNT(server_id) AS server_count,\n AVG(current_players) AS average_current_players...
You are an expert in writing database language. You can write a corresponding 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. You can write a corresponding 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, their type names, and base rates for rooms located on floor 5.", "sql": null }, { "role": "assistant", "content": "SELECT T1.room_number, T2.type_name, T2.base_rate FROM hospitality_technology.rooms AS T1 JOIN hospitality_technology.room_t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser...
[ { "role": "user", "content": "Can you show me each player's total number of achievements unlocked and the total quantity of items they have in inventory for each game they've played?", "sql": null }, { "role": "assistant", "content": "SELECT pa.player_id, a.game_id, COUNT(DISTINCT pa.achieve...
You are an expert in writing database language. You can write a corresponding 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, find the next appointment after each one. Return patient_id, appointment_id AS current_appointment, next_appointment_id, and waiting_time in minutes.", "sql": null }, { "role": "assistant", "content": "SELECT a.patient_id,\n a.appointment...
You are an expert in writing database language. You can write a corresponding 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.appointments ( appointment_id text, client_id text, lawyer_id text, c...
[ { "role": "user", "content": "List all appointments for the client with ID 'client_001' showing the lawyer's ID, appointment subject, and start time.", "sql": null }, { "role": "assistant", "content": "SELECT a.lawyer_id, a.subject, a.start_time\nFROM legal_services.appointments a\nWHERE 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 social_media.follows ( follow_id character varying(64) NOT NULL, follower_user_id ch...
[ { "role": "user", "content": "Can you find all mutual follows in the system by joining the table with itself? For each mutual follow, show both user IDs and the date when the follow occurred.", "sql": null }, { "role": "assistant", "content": "SELECT f1.follower_user_id AS user_a, f1.followi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url...
[ { "role": "user", "content": "List all posts where the content mentions 'meeting'.", "sql": null }, { "role": "assistant", "content": "SELECT post_id, user_id, content, created_at FROM social_media.posts WHERE content LIKE '%meeting%'", "sql": null }, { "role": "user", "conte...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, docum...
[ { "role": "user", "content": "Give me the case_id and the count of appointments and documents for each case where at least one appointment exists.", "sql": null }, { "role": "assistant", "content": "SELECT a.case_id, COUNT(DISTINCT a.appointment_id) AS appointment_count, COUNT(DISTINCT d.doc...