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 transportation.trips ( trip_id character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "List all unique pairs of origin and destination location IDs that have been used in trips, and count how many trips have occurred for each pair.", "sql": null }, { "role": "assistant", "content": "SELECT origin_location_id, destination_location_id, COUNT(*) AS t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date ti...
[ { "role": "user", "content": "Show me claims handled by agents whose commission rate is greater than 0.1, including the claim ID, incident date, and estimated loss.", "sql": null }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.incident_date, T1.estimated_loss FROM insurance.clai...
You are an expert in writing database language. You can write a corresponding 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.notifications ( notification_id text, citizen_id text, applicati...
[ { "role": "user", "content": "List all notifications sent through the 'Email' channel, showing all columns.", "sql": null }, { "role": "assistant", "content": "SELECT notification_id, citizen_id, application_id, message_subject, message_body, channel, sent_at, status, related_entity_type, re...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da...
[ { "role": "user", "content": "Show me for each loan_type, the total number of loans and the average principal_amount, along with the average account balance for the accounts associated with those loans.", "sql": null }, { "role": "assistant", "content": "SELECT l.loan_type, COUNT(l.loan_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 social_media.follows ( follow_id character varying(64) NOT NULL, follower_user_id ch...
[ { "role": "user", "content": "How many users is each user following? Provide follower_user_id and the count of followings.", "sql": null }, { "role": "assistant", "content": "SELECT follower_user_id, COUNT(*) AS following_count\nFROM social_media.follows\nGROUP BY follower_user_id;", "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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "List all contracts with status 'active' and include their deployment timestamp and network ID.", "sql": null }, { "role": "assistant", "content": "SELECT address, deployed_at, network_id FROM web3.contracts WHERE status = 'active';", "sql": null }, { ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,...
[ { "role": "user", "content": "Please list the agent ID, agent's name, and manager's email for all agents who have a commission_rate greater than 0.12.", "sql": null }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name || ' ' || a.last_name AS agent_name, m.contact_email AS 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.applications ( application_id.text, citizen_id.text, service_id....
[ { "role": "user", "content": "List all appointments along with their scheduled start time and the purpose, as well as the name of the location where each appointment is scheduled.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id, a.scheduled_start_time, a.purpose, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "I want a report of user IDs with their KYC status and the count of wallets they have.", "sql": null }, { "role": "assistant", "content": "SELECT k.user_id, k.status, COUNT(w.wallet_id) AS wallet_count\nFROM trading_platform.kyc_audit k\nLEFT JOIN trading_platfor...
You are an expert in writing database language. You can write a corresponding 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": "Which users have commented on posts that include hashtags? Show their user IDs and the hashtag IDs.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.user_id, ph.hashtag_id\nFROM social_media.comments c\nJOIN social_media.post_hashtags ph 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c...
[ { "role": "user", "content": "List all maintenance logs for vehicles that are currently active, showing the vehicle ID and service type.", "sql": null }, { "role": "assistant", "content": "SELECT m.vehicle_id, m.service_type FROM transportation.maintenance_logs m JOIN 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "Retrieve the product_id and product_name for all insurance products created after March 1, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT product_id, product_name\nFROM insurance.insurance_products\nWHERE created_at > '2024-03-01';", "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, username character vary...
[ { "role": "user", "content": "How many notifications have been sent by each sender? Show sender_user_id and notification count.", "sql": null }, { "role": "assistant", "content": "SELECT sender_user_id, COUNT(*) AS notification_count\nFROM social_media.notifications\nWHERE sender_user_id 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 CREATE TABLE trading_platform.trades ( trade_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "What is the average trade price for each asset for trades executed between '2024-05-01' and '2024-05-31'?", "sql": null }, { "role": "assistant", "content": "SELECT\n asset_id,\n AVG(price) AS avg_price\nFROM trading_platform.trades\nWHERE traded_at >= '2024-0...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "List all players with the games for which they've unlocked achievements, showing username, game title, and count of achievements unlocked per game.", "sql": null }, { "role": "assistant", "content": "SELECT p.username, g.title AS game_title, COUNT(pa.achievement...
You are an expert in writing database language. You can write a corresponding 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": "I would like a list of unread notifications, showing the recipient's username, the sender's full name, the notification_type, and the creation timestamp.", "sql": null }, { "role": "assistant", "content": "```sql\nSELECT\n n.notification_id,\n recipient.userna...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, reservation_id te...
[ { "role": "user", "content": "Get the total_quantity and total_revenue (sum of total_price) for each staff member who placed orders (staff_id_ordered).", "sql": null }, { "role": "assistant", "content": "SELECT staff_id_ordered,\n SUM(quantity) AS total_quantity,\n SUM(total_pric...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t...
[ { "role": "user", "content": "For each subscriber, count the number of insurance plans they have where the plan type is 'HMO'. Show the subscriber name and their count.", "sql": null }, { "role": "assistant", "content": "SELECT T1.subscriber_name, COUNT(T2.plan_id) FROM healthcare.patient_in...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam...
[ { "role": "user", "content": "List all drivers whose licenses are set to expire within the next 60 days, along with their full name, license number, and contact number.", "sql": null }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, license_number, contact_number...
You are an expert in writing database language. You can write a corresponding 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.nodes ( node_id character varying(64) NOT NULL, -- unique identifier...
[ { "role": "user", "content": "Find pairs of distinct nodes that share the same 'last_seen' timestamp but have different port numbers. Show the node IDs, ports, and the shared timestamp for each pair.", "sql": null }, { "role": "assistant", "content": "SELECT T1.node_id AS node1_id , T1.port...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "Show me all conversation IDs (whether group chat or not) that have at least one hashtag used in posts linked to them.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.conversation_id\nFROM social_media.conversations c\nJOIN social_media.post...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id text PRIMARY KEY, account_id text, ...
[ { "role": "user", "content": "I want to find pairs of transactions where one transaction’s related_account_id matches the other’s account_id, indicating reciprocal transfers between accounts.", "sql": null }, { "role": "assistant", "content": "SELECT t1.transaction_id AS outgoing_txn, t2.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 healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List all pairs of diagnoses that belong to the same medical record. Show record_id, diagnosis_id from the first entry as diag1_id, and diagnosis_id from the second entry as diag2_id.", "sql": null }, { "role": "assistant", "content": "SELECT d1.record_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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "Show policy number, cancellation date, and the customer's first and last name for policies cancelled due to 'Non-Payment'.", "sql": null }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.cancellation_date, T2.first_name, T2.last_name FROM policie...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ...
[ { "role": "user", "content": "List the medication names which have never been prescribed to any patient.", "sql": null }, { "role": "assistant", "content": "SELECT m.medication_name\nFROM healthcare.medications m\nLEFT JOIN healthcare.prescriptions p ON m.medication_id = p.medication_id\nWHE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "For each trip, provide the trip_id, the total fuel quantity refueled, and the number of refueling events that occurred during the trip.", "sql": null }, { "role": "assistant", "content": "SELECT trip_id, SUM(quantity) AS total_fuel_quantity, COUNT(*) AS refuel_e...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex...
[ { "role": "user", "content": "Find any two policies for the same customer whose coverage dates overlap. Return the customer ID, both policy numbers, and their start and end dates.", "sql": null }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_number AS policy1_n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam...
[ { "role": "user", "content": "List all maintenance logs for vehicles that had 'Oil Change' service in the last 3 months, showing vehicle ID, service date, and cost.", "sql": null }, { "role": "assistant", "content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "Count the number of policies by their status.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS policy_count\nFROM insurance.policies\nGROUP BY status;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "For each appointment, show the appointment subject, start time, the client's name, and the lawyer's email.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id, a.subject, a.start_time, c.first_name || ' ' || c.last_name AS client_name, l....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, d...
[ { "role": "user", "content": "List all pairs of active services in the same category where one service’s standard fee is higher than the other’s. Display the category, the higher-fee service name with its fee, and the lower-fee service name with its fee.", "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 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.reservations ( reservation_id text PRIMARY KEY, property_id t...
[ { "role": "user", "content": "Show the total payment amount per currency for payments that are either 'Pending' or 'Failed', grouped by currency_code.", "sql": null }, { "role": "assistant", "content": "SELECT currency_code, SUM(amount) AS total_payment_amount\nFROM hospitality_technology.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 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.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ...
[ { "role": "user", "content": "Show me all vehicles that are due for their next service before the end of this month, along with their last service date and type.", "sql": null }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, s.service_date, s.service_type FROM tran...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "Show all doctors who have issued more than 10 prescriptions. Return doctor ID, first name, last name, and total prescription count.", "sql": null }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(pr.prescription_id) 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 gaming_technology.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name...
[ { "role": "user", "content": "List all achievements with their name, points, and the title of the game they belong to.", "sql": null }, { "role": "assistant", "content": "SELECT a.name AS achievement_name, a.points, g.title AS game_title FROM gaming_technology.achievements a JOIN games g 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 transportation.trips ( trip_id text, route_id text, vehicle_id text, driver_id text,...
[ { "role": "user", "content": "For each origin and destination location pair, provide the total number of trips along with the average actual_arrival time.", "sql": null }, { "role": "assistant", "content": "SELECT origin_location_id, destination_location_id, COUNT(*) AS trip_count, AVG(EXTRA...
You are an expert in writing database language. You can write a corresponding 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, list the address with the highest ROI, showing the address, ROI, profit, and most profitable token.", "sql": null }, { "role": "assistant", "content": "SELECT t1.chain, t1.address, t1.roi, t1.profit, t1.most_profit_token FROM smart_money_profit 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.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "How many patients have provided both a phone_number and emergency_contact_phone?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.patients WHERE phone_number IS NOT NULL AND emergency_contact_phone IS NOT NULL;", "sql": nul...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "List all log entries associated with users who have participated in any trade, showing the log details and the trade ID.", "sql": null }, { "role": "assistant", "content": "SELECT T1.log_id, T1.action, T1.details, T1.logged_at, T2.trade_id, T2.buyer_id, T2.selle...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "For each player, can you find the username and registration_date of the player who registered immediately before them in the same country?", "sql": null }, { "role": "assistant", "content": "SELECT p.player_id,\n p.username AS current_username,\n p.r...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t...
[ { "role": "user", "content": "List all servers that are currently marked with a 'offline' status.", "sql": null }, { "role": "assistant", "content": "SELECT server_id, server_name, region FROM gaming_technology.servers WHERE status = 'offline';", "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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "List all citizens who submitted an application within 24 hours of registering. Show the application_id, citizen's full name, registration_date, and submitted_at timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT\na.application_id,\n(c.first_na...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz...
[ { "role": "user", "content": "What is the average profit and average ROI for smart money addresses ranked in the top 500?", "sql": null }, { "role": "assistant", "content": "SELECT AVG(profit), AVG(roi) FROM smart_money_profit WHERE rank <= 500", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_y...
[ { "role": "user", "content": "List all developer names and their countries.", "sql": null }, { "role": "assistant", "content": "SELECT name, country FROM gaming_technology.developers;", "sql": null }, { "role": "user", "content": "Filter the list to only include developers fr...
You are an expert in writing database language. You can write a corresponding 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": "Show me all users who have never commented on any post.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.username\nFROM social_media.users u\nLEFT JOIN social_media.comments c ON u.user_id = c.user_id\nWHERE c.comment_id IS NULL;", "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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,...
[ { "role": "user", "content": "Which Avalanche token has the largest total supply currently held by wallets, and who is its creator?", "sql": null }, { "role": "assistant", "content": "SELECT tb.tick, SUM(tb.amount) AS total_amount, ti.creator\nFROM token_balances_avalanche tb\nJOIN token_inf...
You are an expert in writing database language. You can write a corresponding 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": "Show me all players who have unlocked achievements, and for each, also list the total number of achievements they've unlocked.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, COUNT(*) AS achievements_unlocked FROM gaming_technology.player_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 web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a...
[ { "role": "user", "content": "Find all users and the total value of transactions they have received, showing user_id, username, and total_received_value.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id,\n u.username,\n COALESCE(SUM(t.value), 0) AS total_recei...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "For each medical record, display the record date, doctor full name, and medication name for any prescription linked to that record.", "sql": null }, { "role": "assistant", "content": "SELECT mr.record_date, d.first_name || ' ' || d.last_name AS doctor_full_name,...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,...
[ { "role": "user", "content": "How many payments were made using the payment method 'Credit Card'?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS credit_card_payments\nFROM government_services.payments\nWHERE payment_method = 'Credit Card';", "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.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "For each employee, show their full name, job title, and department, along with the job title and department of their manager.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, e.job...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List property names and the total maximum occupancy across all their room types.", "sql": null }, { "role": "assistant", "content": "SELECT T1.property_name, SUM(T2.max_occupancy) FROM properties AS T1 JOIN room_types AS T2 ON T1.property_id = T2.property_id GRO...
You are an expert in writing database language. You can write a corresponding 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 usernames and bio information for users who have set a non-empty bio in their profile.", "sql": null }, { "role": "assistant", "content": "SELECT username, bio\nFROM social_media.users\nWHERE bio IS NOT NULL AND TRIM(bio) <> '';", "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 manufacturing.components ( component_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "我想查询所有来自美国供应商的组件信息,包括组件名称、供应商名称和供应商的质量评分。", "sql": null }, { "role": "assistant", "content": "SELECT c.component_name, s.supplier_name, s.quality_rating\nFROM manufacturing.components c\nJOIN manufacturing.suppliers s ON c.supplier_id = s.supplier_id\nWHERE s.co...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative t...
[ { "role": "user", "content": "Show me the top 3 narratives by 24-hour trading volume, along with their 1-hour and 24-hour price change percentages.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, volume_24h, price_change_percentage_1h, price_change_percentage_24h FROM n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.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 legal_services.clients ( client_id.text, first_name.text, last_name.text, company_na...
[ { "role": "user", "content": "Show me all open cases along with the case number, the client's full name, and the name and email of the lead lawyer.", "sql": null }, { "role": "assistant", "content": "SELECT c.case_number, cl.first_name || ' ' || cl.last_name AS client_full_name, l.first_name...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id ch...
[ { "role": "user", "content": "For each patient, find their latest medical record and show patient_id, latest_record_id, and record_date.", "sql": null }, { "role": "assistant", "content": "SELECT a.patient_id,\n a.record_id AS latest_record_id,\n a.record_date\nFROM healthcare.me...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure "CREATE TABLE project_fundraising_record (", "id character varying(32) NOT NULL, -- fundrai...
[ { "role": "user", "content": "Show me the top 3 narratives by trend rank, along with their top 3 coins and 24-hour trading volume.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, top_3_coins, volume_24h FROM narrative_info ORDER BY trend_rank ASC LIMIT 3;", "sql": 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 web3.users ( user_id character varying(64) NOT NULL, username character varying(128)...
[ { "role": "user", "content": "How many users registered in each month?", "sql": null }, { "role": "assistant", "content": "SELECT date_trunc('month', created_at) AS month,\n COUNT(*) AS registrations\nFROM web3.users\nGROUP BY month\nORDER BY month;", "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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c...
[ { "role": "user", "content": "List all pairs of vehicles with the same make and model but different manufacture years. Include each vehicle's ID, make, model, and both years.", "sql": null }, { "role": "assistant", "content": "SELECT v1.vehicle_id AS vehicle1_id, v2.vehicle_id AS vehicle2_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 government_services.agencies ( agency_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Which agencies have at least one service location in a city named 'Austin', and what are their agency names and main phone numbers?", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT a.agency_id, a.agency_name, a.main_phone_number\nFROM governme...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "List all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange (exchange = 'NASDAQ') and belong to the 'Technology' sector.", "sql": null }, { "role": "assistant", "content": "SELECT security_id, ticker_symbol, security_na...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name...
[ { "role": "user", "content": "List the full name of employees and the names of the agencies they work for, but only for employees who are currently employed.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, a.agency_name\nFR...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "Show all bookings for trips that are on routes of type 'Shuttle', including the booking ID, passenger's full name, and the route number.", "sql": null }, { "role": "assistant", "content": "SELECT b.booking_id, p.first_name || ' ' || p.last_name AS passenger_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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "Show me all pairs of active policies for the same customer where their coverage periods overlap. Return customer_id, policy1_id, policy2_id, overlap_start, overlap_end.", "sql": null }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty...
[ { "role": "user", "content": "List all unique document types available in the system.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT document_type FROM insurance.claim_documents;", "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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "List all ERC20 tokens that have exactly 18 decimal places. Show their symbol, name, and total supply from the metadata table.", "sql": null }, { "role": "assistant", "content": "SELECT symbol, name, total_supply FROM token_metas WHERE is_erc20 = 1 AND decimals =...
You are an expert in writing database language. You can write a corresponding 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": "List pairs of transfer IDs that occurred sequentially (log_index difference is 1) within the same transaction. Show the transaction ID, the first transfer ID, the second transfer ID, and their log indices.", "sql": null }, { "role": "assistant", "content": "SELE...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What is the maintenance schedule for the platforms at the station with ID 'ST234' for the next month?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the maintenance schedule for the platforms at any station. The data 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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "Show me the top 5 users who have interacted with DApps the most, along with the count of interactions and their wallet addresses.", "sql": null }, { "role": "assistant", "content": "SELECT l.user_id, COUNT(*) AS interaction_count, w.address AS wallet_address FRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "List the medication name and manufacturer of all medications where the description contains the word 'extended'.", "sql": null }, { "role": "assistant", "content": "SELECT medication_name, manufacturer\nFROM healthcare.medications\nWHERE description ILIKE '%exte...
You are an expert in writing database language. You can write a corresponding 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": "List all clients along with their case_number and case_type for cases that are currently 'Open'.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, c.email, cs.case_number, cs.case_type\nFROM legal_services.clients AS c\nJOIN l...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "List all transactions that include an event with the name 'Transfer', showing the transaction ID, the event name, and the transaction's value.", "sql": null }, { "role": "assistant", "content": "SELECT t.transaction_id, e.event_name, t.value FROM web3.transactio...
You are an expert in writing database language. You can write a corresponding 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": "How many rooms are there on each floor?", "sql": null }, { "role": "assistant", "content": "SELECT floor, COUNT(*) FROM hospitality_technology.rooms GROUP BY floor", "sql": null }, { "role": "user", "content": "Only show floors with more than 10 ...
You are an expert in writing database language. You can write a corresponding 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": "For each agent, show the total number of policies they have sold and the sum of the premium amounts. Include the agent_id.", "sql": null }, { "role": "assistant", "content": "SELECT agent_id, COUNT(*) AS policy_count, SUM(premium_amount) AS total_premium\nFROM 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 web3.users ( user_id.text, username.text, email.text, password_hash.text, created_at...
[ { "role": "user", "content": "How many users registered on each date?", "sql": null }, { "role": "assistant", "content": "SELECT DATE(created_at) AS registration_date, COUNT(*) AS user_count FROM web3.users GROUP BY DATE(created_at) ORDER BY registration_date;", "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 blockchain.transactions ( transaction_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Find all pairs of transactions where the sender address and the receiver address are the same, but the transactions occurred on different days. Show transaction IDs, addresses, and their timestamps.", "sql": null }, { "role": "assistant", "content": "SELECT t1.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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "List all passengers who have never made a booking, showing their passenger_id, first_name, last_name, and email.", "sql": null }, { "role": "assistant", "content": "SELECT\n p.passenger_id,\n p.first_name,\n p.last_name,\n p.email\nFROM transportatio...
You are an expert in writing database language. You can write a corresponding 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": "For each year since 2015, show the total number of games released per year.", "sql": null }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM release_date) AS year, COUNT(*) AS total_games\nFROM gaming_technology.games\nWHERE release_date >= '2015-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 gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_rand...
[ { "role": "user", "content": "Can you show me the total number of each item acquired by every player, along with their player_id and item_id?", "sql": null }, { "role": "assistant", "content": "SELECT player_id, item_id, SUM(quantity) AS total_acquired FROM gaming_technology.player_inventory...
You are an expert in writing database language. You can write a corresponding 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 users whose email notifications are disabled, showing their usernames and the last time their settings were updated.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, us.updated_at\nFROM social_media.users u\nJOIN social_media.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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "Show the number of wallets created for each user. Return user_id and wallet_count.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) AS wallet_count\nFROM web3.wallets\nGROUP BY user_id;", "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 hospitality_technology.room_types ( room_type_id text, property_id text, type_name t...
[ { "role": "user", "content": "Get the count of service orders and total payment amount for each reservation.", "sql": null }, { "role": "assistant", "content": "SELECT so.reservation_id,\n COUNT(*) AS order_count,\n SUM(p.amount) AS total_payment\nFROM hospitality_technology.serv...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_l...
[ { "role": "user", "content": "List all routes with a total distance traveled greater than 10,000 km, showing the route number and total distance accumulated across all trips on that route.", "sql": null }, { "role": "assistant", "content": "SELECT r.route_number, SUM(r.distance_km) AS 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 healthcare.medications ( medication_id character varying(64) NOT NULL, medication_na...
[ { "role": "user", "content": "List the NDC code and description for any medication that has an NDC code starting with '5'.", "sql": null }, { "role": "assistant", "content": "SELECT ndc_code, description FROM healthcare.medications WHERE ndc_code LIKE '5%';", "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 PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "Show the total fare collected from bookings, grouped by the state/province of the destination location of the trip, for bookings made in May 2024.", "sql": null }, { "role": "assistant", "content": "SELECT\n l.state_province,\n SUM(b.fare) AS total_fare_collec...
You are an expert in writing database language. You can write a corresponding 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": "For each narrative, what is the average smart money ROI and the total 24-hour trading volume of the narrative?", "sql": null }, { "role": "assistant", "content": "SELECT T3.narrative, T4.avg_roi, T3.volume_24h FROM narrative_info AS T3 JOIN ( SELECT T2.narrative...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id ch...
[ { "role": "user", "content": "Show me all premium payments made via credit card in the last 30 days, along with their policy IDs and payment amounts, sorted by payment date in descending order.", "sql": null }, { "role": "assistant", "content": "SELECT policy_id, amount_paid, payment_date FR...
You are an expert in writing database language. You can write a corresponding 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 each depot name and the total number of vehicles assigned to it, but only include depots with at least 5 vehicles.", "sql": null }, { "role": "assistant", "content": "SELECT l.name AS depot_name,\n COUNT(v.vehicle_id) AS total_vehicles\nFROM transport...
You are an expert in writing database language. You can write a corresponding 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 insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Show me all claims with police reports that were filed in the last 3 months, along with their policy details and estimated loss amounts.", "sql": null }, { "role": "assistant", "content": "SELECT cl.claim_id, cl.policy_id, cl.incident_date, cl.reported_date, cl....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_pro...
[ { "role": "user", "content": "Give me the website for the insurance plan named 'Family Advantage'.", "sql": null }, { "role": "assistant", "content": "SELECT website FROM healthcare.insurance_plans WHERE plan_name = 'Family Advantage';", "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.customers ( customer_id.text, first_name.text, last_name.text, da...
[ { "role": "user", "content": "List all employees who were hired in the last two years along with their department and status.", "sql": null }, { "role": "assistant", "content": "SELECT employee_id, first_name, last_name, department, status FROM financial_services.employees WHERE hire_date >=...
You are an expert in writing database language. You can write a corresponding 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": "List all customers and the total amount they have traded, showing their full name, email, and the total across all their trades. Join customers to their accounts, then to trades.", "sql": null }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.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 insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all agents along with the first and last name of their manager.", "sql": null }, { "role": "assistant", "content": "SELECT a1.first_name AS agent_first_name, a1.last_name AS agent_last_name, a2.first_name AS manager_first_name, a2.last_name AS manager_last_...