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 legal_services.cases ( case_id text, case_number text, case_name text, client_id tex...
[ { "role": "user", "content": "Find all cases that were closed in the year 2022, showing their case name, case number, and date closed.", "sql": null }, { "role": "assistant", "content": "SELECT case_name, case_number, date_closed FROM legal_services.cases WHERE date_closed >= '2022-01-01' AN...
You are an expert in writing database language. You can write a corresponding 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": "List all pairs of vehicles from the same depot that have different fuel types. Include vehicle1_id, fuel_type1, vehicle2_id, fuel_type2, and the depot_id.", "sql": null }, { "role": "assistant", "content": "SELECT v1.vehicle_id AS vehicle1_id, v1.fuel_type AS fu...
You are an expert in writing database language. You can write a corresponding 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": "How many medications are listed per manufacturer? Return manufacturer and med_count for those with more than 10 medications.", "sql": null }, { "role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS med_count\nFROM healthcare.medications\nGROUP BY man...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "Retrieve trip_id and passenger full names for all trips where the passenger record was created before the scheduled departure.", "sql": null }, { "role": "assistant", "content": "SELECT t.trip_id, p.first_name || ' ' || p.last_name AS passenger_name\nFROM transp...
You are an expert in writing database language. You can write a corresponding 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": "I need the average capacity of vehicles for each fuel_type.", "sql": null }, { "role": "assistant", "content": "SELECT fuel_type,\n AVG(capacity) AS avg_capacity\nFROM transportation.vehicles\nGROUP BY fuel_type;", "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 CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "List the username, registration date, and address of all users who have created a wallet.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, u.created_at AS registration_date, w.address AS wallet_address\nFROM web3.users u\nJOIN web3.wallets ...
You are an expert in writing database language. You can write a corresponding 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": "List each property with the total number of active staff members and the average base rate of its room types.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, COUNT(s.staff_id) AS active_staff_count, ROUND(AVG(rt.base_ra...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ...
[ { "role": "user", "content": "How many achievements has each player unlocked and what's the earliest unlocked timestamp for each?", "sql": null }, { "role": "assistant", "content": "SELECT player_id,\n COUNT(*) AS total_unlocked,\n MIN(unlocked_at) AS first_unlocked\nFROM gaming_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id.text, property_id.text, type_name.t...
[ { "role": "user", "content": "Which room types offer both 'Sea View' and 'Balcony' amenities? Show their type names, property IDs, and base rates.", "sql": null }, { "role": "assistant", "content": "SELECT type_name, property_id, base_rate FROM hospitality_technology.room_types WHERE ameniti...
You are an expert in writing database language. You can write a corresponding 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 the usernames and full names of users who are followed by someone with a verified account.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT u2.username, u2.full_name\nFROM social_media.users u1\nJOIN social_media.follows f ON u1.user_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 insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha...
[ { "role": "user", "content": "Show me all documents uploaded in 2024 that do not have a description.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, file_name, uploaded_at\nFROM insurance.claim_documents\nWHERE uploaded_at >= '2024-01-01'\n AND uploaded_at < '2025-01...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id tex...
[ { "role": "user", "content": "Show the invoice_id and total hours logged for each invoice.", "sql": null }, { "role": "assistant", "content": "SELECT invoice_id, SUM(hours_spent) AS total_hours FROM legal_services.time_entries WHERE invoice_id IS NOT NULL GROUP BY invoice_id;", "sql": nu...
You are an expert in writing database language. You can write a corresponding 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": "List all pairs of token transfers where the sender is the same but the recipients differ. Show both transfer IDs and the common sender address.", "sql": null }, { "role": "assistant", "content": "SELECT t1.transfer_id AS transfer_id_1, t2.transfer_id AS transfer...
You are an expert in writing database language. You can write a corresponding 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 full name, specialization, and firm name for all lawyers who are not partners.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T1.specialization, T2.firm_name FROM lawyers AS T1 JOIN law_firms AS T2 ON T1.firm_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.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_...
[ { "role": "user", "content": "List pairs of distinct servers that share the same ip_address. Show server1_name, server2_name, and the shared ip_address.", "sql": null }, { "role": "assistant", "content": "SELECT s1.server_name AS server1_name,\n s2.server_name AS server2_name,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.kyc_audit ( kyc_audit_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Show me all KYC audit records for user ID 'user_abc_123'.", "sql": null }, { "role": "assistant", "content": "SELECT kyc_audit_id, user_id, status, reviewed_at FROM kyc_audit WHERE user_id = 'user_abc_123';", "sql": null }, { "role": "user", "con...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.documents ( document_id character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "Provide a count of appointments grouped by the booking method.", "sql": null }, { "role": "assistant", "content": "SELECT booking_method, COUNT(*) AS appointment_count FROM government_services.appointments GROUP BY booking_method;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id charac...
[ { "role": "user", "content": "List every diagnosis description paired with every insurance plan's website.", "sql": null }, { "role": "assistant", "content": "SELECT T1.description, T2.website FROM healthcare.diagnoses AS T1 CROSS JOIN healthcare.insurance_plans AS T2;", "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.vehicles ( vehicle_id text, license_plate text, vin text, make text, ...
[ { "role": "user", "content": "For each vehicle, show vehicle_id, make, model, the earliest and latest fuel log IDs with their timestamps.", "sql": null }, { "role": "assistant", "content": "WITH extremes AS (\n SELECT vehicle_id,\n MIN(log_timestamp) AS first_ts,\n MAX(log_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 financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "List each customer's account in one currency along with another account in a different currency, showing customer_id, account_primary, currency_primary, account_secondary, and currency_secondary.", "sql": null }, { "role": "assistant", "content": "SELECT a.custo...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, route_number text, description te...
[ { "role": "user", "content": "Show all maintenance logs with the vehicle ID, service date, service type, and the name and city of the location where the vehicle's most recent fueling occurred.", "sql": null }, { "role": "assistant", "content": "SELECT ml.log_id, ml.vehicle_id, ml.service_dat...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "List the usernames and email addresses of users who have participated in group chats, along with the names of those group chats.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, u.email, c.group_name\nFROM social_media.users u\nJOIN social_...
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 schedule of trains arriving at station with ID 'ST789' tomorrow?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide the train schedule for station ID 'ST789' as this information is not available in the current database...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p...
[ { "role": "user", "content": "Show item_id, item_name, and the damage attribute extracted from attributes JSON for items of type 'Weapon'.", "sql": null }, { "role": "assistant", "content": "SELECT item_id,\n item_name,\n (attributes->>'damage')::numeric AS damage\nFROM gaming_te...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri...
[ { "role": "user", "content": "Find narratives with a market cap greater than $500,000,000 and a 7-day price change percentage above 5%. Show the narrative, market_cap, and price_change_percentage_7d.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, market_cap, price_chan...
You are an expert in writing database language. You can write a corresponding 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 liked a post and the content of the post they liked.", "sql": null }, { "role": "assistant", "content": "SELECT T1.username, T2.content FROM social_media.users AS T1 JOIN social_media.likes AS T3 ON T1.user_id = T3.user_id JO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Show the count of services available for each category.", "sql": null }, { "role": "assistant", "content": "SELECT category, COUNT(service_id) AS service_count FROM government_services.services GROUP BY category;", "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": "List all drivers along with the make and model of each vehicle they have been assigned to for trips.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT d.driver_id, d.first_name || ' ' || d.last_name AS driver_full_name, v.make, v.model\nFROM 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": "List all employees and the branch they work at, along with their job title and department.", "sql": null }, { "role": "assistant", "content": "SELECT employee_id, first_name || ' ' || last_name AS full_name, job_title, department, branch_id\nFROM financial_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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "List all rooms along with their room type names and base rates for rooms that are currently 'Available'.", "sql": null }, { "role": "assistant", "content": "SELECT r.room_id, r.room_number, rt.type_name, rt.base_rate\nFROM hospitality_technology.rooms r\nJOIN 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 social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Find the latest three posts with their content and posting users' full names.", "sql": null }, { "role": "assistant", "content": "SELECT p.content, u.full_name, p.created_at\nFROM social_media.posts p\nJOIN social_media.users u ON p.user_id = u.user_id\nORDER BY...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name te...
[ { "role": "user", "content": "I need to find every offline server alongside an online server in the same region.", "sql": null }, { "role": "assistant", "content": "SELECT s_off.server_id AS offline_id,\n s_on.server_id AS online_id\nFROM gaming_technology.servers s_off\nJOIN gaming_te...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id text, contract_id text, event_name text, data text, emitted_a...
[ { "role": "user", "content": "For each wallet, show the wallet address and the total value of tokens they have received across all token transfers.", "sql": null }, { "role": "assistant", "content": "SELECT w.address, COALESCE(SUM(tt.value), 0) AS total_received_value\nFROM web3.wallets w\nL...
You are an expert in writing database language. You can write a corresponding 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.text, follower_user_id.text, following_user_id.text...
[ { "role": "user", "content": "How many users have followed more than one person in total?", "sql": null }, { "role": "assistant", "content": "SELECT follower_user_id, COUNT(DISTINCT following_user_id) AS following_count\nFROM social_media.follows\nGROUP BY follower_user_id\nHAVING COUNT(DIST...
You are an expert in writing database language. You can write a corresponding 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, username character vary...
[ { "role": "user", "content": "List all posts that have never received a comment. Return post_id and user_id.", "sql": null }, { "role": "assistant", "content": "SELECT p.post_id, p.user_id FROM social_media.posts p WHERE NOT EXISTS (SELECT 1 FROM social_media.comments c WHERE c.post_id = 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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "Retrieve the guest and property pairs where the guest lives in the same state as the property. Show guest_id, first_name, last_name, property_id, property_name.", "sql": null }, { "role": "assistant", "content": "SELECT g.guest_id,\n g.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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h...
[ { "role": "user", "content": "List all users who have sent messages containing media files in group conversations, showing their username, email, and the group name.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email, c.group_name\nFROM social_media.messa...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.messages ( message_id.text, conversation_id.text, sender_user_id.text, ...
[ { "role": "user", "content": "How many unread messages does each sender have? Show sender_user_id and count of messages where read_at is null.", "sql": null }, { "role": "assistant", "content": "SELECT sender_user_id, COUNT(*) AS unread_messages\nFROM social_media.messages\nWHERE read_at IS ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str...
[ { "role": "user", "content": "我想查询某个飞机型号的所有构建信息,包括构建的开始日期、预计完成日期以及所在的装配线名称和位置。", "sql": null }, { "role": "assistant", "content": "MATCH (am:AircraftModel)-[:IS_MODEL]-(ab:AircraftBuild)-[:ASSEMBLED_ON]->(al:AssemblyLine)\nWHERE am.model_id = 'specific_model_id'\nRETURN ab.build_id, ab.build...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.wallets ( wallet_id character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "Show me all wallet addresses along with their private keys for users who have more than 3 wallets.", "sql": null }, { "role": "assistant", "content": "SELECT w.address_id, w.private_key FROM blockchain.wallets w WHERE w.user_id IN (SELECT user_id FROM blockchain...
You are an expert in writing database language. You can write a corresponding 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 appointments handled by lawyers from law firms founded after 2015, showing the appointment subject and the lawyer's firm name.", "sql": null }, { "role": "assistant", "content": "SELECT a.subject, f.firm_name\nFROM legal_services.appointments a\nJOIN le...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w...
[ { "role": "user", "content": "Show me the names and phone numbers of all law firms founded in the same city.", "sql": null }, { "role": "assistant", "content": "SELECT lf1.firm_name AS firm1_name, lf1.phone AS firm1_phone, lf2.firm_name AS firm2_name, lf2.phone AS firm2_phone, lf1.address \n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.ti...
[ { "role": "user", "content": "Find beneficiaries with percentage_share above 50% for policies that have any claim with estimated_loss greater than 20000. Show beneficiary_id, first_name, last_name, and policy_id.", "sql": null }, { "role": "assistant", "content": "SELECT pb.beneficiary_id, 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 trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "Show the details of all UTXOs with an amount greater than 5, ordered by amount descending.", "sql": null }, { "role": "assistant", "content": "SELECT utxo_id, transaction_id, output_index, address, amount, spent\nFROM trading_platform.utxos\nWHERE amount > 5\nOR...
You are an expert in writing database language. You can write a corresponding 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 each user's username along with the number of posts they've made that include any media attachment, ordering the results by that count descending.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, COUNT(p.post_id) AS media_post_count\nF...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci...
[ { "role": "user", "content": "What is the total estimated loss for all claims reported in the year 2024?", "sql": null }, { "role": "assistant", "content": "SELECT SUM(estimated_loss) FROM insurance.claims WHERE EXTRACT(YEAR FROM reported_date) = 2024;", "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": "For each account, show account_number, customer_id, and the count of other accounts the same customer has.", "sql": null }, { "role": "assistant", "content": "SELECT a.account_number, a.customer_id, COUNT(b.account_id) AS other_account_count FROM financial_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 healthcare.medical_records ( record_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "For each doctor, count how many medical record entries they have created and show the doctor_id alongside the record count.", "sql": null }, { "role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS record_count\nFROM healthcare.medical_records\nGROUP BY ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ...
[ { "role": "user", "content": "List all fuel log entries with their associated trip's route_number and the vehicle's license_plate where the total_cost exceeds 200, sorted by total_cost descending.", "sql": null }, { "role": "assistant", "content": "SELECT fl.*, t.route_id, r.route_number, v....
You are an expert in writing database language. You can write a corresponding 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 me the total unbilled billable hours per lawyer.", "sql": null }, { "role": "assistant", "content": "SELECT lawyer_id, SUM(hours_spent) AS total_unbilled_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\n AND is_billed = FALSE\nGROUP BY la...
You are an expert in writing database language. You can write a corresponding 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 names and contact emails of all citizens who have made payments for applications assigned to employees with the job title 'Supervisor'.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text...
[ { "role": "user", "content": "Find all pairs of doctors who share the same specialty. Display d1.doctor_id, d1.first_name, d1.last_name, d2.doctor_id, d2.first_name, d2.last_name, and the specialty.", "sql": null }, { "role": "assistant", "content": "SELECT d1.doctor_id AS doctor1_id, d1.fir...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id text, property_id text, service_name te...
[ { "role": "user", "content": "Show me all services that have a price above 100, including their service_id, service_name, and category.", "sql": null }, { "role": "assistant", "content": "SELECT service_id, service_name, category\nFROM hospitality_technology.services\nWHERE price > 100;", ...
You are an expert in writing database language. You can write a corresponding 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 all document names and their types.", "sql": null }, { "role": "assistant", "content": "SELECT document_name, document_type FROM documents;", "sql": null }, { "role": "user", "content": "Only include documents of type 'Contract' and with ver...
You are an expert in writing database language. You can write a corresponding 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 the names and emails of all guests who have communication consent enabled.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM hospitality_technology.guests WHERE communication_consent = TRUE;", "sql": null }, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco...
[ { "role": "user", "content": "List all tokens held by CEX addresses, showing the token symbol, name, current price, and the total USD value held by all CEXes for that token.", "sql": null }, { "role": "assistant", "content": "SELECT T1.token_symbol, T1.token_name, T1.price, SUM(T2.usd_value)...
You are an expert in writing database language. You can write a corresponding 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 property pairs that share the same postal_code, showing each pair's property IDs, names, and the postal_code.", "sql": null }, { "role": "assistant", "content": "SELECT a.property_id AS property_id_1,\n a.property_name AS property_name_1,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identif...
[ { "role": "user", "content": "Calculate the total and average premium amounts for policies that are currently Active.", "sql": null }, { "role": "assistant", "content": "SELECT SUM(premium_amount) AS total_premium,\n AVG(premium_amount) AS average_premium\nFROM insurance.policies\nWHER...
You are an expert in writing database language. You can write a corresponding 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, token_id characte...
[ { "role": "user", "content": "Find all addresses that have both received and sent transfers of the same token. List the address and the token ID for each such instance.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT t1.to_address AS address, t1.token_id FROM web3.token_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 healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id...
[ { "role": "user", "content": "Find all unique diagnosis codes that are associated with more than one doctor, and show how many doctors are linked to each code.", "sql": null }, { "role": "assistant", "content": "SELECT diagnosis_code, COUNT(DISTINCT doctor_id) AS doctor_count FROM healthcare...
You are an expert in writing database language. You can write a corresponding 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": "Show a list of departments with more than 5 employees. Include the department name and the count.", "sql": null }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS employee_count\nFROM government_services.employees\nGROUP BY department\nHAVING 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 healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ...
[ { "role": "user", "content": "Show all doctors whose license number starts with 'MD', including their ID, first name, and last name.", "sql": null }, { "role": "assistant", "content": "SELECT doctor_id, first_name, last_name FROM healthcare.doctors WHERE license_number LIKE 'MD%';", "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 social_media.messages ( message_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List the content and sent time for messages sent by user 'U101'.", "sql": null }, { "role": "assistant", "content": "SELECT content, sent_at FROM social_media.messages WHERE sender_user_id = 'U101';", "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.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_...
[ { "role": "user", "content": "Show me a list of comments and the names of hashtags associated with the posts those comments are on.", "sql": null }, { "role": "assistant", "content": "SELECT T1.comment_id, T3.tag_name FROM comments AS T1 JOIN post_hashtags AS T2 ON T1.post_id = T2.post_id JO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t...
[ { "role": "user", "content": "List each user along with the wallet_id of their first created wallet.", "sql": null }, { "role": "assistant", "content": "SELECT\n m.user_id,\n w.wallet_id AS first_wallet_id\nFROM (\n SELECT user_id, MIN(created_at) AS first_created_at\n FROM web3.wallets\...
You are an expert in writing database language. You can write a corresponding 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": "What is the average delivery time in hours for all delivered service orders?", "sql": null }, { "role": "assistant", "content": "SELECT AVG(EXTRACT(EPOCH FROM (so.delivery_timestamp - so.order_timestamp)) / 3600) AS avg_delivery_hours\nFROM hospitality_technolog...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_l...
[ { "role": "user", "content": "Show me the total fuel quantity and cost for each route, grouped by route number, only for trips that have associated fuel logs.", "sql": null }, { "role": "assistant", "content": "SELECT r.route_number, SUM(f.quantity) AS total_quantity, SUM(f.total_cost) AS to...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.messages ( message_id character varying(64) NOT NULL, conversation_id c...
[ { "role": "user", "content": "What is the total number of messages sent with a media URL?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.messages WHERE media_url 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 social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url...
[ { "role": "user", "content": "How many comments does each post have? Return the post_id and number of comments as comment_count.", "sql": null }, { "role": "assistant", "content": "SELECT post_id, COUNT(comment_id) AS comment_count\nFROM social_media.comments\nGROUP BY post_id;", "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 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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Display the username and the total number of wallets for each user.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, COUNT(w.wallet_id) AS wallet_count FROM trading_platform.users u LEFT JOIN trading_platform.wallets w ON u.user_id = w.user...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id text, patient_id text, appointment_id text, d...
[ { "role": "user", "content": "Count the total number of medical records where both assessment and treatment_plan fields are provided.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS total_records\nFROM healthcare.medical_records\nWHERE assessment IS NOT NULL AND treatm...
You are an expert in writing database language. You can write a corresponding 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.conversation_participants ( participant_id.text, conversation_id.text, ...
[ { "role": "user", "content": "Show me all participants who joined any conversation before January 1st, 2024. Return participant_id, user_id, conversation_id and the joined_at timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT participant_id, user_id, conversation_id, joine...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, player_id uuid, ...
[ { "role": "user", "content": "For each player, show their username and the total quantity of items they own in their inventory, alongside the total number of game sessions they have played.", "sql": null }, { "role": "assistant", "content": "SELECT T1.username, COALESCE(T2.total_item_quantit...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li...
[ { "role": "user", "content": "List all public review comments along with the full name of the guest who submitted the review.", "sql": null }, { "role": "assistant", "content": "SELECT T1.review_id, T2.first_name, T2.last_name, T1.comment FROM hospitality_technology.reviews AS T1 JOIN 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 hospitality_technology.service_orders ( order_id text, reservation_id text, guest_id...
[ { "role": "user", "content": "List all service orders with quantity greater than 1 and total price exceeding 50. Show order ID, guest ID, quantity, and total price.", "sql": null }, { "role": "assistant", "content": "SELECT order_id, guest_id, quantity, total_price FROM hospitality_technolog...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List the full names of citizens who have made payments for services in the 'Transportation' category, showing the payment amount and the service name.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.amount, T3.service_n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "Show me the make and model of vehicles used on routes longer than 150 kilometers, and include the route number.", "sql": null }, { "role": "assistant", "content": "SELECT v.make, v.model, r.route_number \nFROM transportation.trips t\nJOIN transportation.vehicles...
You are an expert in writing database language. You can write a corresponding 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": "Find all pairs of drivers who have the same license expiry date. For each pair, provide both driver_ids, full names, and the shared expiry date.", "sql": null }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver1_id, d1.first_name || ' ' || d1.las...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, route_number text, description te...
[ { "role": "user", "content": "Find all bookings for which the special_requests field is not null. Show the booking ID, passenger ID, and the special request.", "sql": null }, { "role": "assistant", "content": "SELECT booking_id, passenger_id, special_requests\nFROM transportation.bookings\nW...
You are an expert in writing database language. You can write a corresponding 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, claim_id cha...
[ { "role": "user", "content": "How many documents exist for each document_type? Return document_type and the count.", "sql": null }, { "role": "assistant", "content": "SELECT document_type,\n COUNT(*) AS document_count\nFROM insurance.claim_documents\nGROUP BY document_type;", "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 government_services.applications ( application_id character varying(64) NOT NULL, ci...
[ { "role": "user", "content": "Find the full names of employees who have verified documents that have an expiry date in the past and are marked as 'Verified'.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.employees 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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t...
[ { "role": "user", "content": "Find tokens that are currently trending (trend rank 10 or lower) and have a positive net flow from smart money addresses. Show their token symbol, chain, trend rank, and smart money net flow. Order the results by trend rank ascending.", "sql": null }, { "role": "ass...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te...
[ { "role": "user", "content": "Show me all policy beneficiaries who were added in the last 6 months, along with their full names and relationship to the policyholder.", "sql": null }, { "role": "assistant", "content": "SELECT beneficiary_id, policy_id, first_name, last_name, relationship, per...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the count of active insurance products for each product_type and order the results by the count descending.", "sql": null }, { "role": "assistant", "content": "SELECT product_type,\n COUNT(*) AS active_count\nFROM insurance.insurance_products\nWHE...
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 specific tools or equipment used during the maintenance with record_id 'REC456'?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about the specific tools or equipment used during a maintenance record. 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 text, property_name text, address_li...
[ { "role": "user", "content": "For each reservation, show me the guest's full name, the property name, and the room type name.", "sql": null }, { "role": "assistant", "content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS guest_full_name, p.property_name, rt.type_name 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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam...
[ { "role": "user", "content": "What was the total quantity and total cost of 'Gasoline' fuel logged in the year 2023?", "sql": null }, { "role": "assistant", "content": "SELECT SUM(quantity) , SUM(total_cost) FROM transportation.fuel_logs WHERE fuel_type = 'Gasoline' AND EXTRACT(YEAR 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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "List all pairs of drivers whose license_expiry_date falls in the same month and year. Display the first and last names of both drivers as driver1_first, driver1_last, driver2_first, driver2_last, and the shared year and month as expiry_year and expiry_month.", "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.rooms ( room_id.text, property_id.text, room_number.text, roo...
[ { "role": "user", "content": "Show me all rooms along with their current overall review rating for each room, including the room number and property id.", "sql": null }, { "role": "assistant", "content": "SELECT r.room_number, r.property_id, AVG(rv.rating_overall) AS average_overall_rating\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.staff ( staff_id text PRIMARY KEY, property_id text, first_na...
[ { "role": "user", "content": "Find all staff members who are managers and list their direct reports. Show the manager's first name, last name, and the direct report's first name, last name, and position.", "sql": null }, { "role": "assistant", "content": "SELECT m.first_name AS manager_first...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "For each customer, show the number of open accounts and their combined balance, joining the accounts table with itself on customer_id for demonstration.", "sql": null }, { "role": "assistant", "content": "SELECT a.customer_id, COUNT(a.account_id) AS open_account...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "Show medication ID, name, and description for medications manufactured by 'Novartis' where the generic name is missing.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name, description FROM healthcare.medications WHERE manuf...
You are an expert in writing database language. You can write a corresponding 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.servers ( server_id uuid, game_id uuid, server_name text, region t...
[ { "role": "user", "content": "For each game_id and region, show me the server that currently has the highest current_players and the server that has the highest max_players. Return game_id, region, top_current_server_id, top_current_players, top_capacity_server_id, and top_capacity.", "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_profit ( address text, rank numeric, profit numeric, roi numeric, realiz...
[ { "role": "user", "content": "For each chain, show the total number of smart money addresses and the count of addresses with positive profit.", "sql": null }, { "role": "assistant", "content": "SELECT chain, COUNT(address) AS total_addresses, COUNT(CASE WHEN profit > 0 THEN address END) AS 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "List all NFTs on the 'Ethereum' blockchain with a rarity score above 85. Show their name, contract address, token ID, and rarity score.", "sql": null }, { "role": "assistant", "content": "SELECT name, contract_address, token_id, rarity_score FROM nft_metadata WH...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "Show all trades that occurred after '2024-06-01', including the trade ID, quantity, price, and the name and symbol of the asset traded.", "sql": null }, { "role": "assistant", "content": "SELECT t.trade_id, t.quantity, t.price, a.name AS asset_name, a.symbol AS ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name te...
[ { "role": "user", "content": "Show me all servers that are currently full, meaning current players equals max players. List the server name, region, and max players.", "sql": null }, { "role": "assistant", "content": "SELECT server_name, region, max_players FROM gaming_technology.servers WHE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id text PRIMARY KEY, account_id text, ...
[ { "role": "user", "content": "Give me the total transaction amount and the total count of transactions per day for each currency.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_date::date AS txn_date, currency, SUM(amount) AS total_amount, COUNT(*) AS txn_count\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 social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_...
[ { "role": "user", "content": "Show me all replies to comments on post 'P500', including the reply content and the content of the parent comment.", "sql": null }, { "role": "assistant", "content": "SELECT T1.content AS reply_content, T2.content AS parent_comment_content FROM social_media.comm...