Dataset Viewer
Auto-converted to Parquet Duplicate
system
stringlengths
325
7.3k
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 insurance.premium_payments ( payment_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Find all pairs of overlapping payment periods for the same customer. Return customer_id, first payment_id as payment1_id, second payment_id as payment2_id, and both periods' start and end dates." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "List the number of trips and the average passenger count per vehicle." }, { "role": "assistant", "content": "SELECT v.vehicle_id, COUNT(t.trip_id) AS trip_count, AVG(t.passenger_count) AS avg_passenger_count\nFROM transportation.vehicles v\nLEFT JOIN transportation....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Provide a count of diagnoses for each status, grouped by the code type." }, { "role": "assistant", "content": "SELECT code_type, status, COUNT(*) FROM healthcare.diagnoses GROUP BY code_type, status;" }, { "role": "user", "content": "Filter this result 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." }, { "role": "assistant", "content": "SELECT f1.firm_name AS firm1, f2.firm_name AS firm2, EXTRACT(YEAR FROM f1.founded_date) AS year FROM law_firms f1 JOIN law_fi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da...
[ { "role": "user", "content": "List all employees who were hired in the last two years along with their department and status." }, { "role": "assistant", "content": "SELECT employee_id, first_name, last_name, department, status FROM financial_services.employees WHERE hire_date >= (CURRENT_DATE - ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.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." }, { "role": "assistant", "content": "SELECT security_id, ticker_symbol, securi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media...
[ { "role": "user", "content": "Show the count of unread notifications per user for notifications related to posts. Return recipient_user_id and unread_count." }, { "role": "assistant", "content": "SELECT recipient_user_id, COUNT(*) AS unread_count\nFROM social_media.notifications\nWHERE target_en...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id te...
[ { "role": "user", "content": "List the total number of service orders placed by each staff member who delivered the service." }, { "role": "assistant", "content": "SELECT staff_id_delivered, COUNT(*) AS order_count FROM hospitality_technology.service_orders GROUP BY staff_id_delivered;" }, {...
You are an expert in writing database language. You can write a corresponding 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": "Show me the usernames and email addresses of all users who have commented on posts that contain the hashtag 'music'." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email\nFROM social_media.comments c\nJOIN social_media.posts p ON c.post_id = 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 web3.token_transfers ( transfer_id character varying(64) NOT NULL, token_id characte...
[ { "role": "user", "content": "Find all addresses that have both received and sent transfers of the same token. List the address and the token ID for each such instance." }, { "role": "assistant", "content": "SELECT DISTINCT t1.to_address AS address, t1.token_id FROM web3.token_transfers t1 JOIN ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.conversation_participants ( participant_id.text, conversation_id.text, ...
[ { "role": "user", "content": "Which users participated in more than one conversation? Show their user_id and participant_id for each conversation, along with the joined_at time." }, { "role": "assistant", "content": "SELECT user_id, participant_id, conversation_id, joined_at FROM social_media.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 hospitality_technology.staff ( staff_id text PRIMARY KEY, property_id text, first_na...
[ { "role": "user", "content": "List staff members who were hired in the last calendar year, showing their full name, position, and hire date." }, { "role": "assistant", "content": "SELECT first_name, last_name, position, hire_date FROM hospitality_technology.staff WHERE hire_date >= date_trunc('y...
You are an expert in writing database language. You can write a corresponding 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 all customers who have purchased policies for insurance products of type 'health', including their full name, policy number, and the insurance product's name." }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_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 healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t...
[ { "role": "user", "content": "I need a list showing each patient along with their current primary insurance policy number and their immediately previous primary policy number." }, { "role": "assistant", "content": "SELECT ci.patient_id,\n ci.policy_number AS current_policy,\n pi.poli...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var...
[ { "role": "user", "content": "Show me the top 3 tokens by trend rank in the 'NFT' narrative, along with their price and 24-hour trading volume." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE narrative = 'NFT' ORDER BY trend...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.cases ( case_id character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "List all appointments with their subject and associated case number for appointments that have both a case_id and a non-null location." }, { "role": "assistant", "content": "SELECT a.appointment_id, a.subject, a.case_id, c.case_number\nFROM legal_services.appointmen...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, invoice_number text UNIQUE, c...
[ { "role": "user", "content": "Compute the total invoiced amount and average payment delay (in days) by status for invoices issued between 2024-01-01 and 2024-06-30." }, { "role": "assistant", "content": "SELECT status,\n SUM(total_amount) AS total_invoiced,\n AVG(EXTRACT(day FROM (pa...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "List the invoice_number, total_amount, the full name of the client, and the case_number for all invoices." }, { "role": "assistant", "content": "SELECT i.invoice_number, i.total_amount, c.first_name || ' ' || c.last_name AS client_full_name, cs.case_number\nFROM leg...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t...
[ { "role": "user", "content": "List all unique combinations of plan_id and group_number, and show the number of policies for each combination." }, { "role": "assistant", "content": "SELECT plan_id, group_number, COUNT(*) AS policy_count FROM healthcare.patient_insurance GROUP BY plan_id, group_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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "Which wallets hold at least 100 units of any ERC1155 NFT, and what is the token ID and contract address of the NFT for each such holding?" }, { "role": "assistant", "content": "SELECT wallet_address, contract_address, token_id, amount\nFROM nft_holders\nWHERE contra...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List the first name, last name, specialization, and the name of the law firm for all lawyers hired before January 1, 2020." }, { "role": "assistant", "content": "SELECT T1.first_name , T1.last_name , T1.specialization , T2.firm_name FROM legal_services.lawyers AS...
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 fuel consumption rates per hour for the Boeing 747-8 model?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the fuel consumption rates for the Boeing 747-8 model as this data is not included in the aircraft_models ta...
You are an expert in writing database language. You can write a corresponding 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": "For each peer port, count how many peers have used that port." }, { "role": "assistant", "content": "SELECT port,\n COUNT(*) AS peer_count\nFROM trading_platform.peers\nGROUP BY port;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFA...
[ { "role": "user", "content": "Which achievements have been unlocked by more than 100 unique players? Show the achievement ID and the count." }, { "role": "assistant", "content": "SELECT achievement_id, COUNT(DISTINCT player_id) AS player_count FROM gaming_technology.player_achievements GROUP BY ...
You are an expert in writing database language. You can write a corresponding 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": "Please show the names and bar numbers of all lawyers who have led appointments with more than 3 different clients." }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, l.bar_number\nFROM legal_services.lawyers l\nJOIN legal_services.appointments ...
You are an expert in writing database language. You can write a corresponding 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": "Show a list of group chat names with their conversation_id, the total number of participants, and the total number of messages sent in each group chat." }, { "role": "assistant", "content": "SELECT c.conversation_id,\n c.group_name,\n COUNT(cp.participan...
You are an expert in writing database language. You can write a corresponding 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": "Find the total number of unique document types stored in the claim_documents table." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT document_type) FROM insurance.claim_documents;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "Show the first and last names, email, and phone number for all patients who were added to the system in the last 90 days along with their emergency contact name." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, phone_number, emergency_cont...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "List users and their latest wallet address if they have one, ordered by username." }, { "role": "assistant", "content": "SELECT u.username, w.address FROM users u JOIN wallets w ON u.user_id = w.user_id WHERE w.created_at = (SELECT MAX(w2.created_at) FROM wallets w2...
You are an expert in writing database language. You can write a corresponding 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 staff members who have a manager, including each staff’s first and last name, position, and their manager’s first and last name, sorted by staff last name ascending." }, { "role": "assistant", "content": "SELECT s.first_name AS staff_first_name,\n s.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 legal_services.cases ( case_id text, case_number text, case_name text, client_id tex...
[ { "role": "user", "content": "For each case type, calculate the average time to close cases in days, only including cases that have been closed." }, { "role": "assistant", "content": "SELECT case_type,\n AVG(EXTRACT(EPOCH FROM (date_closed - date_opened)) / 86400) AS avg_close_days\nFROM 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 gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id....
[ { "role": "user", "content": "List all games released in 2023 along with their titles, platforms, and the names of their developers." }, { "role": "assistant", "content": "SELECT g.game_id, g.title, g.platform, d.name AS developer_name\nFROM gaming_technology.games g\nJOIN gaming_technology.deve...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.locations ( location_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Which locations lack a postal code? For each, display the name, type, city, and state_province." }, { "role": "assistant", "content": "SELECT name, type, city, state_province\nFROM transportation.locations\nWHERE postal_code IS NULL;" }, { "role": "user", ...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What is the detailed repair history for train number T5678?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the detailed repair history for train number T5678 as this information is not available in the current database table. The table only in...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id.text, first_name.text, last_name.text, company_na...
[ { "role": "user", "content": "List all documents along with the case number they are associated with, as well as the name and email of the lawyer who uploaded them." }, { "role": "assistant", "content": "SELECT d.document_name, d.document_type, d.case_id, l.first_name || ' ' || l.last_name AS la...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary...
[ { "role": "user", "content": "I need a list of conversation IDs and participant usernames for conversations that have media messages. Include conversation_id, username, and media_type." }, { "role": "assistant", "content": "SELECT m.conversation_id, u.username, m.media_type\nFROM social_media.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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h...
[ { "role": "user", "content": "I need to find all group chats created after 2024-01-01, showing group_name and the total number of participants in each." }, { "role": "assistant", "content": "SELECT c.group_name, COUNT(cp.participant_id) AS participant_count\nFROM social_media.conversations c\nJO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "Which customers have accounts with a balance over 500,000 USD? Please include the customer's first and last name along with the account number and current balance." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.account_number, a.balance 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 insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Could you provide the number of customers in each state who currently have at least one active policy? Return the state and customer_count." }, { "role": "assistant", "content": "SELECT c.state, COUNT(DISTINCT c.customer_id) AS customer_count\nFROM insurance.custome...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "List all item names and their rarity, along with the title of the game they belong to." }, { "role": "assistant", "content": "SELECT T1.item_name, T1.rarity, T2.title FROM in_game_items AS T1 JOIN games AS T2 ON T1.game_id = T2.game_id;" }, { "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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "Show me all clients together with the names of the lawyers who have handled cases for them and the case names." }, { "role": "assistant", "content": "SELECT c.client_id, c.first_name || ' ' || c.last_name AS client_full_name, l.first_name || ' ' || l.last_name AS la...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo...
[ { "role": "user", "content": "How many medications are listed per manufacturer? Return manufacturer and med_count for those with more than 10 medications." }, { "role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS med_count\nFROM healthcare.medications\nGROUP BY manufacturer\nHAVING...
You are an expert in writing database language. You can write a corresponding 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": "Show me all documents along with the document name and type, together with both the upload_timestamp and the lawyer ID who uploaded them." }, { "role": "assistant", "content": "SELECT document_id, document_name, document_type, upload_timestamp, uploaded_by_lawyer_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.doctors ( doctor_id text, first_name text, last_name text, specialty text...
[ { "role": "user", "content": "Show prescriptions with their corresponding chief complaint from the medical record. Return prescription_id, record_id, and chief_complaint." }, { "role": "assistant", "content": "SELECT p.prescription_id, p.record_id, mr.chief_complaint\nFROM healthcare.prescriptio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var...
[ { "role": "user", "content": "List all agents who have been terminated, showing their full name, agency name, and termination date." }, { "role": "assistant", "content": "SELECT first_name, last_name, agency_name, termination_date\nFROM insurance.agents\nWHERE status <> '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 insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agenc...
[ { "role": "user", "content": "Find all agents with their managers where the agent's commission rate is above 0.10." }, { "role": "assistant", "content": "SELECT a.agent_id,\n a.first_name || ' ' || a.last_name AS agent_name,\n m.agent_id AS manager_id,\n m.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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,...
[ { "role": "user", "content": "List all ERC20 tokens from the `token_metas` table that have a total supply greater than 1 followed by 21 zeros. Show their contract address, symbol, name, and total supply." }, { "role": "assistant", "content": "SELECT contract_address, symbol, name, total_supply 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.service_locations ( location_id text, agency_id text, location_n...
[ { "role": "user", "content": "For each city and state, show the number of service locations available along with their accessibility status." }, { "role": "assistant", "content": "SELECT city, state, is_accessible, COUNT(*) AS location_count FROM government_services.service_locations GROUP BY ci...
You are an expert in writing database language. You can write a corresponding 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 services in the 'Concierge' department along with their names, price, and whether they are currently available. Include the property name as well." }, { "role": "assistant", "content": "SELECT s.service_name, s.price, s.is_available, p.property_name\nFROM h...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ...
[ { "role": "user", "content": "Please provide the passenger_id, first_name, last_name, booking_id, and booking_time for all bookings where seat_number is 'A1'." }, { "role": "assistant", "content": "SELECT p.passenger_id, p.first_name, p.last_name, b.booking_id, b.booking_time\nFROM transportatio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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." }, { "role": "assistant", "content": "SELECT a.patient_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.service_locations ( location_id.text, agency_id.text, location_n...
[ { "role": "user", "content": "Could you retrieve pairs of accessible service locations in the same city but with different postal codes?" }, { "role": "assistant", "content": "SELECT sl1.location_id AS location1_id,\n sl2.location_id AS location2_id,\n sl1.city\nFROM government_servi...
You are an expert in writing database language. You can write a corresponding 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": "For the latest snapshot time, list the total `usd_value` held by CEXes for each distinct `token_symbol` across all chains. Order the results by total value descending." }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT max(snapshot_time) as m...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri...
[ { "role": "user", "content": "List all pairs of narratives where the first narrative has a higher market_cap than the second. Display narrative1, narrative2, cap1, cap2." }, { "role": "assistant", "content": "SELECT n1.narrative AS narrative1, n2.narrative AS narrative2, n1.market_cap AS cap1, n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.users ( user_id text, username text, email text, password_hash text, created_at...
[ { "role": "user", "content": "Find all pairs of users who registered at exactly the same timestamp, showing both user IDs, usernames, and the shared registration timestamp." }, { "role": "assistant", "content": "SELECT u1.user_id AS user_id_1, u1.username AS username_1, u2.user_id AS user_id_2, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_...
[ { "role": "user", "content": "Can you list all replies along with their parent comment content for post_id 'P100'?" }, { "role": "assistant", "content": "SELECT reply.comment_id AS reply_id, parent.content AS parent_content, reply.content AS reply_content FROM comments AS reply JOIN comments AS ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ...
[ { "role": "user", "content": "Can you provide the total number of fuel refueling events and the sum of total_cost at each fueling location, including the location name and city?" }, { "role": "assistant", "content": "SELECT l.location_id, l.name, l.city, COUNT(fl.fuel_log_id) AS num_refuels, 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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash...
[ { "role": "user", "content": "For each game, show the game ID, title, and the total number of players who have unlocked at least one achievement in that game." }, { "role": "assistant", "content": "SELECT g.game_id, g.title, COUNT(DISTINCT pa.player_id) AS total_players\nFROM gaming_technology.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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "Show me the first name, last name, and policy number for all customers who have filed a claim with an estimated loss over $50,000, along with the agent's full name who sold the policy." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, p.policy...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id....
[ { "role": "user", "content": "Which developers founded after 2010 have published games using the 'Unreal Engine'? List the developer's name, country, game title, and the release year." }, { "role": "assistant", "content": "SELECT d.name AS developer_name, d.country, g.title AS game_title, EXTRAC...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_y...
[ { "role": "user", "content": "Show me the names and websites of all developers whose website contains '.com'." }, { "role": "assistant", "content": "SELECT name, website FROM gaming_technology.developers WHERE website LIKE '%.com%';" }, { "role": "user", "content": "Only include deve...
You are an expert in writing database language. You can write a corresponding 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": "List all premium payments with status 'Completed', showing the payment ID, payment date, amount paid, and the first and last name of the customer who made the payment." }, { "role": "assistant", "content": "SELECT T1.payment_id, T1.payment_date, T1.amount_paid, T2.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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ...
[ { "role": "user", "content": "Show me the average ROI and the total USD value from buy transactions for each narrative category among smart money addresses. Please list the narrative, average ROI, and total buy value." }, { "role": "assistant", "content": "SELECT T2.narrative, AVG(T1.roi) AS ave...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ...
[ { "role": "user", "content": "Show me all maintenance logs for vehicles of make 'Toyota' performed after January 1, 2024. Include the log ID, vehicle ID, service date, and service type." }, { "role": "assistant", "content": "SELECT ml.log_id, ml.vehicle_id, ml.service_date, ml.service_type\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.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for...
[ { "role": "user", "content": "Count how many tokens exist for each contract_address." }, { "role": "assistant", "content": "SELECT contract_address,\n COUNT(*) AS token_count\nFROM web3.tokens\nGROUP BY contract_address;" }, { "role": "user", "content": "Now only include contra...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.applications ( application_id character varying(64) NOT NULL, ci...
[ { "role": "user", "content": "List the reference number and status for all applications, including the registration date of the citizen who submitted it." }, { "role": "assistant", "content": "SELECT a.reference_number, a.status, c.registration_date FROM government_services.applications AS a 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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a...
[ { "role": "user", "content": "Show me the metadata key and value for each asset where the key contains 'info', along with the asset name and symbol." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name, a.symbol, m.key, m.value\nFROM trading_platform.assets a\nJOIN trading_platform.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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "Show me the first name, last name, and date of birth for all patients who are male." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE gender = 'Male';" }, { "role": "user", "content": "Pleas...
You are an expert in writing database language. You can write a corresponding 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": "Show the user IDs of all users whose theme is set to 'blue'." }, { "role": "assistant", "content": "SELECT user_id FROM social_media.user_settings WHERE theme = 'blue';" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,...
[ { "role": "user", "content": "Find the average settlement_amount of closed claims for each claim handler. Return claim_handler_id and avg_settlement_amount." }, { "role": "assistant", "content": "SELECT c.claim_handler_id, AVG(c.settlement_amount) AS avg_settlement_amount\nFROM insurance.claims ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE erc20_balances_historical ( block_number bigint NOT NULL, contract_address varchar N...
[ { "role": "user", "content": "Show ERC20 tokens with total supply greater than 100,000,000, displaying symbol, name, contract address, and total supply from the token_metas table." }, { "role": "assistant", "content": "SELECT symbol, name, contract_address, total_supply FROM token_metas WHERE to...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
3