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 trading_platform.wallets ( wallet_id text, user_id text, address text, private_key t...
[ { "role": "user", "content": "List user IDs with approved KYC status and the addresses of their wallets.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT w.user_id, w.address FROM trading_platform.wallets w JOIN trading_platform.kyc_audit k ON w.user_id = k.user_id WHERE k...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, user_id text, theme text, ...
[ { "role": "user", "content": "Which users have disabled both email and push notifications? Please provide their user IDs and whether their profiles are private.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, private_profile FROM social_media.user_settings WHERE email_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.payments ( payment_id text PRIMARY KEY, application_id text, cit...
[ { "role": "user", "content": "Show me all failed payments along with the application ID, citizen ID, and payment timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT payment_id, application_id, citizen_id, payment_timestamp\nFROM government_services.payments\nWHERE status = ...
You are an expert in writing database language. You can write a corresponding 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": "I need the average close_price per sector for the last month.", "sql": null }, { "role": "assistant", "content": "SELECT s.sector, AVG(m.close_price) AS avg_close_price\nFROM financial_services.market_data m\nJOIN financial_services.securities s ON m.security_id...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What is the current number of passengers at station with ID 'ST123' right now?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the current number of passengers at a station. The data I have access to only include...
You are an expert in writing database language. You can write a corresponding 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": "List all documents uploaded for cases handled in the 'District Court' jurisdiction, showing the document name, case number, and upload timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT d.document_name, cs.case_number, d.upload_timestamp\nFROM...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "Find all pairs of drivers where one driver's license_expiry_date is earlier than another's. Return each pair's driver_ids, full names, and respective expiry dates.", "sql": null }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver1_id, d1.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 // 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 } ]
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "Show all review IDs, property IDs, and the rating for service given for each review.", "sql": null }, { "role": "assistant", "content": "SELECT review_id, property_id, rating_service\nFROM hospitality_technology.reviews;", "sql": null }, { "role": "u...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "List payment records in USD including guest names and processing staff names.", "sql": null }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.amount,\n p.currency_code,\n g.guest_name,\n s.staff_name\nFROM hospitality_technol...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.conversation_participants ( participant_id text, conversation_id text, ...
[ { "role": "user", "content": "List all pairs of users who participated in the same conversation. For each, show conversation_id, user_id1, user_id2.", "sql": null }, { "role": "assistant", "content": "SELECT p1.conversation_id,\n p1.user_id AS user_id1,\n p2.user_id AS user_id2\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 the first and last names of all policy beneficiaries who have a percentage_share greater than 50%, ordered by added_at descending.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name\nFROM insurance.policy_beneficiaries\nWHERE 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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex...
[ { "role": "user", "content": "List pairs of policies for the same customer where one policy starts exactly one day after another policy ends. Return customer_id, the earlier policy_number, the later policy_number, earlier end_date, and later start_date.", "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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "Which services have 'Eligibility' mentioned in their eligibility_criteria field?", "sql": null }, { "role": "assistant", "content": "SELECT service_name, eligibility_criteria\nFROM government_services.services\nWHERE eligibility_criteria ILIKE '%Eligibility%';",...
You are an expert in writing database language. You can write a corresponding 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_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp...
[ { "role": "user", "content": "Compute the average realized_ratio and average pnl for smart money token performance grouped by chain.", "sql": null }, { "role": "assistant", "content": "SELECT chain, AVG(realized_ratio) AS avg_realized_ratio, AVG(pnl) AS avg_pnl\nFROM smart_money_token_perfor...
You are an expert in writing database language. You can write a corresponding 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 SUI coins are currently marked as 'exists' and have a balance over 500000 for any owner? Please show the coin_type, balance, and owner.", "sql": null }, { "role": "assistant", "content": "SELECT coin_type, balance, owner FROM sui_coins WHERE status = 'exis...
You are an expert in writing database language. You can write a corresponding 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": "Count how many prescriptions exist for each medication_id and order the results by the highest count first.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, COUNT(*) AS prescription_count\nFROM healthcare.prescriptions\nGROUP BY medicati...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.employees ( employee_id character varying(64) NOT NULL, agency_i...
[ { "role": "user", "content": "List the names of employees whose job title is the same as their manager's job title. Include the employee's first name, last name, their manager's first name, last name, and their shared job title.", "sql": null }, { "role": "assistant", "content": "SELECT T1.f...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,...
[ { "role": "user", "content": "How many group conversations are there?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = TRUE;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var...
[ { "role": "user", "content": "Show me the top 3 tokens by trend rank in the 'NFT' narrative, along with their price and 24-hour trading volume.", "sql": null }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE narrative = '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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "For each customer, could you list their full name, email, and the combined balance of all their accounts? Please also show the number of accounts they hold.", "sql": null }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name || ' ' || c.last_n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "List all properties that have at least one room on the 10th floor. Include the property name and the count of such rooms.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_name,\n COUNT(r.room_id) AS room_count\nFROM hospitality_technol...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_...
[ { "role": "user", "content": "List for each game the server with the highest current player count and also show how many sessions that server has hosted. Include game_id, server_name, current_players, and session_count.", "sql": null }, { "role": "assistant", "content": "WITH session_counts ...
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uu...
[ { "role": "user", "content": "Find the date (calendar day) with the highest total number of game sessions. Show the date and the total session count.", "sql": null }, { "role": "assistant", "content": "SELECT CAST(start_time AS DATE) AS session_date, COUNT(*) AS total_sessions\nFROM gaming_t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ...
[ { "role": "user", "content": "I need the total quantity of items each player has acquired, showing player_id and total_quantity.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player_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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text...
[ { "role": "user", "content": "List all peer logs, showing the user_id and the action taken, ordered by the most recent log entry.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, action, logged_at\nFROM trading_platform.logs\nORDER BY logged_at DESC;", "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": "List all customer-employee pairs where they share the same email domain, showing customer_id, customer email, employee_id, and employee email.", "sql": null }, { "role": "assistant", "content": "SELECT c.customer_id,\n c.email AS customer_email,\n 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.lawyers ( lawyer_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "List all lawyers who were hired before the year 2020 and are partners. Show their full name (first and last name combined), bar number, and hire date. Order the results by hire date.", "sql": null }, { "role": "assistant", "content": "SELECT first_name || ' ' ||...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id text, user_id text, content text, media_url text, media...
[ { "role": "user", "content": "List all posts created by user 'U100' in March 2024.", "sql": null }, { "role": "assistant", "content": "SELECT post_id, user_id, content, created_at FROM social_media.posts WHERE user_id = 'U100' AND created_at >= '2024-03-01' AND created_at < '2024-04-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 insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,...
[ { "role": "user", "content": "Find managers who have at least one agent reporting to them whose status is 'inactive'. List the manager's full name and the full name of the inactive agent.", "sql": null }, { "role": "assistant", "content": "SELECT T2.first_name AS manager_first_name, T2.last_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "What is the average interest rate for each account type?", "sql": null }, { "role": "assistant", "content": "SELECT account_type, AVG(interest_rate) FROM financial_services.accounts GROUP BY account_type;", "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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t...
[ { "role": "user", "content": "List tokens on the 'Arbitrum' chain with a 24-hour price change percentage greater than 10% and a market cap above 1,000,000 USD. Show their symbol, name, price, 24-hour change percentage, and market cap. Order the results by the 24-hour change percentage in descending order.",...
You are an expert in writing database language. You can write a corresponding 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": "Which addresses across all chains have a realized ratio above 0.9 and a profit above $20,000? Show their address, chain, profit, realized ratio, and most profitable token.", "sql": null }, { "role": "assistant", "content": "SELECT address, chain, profit, realize...
You are an expert in writing database language. You can write a corresponding 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": "I want to see a list of all patients, including their full name and date of birth, along with every doctor they have been diagnosed by and that doctor's specialty.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name || ' ' || 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 social_media.likes ( like_id character varying(64) NOT NULL, -- unique identifie...
[ { "role": "user", "content": "Count the total number of likes on posts versus likes on comments across the entire platform.", "sql": null }, { "role": "assistant", "content": "SELECT CASE WHEN post_id IS NOT NULL THEN 'post' ELSE 'comment' END AS like_target, COUNT(*) AS total_likes FROM soc...
You are an expert in writing database language. You can write a corresponding 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": "Show me each patient and doctor pair that have both an active chronic diagnosis and at least one prescription recorded in the same medical record. Include patient_id, doctor_id, diagnosis_date, prescription_date, and medication_id.", "sql": null }, { "role": "assist...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, policy_id text, cu...
[ { "role": "user", "content": "List all beneficiaries who have a null contact_info. Return beneficiary_id, first_name, last_name, policy_id.", "sql": null }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name, last_name, policy_id\nFROM insurance.policy_beneficiaries\nWHERE ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "List all premium payments along with the payment date, amount, and the status of the related policy.", "sql": null }, { "role": "assistant", "content": "SELECT pp.payment_id, pp.payment_date, pp.amount_paid, p.status AS policy_status\nFROM insurance.premium_paym...
You are an expert in writing database language. You can write a corresponding 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 fueling event, show its fuel_log_id, vehicle_id, log_timestamp, and the previous fueling event's fuel_log_id, log_timestamp, and quantity for the same vehicle.", "sql": null }, { "role": "assistant", "content": "SELECT fl.fuel_log_id,\n fl.vehicle...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "List all documents, including their name and upload timestamp, along with the first and last name of the client associated with the case they belong to.", "sql": null }, { "role": "assistant", "content": "SELECT d.document_name, d.upload_timestamp, c.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 web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "Show the event_id, transaction_id, and emitted_at timestamp for all events with event_name 'Approval' and contract_id '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'.", "sql": null }, { "role": "assistant", "content": "SELECT event_id, transaction_id, emitted_at 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "List the top 5 ERC20 tokens by total_supply along with their latest USD price.", "sql": null }, { "role": "assistant", "content": "SELECT tm.symbol, tm.contract_address, tm.total_supply, tpl.price\nFROM token_metas tm\nJOIN token_prices_latest tpl ON tm.contract...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "For each property, show the total number of reservations with status 'Confirmed' and the average total_amount.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id,\n p.property_name,\n COUNT(r.reservation_id) AS confirmed_reserva...
You are an expert in writing database language. You can write a corresponding 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": "List all pairs of insurance products that share the same product_type but have differing active statuses. Return both product_ids, the product_type, and each is_active flag.", "sql": null }, { "role": "assistant", "content": "SELECT p1.product_id AS product_id_1...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.hashtags ( hashtag_id.text, tag_name.text, created_at.timestamp ) CREAT...
[ { "role": "user", "content": "List all group conversations that were created after January 1st, 2023, and for each, show the names of hashtags that were created within the same month as the conversation.", "sql": null }, { "role": "assistant", "content": "SELECT c.conversation_id, c.group_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 narrative_info ( narrative text, top_3_coins text, price_change_percentage_1h numeri...
[ { "role": "user", "content": "Show the top 5 narratives ranked by trend_rank (lowest is better). Include the narrative, trend rank, and number of tokens.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, trend_rank, token_num FROM narrative_info ORDER BY trend_rank ASC LI...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w...
[ { "role": "user", "content": "List all law firms whose address contains 'Avenue'.", "sql": null }, { "role": "assistant", "content": "SELECT firm_id, firm_name, address FROM legal_services.law_firms WHERE address LIKE '%Avenue%';", "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.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "Show all diagnoses recorded by doctor with ID 'doc789'. Include the diagnosis ID, patient ID, description, and diagnosis date.", "sql": null }, { "role": "assistant", "content": "SELECT diagnosis_id, patient_id, description, diagnosis_date FROM healthcare.diagno...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam...
[ { "role": "user", "content": "Find all pairs of drivers who were hired on the same date. For each pair, show the first_name and last_name of both drivers as driver1_first, driver1_last, driver2_first, driver2_last, and their shared hire_date.", "sql": null }, { "role": "assistant", "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 hospitality_technology.service_orders ( order_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "For each guest, show the count of service orders they placed for services in the 'Food & Beverage' department. Include the guest's full name and the order count.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, COUNT(T2.ord...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri...
[ { "role": "user", "content": "Give me all trips where the trip status is 'Completed' with their trip ID, vehicle ID, and number of passengers.", "sql": null }, { "role": "assistant", "content": "SELECT trip_id, vehicle_id, passenger_count FROM transportation.trips WHERE status = 'Completed';...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the tok...
[ { "role": "user", "content": "For each chain, which token had the highest number of smart money addresses buying it this week? Show the token symbol and narrative too.", "sql": null }, { "role": "assistant", "content": "SELECT chain, token_symbol, narrative, MAX(address_amount) AS max_buyers...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_u...
[ { "role": "user", "content": "For each player, show the total quantity of all items they have ever acquired and their earliest acquisition date.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, SUM(quantity) AS total_quantity, MIN(acquired_at) AS earliest_acquisition 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 hospitality_technology.services ( service_id.text, property_id.text, service_name.te...
[ { "role": "user", "content": "List all unavailable services along with their names, prices, and the departments they belong to.", "sql": null }, { "role": "assistant", "content": "SELECT service_name, price, department FROM hospitality_technology.services WHERE is_available = false;", "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 trading_platform.kyc_audit ( kyc_audit_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Show me all KYC audit records for user ID 'user_abc_123'.", "sql": null }, { "role": "assistant", "content": "SELECT kyc_audit_id, user_id, status, reviewed_at FROM kyc_audit WHERE user_id = 'user_abc_123';", "sql": null }, { "role": "user", "con...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.dapps ( dapp_id.text, name.text, description.text, url.text )
[ { "role": "user", "content": "Show all DApps whose name starts with the letter 'C'.", "sql": null }, { "role": "assistant", "content": "SELECT * FROM trading_platform.dapps WHERE name ILIKE 'C%';", "sql": null }, { "role": "user", "content": "Could you instead make it case-se...
You are an expert in writing database language. You can write a corresponding 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.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for...
[ { "role": "user", "content": "List all tokens with a total supply greater than 1,000,000.", "sql": null }, { "role": "assistant", "content": "SELECT token_id, token_name, token_symbol, contract_address, total_supply\nFROM web3.tokens\nWHERE total_supply > 1000000;", "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 average maintenance cost for each service type per vehicle.", "sql": null }, { "role": "assistant", "content": "SELECT vehicle_id,\n service_type,\n AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nGROUP BY vehicle_id, service_ty...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List all service orders, including the service name and quantity, along with the full name of the staff member who placed the order.", "sql": null }, { "role": "assistant", "content": "SELECT so.order_id, s.service_name, so.quantity, st.first_name, st.last_name ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media...
[ { "role": "user", "content": "Count the number of unique users who are being followed.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT following_user_id) FROM social_media.follows", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Retrieve all public posts that have geolocation coordinates specified, showing post_id, user_id, location_lat, location_lon, ordered by created_at descending.", "sql": null }, { "role": "assistant", "content": "SELECT post_id, user_id, location_lat, location_lon...
You are an expert in writing database language. You can write a corresponding 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 all reservations for rooms on the 3rd floor, including guest_id, reservation_id, room_number, property_name, and check_in_date.", "sql": null }, { "role": "assistant", "content": "SELECT r.reservation_id, r.guest_id, ro.room_number, p.property_name, r.check...
You are an expert in writing database language. You can write a corresponding 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 the number of comments each user has made on each post.", "sql": null }, { "role": "assistant", "content": "SELECT post_id, user_id, COUNT(*) AS comment_count FROM social_media.comments GROUP BY post_id, user_id;", "sql": null }, { "role": "u...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id text, reservation_id text, guest_id...
[ { "role": "user", "content": "List all service orders with quantity greater than 1 and total price exceeding 50. Show order ID, guest ID, quantity, and total price.", "sql": null }, { "role": "assistant", "content": "SELECT order_id, guest_id, quantity, total_price FROM hospitality_technolog...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "List all appointments that are currently scheduled and show their appointment time.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, doctor_id, appointment_time FROM healthcare.appointments WHERE status = 'Scheduled';", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_na...
[ { "role": "user", "content": "Find all pairs of insurance products that belong to the same product_type and are both active, listing the two product IDs and their names.", "sql": null }, { "role": "assistant", "content": "SELECT p1.product_id AS product1_id, p1.product_name AS product1_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": "Provide a list of all unique genders present in the citizens table.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT gender FROM government_services.citizens;", "sql": null }, { "role": "user", "content": "How many citizens bel...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "How many users have their profile pictures set and also have written a bio?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS user_count\nFROM social_media.users\nWHERE profile_picture_url IS NOT NULL AND profile_picture_url <> ''\n AND bio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "List all NFT collections on the 'Ethereum' blockchain. Show their name and contract address from the collections table.", "sql": null }, { "role": "assistant", "content": "SELECT name, contract_address FROM nft_collections WHERE blockchain = 'Ethereum';", "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 social_media.likes ( like_id character varying(64) NOT NULL, user_id character varyi...
[ { "role": "user", "content": "Count the total number of group chats.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = true;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary...
[ { "role": "user", "content": "List all posts that have received at least one like and at least one comment, showing the post_id and the total number of likes and comments each has.", "sql": null }, { "role": "assistant", "content": "SELECT p.post_id, COUNT(DISTINCT l.like_id) AS like_count, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "Show me the count of available rooms for each property.", "sql": null }, { "role": "assistant", "content": "SELECT T1.property_name, count(T2.room_id) FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.rooms AS T2 ON T1.property_id = T2.pro...
You are an expert in writing database language. You can write a corresponding 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 hired in 2023 along with their job title and email.", "sql": null }, { "role": "assistant", "content": "SELECT employee_id, first_name, last_name, job_title, email\nFROM financial_services.employees\nWHERE EXTRACT(YEAR FROM hire_date) = 2023;"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id.text, customer_id.text, account_number.text...
[ { "role": "user", "content": "List each security’s ticker symbol and the total number of trades executed for it, along with the sum of quantities traded.", "sql": null }, { "role": "assistant", "content": "SELECT s.ticker_symbol, COUNT(t.trade_id) AS total_trades, SUM(t.quantity) AS total_qu...
You are an expert in writing database language. You can write a corresponding 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": "Give me each server's name, the region, and the maximum number of players that have been connected at once.", "sql": null }, { "role": "assistant", "content": "SELECT s.server_id, s.server_name, s.region, MAX(s.current_players) AS max_players_seen\nFROM gaming_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 token_basic_info ( coin_id text, token_name text, token_symbol text, token_address t...
[ { "role": "user", "content": "Find tokens on the 'Polygon' chain with a market cap greater than $1,000,000,000 and a positive price change in the last 24 hours. List their symbol, name, market cap, and 24h price change.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol,...
You are an expert in writing database language. You can write a corresponding 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, account_id text, related_acco...
[ { "role": "user", "content": "I want to see the total sum of transaction amounts and their average amount for each transaction_type along with the total number of transactions, grouped by currency.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_type, currency, COUNT(*...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and have a daily trading volume exceeding 1 million shares, along with the account details (account_id, account_number, balance) of customers who hold these securities in t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da...
[ { "role": "user", "content": "List all employees who are currently active and were hired before 2022. Show employee_id, first_name, last_name, job_title, department, and hire_date.", "sql": null }, { "role": "assistant", "content": "SELECT\n employee_id,\n first_name,\n last_name,\n 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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam...
[ { "role": "user", "content": "Which drivers have licenses expiring before 2025-01-01, and what are their first and last names along with the license expiry date?", "sql": null }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, license_expiry_date FROM transportati...
You are an expert in writing database language. You can write a corresponding 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": "List all customer_ids who have both a checking account and a savings account with a combined balance exceeding $50,000.", "sql": null }, { "role": "assistant", "content": "SELECT c.customer_id FROM financial_services.accounts c JOIN financial_services.accounts 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "For each agency offering more than 5 active services, list the agency_name, jurisdiction_level, and the count of active services. Order the results by the count in descending order.", "sql": null }, { "role": "assistant", "content": "SELECT a.agency_name,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.users ( user_id character varying(64) NOT NULL, username character varyin...
[ { "role": "user", "content": "List the username and email for all users whose email address ends with '@example.com'.", "sql": null }, { "role": "assistant", "content": "SELECT username, email FROM blockchain.users WHERE email LIKE '%@example.com';", "sql": null }, { "role": "use...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE narrative_info ( narrative character varying(512) NOT NULL, top_3_coins text, price_...
[ { "role": "user", "content": "Show narratives that have a market cap over 1 billion and a 24-hour volume over 50 million. Display the narrative, market cap, and 24h volume.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, market_cap, volume_24h FROM narrative_info WHERE ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character...
[ { "role": "user", "content": "Which projects had fundraising rounds named 'Series A' in 2022, and what are their token symbols and current token prices from DEX pools?", "sql": null }, { "role": "assistant", "content": "SELECT p.project_name, p.rounds_name, d.token_symbol, d.price\nFROM proj...
You are an expert in writing database language. You can write a corresponding 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": "Show me the hashtag IDs and their names.", "sql": null }, { "role": "assistant", "content": "SELECT hashtag_id, tag_name FROM social_media.hashtags;", "sql": null }, { "role": "user", "content": "I also want to see when each hashtag was created."...
You are an expert in writing database language. You can write a corresponding 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": "Get a list of all distinct specialties found among the doctors.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT specialty FROM healthcare.doctors;", "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": "Could you provide the sum of Deposit and Withdrawal amounts for each customer, showing their first and last names?", "sql": null }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name,\n SUM(CASE WHEN t.transaction_type = 'De...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "List the patient_id, first_name, last_name, and phone_number for all patients whose gender is 'Female', and whose emergency_contact_name is not null. Also, only include patients who have an email address.", "sql": null }, { "role": "assistant", "content": "SELEC...
You are an expert in writing database language. You can write a corresponding 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 full name and email of each driver and the number of vehicles currently assigned to their depot.", "sql": null }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, d.email, COUNT(v.vehicle_id) AS vehicles_at_depot\nFROM transportation...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_...
[ { "role": "user", "content": "能否帮我统计特定车站(station_id 为 'station_xyz')的所有工作人员数量?", "sql": null }, { "role": "assistant", "content": "MATCH (s:Station {station_id: 'station_xyz'})<-[:BASED_AT]-(staff:Staff)\nRETURN COUNT(staff) AS total_staff", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text,...
[ { "role": "user", "content": "Show me all room types with 'King' in the bed_type field, along with their property IDs and base rates.", "sql": null }, { "role": "assistant", "content": "SELECT room_type_id, property_id, type_name, bed_type, base_rate FROM hospitality_technology.room_types WH...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "Show all pairs of players who share the same email domain. Return player1, player2, and the domain.", "sql": null }, { "role": "assistant", "content": "SELECT p1.username AS player1,\n p2.username AS player2,\n SPLIT_PART(p1.email, '@', 2) AS domain\...
You are an expert in writing database language. You can write a corresponding 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": "Count the number of documents submitted for each service. Show the service_name and the document_count.", "sql": null }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(d.document_id) AS document_count\nFROM government_services.services s\nJOIN g...
You are an expert in writing database language. You can write a corresponding 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_dexpool_info (", "pair_address character varying(512) NOT NULL, -- the ...
[ { "role": "user", "content": "For each chain, find the token with the highest price and the token with the lowest price. List chain, high_price_token, max_price, low_price_token, and min_price.", "sql": null }, { "role": "assistant", "content": "WITH max_prices AS (\n SELECT chain,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "Show me the object ID, coin type, and balance for all SUI coins where the status is 'active'.", "sql": null }, { "role": "assistant", "content": "SELECT object_id, coin_type, balance FROM sui_coins WHERE status = 'active'", "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 insurance.premium_payments ( payment_id.text, policy_id.text, customer_id.text, paym...
[ { "role": "user", "content": "Find all pairs of payments for the same policy where the payment_periods overlap. Show payment_id1, payment_id2, policy_id, overlap_start, and overlap_end.", "sql": null }, { "role": "assistant", "content": "SELECT p1.payment_id AS payment_id1,\n p2.paymen...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 insurance.insurance_products ( product_id text, product_name text, product_type text...
[ { "role": "user", "content": "List all products, showing their ID, name, type, and whether they are active.", "sql": null }, { "role": "assistant", "content": "SELECT product_id, product_name, product_type, is_active FROM insurance.insurance_products;", "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 legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List the first name, last name, specialization, and the name of the law firm for all lawyers hired before January 1, 2020.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name , T1.last_name , T1.specialization , T2.firm_name FROM legal_se...