Dataset Viewer
Auto-converted to Parquet Duplicate
system
stringlengths
319
7.62k
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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_i...
[ { "role": "user", "content": "Find pairs of reservations at the same property where the second check-in is within 7 days after the first check-out. Return first_reservation, second_reservation, and gap_days." }, { "role": "assistant", "content": "SELECT r1.reservation_id AS first_reservation,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "How many citizens are marked as not verified?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.citizens WHERE is_verified = FALSE;" } ]
You are an expert in writing database language. You can write a corresponding 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 pairs of law firms that are located at the same address. Display the names of both firms and the shared address, ensuring the address is not null." }, { "role": "assistant", "content": "SELECT\n t1.firm_name AS firm1_name,\n t2.firm_name AS firm2_name,\n 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 legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case...
[ { "role": "user", "content": "Show me all invoices where the notes field is not null. Display invoice number, client ID, and notes." }, { "role": "assistant", "content": "SELECT invoice_number, client_id, notes FROM legal_services.invoices WHERE notes IS NOT NULL;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ...
[ { "role": "user", "content": "List all in-game items with their name, type, and rarity." }, { "role": "assistant", "content": "SELECT item_name, item_type, rarity FROM gaming_technology.in_game_items;" }, { "role": "user", "content": "Filter this list to include only items with 'Rare...
You are an expert in writing database language. You can write a corresponding 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": "For each patient, find the date of their most recent medical record and the effective date of their current primary insurance plan. Return patient_id, last_record_date, and effective_date." }, { "role": "assistant", "content": "SELECT m.patient_id,\n m.last_da...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.loans ( loan_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "For each loan, calculate the number of days until maturity. Display loan_id, account_id, maturity_date, and days_to_maturity as the difference between maturity_date and CURRENT_DATE." }, { "role": "assistant", "content": "SELECT loan_id,\n account_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 project_fundraising_record (", "id character varying(32) NOT NULL, -- fundrai...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table." }, { "role": "assistant", "content": "SELECT pfr.project_name, pfr.valuation, tbi.token_symbol,...
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 ticket prices for trains departing from the station with ID 'ST456'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on ticket prices as this data is not included in the station management database. For ticket pricing, ...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve each customer_id, first_name, last_name, and close_price for market_data entries that occurred on the day of their account creation." }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name, md.close_price FROM financial_servic...
You are an expert in writing database language. You can write a corresponding 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'." }, { "role": "assistant", "content": "SELECT u.username, COUNT(*) AS image_post_count\nFROM social_media.users u\nJOIN social_media.posts p ON 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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "List all partners who were hired in the same year. Show their first name, last name, hire year, and firm ID." }, { "role": "assistant", "content": "SELECT l1.first_name, l1.last_name, EXTRACT(YEAR FROM l1.hire_date) AS hire_year, l1.firm_id FROM legal_services.lawye...
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?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to data regarding the environmental impact assessments for the production of specific aircraft models...
You are an expert in writing database language. You can write a corresponding 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": "For each service location, show the location name, city, and the number of appointments scheduled at that location." }, { "role": "assistant", "content": "SELECT sl.location_name, sl.city, COUNT(a.appointment_id) AS appointment_count\nFROM government_services.servic...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id.text, property_id.text, type_name.t...
[ { "role": "user", "content": "Show all room types that offer 'WiFi' in their amenities." }, { "role": "assistant", "content": "SELECT room_type_id, property_id, type_name, amenities FROM hospitality_technology.room_types WHERE amenities LIKE '%WiFi%';" }, { "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.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,...
[ { "role": "user", "content": "List all active policies, showing the policy number, the customer's full name, and the agent's full name who sold the policy." }, { "role": "assistant", "content": "SELECT T1.policy_number, T2.first_name, T2.last_name, T3.first_name, T3.last_name FROM policies 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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex...
[ { "role": "user", "content": "List policy IDs and policy numbers for policies that have a null cancellation reason." }, { "role": "assistant", "content": "SELECT policy_id, policy_number FROM insurance.policies WHERE cancellation_reason IS 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.orders ( order_id.text, user_id.text, wallet_id.text, asset_id.text...
[ { "role": "user", "content": "Count the number of orders in each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS order_count\nFROM trading_platform.orders\nGROUP BY 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "What is the average commission rate for agents whose status is 'Terminated'?" }, { "role": "assistant", "content": "SELECT AVG(commission_rate) FROM insurance.agents WHERE status = 'Terminated' AND commission_rate IS NOT NULL;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "Which wallets currently hold more than 200 units of any ERC1155 NFT, and what is the token ID and contract address for each such holding?" }, { "role": "assistant", "content": "SELECT contract_address, token_id, wallet_address, amount FROM nft_holders WHERE 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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "Show me the policy number, premium amount, and payment status for every premium payment made, along with the customer's full name for each one." }, { "role": "assistant", "content": "SELECT p.policy_number, pp.amount_paid, pp.status, c.first_name, c.last_name\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 web3.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created...
[ { "role": "user", "content": "Find the address and creation date of all wallets whose private keys start with '0xabc'." }, { "role": "assistant", "content": "SELECT address, created_at FROM web3.wallets WHERE private_key LIKE '0xabc%';" }, { "role": "user", "content": "Actually, can ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,...
[ { "role": "user", "content": "List all Avalanche tokens where the circulating total supply is less than the maximum supply. Include tick, creator, max_supply, total_supply (sum of amount), and the difference between max_supply and total_supply." }, { "role": "assistant", "content": "SELECT bi.ti...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.follows ( follow_id text, follower_user_id text, following_user_id text...
[ { "role": "user", "content": "Find pairs of user IDs (A, B) such that user A follows user B, and user B also follows user A (mutual follows). List user A's ID and user B's ID." }, { "role": "assistant", "content": "SELECT T1.follower_user_id AS user_a, T1.following_user_id AS user_b FROM social_...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the name and description of services offered by agencies in the 'Federal' jurisdiction." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.description FROM government_services.services AS T1 JOIN government_services.agencies AS T2 ON T1.agenc...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre...
[ { "role": "user", "content": "List the name and location ID for all locations where the postal code is missing." }, { "role": "assistant", "content": "SELECT name, location_id FROM transportation.locations WHERE postal_code IS NULL;" }, { "role": "user", "content": "Also include the ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c...
[ { "role": "user", "content": "Can you show the fuel_log_id, vehicle make, and quantity for all fuel logs where the quantity is greater than 100?" }, { "role": "assistant", "content": "SELECT f.fuel_log_id, v.make, f.quantity\nFROM transportation.fuel_logs f\nJOIN transportation.vehicles v ON f.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 social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_us...
[ { "role": "user", "content": "How many messages in total have been sent that do not contain any media attachment?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS non_media_message_count\nFROM social_media.messages\nWHERE media_url IS NULL OR media_url = '';" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_us...
[ { "role": "user", "content": "List the sender_user_id and the total number of messages they have sent that include media attachments, along with the conversation_id." }, { "role": "assistant", "content": "SELECT sender_user_id, conversation_id, COUNT(*) AS media_message_count\nFROM social_media....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.trades ( trade_id character varying(64) NOT NULL, -- unique i...
[ { "role": "user", "content": "Which accounts have executed trades with a total value greater than 1,000,000?" }, { "role": "assistant", "content": "SELECT account_id, SUM(total_amount) AS total_traded_amount\nFROM financial_services.trades\nGROUP BY account_id\nHAVING SUM(total_amount) > 1000000...
You are an expert in writing database language. You can write a corresponding 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": "List all group conversations that have at least one unread notification, include the conversation ID, group name, and the count of unread notifications as unread_count." }, { "role": "assistant", "content": "SELECT c.conversation_id, c.group_name, COUNT(n.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 trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id charact...
[ { "role": "user", "content": "List all peers with their IP addresses who have not been seen in the last 7 days." }, { "role": "assistant", "content": "SELECT peer_id, ip_address, port, last_seen\nFROM trading_platform.peers\nWHERE last_seen < NOW() - INTERVAL '7 days';" } ]
You are an expert in writing database language. You can write a corresponding 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 the total number of time entries for each case." }, { "role": "assistant", "content": "SELECT case_id, COUNT(*) AS entry_count\nFROM legal_services.time_entries\nGROUP BY case_id;" }, { "role": "user", "content": "Only include cases where the tot...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, docum...
[ { "role": "user", "content": "List pairs of documents uploaded by the same lawyer but for different cases, showing both document names, their case IDs, and the lawyer ID." }, { "role": "assistant", "content": "SELECT t1.document_name AS document1_name, t1.case_id AS document1_case_id, t2.documen...
You are an expert in writing database language. You can write a corresponding 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": "Which customers have filed claims that are currently under review, and what are the details of those claims?" }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name, cl.claim_id, cl.incident_date, cl.description, cl.status\nFROM insura...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir...
[ { "role": "user", "content": "Show the total number of customers in each state." }, { "role": "assistant", "content": "SELECT\n state,\n COUNT(customer_id)\nFROM insurance.customers\nGROUP BY\n state;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c...
[ { "role": "user", "content": "Show me each staff member and the count of service orders they have delivered." }, { "role": "assistant", "content": "SELECT st.staff_id, st.first_name, st.last_name, COUNT(so.order_id) AS delivered_orders\nFROM hospitality_technology.staff st\nLEFT JOIN hospitality...
You are an expert in writing database language. You can write a corresponding 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": "For each block that contains more than 5 transactions, list the block number, the total sum of values transferred within that block, and the average gas used per transaction in that block." }, { "role": "assistant", "content": "SELECT block_number, SUM(value) AS tot...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, ticker_symbol text, is...
[ { "role": "user", "content": "I want to list each security alongside another security issued by the same issuer." }, { "role": "assistant", "content": "SELECT a.security_id, a.ticker_symbol, b.security_id AS other_security_id, b.ticker_symbol AS other_ticker, a.issuer_name\nFROM financial_servic...
You are an expert in writing database language. You can write a corresponding 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, token_id text, from_address text, to_addres...
[ { "role": "user", "content": "For each transaction, show its transaction_id and the count of tokens transferred within that transaction." }, { "role": "assistant", "content": "SELECT transaction_id, COUNT(token_id) AS tokens_transferred FROM web3.token_transfers GROUP BY transaction_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 financial_services.transactions ( transaction_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "For each employee who serves as a relationship manager, what is the total transaction amount processed for the accounts they manage?" }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, SUM(t.amount) AS total_managed_transaction_amount FROM finan...
You are an expert in writing database language. You can write a corresponding 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." }, { "role": "assistant", "content": "SELECT appointment_id , start_time , end_time , subject FROM legal_services.appointment...
You are an expert in writing database language. You can write a corresponding 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": "List all users, showing their user ID, username, and the total number of wallets they have created. Include users who have no wallets." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(w.wallet_id) AS wallet_count FROM trading_platform.users...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, d...
[ { "role": "user", "content": "For each agency, how many services are currently inactive? Return the agency_id and the count of inactive services." }, { "role": "assistant", "content": "SELECT\n agency_id,\n COUNT(*) AS inactive_service_count\nFROM government_services.services\nWHERE is_active ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure "CREATE TABLE cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the ...
[ { "role": "user", "content": "What is the total USD value of tokens held by CEX addresses on the 'Ethereum' chain for the most recent snapshot time?" }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT max(snapshot_time) as max_time\n FROM cex_token_balance\n)\nSELECT sum(...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show the full names and emails of staff members who have delivered at least one service order." }, { "role": "assistant", "content": "SELECT DISTINCT s.first_name, s.last_name, s.work_email\nFROM hospitality_technology.staff s\nJOIN hospitality_technology.service_or...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.ti...
[ { "role": "user", "content": "List the claim ID, incident date, estimated loss, and the first and last name of the customer for all claims with an estimated loss greater than 5000." }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.incident_date, T1.estimated_loss, T2.first_name, T2.l...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci...
[ { "role": "user", "content": "What is the total estimated loss for all claims reported in the year 2024?" }, { "role": "assistant", "content": "SELECT SUM(estimated_loss) FROM insurance.claims WHERE EXTRACT(YEAR FROM reported_date) = 2024;" } ]
You are an expert in writing database language. You can write a corresponding 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": "Show me the user ID and the total count of wallets associated with each user who owns at least one wallet." }, { "role": "assistant", "content": "SELECT T1.user_id, COUNT(T2.wallet_id) FROM trading_platform.users AS T1 JOIN trading_platform.wallets AS T2 ON T1.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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character...
[ { "role": "user", "content": "For each fundraising round, show the round name, the count of distinct projects, the total investment value, and the average current price of associated tokens. Match projects to tokens where project_name = token_name and sort by total investment descending." }, { "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 hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex...
[ { "role": "user", "content": "List all payments made using a credit card, including guest_id, amount, payment_method, and payment_timestamp." }, { "role": "assistant", "content": "SELECT guest_id, amount, payment_method, payment_timestamp FROM hospitality_technology.payments WHERE payment_method...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the route number and description for routes whose estimated duration exceeds 120 minutes." }, { "role": "assistant", "content": "SELECT route_number, description\nFROM transportation.routes\nWHERE estimated_duration_minutes > 120;" }, { "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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "Show all cases that were opened and subsequently closed in the same calendar year. List the case name, case number, date opened, and date closed." }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened, date_closed FROM legal_services.cases...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha...
[ { "role": "user", "content": "Which document types have been used for more than 100 documents, and what is the total file size across all documents of each such type?" }, { "role": "assistant", "content": "SELECT document_type, COUNT(*) AS document_count, SUM(file_size_bytes) AS total_file_size_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,...
[ { "role": "user", "content": "Please list the agent ID, agent's name, and manager's email for all agents who have a commission_rate greater than 0.12." }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name || ' ' || a.last_name AS agent_name, m.contact_email AS manager_email\nFRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_i...
[ { "role": "user", "content": "I need to identify overlapping appointments for each doctor. Return doctor_id, the first appointment_id, the overlapping appointment_id, and the overlap start time." }, { "role": "assistant", "content": "SELECT A.doctor_id,\n A.appointment_id AS a1,\n 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 healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "List the names and manufacturers of all medications that do not have an NDC code." }, { "role": "assistant", "content": "SELECT medication_name, manufacturer\nFROM healthcare.medications\nWHERE ndc_code IS NULL;" }, { "role": "user", "content": "Please 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 trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type te...
[ { "role": "user", "content": "List all assets that have at least one associated metadata entry, showing the asset name, symbol, and the key and value of each metadata entry." }, { "role": "assistant", "content": "SELECT a.name, a.symbol, m.key, m.value FROM trading_platform.assets a JOIN trading...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, d...
[ { "role": "user", "content": "List all pairs of active services in the same category where one service’s standard fee is higher than the other’s. Display the category, the higher-fee service name with its fee, and the lower-fee service name with its fee." }, { "role": "assistant", "content": "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 transportation.routes ( route_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "Find pairs of routes where the destination of one route matches the origin of another. Show the first_route_number, first_description, second_route_number, and second_description." }, { "role": "assistant", "content": "SELECT r1.route_number AS first_route_number, 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.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "I need to find patients who received prescriptions within 7 days after their latest appointment. Show patient_id, first and last name, appointment_time, prescription_date, and medication_name." }, { "role": "assistant", "content": "WITH latest_appt AS (\n SELECT pa...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "Retrieve the citizen_id, full name, and registration_date of all citizens born before 1980-01-01 who are not verified." }, { "role": "assistant", "content": "SELECT citizen_id,\n first_name || ' ' || last_name AS full_name,\n registration_date\nFROM gove...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text, property_id text, type_name t...
[ { "role": "user", "content": "Show me all available services with a unit of 'Per Hour'." }, { "role": "assistant", "content": "SELECT service_name , description , price FROM hospitality_technology.services WHERE is_available = true AND unit = 'Per Hour'" }, { "role": "user", "c...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ...
[ { "role": "user", "content": "Show me all insurance products of type 'Health' or 'Dental'." }, { "role": "assistant", "content": "SELECT *\nFROM insurance.insurance_products\nWHERE product_type IN ('Health', 'Dental');" }, { "role": "user", "content": "I only want to see those that 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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par...
[ { "role": "user", "content": "Find users who have both commented on a post and liked that same post. Return the user_id and the count of such posts as post_count." }, { "role": "assistant", "content": "SELECT c.user_id, COUNT(DISTINCT c.post_id) AS post_count\nFROM social_media.comments c\nJOIN ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "List all premium payments that were made using 'credit card' as the payment method." }, { "role": "assistant", "content": "SELECT payment_id, policy_id, customer_id, payment_date, amount_paid, payment_method\nFROM insurance.premium_payments\nWHERE payment_method = '...
You are an expert in writing database language. You can write a corresponding 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": "How many documents are set to expire in the year 2025?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS document_count\nFROM government_services.documents\nWHERE expiry_date >= '2025-01-01' AND expiry_date < '2026-01-01';" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id text PRIMARY KEY, contract_id text, event_name text, data tex...
[ { "role": "user", "content": "Find all events where the data field contains 'amount' and show the event name, contract ID, and transaction ID, along with the log index, sorted by log index in ascending order." }, { "role": "assistant", "content": "SELECT event_name, contract_id, transaction_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 healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NU...
[ { "role": "user", "content": "List all insurance plans that will expire within the next 30 days, showing the patient IDs and subscriber names." }, { "role": "assistant", "content": "SELECT patient_id, subscriber_name, policy_number, expiration_date\nFROM healthcare.patient_insurance\nWHERE expir...
You are an expert in writing database language. You can write a corresponding 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": "List the top 3 tokens by liquidity on BSC and show their token symbols, prices, market cap, and liquidity." }, { "role": "assistant", "content": "SELECT token_symbol, price, market_cap, liquidity\nFROM token_dexpool_info\nWHERE chain = 'BSC'\nORDER BY liquidity DESC...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, docum...
[ { "role": "user", "content": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs." }, { "role": "assistant", "content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS case_id_2 FROM lega...
You are an expert in writing database language. You can write a corresponding 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": "Which two tokens on each chain have the greatest difference in their 24h price change percentage? Show token_symbol A, token_symbol B, chain, and the absolute difference." }, { "role": "assistant", "content": "SELECT DISTINCT ON (t1.chain)\n t1.token_symbol AS symb...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "List all unspent UTXOs with an amount greater than 10." }, { "role": "assistant", "content": "SELECT utxo_id, transaction_id, address, amount FROM utxos WHERE spent = FALSE AND amount > 10;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci...
[ { "role": "user", "content": "Show me all insurance products along with the number of distinct agents whose handled claims are for policies using that product. Include product_id, product_name, and agent_count." }, { "role": "assistant", "content": "SELECT ip.product_id, ip.product_name, COUNT(D...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "List the users who have never posted any public posts, showing user_id, username, and email." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, u.email FROM social_media.users u LEFT JOIN social_media.posts p ON p.user_id = u.user_id AND p.visibili...
You are an expert in writing database language. You can write a corresponding 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": "How many hashtags were created in each month of 2024?" }, { "role": "assistant", "content": "SELECT date_trunc('month', created_at) AS month, COUNT(*) AS count\nFROM social_media.hashtags\nWHERE created_at >= '2024-01-01'\n AND created_at < '2025-01-01'\nGROUP BY 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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, da...
[ { "role": "user", "content": "Show me all employees (employee_id, first_name, last_name) in the 'Investment' department who have processed loans (loan_id) with a principal amount greater than $100,000, along with the count of such loans for each employee." }, { "role": "assistant", "content": "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 hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id ...
[ { "role": "user", "content": "Show me the email addresses and hire dates for all staff who have a manager." }, { "role": "assistant", "content": "SELECT work_email, hire_date\nFROM hospitality_technology.staff\nWHERE manager_id IS NOT NULL;" }, { "role": "user", "content": "Only incl...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
2