Dataset Viewer
Auto-converted to Parquet Duplicate
system
stringlengths
333
7.84k
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 healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "List appointment IDs, patient first and last names, and their chief complaint for appointments that have an associated medical record." }, { "role": "assistant", "content": "SELECT a.appointment_id, p.first_name, p.last_name, mr.chief_complaint\nFROM healthcare.appo...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, name character va...
[ { "role": "user", "content": "Find transaction IDs in the utxos table that have both spent and unspent UTXOs associated with them. List these transaction IDs." }, { "role": "assistant", "content": "SELECT transaction_id FROM trading_platform.utxos GROUP BY transaction_id HAVING MIN(spent::int) =...
You are an expert in writing database language. You can write a corresponding 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": "Can you show me the email addresses of all drivers whose status is 'Inactive'?" }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, email FROM transportation.drivers WHERE status = 'Inactive';" }, { "role": "user", "content": "...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par...
[ { "role": "user", "content": "For each conversation, how many participants have joined before January 1, 2024?" }, { "role": "assistant", "content": "SELECT conversation_id, COUNT(user_id) AS participant_count\nFROM social_media.conversation_participants\nWHERE joined_at < '2024-01-01'\nGROUP 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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t...
[ { "role": "user", "content": "Retrieve the top 5 tokens by 24h price_change_percentage_24h from token_basic_info along with their chain, narrative, and total 24h trading volume. Also include the narrative's token count from narrative_info." }, { "role": "assistant", "content": "SELECT t.token_sy...
You are an expert in writing database language. You can write a corresponding 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": "Can you provide a query that lists each game title, its platform, and the name of its developer by joining the games and developers tables?" }, { "role": "assistant", "content": "SELECT g.title,\n g.platform,\n d.name AS developer_name\nFROM gaming_techn...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "Show me the latest uploaded document (name and version) for each invoice that is linked to a case, including the invoice number and total amount." }, { "role": "assistant", "content": "SELECT i.invoice_number, i.total_amount, d.document_name, d.version AS latest_ver...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Find the first name, last name, and contact email of citizens who have scheduled appointments in March 2024." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.contact_email FROM government_services.citizens AS T1 JOIN government_...
You are an expert in writing database language. You can write a corresponding 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.documents ( document_id character varying(64) NOT NULL, applicat...
[ { "role": "user", "content": "List all document IDs and their corresponding location names for documents that are associated with applications assigned to a service location in the city of 'Los Angeles'." }, { "role": "assistant", "content": "SELECT d.document_id, sl.location_name\nFROM governme...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a...
[ { "role": "user", "content": "Show the total number of contracts grouped by their status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS contract_count FROM web3.contracts GROUP BY status;" }, { "role": "user", "content": "Can you also filter to only include 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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "Retrieve the most recent log entry for each user, including action and logged_at." }, { "role": "assistant", "content": "SELECT l1.user_id,\n l1.action,\n l1.logged_at\nFROM trading_platform.logs l1\nWHERE l1.logged_at = (\n SELECT MAX(l2.logged_at)\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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ...
[ { "role": "user", "content": "What is the total net_flow and average realized_ratio for tokens on the Polygon chain?" }, { "role": "assistant", "content": "SELECT SUM(net_flow) AS total_net_flow, AVG(realized_ratio) AS avg_realized_ratio\nFROM smart_money_token_performance\nWHERE chain = 'Polygo...
You are an expert in writing database language. You can write a corresponding 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, -- uniq...
[ { "role": "user", "content": "List all staff who report directly to a manager with access_level 5. Include staff full name, position, and the name of their manager." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name AS staff_first_name, s.last_name AS staff_last_name, s.posit...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "Show me all SUI NFTs with status 'exists' and their name and owner." }, { "role": "assistant", "content": "SELECT object_id, name, owner FROM sui_nfts WHERE status = 'exists';" }, { "role": "user", "content": "Also include the collection type and package...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a...
[ { "role": "user", "content": "Which user has created the most tokens? Please show the username and the number of tokens they have created." }, { "role": "assistant", "content": "SELECT u.username, COUNT(*) AS token_count\nFROM web3.tokens t\nJOIN web3.contracts c ON t.contract_address = c.addres...
You are an expert in writing database language. You can write a corresponding 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": "Provide a count of players for each registered country." }, { "role": "assistant", "content": "SELECT country_code, COUNT(*) FROM gaming_technology.players GROUP BY country_code;" }, { "role": "user", "content": "Filter the results to only show countries...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "List the usernames and user IDs of all users whose bio contains the word 'developer'." }, { "role": "assistant", "content": "SELECT user_id, username\nFROM social_media.users\nWHERE bio ILIKE '%developer%';" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "Which patients have a primary insurance policy and are subscribed to a plan provided by 'Cigna'? List patient ID, full name, policy number, plan ID, and insurance provider." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pi.pol...
You are an expert in writing database language. You can write a corresponding 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 the document name, upload timestamp, time entry date worked, and hours spent for all entries related to case 'CASE_XYZ'." }, { "role": "assistant", "content": "SELECT T1.document_name , T1.upload_timestamp , T2.date_worked , T2.hours_spent FROM 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 gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ...
[ { "role": "user", "content": "List each achievement with the very next achievement unlocked by the same player using a self-join. Show player_id, current_ach, current_unlocked_at, next_ach, and next_unlocked_at." }, { "role": "assistant", "content": "SELECT pa1.player_id,\n pa1.achievement...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List all pairs of diagnoses that belong to the same medical record. Show record_id, diagnosis_id from the first entry as diag1_id, and diagnosis_id from the second entry as diag2_id." }, { "role": "assistant", "content": "SELECT d1.record_id,\n d1.diagnosis_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 web3.users ( user_id text, username text, email text, password_hash text, created_at...
[ { "role": "user", "content": "Show the usernames and registration dates for all users whose email ends with '@gmail.com'." }, { "role": "assistant", "content": "SELECT username, created_at FROM web3.users WHERE email LIKE '%@gmail.com';" }, { "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 government_services.documents ( document_id character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "List the full names and job titles of all employees who have not verified any documents." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, e.job_title FROM government_services.employees AS e LEFT JOIN government_services.documents AS d ON e.em...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_nam...
[ { "role": "user", "content": "Show the average close price and total volume for market data, grouped by source." }, { "role": "assistant", "content": "SELECT source, AVG(close_price), SUM(volume) FROM financial_services.market_data GROUP BY source;" }, { "role": "user", "content": "O...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "For all appointments scheduled after '2024-07-01', list the appointment ID, the full name of the citizen, the location name, and the city." }, { "role": "assistant", "content": "SELECT a.appointment_id,\n CONCAT(c.first_name, ' ', c.last_name) AS citizen_full_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.messages ( message_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List the last 20 messages that have a media_url, showing message_id, sender_user_id, media_type, and sent_at, ordered by sent_at descending." }, { "role": "assistant", "content": "SELECT message_id,\n sender_user_id,\n media_type,\n sent_at\nFROM 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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir...
[ { "role": "user", "content": "Show me the policy number, start date, end date, product name, and product type for all policies." }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.start_date, T1.end_date, T2.product_name, T2.product_type FROM insurance.policies AS T1 JOIN insuranc...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.service_locations ( location_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List the number of appointments for each booking method." }, { "role": "assistant", "content": "SELECT\n a.booking_method,\n COUNT(*) AS appointment_count\nFROM appointments a\nGROUP BY a.booking_method;" }, { "role": "user", "content": "Filter this to...
You are an expert in writing database language. You can write a corresponding 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": "For each user, calculate the total value of 'buy' and 'sell' orders (quantity * price)." }, { "role": "assistant", "content": "SELECT b.user_id,\n b.total_buy_value,\n s.total_sell_value\nFROM (\n SELECT user_id,\n SUM(quantity * price) AS total...
You are an expert in writing database language. You can write a corresponding 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": "Can you list all patients who switched their primary insurance plan, including the patient_id, old plan_id, new plan_id, and the date of the switch?" }, { "role": "assistant", "content": "SELECT p1.patient_id,\n p1.plan_id AS old_plan_id,\n p2.plan_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 hospitality_technology.payments ( payment_id character varying(64) NOT NULL, reserva...
[ { "role": "user", "content": "Show me all payments made using the 'CreditCard' method in USD, including payment_id, amount, and payment_timestamp." }, { "role": "assistant", "content": "SELECT payment_id, amount, payment_timestamp\nFROM hospitality_technology.payments\nWHERE payment_method = 'Cr...
You are an expert in writing database language. You can write a corresponding 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": "List all items of type 'Armor' in the database, showing the item name, rarity, and their corresponding game_id." }, { "role": "assistant", "content": "SELECT item_id, item_name, rarity, game_id\nFROM gaming_technology.in_game_items\nWHERE item_type = 'Armor';" }, ...
You are an expert in writing database language. You can write a corresponding 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 asset, list its ID and the total number of trades and the total traded value (quantity * price)." }, { "role": "assistant", "content": "SELECT a.asset_id,\n COALESCE(t.trade_count, 0) AS trade_count,\n COALESCE(t.total_value, 0) AS total_value\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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Show me a list of all users who have participated in any trade (either as a buyer or a seller), including their username and the total number of trades they were involved in." }, { "role": "assistant", "content": "SELECT T1.username , count(T2.trade_id) FROM 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 smart_money_token_inflow (", "token_address character varying(100) NOT NULL, ...
[ { "role": "user", "content": "What are the top 3 narratives with the highest total USD buy value?" }, { "role": "assistant", "content": "SELECT narrative,\n SUM(usd_value) AS total_buy_usd\nFROM smart_money_token_inflow\nWHERE type = 1\nGROUP BY narrative\nORDER BY total_buy_usd DESC\nLIMI...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "Find all tokens with their contract addresses and the number of wallets that hold each token, sorted by wallet count in descending order." }, { "role": "assistant", "content": "SELECT t.token_id, t.contract_address, COUNT(DISTINCT w.wallet_id) AS wallet_count FROM w...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_i...
[ { "role": "user", "content": "List properties where actual check-in occurred later than the scheduled check-in date. Show the property ID and the count of such reservations." }, { "role": "assistant", "content": "SELECT property_id, COUNT(*) FROM reservations WHERE actual_check_in_ts > check_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 social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Find the latest three posts with their content and posting users' full names." }, { "role": "assistant", "content": "SELECT p.content, u.full_name, p.created_at\nFROM social_media.posts p\nJOIN social_media.users u ON p.user_id = u.user_id\nORDER BY p.created_at DES...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ...
[ { "role": "user", "content": "List all insurance products along with their product types and the date they were last updated, but only include products where the base premium is greater than 2000." }, { "role": "assistant", "content": "SELECT product_id, product_name, product_type, updated_at\nF...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam...
[ { "role": "user", "content": "What was the total quantity and total cost of 'Gasoline' fuel logged in the year 2023?" }, { "role": "assistant", "content": "SELECT SUM(quantity) , SUM(total_cost) FROM transportation.fuel_logs WHERE fuel_type = 'Gasoline' AND EXTRACT(YEAR FROM log_timestamp) =...
You are an expert in writing database language. You can write a corresponding 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.bookings ( booking_id.text, passenger_id.text, trip_id.text, seat_num...
[ { "role": "user", "content": "List the number of bookings for each day." }, { "role": "assistant", "content": "SELECT DATE(booking_time) AS booking_date, COUNT(*) AS booking_count\nFROM transportation.bookings\nGROUP BY DATE(booking_time);\n" }, { "role": "user", "content": "Now only...
You are an expert in writing database language. You can write a corresponding 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 social_media.users ( user_id character varying(64) NOT NULL, username character vary...
[ { "role": "user", "content": "List the usernames and the IDs of conversations they have joined." }, { "role": "assistant", "content": "SELECT T1.username, T2.conversation_id FROM social_media.users AS T1 JOIN social_media.conversation_participants AS T2 ON T1.user_id = T2.user_id;" }, { ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key t...
[ { "role": "user", "content": "List peer IDs and IP addresses for all peers whose IP address starts with '10.'." }, { "role": "assistant", "content": "SELECT peer_id, ip_address FROM trading_platform.peers WHERE ip_address LIKE '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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Which citizens have submitted applications for services offered by agencies established before 2020? Please show the citizen's first name, last name, and the agency's name." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.agency_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List all staff members who have responded to at least one review in the last 6 months, including their first and last names and the count of responses." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, COUNT(r.review_id) AS respons...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr...
[ { "role": "user", "content": "List all achievements with more than 100 points." }, { "role": "assistant", "content": "SELECT *\nFROM gaming_technology.achievements\nWHERE points > 100;" }, { "role": "user", "content": "Now exclude any hidden achievements." }, { "role": "assis...
You are an expert in writing database language. You can write a corresponding 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": "List all invoices where the amount paid is less than the total amount." }, { "role": "assistant", "content": "SELECT invoice_number, client_id, total_amount, amount_paid, status FROM legal_services.invoices WHERE amount_paid < total_amount" }, { "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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre...
[ { "role": "user", "content": "Can you give me all locations in Los Angeles?" }, { "role": "assistant", "content": "SELECT location_id, name, type, address_line1, city, state_province, postal_code, country, latitude, longitude, timezone\nFROM transportation.locations\nWHERE city = 'Los Angeles';"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w...
[ { "role": "user", "content": "What is the total sum of amounts paid for all invoices?" }, { "role": "assistant", "content": "SELECT SUM(amount_paid) FROM invoices;" }, { "role": "user", "content": "Group this total by the status of the invoice." }, { "role": "assistant", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "For each insurance product, can you list its product name, the number of unique agents who have sold policies for that product, and the total premium paid across those policies?" }, { "role": "assistant", "content": "SELECT ip.product_name, COUNT(DISTINCT a.agent_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.trades ( trade_id character varying(64) NOT NULL, account_id char...
[ { "role": "user", "content": "List each account number and the total quantity of shares traded through it." }, { "role": "assistant", "content": "SELECT T2.account_number, SUM(T1.quantity) FROM financial_services.trades AS T1 JOIN financial_services.accounts AS T2 ON T1.account_id = T2.account_i...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "For each claim, show the corresponding product_type of the insurance product for the related policy." }, { "role": "assistant", "content": "SELECT cl.claim_id, ip.product_type\nFROM insurance.claims cl\nJOIN insurance.policies p ON cl.policy_id = p.policy_id\nJOIN i...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "Give me each server's name, the region, and the maximum number of players that have been connected at once." }, { "role": "assistant", "content": "SELECT s.server_id, s.server_name, s.region, MAX(s.current_players) AS max_players_seen\nFROM gaming_technology.servers...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List the first name, last name, and date of birth for all citizens born before January 1, 1995." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM government_services.citizens WHERE date_of_birth < '1995-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 healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, ...
[ { "role": "user", "content": "I want to list pairs of insurance plans from the same provider, showing both plan IDs and names alongside the provider." }, { "role": "assistant", "content": "SELECT p1.plan_id, p1.plan_name, p2.plan_id AS plan_id_2, p2.plan_name AS plan_name_2, p1.insurance_provide...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, employee_id chara...
[ { "role": "user", "content": "How many routes start and end in the same city?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS same_city_routes\nFROM transportation.routes AS r\nJOIN transportation.locations AS o ON r.origin_location_id = o.location_id\nJOIN transportation.locations 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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ...
[ { "role": "user", "content": "Which insurance products have 'comprehensive' in their coverage details? Show the product_id and product_name." }, { "role": "assistant", "content": "SELECT product_id, product_name FROM insurance.insurance_products WHERE coverage_details ILIKE '%comprehensive%';" ...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, patient_id text, appointmen...
[ { "role": "user", "content": "List all medical records along with the chief complaint and record date for patients who had their medical record created after March 1, 2023 and whose record was created by doctor with ID 'doctor_123'." }, { "role": "assistant", "content": "SELECT record_id, patien...
You are an expert in writing database language. You can write a corresponding 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 trades for a given security, showing ticker_symbol, trade_id, account_id, trade_type, and total_amount." }, { "role": "assistant", "content": "SELECT s.ticker_symbol, t.trade_id, t.account_id, t.trade_type, t.total_amount\nFROM financial_services.trades t\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 social_media.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text ) C...
[ { "role": "user", "content": "List all unread notifications for group conversations, including the conversation name, sender_user_id, and notification creation time." }, { "role": "assistant", "content": "SELECT c.group_name, n.sender_user_id, n.created_at\nFROM social_media.notifications n\nJOI...
You are an expert in writing database language. You can write a corresponding 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.notifications ( notification_id.text, user_id.text, message.text, s...
[ { "role": "user", "content": "I want to find the average time it takes for a notification to be marked as read, calculated for each user. Please show the user ID and the average read time in seconds, considering only notifications that have been read." }, { "role": "assistant", "content": "SELEC...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "Please list the full name and status of clients who have not provided a company name." }, { "role": "assistant", "content": "SELECT first_name, last_name, status\nFROM legal_services.clients\nWHERE company_name 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 train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "Can you help me retrieve the details of all bookings for a specific route with route_id 'RT789', including the passenger names and the scheduled departure times?" }, { "role": "assistant", "content": "SELECT b.booking_id, p.first_name, p.last_name, s.departure_datet...
You are an expert in writing database language. You can write a corresponding 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": "For each Avalanche token tick, calculate the total transfer volume and transaction count over the past 7 days using token_activities_avalanche. Include the token tick, total_volume, and tx_count." }, { "role": "assistant", "content": "SELECT\n tick,\n SUM(amt) 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 government_services.payments ( payment_id character varying(64) NOT NULL, applicatio...
[ { "role": "user", "content": "Show me the total payment amount and number of payments for each service." }, { "role": "assistant", "content": "SELECT service_id, SUM(amount) AS total_amount, COUNT(*) AS payment_count FROM government_services.payments GROUP BY service_id;" }, { "role": "u...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern...
[ { "role": "user", "content": "For each player, show their username and the total number of unique in-game items they have in their inventory." }, { "role": "assistant", "content": "SELECT p.username, COUNT(DISTINCT pi.item_id) AS unique_items\nFROM gaming_technology.players p\nJOIN gaming_techno...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.prescriptions ( prescription_id text PRIMARY KEY, record_id text, patient...
[ { "role": "user", "content": "Show me all prescriptions, including the prescription ID, medication ID, prescription date, and the prescribing doctor's ID, for patients who have received more than 2 prescriptions." }, { "role": "assistant", "content": "SELECT prescription_id, medication_id, presc...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, vehicle_id ch...
[ { "role": "user", "content": "List consecutive fuel log entries for each vehicle based on log_timestamp. Show vehicle ID, current log ID, previous log ID, current timestamp, previous timestamp, and the quantity difference (current - previous)." }, { "role": "assistant", "content": "SELECT\n 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "List the sent notifications related to appointments, including notification ID, message subject, citizen full name, and scheduled start time of the appointment." }, { "role": "assistant", "content": "SELECT\n n.notification_id,\n n.message_subject,\n c.first_name...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri...
[ { "role": "user", "content": "Show the top 5 narratives by 24h volume, displaying narrative and volume_24h." }, { "role": "assistant", "content": "SELECT narrative, volume_24h FROM narrative_info ORDER BY volume_24h DESC LIMIT 5;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id text, property_id text, service_name te...
[ { "role": "user", "content": "Can you give me the number of available services and their average price for each department?" }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS available_services_count, AVG(price) AS average_price\nFROM hospitality_technology.services\nWHERE is_...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
1