system
stringlengths
315
8.44k
conversations
listlengths
2
8
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_...
[ { "role": "user", "content": "I want to see for each server region the total number of servers and the average duration of all sessions hosted in that region.", "sql": null }, { "role": "assistant", "content": "SELECT s.region, COUNT(DISTINCT s.server_id) AS server_count, AVG(gs.duration_sec...
You are an expert in writing database language. You can write a corresponding 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": "Provide a summary for each transaction ID, showing the total amount of all its unspent UTXOs.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, SUM(amount) FROM utxos WHERE spent = false GROUP BY transaction_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Retrieve the number of distinct guests for each service order status.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(DISTINCT guest_id) AS guest_count\nFROM hospitality_technology.service_orders\nGROUP BY status;", "sql": null }, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam...
[ { "role": "user", "content": "What is the total USD value of tokens held by CEXes for tokens belonging to the 'DeFi' narrative on the 'Ethereum' chain? Show the narrative, chain, and total value.", "sql": null }, { "role": "assistant", "content": "SELECT T2.narrative, T1.chain, SUM(T1.usd_va...
You are an expert in writing database language. You can write a corresponding 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.invoices ( invoice_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "List pairs of invoice_number for invoices that share the same due_date.", "sql": null }, { "role": "assistant", "content": "SELECT a.due_date,\n a.invoice_number AS invoice1,\n b.invoice_number AS invoice2\nFROM legal_services.invoices a\nJOIN legal_...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, property_id text, reser...
[ { "role": "user", "content": "Show me the full names of guests who reviewed property 'P005' and gave an overall rating of 5.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name FROM guests AS T1 JOIN reviews AS T2 ON T1.guest_id = T2.guest_id WHERE T2.prope...
You are an expert in writing database language. You can write a corresponding 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, game_id uuid, item_name text, item_t...
[ { "role": "user", "content": "Can you show me the number of unique item types and the average cost amount for each game?", "sql": null }, { "role": "assistant", "content": "SELECT game_id, COUNT(DISTINCT item_type) AS unique_item_types, AVG(cost_amount) AS avg_cost_amount FROM gaming_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.users ( user_id text PRIMARY KEY, username text, email text, password_h...
[ { "role": "user", "content": "List each hashtag_id along with the total number of distinct posts it's linked to.", "sql": null }, { "role": "assistant", "content": "SELECT hashtag_id, COUNT(DISTINCT post_id) AS post_count\nFROM social_media.post_hashtags\nGROUP BY hashtag_id;", "sql": nu...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_t...
[ { "role": "user", "content": "I want to see pairs of items from the same game that share the same rarity but are of different types. Show each pair's names and types.", "sql": null }, { "role": "assistant", "content": "SELECT a.game_id,\n a.item_name AS item1_name,\n a.item_type ...
You are an expert in writing database language. You can write a corresponding 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 social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "I want to see each user's username and the number of posts they've made that include a media attachment of type 'image'.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, COUNT(*) AS image_post_count\nFROM social_media.users u\nJOIN social_m...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p...
[ { "role": "user", "content": "Can you list all item names and their types from the in-game items table?", "sql": null }, { "role": "assistant", "content": "SELECT item_name, item_type FROM gaming_technology.in_game_items;", "sql": null }, { "role": "user", "content": "Please ...
You are an expert in writing database language. You can write a corresponding 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": "List all agencies and their main phone numbers.", "sql": null }, { "role": "assistant", "content": "SELECT agency_name, main_phone_number FROM government_services.agencies;", "sql": null }, { "role": "user", "content": "Now show me the service lo...
You are an expert in writing database language. You can write a corresponding 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 NFTs with status 'exists' and their name and owner.", "sql": null }, { "role": "assistant", "content": "SELECT object_id, name, owner FROM sui_nfts WHERE status = 'exists';", "sql": null }, { "role": "user", "content": "Also inclu...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Which agencies offer more than three services? List the agency ID and the total number of services they provide.", "sql": null }, { "role": "assistant", "content": "SELECT agency_id, COUNT(service_id) AS total_services\nFROM government_services.services\nGROUP B...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "List all accounts having both a loan and at least one transaction in the last 7 days. Show account_id, account_type, and the total number of transactions in that period.", "sql": null }, { "role": "assistant", "content": "SELECT a.account_id, a.account_type, COU...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number...
[ { "role": "user", "content": "List all pairs of lawyers who share the same last name but have different first names. Show the first name, last name, and lawyer ID for both lawyers in each pair.", "sql": null }, { "role": "assistant", "content": "SELECT l1.first_name AS lawyer1_first_name, l1...
You are an expert in writing database language. You can write a corresponding 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(), usern...
[ { "role": "user", "content": "Show me all servers, the title of the game they host, and the name of the game's developer.", "sql": null }, { "role": "assistant", "content": "SELECT s.server_name, g.title AS game_title, d.name AS developer_name FROM gaming_technology.servers s JOIN gaming_tec...
You are an expert in writing database language. You can write a corresponding 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": "Show me the usernames of users who are participating in a conversation but have not sent any messages in that conversation, along with the conversation ID.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT\n u.username,\n cp.conversation_id\n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_i...
[ { "role": "user", "content": "For each review, show me the review comment and the associated service names that the guest has ordered during the same reservation.", "sql": null }, { "role": "assistant", "content": "SELECT r.review_id, r.comment, s.service_name \nFROM hospitality_technology.r...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NU...
[ { "role": "user", "content": "Can you list all the policy numbers and their group_numbers for policies that will expire within the next 90 days from today?", "sql": null }, { "role": "assistant", "content": "SELECT policy_number, group_number FROM healthcare.patient_insurance WHERE expiratio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "Show me all NFT collections on Ethereum with more than 10,000 tokens, including their names and contract addresses.", "sql": null }, { "role": "assistant", "content": "SELECT name, contract_address FROM nft_collections WHERE blockchain = 'Ethereum' AND token_cou...
You are an expert in writing database language. You can write a corresponding 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.guests ( guest_id character varying(64) NOT NULL, first_name ...
[ { "role": "user", "content": "List all staff members who work at properties offering 'Wellness' services, including the staff member's full name and position, and the property ID.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT s.first_name, s.last_name, s.position, s.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 social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "Show me the full names and email addresses of users who have received notifications of type 'mention', and the notification creation time.", "sql": null }, { "role": "assistant", "content": "SELECT u.full_name, u.email, n.created_at\nFROM social_media.notificati...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Show me transactions where the sender and receiver addresses are the same. List transaction_id, amount, and timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, amount, timestamp FROM blockchain.transactions WHERE sender_address ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text...
[ { "role": "user", "content": "List the first and last names of all doctors whose email address ends with '@hospital.org'.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name FROM healthcare.doctors WHERE email LIKE '%@hospital.org';", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show me all time entries from the last 90 days, including the entry description, hours spent, the name of the case, and the name of the client.", "sql": null }, { "role": "assistant", "content": "SELECT T1.description, T1.hours_spent, T2.case_name, T3.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.contracts ( contract_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "For each wallet, list its address, the user_id, and the total value of all token transfers sent from that wallet, along with the contract address of the token.", "sql": null }, { "role": "assistant", "content": "SELECT w.wallet_id, w.address, w.user_id, SUM(tt.v...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ...
[ { "role": "user", "content": "Show all diagnoses, including the diagnosis ID, description, diagnosis date, and the full name of the doctor who made the diagnosis.", "sql": null }, { "role": "assistant", "content": "SELECT T1.diagnosis_id, T1.description, T1.diagnosis_date, T2.first_name, 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "List the ERC20 tokens (from token_metas) with exactly 6 decimals. Show their symbol, contract_address, and name.", "sql": null }, { "role": "assistant", "content": "SELECT symbol, contract_address, name FROM token_metas WHERE is_erc20 = 1 AND decimals = 6;", ...
You are an expert in writing database language. You can write a corresponding 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": "Which DApps have the word 'exchange' in their description?", "sql": null }, { "role": "assistant", "content": "SELECT name, description\nFROM trading_platform.dapps\nWHERE description ILIKE '%exchange%';", "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 trading_platform.wallets ( wallet_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "I want a report of user IDs with their KYC status and the count of wallets they have.", "sql": null }, { "role": "assistant", "content": "SELECT k.user_id, k.status, COUNT(w.wallet_id) AS wallet_count\nFROM trading_platform.kyc_audit k\nLEFT JOIN trading_platfor...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "List each insurance provider with the count of primary active policies (is_primary = TRUE and expiration_date IS NULL or expiration_date > CURRENT_DATE). Return the provider and the count.", "sql": null }, { "role": "assistant", "content": "SELECT ip.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 healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id charac...
[ { "role": "user", "content": "Show me all diagnoses that correspond to a medication based on matching the diagnosis_code with the medication's NDC code, and include diagnosis_id, patient_id, diagnosis_date, medication_name, and status.", "sql": null }, { "role": "assistant", "content": "SELE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "List the first name, last name, and the total count of maintenance logs associated with the vehicles driven by each driver.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, count(T4.log_id) FROM transportation.drivers AS T1...
You are an expert in writing database language. You can write a corresponding 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": "For each narrative in token_basic_info, compute the total liquidity and count of tokens from token_dexpool_info. Show narrative, total_liquidity, and token_count.", "sql": null }, { "role": "assistant", "content": "SELECT tbi.narrative,\n SUM(td.liquidity) 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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact...
[ { "role": "user", "content": "List all pairs of law firms founded in the same year, showing the two firm names and the shared year.", "sql": null }, { "role": "assistant", "content": "SELECT f1.firm_name AS firm1, f2.firm_name AS firm2, EXTRACT(YEAR FROM f1.founded_date) AS year FROM law_fir...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "For each user, count the number of distinct smart contracts they have called. Return user_id, username, and contract_count, ordered by contract_count descending.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id,\n u.username,\n 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.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "Count the number of distinct patients enrolled in each insurance plan. Return plan_id and patient_count.", "sql": null }, { "role": "assistant", "content": "SELECT plan_id,\n COUNT(DISTINCT patient_id) AS patient_count\nFROM healthcare.patient_insurance\nG...
You are an expert in writing database language. You can write a corresponding 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": "Show me all accounts along with their associated customers' full names and the account status.", "sql": null }, { "role": "assistant", "content": "SELECT a.account_id, a.account_number, a.account_type, a.status, c.first_name || ' ' || c.last_name AS customer_ful...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name...
[ { "role": "user", "content": "Show the payment ID, amount, and payment method for all payments made in USD with an amount greater than 50.", "sql": null }, { "role": "assistant", "content": "SELECT payment_id, amount, payment_method\nFROM government_services.payments\nWHERE currency = 'USD' ...
You are an expert in writing database language. You can write a corresponding 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 each user along with the number of wallets they own and the number of unique addresses found in their UTXOs.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, COUNT(DISTINCT w.wallet_id) as wallet_count, COUNT(DISTINCT ut.address) as uni...
You are an expert in writing database language. You can write a corresponding 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": "How many games are there per platform, and what is the earliest release_date for each platform?", "sql": null }, { "role": "assistant", "content": "SELECT platform,\n COUNT(*) AS game_count,\n MIN(release_date) AS earliest_release\nFROM gaming_techno...
You are an expert in writing database language. You can write a corresponding 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 government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ...
[ { "role": "user", "content": "Can you show me a list of all agencies along with their parent agency names?", "sql": null }, { "role": "assistant", "content": "SELECT a.agency_id, a.agency_name, pa.agency_name AS parent_agency_name\nFROM government_services.agencies a\nLEFT JOIN government_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 social_media.conversation_participants ( participant_id character varying(64) NO...
[ { "role": "user", "content": "List each participant_id along with the total number of participants in their conversation, and include user_id and conversation_id.", "sql": null }, { "role": "assistant", "content": "SELECT cp.participant_id, cp.user_id, cp.conversation_id, counts.participant_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr...
[ { "role": "user", "content": "List all achievements with more than 100 points.", "sql": null }, { "role": "assistant", "content": "SELECT *\nFROM gaming_technology.achievements\nWHERE points > 100;", "sql": null }, { "role": "user", "content": "Now exclude any hidden achievem...
You are an expert in writing database language. You can write a corresponding 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": "How many distinct addresses achieved a realized_ratio higher than 0.9 last month?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT address) FROM smart_money_profit WHERE realized_ratio > 0.9;", "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 web3.transactions ( transaction_id text, from_address text, to_address text, value n...
[ { "role": "user", "content": "List all failed transactions where the gas_used is greater than 100,000, including the transaction_id and timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, timestamp FROM web3.transactions WHERE status = 'failed' AND gas_used ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Show all transactions where the sender and receiver are different addresses but the transaction amount is exactly 1000. Include transaction_id, sender_address, receiver_address, and timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT transactio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "Find all pairs of events that occurred in the same transaction but at different log indices, showing both event_ids, their event_names, the transaction_id, and each log_index.", "sql": null }, { "role": "assistant", "content": "SELECT a.event_id AS event_id1,\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, ...
[ { "role": "user", "content": "List all rooms with their numbers, property names, and the full name of the property manager.", "sql": null }, { "role": "assistant", "content": "SELECT r.room_number, p.property_name, s.first_name || ' ' || s.last_name AS manager_full_name\nFROM hospitality_tec...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number...
[ { "role": "user", "content": "Show me the full names of partners and the full names of non-partner lawyers at the same firm.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name || ' ' || p.last_name AS partner_full_name, np.first_name || ' ' || np.last_name AS lawyer_full...
You are an expert in writing database language. You can write a corresponding 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.transactions ( transaction_id character varying(64) NOT NULL, from_address char...
[ { "role": "user", "content": "Retrieve all transactions where the total value of token transfers in that transaction exceeds the Ether value of the transaction itself. Include transaction_id, ether_value, and total_token_value.", "sql": null }, { "role": "assistant", "content": "SELECT\n 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.servers ( server_id.uuid, game_id.uuid, server_name.text, region.t...
[ { "role": "user", "content": "List the 10 most recent achievement unlocks across all players. Show player ID, achievement ID, and unlock timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, achievement_id, unlocked_at FROM gaming_technology.player_achievements 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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "List the full name, email, and phone number of all partners together with the full name of a non-partner lawyer in the same law firm.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name AS partner_first_name, p.last_name AS partner_last_name,...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for...
[ { "role": "user", "content": "Show the transaction ID, the transaction value from the transactions table, and the sum of the value from token_transfers for all transactions that have at least one associated token transfer. Name the sum column total_token_transfer_value.", "sql": null }, { "role"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_l...
[ { "role": "user", "content": "Show all trips, including the trip ID, vehicle license plate, and the vehicle's capacity.", "sql": null }, { "role": "assistant", "content": "SELECT t.trip_id, v.license_plate, v.capacity FROM transportation.trips t JOIN vehicles v ON t.vehicle_id = v.vehicle_id...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Find the first name, last name, and contact email of citizens who have scheduled appointments in March 2024.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.contact_email FROM government_services.citizens AS T1...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, gener...
[ { "role": "user", "content": "Show me the medication_id, medication_name, and manufacturer for all medications where the generic_name contains the word 'azole'.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications...
You are an expert in writing database language. You can write a corresponding 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, token_name charac...
[ { "role": "user", "content": "List all tokens with a liquidity over $1 million and a negative 1-hour price change percentage on the Binance chain.", "sql": null }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, price_change_percentage_1h, liquidity FROM token_dexp...
You are an expert in writing database language. You can write a corresponding 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 the user IDs and usernames for all users who registered in the year 2024.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, username FROM trading_platform.users WHERE created_at >= '2024-01-01 00:00:00' AND created_at < '2025-01-01 00:00:0...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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.routes ( route_id text, route_number text, description text, origin_l...
[ { "role": "user", "content": "List the booking ID, trip ID, and the booking status for all bookings.", "sql": null }, { "role": "assistant", "content": "SELECT booking_id, trip_id, status FROM transportation.bookings;", "sql": null }, { "role": "user", "content": "For these b...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, -- unique identifier...
[ { "role": "user", "content": "Show all premium payments along with the incident date and estimated loss of any associated claims for the same policy. List payment_id, amount_paid, payment_date, incident_date, and estimated_loss.", "sql": null }, { "role": "assistant", "content": "SELECT T1.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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un...
[ { "role": "user", "content": "For each publisher, find pairs of games they have published that belong to different genres. Include publisher_id, the genre and title of both games in each pair.", "sql": null }, { "role": "assistant", "content": "SELECT g1.publisher_id,\n g1.genre AS gen...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "Show me all appointments where the subject contains the word 'Meeting', including the appointment ID, start time, end time, and subject.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id , start_time , end_time , subject FROM legal_ser...
You are an expert in writing database language. You can write a corresponding 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": "Provide each trip's ID, vehicle license plate, driver's full name, origin city, and destination city.", "sql": null }, { "role": "assistant", "content": "SELECT t.trip_id,\n v.license_plate,\n CONCAT(d.first_name, ' ', d.last_name) AS driver_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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "Count the number of patients grouped by gender, showing gender and patient_count.", "sql": null }, { "role": "assistant", "content": "SELECT gender, COUNT(*) AS patient_count\nFROM healthcare.patients\nGROUP BY gender;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "I need to find all pairs of policies for each customer whose coverage periods overlap. Show customer_id, the two policy_ids for each overlapping pair.", "sql": null }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_id AS policy1_id,\...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h...
[ { "role": "user", "content": "Which users have participated in group chats and also liked comments? Please show their usernames, the group name, and the comment_id they've liked.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, c.group_name, l.comment_id\nFROM social_me...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "Find all pairs of servers located in the same region but with different statuses. Show the server names, the region, and their statuses.", "sql": null }, { "role": "assistant", "content": "SELECT s1.server_name AS server1, s2.server_name AS server2, s1.region, 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.cases ( case_id.text, case_number.text, case_name.text, client_id.tex...
[ { "role": "user", "content": "List all cases that have an invoice issued in July 2024, showing the case name, case number, invoice number, and issue date.", "sql": null }, { "role": "assistant", "content": "SELECT T1.case_name, T1.case_number, T2.invoice_number, T2.issue_date FROM legal_serv...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id...
[ { "role": "user", "content": "Which customers have more than one account? Please include customer_id and the number of accounts they hold.", "sql": null }, { "role": "assistant", "content": "SELECT customer_id, COUNT(account_id) AS account_count FROM financial_services.accounts GROUP BY cust...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "List all players with the games for which they've unlocked achievements, showing username, game title, and count of achievements unlocked per game.", "sql": null }, { "role": "assistant", "content": "SELECT p.username, g.title AS game_title, COUNT(pa.achievement...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.te...
[ { "role": "user", "content": "Can you show me the total number of available services and the average price for each department?", "sql": null }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS available_service_count, AVG(price) AS average_price FROM hospitality_technology....
You are an expert in writing database language. You can write a corresponding 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": "Get each property's name and the number of distinct service categories it offers.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_name,\n COUNT(DISTINCT s.category) AS category_count\nFROM hospitality_technology.properties p\nLEFT JOI...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, game_id uuid, item_name ...
[ { "role": "user", "content": "I need pairs of items within the same game where one item_type is 'Weapon' and the other is 'Consumable'. Show game_id, weapon_name, and consumable_name.", "sql": null }, { "role": "assistant", "content": "SELECT i1.game_id, i1.item_name AS weapon_name, i2.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 trading_platform.wallets ( wallet_id text, user_id text, address text, private_key t...
[ { "role": "user", "content": "Show me pairs of wallets that belong to the same user, listing the wallet_id, user_id, address, and created_at for the earlier and later wallet in each pair.", "sql": null }, { "role": "assistant", "content": "SELECT w1.user_id,\n w1.wallet_id AS earlier_w...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 financial_services.transactions ( transaction_id text, account_id text, related_acco...
[ { "role": "user", "content": "Show the total number of transactions for each currency.", "sql": null }, { "role": "assistant", "content": "SELECT currency, COUNT(*) FROM financial_services.transactions GROUP BY currency", "sql": null }, { "role": "user", "content": "Can you a...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "Find all events emitted by contracts that are also associated with token transfers. Show the event id, contract id, event name, emitted_at, transaction id, and also include the corresponding transfer id from token_transfers.", "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 hospitality_technology.staff ( staff_id text PRIMARY KEY, property_id text, first_na...
[ { "role": "user", "content": "Show me all staff members who have a manager assigned, along with each manager's full name.", "sql": null }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, s.manager_id, m.first_name AS manager_first_name, m.last_name AS manager...
You are an expert in writing database language. You can write a corresponding 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": "List the user IDs, theme, and updated_at for users who have disabled email notifications, enabled push notifications, and have a private profile.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, theme, updated_at FROM social_media.user_setting...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "Find the total transfer volume for each Avalanche token over the past 7 days and include the token's creator.", "sql": null }, { "role": "assistant", "content": "SELECT a.tick,\n i.creator,\n SUM(a.amt) AS total_volume\nFROM token_activities_avalanch...
You are an expert in writing database language. You can write a corresponding 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": "How many service orders were placed by each staff member (staff_id_ordered)? Show the staff ID and the count.", "sql": null }, { "role": "assistant", "content": "SELECT staff_id_ordered, COUNT(*) FROM hospitality_technology.service_orders GROUP BY staff_id_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 web3.wallets ( wallet_id text, user_id text, address text, private_key text, created...
[ { "role": "user", "content": "For each user, what is the average time difference in days between their wallet creations? Return user_id and avg_diff_days.", "sql": null }, { "role": "assistant", "content": "WITH diffs AS (\n SELECT\n user_id,\n EXTRACT(EPOCH FROM (created_at - LAG(cre...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.nodes ( node_id text, ip_address text, port integer, last_seen timestamp ...
[ { "role": "user", "content": "How many unique email domains are there among all registered users?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT SUBSTRING(email FROM POSITION('@' IN email) + 1)) AS unique_domains FROM blockchain.users;", "sql": null }, { ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "List all pairs of clients who registered on the same day, showing each client's first_name, last_name, and the registration date.", "sql": null }, { "role": "assistant", "content": "SELECT c1.first_name AS first_name_1, c1.last_name AS last_name_1, c2.first_name...
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 healthcare.medical_records ( record_id text, patient_id text, appointment_id text, d...
[ { "role": "user", "content": "Show me pairs of patients who have had a medical record created on the same day. For each pair, include the first patient's ID, the second patient's ID, the shared record_date, and their respective record_ids.", "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 insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identif...
[ { "role": "user", "content": "List all policies that have been cancelled, showing the policy number, cancellation date, and reason.", "sql": null }, { "role": "assistant", "content": "SELECT policy_number, cancellation_date, cancellation_reason FROM insurance.policies WHERE status = 'Cancell...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "List all transactions that include an event with the name 'Transfer', showing the transaction ID, the event name, and the transaction's value.", "sql": null }, { "role": "assistant", "content": "SELECT t.transaction_id, e.event_name, t.value FROM web3.transactio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "Retrieve the product_id and product_name for all insurance products created after March 1, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT product_id, product_name\nFROM insurance.insurance_products\nWHERE created_at > '2024-03-01';", "sql":...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "Which room types have the highest average base_rate? Return type_name and avg_rate, sorted descending, limit 5.", "sql": null }, { "role": "assistant", "content": "SELECT rt.type_name,\n AVG(rt.base_rate) AS avg_rate\nFROM hospitality_technology.room_types...
You are an expert in writing database language. You can write a corresponding 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 time entries, showing the date worked, hours spent, description, the first and last name of the lawyer, and the name of the case.", "sql": null }, { "role": "assistant", "content": "SELECT T1.date_worked, T1.hours_spent, T1.description, T2.first_name, 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 legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, c...
[ { "role": "user", "content": "Show me all appointments that have both a non-null location and notes, along with their appointment_id, client_id, lawyer_id, and start_time.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id, client_id, lawyer_id, start_time FROM legal_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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character...
[ { "role": "user", "content": "Which narrative in narrative_info has the highest volume_24h, and what are its top_3_coins and token_num?", "sql": null }, { "role": "assistant", "content": "SELECT narrative,\n top_3_coins,\n token_num\nFROM narrative_info\nORDER BY volume_24h DESC\nLIMIT 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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti...
[ { "role": "user", "content": "How many NFTs are currently held for each contract address and token ID? Please show contract address, token id, and total amount held.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, token_id, SUM(CAST(amount AS BIGINT)) as total_he...
You are an expert in writing database language. You can write a corresponding 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.securities ( security_id text, ticker_symbol text, isin_code text...
[ { "role": "user", "content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector, along with their last_updated timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT security_id, tick...