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 gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id....
[ { "role": "user", "content": "List all pairs of games developed by the same developer, returning developer_id, title of the first game, and title of the second game.", "sql": null }, { "role": "assistant", "content": "SELECT g1.developer_id, g1.title AS game1, g2.title AS game2\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 gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(...
[ { "role": "user", "content": "Can you show me the number of items per rarity and item type combination, along with the minimum and maximum cost for each group?", "sql": null }, { "role": "assistant", "content": "SELECT item_type, rarity, COUNT(*) AS num_items, MIN(cost_amount) AS min_cost, 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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name....
[ { "role": "user", "content": "Show the job title, first name, and last name of all employees who were hired before 2010-01-01.", "sql": null }, { "role": "assistant", "content": "SELECT job_title, first_name, last_name\nFROM government_services.employees\nWHERE hire_date < '2010-01-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 cex_token_balance ( snapshot_time.text, chain.text, address.text, exchange.text, tok...
[ { "role": "user", "content": "How many unique tokens are recorded for each chain in the latest snapshot in cex_token_balance?", "sql": null }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT MAX(snapshot_time) AS max_time FROM cex_token_balance\n)\nSELECT \n chain, \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.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number...
[ { "role": "user", "content": "Get all appointments scheduled in the next 7 days, showing the appointment_id, start_time, end_time, subject, and associated case_name. Only include appointments with status 'Scheduled', and sort by start_time ascending.", "sql": null }, { "role": "assistant", "...
You are an expert in writing database language. You can write a corresponding 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 character varying(100) NOT NULL, -- the user's address ...
[ { "role": "user", "content": "Show the top 3 addresses by ROI on the Polygon chain, including profit and the most profitable token.", "sql": null }, { "role": "assistant", "content": "SELECT address, roi, profit, most_profit_token FROM smart_money_profit WHERE chain = 'Polygon' ORDER BY roi ...
You are an expert in writing database language. You can write a corresponding 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, -- unique iden...
[ { "role": "user", "content": "Find the username, email, and total number of orders placed by each user.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, u.email, COUNT(o.order_id) AS order_count\nFROM trading_platform.users u\nLEFT JOIN trading_platform.wallets w ON u.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 social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "List the usernames and user IDs of all users whose bio contains the word 'developer'.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, username\nFROM social_media.users\nWHERE bio ILIKE '%developer%';", "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.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte...
[ { "role": "user", "content": "List all hashtag names and their creation dates.", "sql": null }, { "role": "assistant", "content": "SELECT tag_name, created_at FROM social_media.hashtags;", "sql": null }, { "role": "user", "content": "Please only include hashtags created in th...
You are an expert in writing database language. You can write a corresponding 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": "Show all medical records with the record_id, record_date, the patient's insurance policy_number, and the doctor's ID, for records linked to a currently active insurance policy.", "sql": null }, { "role": "assistant", "content": "SELECT mr.record_id, mr.record_da...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,...
[ { "role": "user", "content": "特定の組み立てラインに割り当てられた従業員とそのラインの手順情報を取得したいです。従業員ID、名前、職種と手順名、手順番号を含めてください。", "sql": null }, { "role": "assistant", "content": "db.employees.aggregate([\n { $match: { assigned_line_id: '<specific_line_id>' } },\n { $lookup: {\n from: 'assembly_steps',\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": "Show the average base rate and maximum occupancy of room types grouped by property_type.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_type,\n AVG(rt.base_rate) AS avg_base_rate,\n MAX(rt.max_occupancy) AS max_occupancy\nFR...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.loans ( loan_id character varying(64) NOT NULL, account_id charac...
[ { "role": "user", "content": "Show me all active loans (loan_id, loan_type, principal_amount) where the remaining term is less than 6 months, along with their account_id and monthly_payment.", "sql": null }, { "role": "assistant", "content": "SELECT loan_id, loan_type, principal_amount, acco...
You are an expert in writing database language. You can write a corresponding 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": "What are the top five most recently uploaded documents, including document_id, document_name, and upload_timestamp?", "sql": null }, { "role": "assistant", "content": "SELECT document_id, document_name, upload_timestamp\nFROM legal_services.documents\nORDER BY 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.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri...
[ { "role": "user", "content": "For each pair of origin and destination location IDs, show the number of completed trips between them.", "sql": null }, { "role": "assistant", "content": "SELECT origin_location_id, destination_location_id, COUNT(*) AS completed_trip_count FROM transportation.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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ...
[ { "role": "user", "content": "List all pairs of tokens on the same chain where one has positive net_flow and another has negative net_flow, showing their symbols and net_flows.", "sql": null }, { "role": "assistant", "content": "SELECT a.chain,\n a.token_symbol AS token_pos,\n a....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number contain...
[ { "role": "user", "content": "For each Bitcoin token tick, show me the creator address from the token_info_bitcoin table and the number of unique wallets currently holding that token.", "sql": null }, { "role": "assistant", "content": "SELECT ti.tick, ti.creator, COUNT(DISTINCT tb.wallet_add...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Count the number of active services provided by each agency. Show the agency name and the count.", "sql": null }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(s.service_id) AS active_service_count FROM government_services.agencies AS a JOIN gov...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre...
[ { "role": "user", "content": "List the first and last names, email, and loyalty program ID of all passengers who joined after January 1, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email, loyalty_program_id\nFROM transportation.passengers\nWHERE 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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco...
[ { "role": "user", "content": "List narratives that have a 24-hour trading volume exceeding $50,000,000 and include at least 100 distinct tokens. Show the narrative name, volume, and token count.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, volume_24h, token_num FROM ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t...
[ { "role": "user", "content": "List all wallets that were created during the hour of the day which saw the highest number of wallet creations. Show the wallet ID, user ID, address, and creation timestamp.", "sql": null }, { "role": "assistant", "content": "WITH HourlyCounts AS (\n SELECT 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "I need to list the top 5 ERC20 tokens by total supply, including symbol, contract_address, and name.", "sql": null }, { "role": "assistant", "content": "SELECT tm.contract_address, tm.symbol, tm.name, CAST(tm.total_supply AS DECIMAL) AS total_supply\nFROM token_...
You are an expert in writing database language. You can write a corresponding 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": "List all documents uploaded in July 2024, including their document_name, document_type, and upload_timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT document_name, document_type, upload_timestamp FROM legal_services.documents WHERE upload_tim...
You are an expert in writing database language. You can write a corresponding 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 a list of clients whose status is 'inactive', including their first and last name, email, phone, and date registered.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email, phone, date_registered\nFROM legal_services.client...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i...
[ { "role": "user", "content": "What is the total amount paid by each customer? Show the customer_id and the sum of amount_paid.", "sql": null }, { "role": "assistant", "content": "SELECT customer_id, SUM(amount_paid) FROM insurance.premium_payments GROUP BY customer_id;", "sql": null },...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and have a daily trading volume exceeding 1 million shares, along with the account details (account_id, account_number, balance) of customers who hold these securities in 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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par...
[ { "role": "user", "content": "Which users have commented on posts created by the users they follow? Please show the commenter user_ids and the followed user_ids.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.user_id AS commenter_user_id, f.following_user_id AS followe...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, national_id_number text,...
[ { "role": "user", "content": "Show the appointment ID, scheduled start time, and the full name of the citizen for all appointments related to services with a standard fee greater than 150.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id, a.scheduled_start_time, 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 gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr...
[ { "role": "user", "content": "Get name pairs of achievements for each game where one is hidden and the other is visible.", "sql": null }, { "role": "assistant", "content": "SELECT a.achievement_id AS hidden_achievement_id, a.name AS hidden_name, b.achievement_id AS visible_achievement_id, b....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci...
[ { "role": "user", "content": "For claims reported after January 1st, 2024, show the claim ID, incident date, the policy number associated, and the full name of the agent who handled each claim.", "sql": null }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, p.policy_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 healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, gener...
[ { "role": "user", "content": "Show me each generic_name and the number of medications with that generic_name, sorted by the highest count first.", "sql": null }, { "role": "assistant", "content": "SELECT generic_name, COUNT(*) AS medication_count FROM healthcare.medications GROUP BY generic_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT ...
[ { "role": "user", "content": "Find pairs of achievements unlocked by the same player where the first unlock happened before the second.", "sql": null }, { "role": "assistant", "content": "SELECT pa1.player_id,\n pa1.achievement_id AS ach1,\n pa2.achievement_id AS ach2,\n 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "List the names of services and the total number of times each service has been ordered. Only include services that have been ordered at least once.", "sql": null }, { "role": "assistant", "content": "SELECT T1.service_name, count(T2.order_id) AS order_count 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 hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text,...
[ { "role": "user", "content": "Show me all room types with 'King' in the bed_type field, along with their property IDs and base rates.", "sql": null }, { "role": "assistant", "content": "SELECT room_type_id, property_id, type_name, bed_type, base_rate FROM hospitality_technology.room_types 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 government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "For all appointments scheduled after '2024-07-01', list the appointment ID, the full name of the citizen, the location name, and the city.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id,\n CONCAT(c.first_name, ' ', c.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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex...
[ { "role": "user", "content": "Which transaction_id has the highest total value transferred? Show the transaction_id and the sum of values for that transaction.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, SUM(value) AS total_transaction_value FROM web3.token_tra...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE nft_holders ( block_number.bigint, contract_address.text, wallet_address.text, token...
[ { "role": "user", "content": "List all token transfers from address '0xsend...' in the token_activities table, showing the tick, amt, and to_address.", "sql": null }, { "role": "assistant", "content": "SELECT tick, amt, to_address FROM token_activities WHERE from_address = '0xsend...';", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti...
[ { "role": "user", "content": "Show me the contract address and symbol for all ERC20 tokens that have at least one approval recorded.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT ea.contract_address, tm.symbol\nFROM erc20_approval ea\nLEFT JOIN token_prices_latest tm ON...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id text, first_name text, last_name text, agency_name text,...
[ { "role": "user", "content": "How many agents were hired in the year 2023?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS agents_hired_2023 FROM insurance.agents WHERE hire_date BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t...
[ { "role": "user", "content": "Find pairs of wallets that were created at the exact same timestamp but are owned by different users. List the IDs of both wallets and the shared creation timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT\n w1.wallet_id AS wallet1_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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "Show me all clients whose company name contains 'Tech' and display their email and date of registration.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, company_name, email, date_registered FROM legal_services.clients WHERE comp...
You are an expert in writing database language. You can write a corresponding 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.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp tim...
[ { "role": "user", "content": "List all users along with the number of smart contracts created by wallets they own.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(sc.contract_id) AS contracts_created\nFROM blockchain.users u\nJOIN blockchain.wallets w ...
You are an expert in writing database language. You can write a corresponding 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.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text ) C...
[ { "role": "user", "content": "Which posts have been mentioned with at least one hashtag and also have users who joined the conversation corresponding to the post? Please show the post_id and the user_id of participants.", "sql": null }, { "role": "assistant", "content": "SELECT ph.post_id, 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 financial_services.loans ( loan_id text, account_id text, loan_type text, principal_...
[ { "role": "user", "content": "Show all loans with a maturity date in the next 60 days, along with their account_id, principal_amount, interest_rate, and maturity_date.", "sql": null }, { "role": "assistant", "content": "SELECT loan_id, account_id, principal_amount, interest_rate, maturity_da...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List the first name, last name, and the name of the law firm for all lawyers.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.firm_name FROM lawyers AS T1 JOIN law_firms AS T2 ON T1.firm_id = T2.firm_id", "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 social_media.conversations ( conversation_id.text, created_at.timestamp, last_messag...
[ { "role": "user", "content": "Get the count of unread 'message' notifications per group chat, showing conversation_id, group_name, and unread_message_notifications.", "sql": null }, { "role": "assistant", "content": "SELECT c.conversation_id,\n c.group_name,\n COUNT(n.notificatio...
You are an expert in writing database language. You can write a corresponding 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": "List all policies that expired in the last 30 days, along with their product IDs and premium amounts.", "sql": null }, { "role": "assistant", "content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE end_date BETWEEN DATE_SUB(CURRENT...
You are an expert in writing database language. You can write a corresponding 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": "List all messages that have not been read yet. Show the message_id, sender_user_id, and sent_at.", "sql": null }, { "role": "assistant", "content": "SELECT message_id, sender_user_id, sent_at FROM social_media.messages WHERE read_at IS 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 healthcare.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id...
[ { "role": "user", "content": "List the diagnosis ID, description, and diagnosis date for all non-chronic diagnoses recorded for patient 'pat123'.", "sql": null }, { "role": "assistant", "content": "SELECT diagnosis_id, description, diagnosis_date FROM healthcare.diagnoses WHERE patient_id = ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir...
[ { "role": "user", "content": "Count the number of policies issued in each calendar year, and show the year and the count.", "sql": null }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM issued_at), COUNT(*) FROM insurance.policies WHERE issued_at IS NOT NULL GROUP BY 1 ORDER 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 narrative_info (", "narrative character varying(512) NOT NULL, -- the id of na...
[ { "role": "user", "content": "List all tokens from the token_dexpool_info table with a liquidity over $10 million and a positive 6-hour price change percentage on the Ethereum chain.", "sql": null }, { "role": "assistant", "content": "SELECT token_name, token_symbol, liquidity, price_change_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "Show me the full names and email addresses of all customers who registered after January 1st, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM insurance.customers WHERE created_at > '2024-01-01';", "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 government_services.employees ( employee_id character varying(64) NOT NULL, agency_i...
[ { "role": "user", "content": "List the names of employees whose job title is the same as their manager's job title. Include the employee's first name, last name, their manager's first name, last name, and their shared job title.", "sql": null }, { "role": "assistant", "content": "SELECT T1.f...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_i...
[ { "role": "user", "content": "Can you give me the total number of appointments grouped by status?", "sql": null }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS total_appointments\nFROM healthcare.appointments\nGROUP BY status;", "sql": null }, { "role": "...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_nam...
[ { "role": "user", "content": "I need a summary of total traded volume and average price per unit by sector using the trades and securities tables for trades in the last 30 days.", "sql": null }, { "role": "assistant", "content": "SELECT\n s.sector,\n SUM(t.quantity) AS total_volume,\n AVG...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id text PRIMARY KEY, account_id text, ...
[ { "role": "user", "content": "List transactions where the description includes another transaction's reference_number, showing both transaction IDs and the referenced reference_number.", "sql": null }, { "role": "assistant", "content": "SELECT t1.transaction_id AS source_id, t2.transaction_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 social_media.comments ( comment_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Show me the content and creation time of comments made on posts authored by the user with ID 'user_X'.", "sql": null }, { "role": "assistant", "content": "SELECT T1.content, T1.created_at FROM social_media.comments AS T1 JOIN social_media.posts AS T2 ON T1.post_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te...
[ { "role": "user", "content": "Show all beneficiaries added in 2024. Include beneficiary_id, full name, relationship, percentage_share, and the added_at timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name || ' ' || last_name AS full_name, relations...
You are an expert in writing database language. You can write a corresponding 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 the contract address and total number of approvals for all ERC20 tokens from the erc20_approval table.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS total_approvals\nFROM erc20_approval\nGROUP BY contract_address;"...
You are an expert in writing database language. You can write a corresponding 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": "For service orders delivered in the last 30 days, show each guest's ID, first and last name, the count of service orders, and total spent.", "sql": null }, { "role": "assistant", "content": "SELECT so.guest_id,\n g.first_name,\n g.last_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 government_services.services ( service_id.text, agency_id.text, service_name.text, d...
[ { "role": "user", "content": "Find pairs of active services from the same agency where one service's average processing time is longer than the other's. Display the agency_id, the slower service name with its processing time, and the faster service name with its processing time.", "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 character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "Show the most recent maintenance service for each vehicle, including the vehicle's make and model.", "sql": null }, { "role": "assistant", "content": "SELECT m.vehicle_id, v.make, v.model, m.service_date, m.service_type, m.odometer_reading\nFROM transportation.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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,...
[ { "role": "user", "content": "Retrieve the document_id and file_name for all claim documents with file size larger than 1 MB, ordered by file size descending.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, file_name\nFROM insurance.claim_documents\nWHERE file_size_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "Show me the average daily price range (high minus low) and the total count of data points for each security type, based on the market data available.", "sql": null }, { "role": "assistant", "content": "SELECT s.security_type, AVG(md.high_price - md.low_price) AS...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "List all room numbers with their room type name and property name for rooms that have a Jacuzzi feature.", "sql": null }, { "role": "assistant", "content": "SELECT r.room_number, rt.type_name, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitalit...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id.text, customer_id.text, account_number.text...
[ { "role": "user", "content": "Summarize the total balance and average interest rate for each account type.", "sql": null }, { "role": "assistant", "content": "SELECT account_type, SUM(balance) AS total_balance, AVG(interest_rate) AS average_interest_rate FROM financial_services.accounts GROU...
You are an expert in writing database language. You can write a corresponding 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 the usernames and email addresses of users who have participated in any conversation.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM social_media.users AS T1 JOIN social_media.conversation_participants AS T2 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 hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text,...
[ { "role": "user", "content": "Can you list all the room types and their base rates along with the maximum occupancy for each property?", "sql": null }, { "role": "assistant", "content": "SELECT property_id, type_name, base_rate, max_occupancy FROM hospitality_technology.room_types;", "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 healthcare.appointments ( appointment_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Show me all appointments scheduled to last exactly 60 minutes.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, doctor_id, appointment_time, duration_minutes, status\nFROM healthcare.appointments\nWHERE duration_minutes = 60...
You are an expert in writing database language. You can write a corresponding 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 payments, including the associated reservation ID, guest's full name, payment amount, and timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT T1.payment_id, T1.reservation_id, T3.first_name, T3.last_name, T1.amount, T1.payment_timestam...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "Retrieve all active SUI coins with their owner, balance, symbol, and name.", "sql": null }, { "role": "assistant", "content": "SELECT sc.owner, sc.coin_type, sc.balance, scm.symbol, scm.name\nFROM sui_coins sc\nJOIN sui_coins_metadata scm ON sc.coin_type = scm.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.medical_records ( record_id text PRIMARY KEY, patient_id text, appointmen...
[ { "role": "user", "content": "Count the number of medical records created for each doctor, and list the doctor_id alongside their record count.", "sql": null }, { "role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS record_count FROM healthcare.medical_records GROUP BY doctor_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.developers ( developer_id uuid PRIMARY KEY, name text, country tex...
[ { "role": "user", "content": "Can you list each developer name alongside another developer from the same country?", "sql": null }, { "role": "assistant", "content": "SELECT d1.name AS dev1, d2.name AS dev2, d1.country\nFROM developers d1\nJOIN developers d2\n ON d1.country = d2.country\n A...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ...
[ { "role": "user", "content": "I want to know the average fuel quantity refueled per vehicle, grouped by vehicle_id.", "sql": null }, { "role": "assistant", "content": "SELECT fl.vehicle_id, AVG(fl.quantity) AS avg_quantity\nFROM transportation.fuel_logs fl\nGROUP BY fl.vehicle_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 legal_services.clients ( client_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Which clients have not had any appointments scheduled? Please list their first name, last name, and email.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, c.email\nFROM legal_services.clients c\nLEFT JOIN legal_services.appo...
You are an expert in writing database language. You can write a corresponding 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": "List customers who have more than one policy. Show the customer ID and the count of policies.", "sql": null }, { "role": "assistant", "content": "SELECT customer_id, COUNT(*) AS policy_count FROM insurance.policies GROUP BY customer_id HAVING COUNT(*) > 1;", ...
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_u...
[ { "role": "user", "content": "List the usernames of players who own at least one item from the game with title 'Game Title X'.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.username FROM players AS T1 INNER JOIN player_inventory AS T2 ON T1.player_id = T2.player_id 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 social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Which users have participated in conversations that are not group chats? Please show their usernames and the conversation IDs.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, cp.conversation_id\nFROM social_media.conversation_participants ...
You are an expert in writing database language. You can write a corresponding 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": "I need the case_number, client's full name, case_type, and status for all cases.", "sql": null }, { "role": "assistant", "content": "SELECT c.case_number,\n cl.first_name || ' ' || cl.last_name AS client_name,\n c.case_type,\n c.status\nFROM 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 Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str...
[ { "role": "user", "content": "Can you help me fetch the inventory details for components associated with a specific aircraft build, including the batch number, quantity, and warehouse location?", "sql": null }, { "role": "assistant", "content": "MATCH (ab:AircraftBuild {build_id: 'specific_b...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu...
[ { "role": "user", "content": "Which hashtags appear on the most posts? Return hashtag_id, tag_name, and the number of posts each hashtag is used in, sorted descending, limited to the top 3.", "sql": null }, { "role": "assistant", "content": "SELECT\n h.hashtag_id,\n h.tag_name,\n COUNT(ph...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Show each wallet address and the number of canceled orders it has, ordering the results by that count in descending order.", "sql": null }, { "role": "assistant", "content": "SELECT w.address,\n COUNT(o.order_id) AS canceled_orders\nFROM trading_platform.w...
You are an expert in writing database language. You can write a corresponding 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 wallet addresses and their amount holding more than 10,000 units of any ERC20 token.", "sql": null }, { "role": "assistant", "content": "SELECT wallet_address, contract_address, amount FROM erc20_balances WHERE CAST(amount AS numeric) > 10000;", "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 financial_services.trades ( trade_id character varying(64) NOT NULL, -- unique i...
[ { "role": "user", "content": "Which accounts have executed trades with a total value greater than 1,000,000?", "sql": null }, { "role": "assistant", "content": "SELECT account_id, SUM(total_amount) AS total_traded_amount\nFROM financial_services.trades\nGROUP BY account_id\nHAVING SUM(total_...
You are an expert in writing database language. You can write a corresponding 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 route type, count the distinct vehicles that have completed trips on those routes. Return type and vehicle_count, sorted by vehicle_count descending.", "sql": null }, { "role": "assistant", "content": "SELECT r.type,\n COUNT(DISTINCT t.vehicle_id)...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.users ( user_id.text, username.text, email.text, password_hash.text, created_at...
[ { "role": "user", "content": "For each user, show how many users registered after them. Return the user_id, username, and the count of later registrants.", "sql": null }, { "role": "assistant", "content": "SELECT u1.user_id, u1.username, COUNT(u2.user_id) AS later_user_count FROM web3.users ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_...
[ { "role": "user", "content": "Can you show me the total number of sessions and the average score for each server and each game combination?", "sql": null }, { "role": "assistant", "content": "SELECT server_id, game_id, COUNT(*) AS total_sessions, AVG(score) AS average_score FROM gaming_techn...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id.text, user_id.text, message.text, s...
[ { "role": "user", "content": "Could you provide the total number of notifications sent on each day?", "sql": null }, { "role": "assistant", "content": "SELECT DATE(sent_at), COUNT(*) FROM notifications GROUP BY DATE(sent_at) ORDER BY DATE(sent_at);", "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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu...
[ { "role": "user", "content": "How many users were registered in each month of 2024?", "sql": null }, { "role": "assistant", "content": "SELECT date_trunc('month', created_at) AS month, COUNT(*) AS user_count\nFROM social_media.users\nWHERE created_at >= '2024-01-01'\n AND created_at < '2025...
You are an expert in writing database language. You can write a corresponding 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.appointments ( appointment_id text, citizen_id text, employee_id...
[ { "role": "user", "content": "For each location, count the total number of appointments scheduled. Show the location name and the count.", "sql": null }, { "role": "assistant", "content": "SELECT T2.location_name, COUNT(T1.appointment_id) FROM government_services.appointments AS T1 JOIN loca...
You are an expert in writing database language. You can write a corresponding 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 Avalanche tokens where the circulating total supply is less than the maximum supply. Include tick, creator, max_supply, total_supply (sum of amount), and the difference between max_supply and total_supply.", "sql": null }, { "role": "assistant", "conten...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex...
[ { "role": "user", "content": "Show me the number of cases for each case_type that were closed in 2023.", "sql": null }, { "role": "assistant", "content": "SELECT case_type,\n COUNT(*) AS case_count\nFROM legal_services.cases\nWHERE date_closed BETWEEN '2023-01-01' AND '2023-12-31'\nGRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Show me the full name and job title for all employees who were hired in the last 3 years, along with the full name of their manager.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, e.job_title,...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty...
[ { "role": "user", "content": "List all claim documents where the description contains the word 'invoice'.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_name, description FROM insurance.claim_documents WHERE description ILIKE '%invoice%';", "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.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "List all usernames and their respective group chat names where they are participants.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, c.group_name \nFROM social_media.conversation_participants cp\nJOIN social_media.users u ON cp.user_id = ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Show me the product ID, name, and description for insurance products where the description contains the word 'policy'.", "sql": null }, { "role": "assistant", "content": "SELECT product_id, product_name, description 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 transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ...
[ { "role": "user", "content": "For each booking, list the booking_id, fare, and the total quantity of fuel consumed on its associated trip.", "sql": null }, { "role": "assistant", "content": "SELECT b.booking_id,\n b.fare,\n SUM(fl.quantity) AS total_fuel_quantity\nFROM transporta...
You are an expert in writing database language. You can write a corresponding 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, -- unique iden...
[ { "role": "user", "content": "Show for every asset the usernames of users who have both bought and sold that asset, along with the asset name.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT a.asset_id, a.name AS asset_name, u.username\nFROM trading_platform.assets a\nJOI...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, customer_id text, product_id text, ...
[ { "role": "user", "content": "List the first and last names of all agents who have sold policies of product type 'Auto', along with the name of the product they sold.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name, T3.product_name FROM insuran...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty...
[ { "role": "user", "content": "Find claims where documents were uploaded by more than one distinct user. Show the claim_id.", "sql": null }, { "role": "assistant", "content": "SELECT claim_id FROM insurance.claim_documents GROUP BY claim_id HAVING COUNT(DISTINCT uploaded_by) > 1;", "sql":...