system
stringlengths
315
8.06k
conversations
listlengths
6
48
You are an expert in writing database language. You can write a corresponding 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 character varying(32) NOT NULL, -- the ...
[ { "role": "user", "content": "Which token symbol has the highest price among all tokens held by CEXes on the Polygon chain?", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, MAX(price) AS max_price FROM cex_token_balance WHERE chain = 'Polygon' GROUP BY token_symbol OR...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.service_locations ( location_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "I want to know the total number of appointments per location along with the location name for appointments scheduled in March 2024.", "sql": null }, { "role": "assistant", "content": "SELECT\n sl.location_name,\n COUNT(a.appointment_id) AS appointment_count\nF...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, name character va...
[ { "role": "user", "content": "Find transaction IDs in the utxos table that have both spent and unspent UTXOs associated with them. List these transaction IDs.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id FROM trading_platform.utxos GROUP BY transaction_id HAVING ...
You are an expert in writing database language. You can write a corresponding 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 legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, c...
[ { "role": "user", "content": "Find all pairs of appointments that are scheduled for the same case and overlap in time. Show the IDs of the two overlapping appointments and the shared case ID.", "sql": null }, { "role": "assistant", "content": "SELECT t1.appointment_id AS appointment1_id, t2....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, route_id character va...
[ { "role": "user", "content": "Show me pairs of trip IDs that used the same vehicle.", "sql": null }, { "role": "assistant", "content": "SELECT\n t1.trip_id AS trip1_id,\n t2.trip_id AS trip2_id\nFROM transportation.trips AS t1\nJOIN transportation.trips AS t2\n ON t1.vehicle_id = t2.vehic...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id charac...
[ { "role": "user", "content": "Show each patient's policy number, the associated insurance plan ID, and any medications they have been prescribed, including the medication ID and prescription date.", "sql": null }, { "role": "assistant", "content": "SELECT pi.patient_id, pi.policy_number, pi....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "List accounts that were opened in the same month and year as another account for the same customer, but have a different account type. Show the account_id, customer_id, account_type, and opened_date for these accounts.", "sql": null }, { "role": "assistant", "co...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "For each maintenance log, list the vehicle's license plate, the name of the mechanic, and the service date, ordered by most recent service first.", "sql": null }, { "role": "assistant", "content": "SELECT ml.log_id, v.license_plate, ml.mechanic_name, ml.service_...
You are an expert in writing database language. You can write a corresponding 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": "Provide the count of transfers for each token_id.", "sql": null }, { "role": "assistant", "content": "SELECT token_id,\n COUNT(*) AS transfer_count\nFROM web3.token_transfers\nGROUP BY token_id;", "sql": null }, { "role": "user", "content":...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, crea...
[ { "role": "user", "content": "I need to find users who have liked both a post and a comment on the same day. For each such user and date, list user_id, date, post_id, and comment_id.", "sql": null }, { "role": "assistant", "content": "SELECT p.user_id, DATE(p.created_at) AS like_date, p.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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List the first name and last name of employees who were hired in the year 2023, along with the name of the agency they work for.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, a.agency_name FROM government_services.employee...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What are the environmental impact assessments for the production of the Airbus A350 model?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I don't have access to data regarding the environmental impact assessments for the production of specifi...
You are an expert in writing database language. You can write a corresponding 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(), g...
[ { "role": "user", "content": "I need to list all pairs of in-game items in the same game where one item is Epic and the other is Legendary, showing game_id, epic_item, and legendary_item.", "sql": null }, { "role": "assistant", "content": "SELECT a.game_id,\n a.item_name AS epic_item,\...
You are an expert in writing database language. You can write a corresponding 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": "Show me all pairs of patients who share the same emergency contact phone, including both patient IDs, their names, and the shared emergency contact phone.", "sql": null }, { "role": "assistant", "content": "SELECT p1.patient_id,\n p1.first_name,\n p1...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Use Hashes for platform details. Key format: platform:<platform_id> // HSET platform:plat_123 ...
[ { "role": "user", "content": "Can you help me retrieve the details of all schedules for a specific train with train_id 'train_789', including the route and stops information?", "sql": null }, { "role": "assistant", "content": "HGETALL train:train_789\nSMEMBERS schedule:sched_*:train:train_78...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id text, property_id text, service_name te...
[ { "role": "user", "content": "List all food and beverage services (category = 'Food & Beverage') with their names, prices, and units, where the price is less than $20.", "sql": null }, { "role": "assistant", "content": "SELECT service_name, price, unit FROM hospitality_technology.services 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 insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i...
[ { "role": "user", "content": "Which customers have made more than three premium payments in 2024? Show the customer_id and the number of payments.", "sql": null }, { "role": "assistant", "content": "SELECT customer_id, COUNT(*) AS payment_count FROM insurance.premium_payments WHERE payment_d...
You are an expert in writing database language. You can write a corresponding 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": "List all pairs of beneficiaries on the same policy, showing policy_id, beneficiary1_id, beneficiary1 first_name, beneficiary1 last_name, beneficiary2_id, beneficiary2 first_name, and beneficiary2 last_name.", "sql": null }, { "role": "assistant", "content": "SEL...
You are an expert in writing database language. You can write a corresponding 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": "Find users who have both commented on a post and liked that same post. Return the user_id and the count of such posts as post_count.", "sql": null }, { "role": "assistant", "content": "SELECT c.user_id, COUNT(DISTINCT c.post_id) AS post_count\nFROM social_media....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, ...
[ { "role": "user", "content": "For each player, calculate the total quantity of items they have acquired. Return player_id and total_quantity.", "sql": null }, { "role": "assistant", "content": "SELECT player_id,\n SUM(quantity) AS total_quantity\nFROM 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.messages ( message_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "How many messages currently have a media file attached?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.messages WHERE media_url IS NOT NULL;", "sql": null }, { "role": "user", "content": "For each user, show...
You are an expert in writing database language. You can write a corresponding 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": "Calculate the total sum of hours spent across all time entries that are billable but have not yet been billed.", "sql": null }, { "role": "assistant", "content": "SELECT SUM(hours_spent) FROM legal_services.time_entries WHERE is_billable = TRUE AND is_billed = 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 legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "List all appointments along with their subject and start time for lawyers specializing in 'Criminal Law'.", "sql": null }, { "role": "assistant", "content": "SELECT T1.subject, T1.start_time FROM legal_services.appointments AS T1 JOIN legal_services.lawyers 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 financial_services.market_data ( data_point_id bigserial NOT NULL, security_id chara...
[ { "role": "user", "content": "Provide for each security its ticker_symbol, the most recent close_price and corresponding timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT s.ticker_symbol, md.close_price, md.data_timestamp\nFROM financial_services.market_data md\nJOIN fina...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary...
[ { "role": "user", "content": "List all users who commented on posts tagged with hashtag 'spring', showing user_id, comment_id, content, and tag_name.", "sql": null }, { "role": "assistant", "content": "SELECT c.user_id, c.comment_id, c.content, h.tag_name\nFROM social_media.comments c\nJOIN ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.service_locations ( location_id text, agency_id text, location_n...
[ { "role": "user", "content": "List the latitude and longitude coordinates for all service locations located in a city named 'Seattle'.", "sql": null }, { "role": "assistant", "content": "SELECT latitude , longitude FROM government_services.service_locations WHERE city = 'Seattle'", "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 transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id ...
[ { "role": "user", "content": "Find pairs of consecutive maintenance logs for the same vehicle based on service date. Show the vehicle ID, log IDs, service dates, and odometer readings for both logs in each pair.", "sql": null }, { "role": "assistant", "content": "SELECT vehicle_id, log_id, s...
You are an expert in writing database language. You can write a corresponding 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 cases opened in the year 2024, along with the full name of the client for each case.", "sql": null }, { "role": "assistant", "content": "SELECT T1.case_number, T1.case_name, T2.first_name, T2.last_name FROM cases AS T1 JOIN clients AS T2 ON T1.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 gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_...
[ { "role": "user", "content": "For each server, what is the earliest and latest start time of its sessions?", "sql": null }, { "role": "assistant", "content": "SELECT server_id, MIN(start_time), MAX(start_time) FROM gaming_technology.game_sessions GROUP BY server_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.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 insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all premium payments along with the customer's first and last name for payments made after July 1, 2023.", "sql": null }, { "role": "assistant", "content": "SELECT pp.payment_id, pp.payment_date, pp.amount_paid, cu.first_name, cu.last_name\nFROM insurance.p...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "Show me all Sui coins with at least 6 decimal places and status 'exists' from the metadata table. List coin_type, symbol, name, and decimals.", "sql": null }, { "role": "assistant", "content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nW...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.employees ( employee_id character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "List employees whose job title is different from their manager's job title, showing the employee's full name and their manager's full name.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, m.first_name AS manager_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.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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,...
[ { "role": "user", "content": "Find the average settlement_amount of closed claims for each claim handler. Return claim_handler_id and avg_settlement_amount.", "sql": null }, { "role": "assistant", "content": "SELECT c.claim_handler_id, AVG(c.settlement_amount) AS avg_settlement_amount\nFROM ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.prescriptions ( prescription_id.text, record_id.text, patient_id.text, do...
[ { "role": "user", "content": "For each prescription, find the next prescription for the same patient. Return current prescription_id, next_prescription_id, patient_id, and days between start dates.", "sql": null }, { "role": "assistant", "content": "SELECT p1.patient_id,\n p1.prescript...
You are an expert in writing database language. You can write a corresponding 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": "Find all patients who have never received any diagnoses. Show patient ID, first_name, and last_name.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id,\n p.first_name,\n p.last_name\nFROM healthcare.patients p\nLEFT JOIN healthc...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "Count the number of events for each hour of the day based on the emitted_at timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT EXTRACT(HOUR FROM emitted_at) AS event_hour, COUNT(*) AS event_count FROM web3.events GROUP BY event_hour ORDER BY 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 hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.te...
[ { "role": "user", "content": "Show me reviews from 'Expedia' that have an overall rating of 1 or 2.", "sql": null }, { "role": "assistant", "content": "SELECT review_id, property_id, guest_id, rating_overall, review_date, comment FROM hospitality_technology.reviews WHERE review_source = 'Exp...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url...
[ { "role": "user", "content": "List all posts where the content mentions 'meeting'.", "sql": null }, { "role": "assistant", "content": "SELECT post_id, user_id, content, created_at FROM social_media.posts WHERE content LIKE '%meeting%'", "sql": null }, { "role": "user", "conte...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "List all users who currently have a 'pending' KYC status, showing their user ID and username.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.username FROM users u JOIN kyc_audit k ON u.user_id = k.user_id WHERE k.status = 'pending';", ...
You are an expert in writing database language. You can write a corresponding 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 all policies that have a coverage limit greater than 750000 and a premium amount greater than 1000. Show the policy number, product ID, coverage limit, and premium amount.", "sql": null }, { "role": "assistant", "content": "SELECT\n policy_number,\n produ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.user_settings ( setting_id text, user_id text, theme text, email_notifi...
[ { "role": "user", "content": "Can you show me all user IDs that have both email and push notifications disabled, along with whether their profile is set to private?", "sql": null }, { "role": "assistant", "content": "SELECT user_id, private_profile FROM social_media.user_settings WHERE email...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text...
[ { "role": "user", "content": "Show me all wallet addresses that belong to user_id 'U12345'.", "sql": null }, { "role": "assistant", "content": "SELECT address_id FROM blockchain.wallets WHERE user_id = 'U12345';", "sql": null }, { "role": "user", "content": "Now join this wit...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, name characte...
[ { "role": "user", "content": "Get all pairs of locations in the same city, showing both location IDs, names, and the shared city.", "sql": null }, { "role": "assistant", "content": "SELECT l1.location_id AS location1_id, l1.name AS location1_name,\n l2.location_id AS location2_id, l2.n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "Show me a list of players and, for each, list all the different games where they have acquired items. Also include the number of unique item types they've acquired per game.", "sql": null }, { "role": "assistant", "content": "SELECT p.player_id, p.username, g.ti...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "I want to see all time entries where the description contains the word 'draft' and that have not been billed yet.", "sql": null }, { "role": "assistant", "content": "SELECT *\nFROM legal_services.time_entries\nWHERE description ILIKE '%draft%'\n AND is_billed =...
You are an expert in writing database language. You can write a corresponding 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": "Find pairs of citizens who have the same last name but different national_id_number.", "sql": null }, { "role": "assistant", "content": "SELECT c1.citizen_id AS citizen_id_1, c1.first_name AS first_name_1, c1.last_name AS last_name_1, c1.national_id_number AS 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 gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT ...
[ { "role": "user", "content": "Show me how many achievements each player has unlocked.", "sql": null }, { "role": "assistant", "content": "SELECT player_id,\n COUNT(*) AS total_unlocked\nFROM gaming_technology.player_achievements\nGROUP BY player_id;", "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 Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str...
[ { "role": "user", "content": "我想获取某个组件的详细信息,包括组件名称、描述、重量以及成本。", "sql": null }, { "role": "assistant", "content": "MATCH (c:Component)\nWHERE c.component_id = 'specific_component_id'\nRETURN c.component_name, c.description, c.weight_kg, c.cost_usd", "sql": null }, { "role": "user"...
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 average speed of train number T9876 during its last journey?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the average speed of train number T9876 during its last journey. The data in the trains tab...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.payments ( payment_id text PRIMARY KEY, application_id text, cit...
[ { "role": "user", "content": "Can you show me the total amount paid by each citizen for each service? Please display the citizen_id, service_id, and the total amount.", "sql": null }, { "role": "assistant", "content": "SELECT citizen_id, service_id, SUM(amount) AS total_amount\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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var...
[ { "role": "user", "content": "Show all active agents along with their respective managers' full names.", "sql": null }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name || ' ' || a.last_name AS agent_name, m.first_name || ' ' || m.last_name AS manager_name FROM insurance.ag...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un...
[ { "role": "user", "content": "List each genre and the number of games in that genre.", "sql": null }, { "role": "assistant", "content": "SELECT genre,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY genre;", "sql": null }, { "role": "user", "content": "...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.ti...
[ { "role": "user", "content": "List the claim ID, incident date, estimated loss, and the first and last name of the customer for all claims with an estimated loss greater than 5000.", "sql": null }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.incident_date, T1.estimated_loss, T2...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id.text, property_id.text, type_name.t...
[ { "role": "user", "content": "Show all room types that offer 'WiFi' in their amenities.", "sql": null }, { "role": "assistant", "content": "SELECT room_type_id, property_id, type_name, amenities FROM hospitality_technology.room_types WHERE amenities LIKE '%WiFi%';", "sql": null }, { ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "I need to find all pairs of diagnoses for the same patient where one diagnosis is chronic and the other is non-chronic. Show patient_id, chronic diagnosis_id as chronic_id, non-chronic diagnosis_id as acute_id, chronic diagnosis_date, and acute diagnosis_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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre...
[ { "role": "user", "content": "List all locations situated within the state of California.", "sql": null }, { "role": "assistant", "content": "SELECT location_id, name, city, state_province FROM transportation.locations WHERE state_province = 'CA';", "sql": null }, { "role": "user...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time...
[ { "role": "user", "content": "Show me the total fuel cost for each vehicle, grouped by fuel type.", "sql": null }, { "role": "assistant", "content": "SELECT vehicle_id, fuel_type, SUM(total_cost) AS total_fuel_cost FROM transportation.fuel_logs GROUP BY vehicle_id, fuel_type;", "sql": nu...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Which citizens have made the highest total payments in USD? Show their full name and total payment amount, ordered by total in descending order, limited to the top 3.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name A...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Show me a summary listing each customer's full name and the number of accounts they have, broken down by account status.", "sql": null }, { "role": "assistant", "content": "SELECT\n c.first_name,\n c.last_name,\n a.status,\n COUNT(a.account_id) AS account_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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text...
[ { "role": "user", "content": "Count the total number of distinct specialties listed in the doctors table.", "sql": null }, { "role": "assistant", "content": "SELECT count(DISTINCT specialty) FROM healthcare.doctors;", "sql": null }, { "role": "user", "content": "Show the lice...
You are an expert in writing database language. You can write a corresponding 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, patient_id, and doctor_id for all diagnoses with status 'Pending' and is_chronic set to TRUE.", "sql": null }, { "role": "assistant", "content": "SELECT diagnosis_id, patient_id, doctor_id FROM healthcare.diagnoses WHERE status = 'Pending'...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "Show me the usernames and emails of all users who have placed at least one 'buy' order for the asset named 'Bitcoin'.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM trading_platform.users AS T1 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 insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha...
[ { "role": "user", "content": "Show the document ID, claim ID, and file name for all documents with a MIME type starting with 'image/'.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_name FROM insurance.claim_documents WHERE mime_type LIKE 'image/%';", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t...
[ { "role": "user", "content": "How many insurance policies does each subscriber have? Please display the subscriber name and policy count.", "sql": null }, { "role": "assistant", "content": "SELECT subscriber_name, COUNT(*) AS policy_count FROM healthcare.patient_insurance GROUP BY subscriber...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Use Hashes. Key pattern: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_numbe...
[ { "role": "user", "content": "Can you help me get a list of components and their associated materials, including the supplier information for each component?", "sql": null }, { "role": "assistant", "content": "SMEMBERS material_components:<material_id>\nHGETALL component:<component_id>\nHGET...
You are an expert in writing database language. You can write a corresponding 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 text, token_name text, token_symbol text, token_address t...
[ { "role": "user", "content": "Which exchange holds the largest total USD value of the token with the highest 24h price increase in the 'AI' narrative, and what is that value?", "sql": null }, { "role": "assistant", "content": "SELECT ctb.exchange, SUM(ctb.usd_value) AS total_usd_value\nFROM ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "Can you help me find the total passenger capacity for each train car on a specific route with route_id 'RT123'?", "sql": null }, { "role": "assistant", "content": "SELECT tc.train_id, tc.car_id, tc.car_number, tc.capacity\nFROM train_station_management.train_car...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appo...
[ { "role": "user", "content": "For each location, what is the average appointment duration? Show location_id and the average duration.", "sql": null }, { "role": "assistant", "content": "SELECT location_id, AVG(duration_minutes) FROM healthcare.appointments GROUP BY location_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 social_media.comments ( comment_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List the content and comment ID for all comments made by users with private profiles.", "sql": null }, { "role": "assistant", "content": "SELECT c.comment_id, c.content FROM social_media.comments AS c JOIN social_media.user_settings AS us ON c.user_id = us.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 trading_platform.dapps ( dapp_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "Show me the names and URLs of all DApps, and for each DApp, list the KYC status and last review date for all users who have an audit entry.", "sql": null }, { "role": "assistant", "content": "SELECT d.name AS dapp_name, d.url, k.user_id, k.status, k.reviewed_at\...
You are an expert in writing database language. You can write a corresponding 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, user_id charact...
[ { "role": "user", "content": "Count the number of metadata entries for each asset.", "sql": null }, { "role": "assistant", "content": "SELECT asset_id, COUNT(*) AS metadata_count\nFROM trading_platform.metadata\nGROUP BY asset_id;", "sql": null }, { "role": "user", "content":...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Show all peers, listing their ID, IP address, and port.", "sql": null }, { "role": "assistant", "content": "SELECT peer_id, ip_address, port FROM trading_platform.peers;", "sql": null }, { "role": "user", "content": "Display the username and the ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par...
[ { "role": "user", "content": "Show me all replies to comments, including the reply's comment ID, the parent comment ID, and the content.", "sql": null }, { "role": "assistant", "content": "SELECT comment_id, parent_comment_id, content FROM social_media.comments WHERE parent_comment_id IS NOT...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Show the count of citizens grouped by their verification status.", "sql": null }, { "role": "assistant", "content": "SELECT is_verified, COUNT(*) FROM government_services.citizens GROUP BY is_verified;", "sql": null }, { "role": "user", "content"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, docum...
[ { "role": "user", "content": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs.", "sql": null }, { "role": "assistant", "content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS ca...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.follows ( follow_id.text, follower_user_id.text, following_user_id.text...
[ { "role": "user", "content": "How many users have followed more than one person in total?", "sql": null }, { "role": "assistant", "content": "SELECT follower_user_id, COUNT(DISTINCT following_user_id) AS following_count\nFROM social_media.follows\nGROUP BY follower_user_id\nHAVING COUNT(DIST...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, gener...
[ { "role": "user", "content": "List all medications with a description that includes the word 'antibiotic'.", "sql": null }, { "role": "assistant", "content": "SELECT * FROM healthcare.medications WHERE description ILIKE '%antibiotic%';", "sql": null }, { "role": "user", "cont...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.cases ( case_id character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "Show me the total hours spent by each lawyer for each case, along with the case number and lawyer ID.", "sql": null }, { "role": "assistant", "content": "SELECT t.case_id, c.case_number, t.lawyer_id, SUM(t.hours_spent) AS total_hours\nFROM legal_services.time_en...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL,...
[ { "role": "user", "content": "Show each staff member's first name, last name, and the average base rate of room types available at the property where they work.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.avg_base_rate FROM hospitality_technolog...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, -- the user's address ...
[ { "role": "user", "content": "Show me the top 5 smart money addresses by profit on the Ethereum chain, along with their most profitable token and ROI, but only include addresses with a realized profit ratio above 70%.", "sql": null }, { "role": "assistant", "content": "SELECT address, most_p...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.passengers ( passenger_id text PRIMARY KEY, first_name text, last_nam...
[ { "role": "user", "content": "Count the number of passengers in each month of the year 2024 based on their created_at date.", "sql": null }, { "role": "assistant", "content": "SELECT EXTRACT(MONTH FROM created_at) AS month, COUNT(*) AS passenger_count\nFROM transportation.passengers\nWHERE 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 Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty...
[ { "role": "user", "content": "특정 품질 등급 이상의 공급업체를 조회하고 싶습니다. 품질 등급, 공급업체 이름, 국가를 포함해 주세요.", "sql": null }, { "role": "assistant", "content": "GET suppliers/_search\n{\n \"query\": {\n \"range\": {\n \"quality_rating\": {\n \"gte\": 4.0\n }\n }\n },\n \"_source\": [\"...
You are an expert in writing database language. You can write 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.find(\n { job_title: '<specific_job_title>' },\n { employee_id: 1, first_name: 1, last_name: 1, job_title: 1, hire_date: 1, _id: 0 }\n).sort({ hi...
You are an expert in writing database language. You can write a corresponding 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, firm_name charact...
[ { "role": "user", "content": "Show me the names, founding dates, and websites of all law firms whose name contains the word 'Legal' and were founded after the year 2005. Sort the results by their founding date.", "sql": null }, { "role": "assistant", "content": "SELECT firm_name, founded_dat...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte...
[ { "role": "user", "content": "List all pairs of hashtags created on the same calendar date, showing both tag names and the creation date.", "sql": null }, { "role": "assistant", "content": "SELECT h1.tag_name AS tag1, h2.tag_name AS tag2, DATE(h1.created_at) AS created_date\nFROM social_medi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // db.createCollection('stations') // Optional: Add unique index: db.stations.createIndex({ stati...
[ { "role": "user", "content": "Can you help me count the total number of active staff members in the database?", "sql": null }, { "role": "assistant", "content": "db.staff.countDocuments({ is_active: true });", "sql": null }, { "role": "user", "content": "Can you assist me 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 Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c...
[ { "role": "user", "content": "Can you help me fetch the inventory records for components stored in a specific warehouse, along with their expiry dates?", "sql": null }, { "role": "assistant", "content": "HGETALL inv:<inventory_record_id>\nZRANGE component_expiry:<component_id> 0 -1 WITHSCORE...
You are an expert in writing database language. You can write a corresponding 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": "Show me all transactions along with the related account IDs where the transaction type is 'Transfer'.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, account_id, related_account_id, transaction_type, amount, currency, transaction_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 hospitality_technology.properties ( property_id text, property_name text, address_li...
[ { "role": "user", "content": "Show me all service orders for spa services in the last month, including the guest name and staff who delivered the service.", "sql": null }, { "role": "assistant", "content": "SELECT so.order_id, g.first_name, g.last_name, s.service_name, st.first_name AS staff...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.logs ( log_id text PRIMARY KEY, user_id text, action text, details ...
[ { "role": "user", "content": "Count the number of logs for each action type.", "sql": null }, { "role": "assistant", "content": "SELECT action,\n COUNT(*) AS count\nFROM trading_platform.logs\nGROUP BY action;", "sql": null }, { "role": "user", "content": "For each 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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "List the order ID, type, and quantity for all orders placed using the wallet with ID 'wallet123'.", "sql": null }, { "role": "assistant", "content": "SELECT order_id, order_type, quantity FROM orders WHERE wallet_id = 'wallet123'", "sql": null }, { "...
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 total number of vacation days taken by employee with ID 'EMP101' in the past year?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the vacation days taken by an employee as this data is not stored 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 healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ...
[ { "role": "user", "content": "Show all prescriptions with prescription_id, patient_id, medication_id, quantity_dispensed, and refills_allowed.", "sql": null }, { "role": "assistant", "content": "SELECT prescription_id, patient_id, medication_id, quantity_dispensed, refills_allowed FROM healt...
You are an expert in writing database language. You can write a corresponding 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 users who commented on posts and the content of the post they commented on. Show commenter username and post content.", "sql": null }, { "role": "assistant", "content": "SELECT T1.username, T2.content FROM social_media.users AS T1 JOIN social_media.comments...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, propert...
[ { "role": "user", "content": "List all available services along with the property name where they are offered.", "sql": null }, { "role": "assistant", "content": "SELECT s.service_id, s.service_name, p.property_name\nFROM hospitality_technology.services s\nJOIN hospitality_technology.propert...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ...
[ { "role": "user", "content": "Get the number of insurance products grouped by product_type and their active status. Return product_type, is_active, and the count of products.", "sql": null }, { "role": "assistant", "content": "SELECT product_type, is_active, COUNT(*) AS product_count\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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,...
[ { "role": "user", "content": "Show the full names and contact emails of all citizens who have made a payment for an application that is currently in 'Pending' status.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contac...