Dataset Viewer
Auto-converted to Parquet Duplicate
system
stringlengths
315
8.44k
conversations
listlengths
2
8
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a...
[ { "role": "user", "content": "Show a list of all DApps together with the total number of unique assets linked to each via the metadata table.", "sql": null }, { "role": "assistant", "content": "SELECT d.dapp_id, d.name, d.url, COUNT(DISTINCT m.asset_id) AS unique_asset_count\nFROM trading_pl...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Index 'aircraft_models'. Mapping: { properties: { model_id: { type: 'keyword' }, model_name: { ty...
[ { "role": "user", "content": "I need to get the total quantity of components in inventory for a specific warehouse location. Can you help with that?", "sql": null }, { "role": "assistant", "content": "SELECT location_warehouse, SUM(quantity) AS total_quantity\nFROM component_inventory\nWHERE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char...
[ { "role": "user", "content": "Retrieve all transactions where the total value of token transfers in that transaction exceeds the Ether value of the transaction itself. Include transaction_id, ether_value, and total_token_value.", "sql": null }, { "role": "assistant", "content": "SELECT\n t....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco...
[ { "role": "user", "content": "How many distinct fundraising round names are recorded in the table?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT rounds_name) FROM project_fundraising_record;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id 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.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id, p.first_name, p.last_name, mr.chief_complaint\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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List all rooms that are currently marked as 'OutOfOrder' or 'Maintenance'. Show their room number and current status.", "sql": null }, { "role": "assistant", "content": "SELECT room_number, status FROM hospitality_technology.rooms WHERE status IN ('OutOfOrder', ...
You are an expert in writing database language. You can write a corresponding 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 the claim ID, customer full name, and claim status for all claims with a settlement amount less than 1000.", "sql": null }, { "role": "assistant", "content": "SELECT cl.claim_id, c.first_name || ' ' || c.last_name AS customer_full_name, cl.status\nFROM insu...
You are an expert in writing database language. You can write a corresponding 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.text, chain.text, address.text, exchange.text, tok...
[ { "role": "user", "content": "Which exchanges hold the largest total USD value of tokens on the BSC chain in the most recent snapshot, and what is the top token (by usd_value) held by each exchange?", "sql": null }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT MAX(s...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.likes ( like_id text PRIMARY KEY, user_id text, post_id text, comment_i...
[ { "role": "user", "content": "Find the total number of likes made on posts versus comments. Show two columns: like_type (either 'post' or 'comment') and like_count.", "sql": null }, { "role": "assistant", "content": "SELECT CASE WHEN post_id IS NOT NULL THEN 'post' ELSE 'comment' END AS like...
You are an expert in writing database language. You can write a corresponding 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, -- unique id...
[ { "role": "user", "content": "Find pairs of distinct token transfers that occurred in the same transaction and were initiated by the same sender address. List the transaction ID, the common sender address, and both transfer IDs.", "sql": null }, { "role": "assistant", "content": "SELECT\n t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text...
[ { "role": "user", "content": "List all unique actions that have been logged in the system.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT action FROM trading_platform.logs;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h...
[ { "role": "user", "content": "Show me the usernames and emails of users who have liked any comment, along with the comment IDs and when the like occurred.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, u.email, l.comment_id, l.created_at\nFROM social_media.likes l\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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List each property with its manager's full name and the count of currently available services it offers.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id,\n p.property_name,\n CONCAT(m.first_name, ' ', m.last_name) AS manager_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key t...
[ { "role": "user", "content": "Show me the order ID, order type, and asset name for all orders that resulted in at least one trade.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT o.order_id, o.order_type, a.name FROM trading_platform.orders o JOIN trading_platform.trades ...
You are an expert in writing database language. You can write a corresponding 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 NULL, ...
[ { "role": "user", "content": "How many insurance policies have no expiration_date specified?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM healthcare.patient_insurance\nWHERE expiration_date IS NULL;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,...
[ { "role": "user", "content": "List the full name (first name and last name) of all citizens who have uploaded documents whose expiry date is in the past.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 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 web3.users ( user_id text PRIMARY KEY, username text, email text, password_hash text...
[ { "role": "user", "content": "Show me all users whose username contains 'dev', including their user_id and email address.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, username, email FROM web3.users WHERE username ILIKE '%dev%';", "sql": null }, { "role": "...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id text, user_id text, message text, s...
[ { "role": "user", "content": "Show me all notifications sent in the last 7 days, including the user ID and message.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, message, sent_at FROM trading_platform.notifications WHERE sent_at >= NOW() - INTERVAL '7 days';", "sql"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par...
[ { "role": "user", "content": "Show me all comments that have non-empty content, including their ID, post ID, user ID, and content.", "sql": null }, { "role": "assistant", "content": "SELECT comment_id, post_id, user_id, content FROM social_media.comments WHERE content IS NOT NULL AND content...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show me all staff members hired in 2022, including their first name, last name, and hire date.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, hire_date FROM hospitality_technology.staff WHERE EXTRACT(YEAR FROM hire_date) = 2022...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key t...
[ { "role": "user", "content": "Show me pairs of wallets that belong to the same user, listing the wallet_id, user_id, address, and created_at for the earlier and later wallet in each pair.", "sql": null }, { "role": "assistant", "content": "SELECT w1.user_id,\n w1.wallet_id AS earlier_w...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "Which lawyers have uploaded at least two different types of documents? Show their first name, last name, and the count of unique document types.", "sql": null }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, COUNT(DISTINCT d.document_type)...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash...
[ { "role": "user", "content": "Which players have not logged in in the last 30 days but have unlocked any achievements? Show player_id, username, and total unlocked achievements.", "sql": null }, { "role": "assistant", "content": "SELECT p.player_id, p.username, COUNT(pa.achievement_id) AS 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 legal_services.cases ( case_id text, case_number text, case_name text, client_id tex...
[ { "role": "user", "content": "Show me all cases with a status of 'Pending', displaying their case name and court jurisdiction.", "sql": null }, { "role": "assistant", "content": "SELECT case_name, court_jurisdiction FROM legal_services.cases WHERE status = 'Pending';", "sql": null }, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text...
[ { "role": "user", "content": "Show each user's username along with their KYC status and the date of their latest KYC review.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, ka.status, ka.reviewed_at AS latest_review\nFROM trading_platform.users u\nJOIN trading_platform...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "Get each property's name and the number of distinct service categories it offers.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_name,\n COUNT(DISTINCT s.category) AS category_count\nFROM hospitality_technology.properties p\nLEFT JOI...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "Show me the count of available rooms for each property.", "sql": null }, { "role": "assistant", "content": "SELECT T1.property_name, count(T2.room_id) FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.rooms AS T2 ON T1.property_id = T2.pro...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex...
[ { "role": "user", "content": "Show me the top 10 token transfers by value, including the token ID and the transaction ID, sorted in descending order.", "sql": null }, { "role": "assistant", "content": "SELECT token_id, transaction_id, value FROM web3.token_transfers ORDER BY value DESC LIMIT...
You are an expert in writing database language. You can write a corresponding 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": "List all diesel fuel logs from the last 3 months with their vehicle details and total cost.", "sql": null }, { "role": "assistant", "content": "SELECT f.fuel_log_id, f.log_timestamp, v.vehicle_id, v.make, v.model, f.quantity, f.total_cost FROM transportation.fue...
You are an expert in writing database language. You can write a corresponding 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.", "sql": null }, { "role": "assistant", "content": "SELECT c.client_id, c.first_name || ' ' || c.last_name AS client_full_name, l.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 Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id...
[ { "role": "user", "content": "我想查看所有检查记录中检查员的ID和检查结果,同时统计每个检查员的检查次数。", "sql": null }, { "role": "assistant", "content": "db.inspections.aggregate([\n {\n $group: {\n _id: '$inspector_employee_id',\n total_inspections: { $count: {} },\n results: { $push: '$result' }\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 manufacturing.materials ( material_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "特定の材料の詳細情報を取得したいです。材料ID、材料名、仕様、密度を取得してください。", "sql": null }, { "role": "assistant", "content": "SELECT material_id, material_name, specification, density_kg_m3\nFROM manufacturing.materials\nWHERE material_id = 'specific_material_id';", "sql": null }, { ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "Can you write a SQL statement that returns each server’s name, its region, and the average duration in seconds of all game sessions that took place on that server? Only include servers that have handled at least 5 sessions.", "sql": null }, { "role": "assistant", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, docum...
[ { "role": "user", "content": "For each document (identified by case_id and document_name), find the latest version number and the ID of the lawyer who uploaded that version.", "sql": null }, { "role": "assistant", "content": "WITH RankedDocuments AS ( SELECT document_id, case_id, document_na...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_a...
[ { "role": "user", "content": "How many contracts are deployed each month for each status?", "sql": null }, { "role": "assistant", "content": "SELECT TO_CHAR(deployed_at, 'YYYY-MM') AS deploy_month,\n status,\n COUNT(*) AS contract_count\nFROM web3.contracts\nGROUP BY TO_CHAR(depl...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, first_name text, last_name text, ...
[ { "role": "user", "content": "Find all patients who have never received any diagnoses. Show patient ID, first_name, and last_name.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id,\n p.first_name,\n p.last_name\nFROM healthcare.patients p\nLEFT JOIN healthc...
You are an expert in writing database language. You can write a corresponding 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.notifications ( notification_id.text, citizen_id.text, applicati...
[ { "role": "user", "content": "List the message subjects for all notifications sent via the 'Push' channel that have a 'Sent' status.", "sql": null }, { "role": "assistant", "content": "SELECT message_subject FROM government_services.notifications WHERE channel = 'Push' AND status = 'Sent';",...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti...
[ { "role": "user", "content": "Can you list all SUI coins with 'active' status and their owner addresses and balances?", "sql": null }, { "role": "assistant", "content": "SELECT object_id, coin_type, owner, balance\nFROM sui_coins\nWHERE status = 'active';", "sql": null }, { "role...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure "CREATE TABLE cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the ...
[ { "role": "user", "content": "List smart money addresses with a realized ratio greater than 0.9 and a profit greater than 50000. Show the address, chain, realized ratio, and profit.", "sql": null }, { "role": "assistant", "content": "SELECT address, chain, realized_ratio, profit FROM smart_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 government_services.documents ( document_id text, application_id text, citizen_id te...
[ { "role": "user", "content": "List the full names of employees who have verified 'Proof of Identity' documents.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.employees AS T1 JOIN government_services.documents AS T2 ON...
You are an expert in writing database language. You can write a corresponding 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": "I need the case_number and case_name along with the total billing amount (hours_spent * billing_rate) for cases that are currently open.", "sql": null }, { "role": "assistant", "content": "SELECT c.case_number, c.case_name, SUM(te.hours_spent * te.billing_rate) ...
You are an expert in writing database language. You can write a corresponding 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": "I need a combined report displaying each customer’s full name, their account number, account balance, and the ticker symbol and security name of every security traded in the same currency as their account.", "sql": null }, { "role": "assistant", "content": "SELE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id...
[ { "role": "user", "content": "Compute the co-occurrence count for each hashtag pair across all posts.", "sql": null }, { "role": "assistant", "content": "SELECT ph1.hashtag_id AS tag_a, ph2.hashtag_id AS tag_b, COUNT(DISTINCT ph1.post_id) AS co_occurrence_count\nFROM social_media.post_hashta...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, customer_id text, product_id text, ...
[ { "role": "user", "content": "Show me the claim ID, status, and the policy number for all claims with an estimated loss greater than 5000.", "sql": null }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.status, T2.policy_number FROM insurance.claims AS T1 JOIN insurance.policies 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 government_services.employees ( employee_id character varying(64) NOT NULL, agency_i...
[ { "role": "user", "content": "How many employees were hired in each year?", "sql": null }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM hire_date) AS hire_year , COUNT(*) AS employee_count FROM employees GROUP BY hire_year", "sql": null }, { "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.customers ( customer_id text, first_name text, last_name text, date_of_bir...
[ { "role": "user", "content": "What is the total amount paid across all premium payments for payments marked as 'Failed'?", "sql": null }, { "role": "assistant", "content": "SELECT sum(amount_paid) FROM insurance.premium_payments WHERE status = 'Failed';", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te...
[ { "role": "user", "content": "List all beneficiaries who have a relationship of 'Parent' and a percentage_share less than 25%. Show their beneficiary_id, first_name, last_name, relationship, and percentage_share.", "sql": null }, { "role": "assistant", "content": "SELECT beneficiary_id, firs...
You are an expert in writing database language. You can write a corresponding 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": "Which service locations are not accessible and belong to agencies with a jurisdiction level of 'Local'? Show the location name and city.", "sql": null }, { "role": "assistant", "content": "SELECT sl.location_name, sl.city\nFROM government_services.service_locati...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE smart_money_profit ( address.text, rank.numeric, profit.numeric, roi.numeric, realiz...
[ { "role": "user", "content": "List the top 3 addresses with the highest profit on the Arbitrum chain, including roi and most_profit_token.", "sql": null }, { "role": "assistant", "content": "SELECT address, profit, roi, most_profit_token FROM smart_money_profit WHERE chain = 'Arbitrum' ORDER...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.bookings ( booking_id text, passenger_id text, trip_id text, seat_num...
[ { "role": "user", "content": "List each booking with its previous booking time for the same passenger.", "sql": null }, { "role": "assistant", "content": "SELECT b.booking_id,\n b.passenger_id,\n b.booking_time,\n LAG(b.booking_time) OVER (PARTITION BY b.passenger_id ORDER ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "Count the number of premium payments that have a null payment method.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS null_payment_method_count\nFROM insurance.premium_payments\nWHERE payment_method IS NULL;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr...
[ { "role": "user", "content": "I need to list pairs of achievements within the same game, showing game_id, the name of the first achievement, and the name of the second achievement.", "sql": null }, { "role": "assistant", "content": "SELECT a1.game_id, a1.name AS achievement1, a2.name AS achi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.in_game_items ( item_id uuid PRIMARY KEY, game_id uuid, item_name ...
[ { "role": "user", "content": "I need pairs of items within the same game where one item_type is 'Weapon' and the other is 'Consumable'. Show game_id, weapon_name, and consumable_name.", "sql": null }, { "role": "assistant", "content": "SELECT i1.game_id, i1.item_name AS weapon_name, i2.item_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser...
[ { "role": "user", "content": "For each game, which server has hosted the most sessions?", "sql": null }, { "role": "assistant", "content": "SELECT game_id, server_id, COUNT(*) AS session_count FROM gaming_technology.game_sessions GROUP BY game_id, server_id;", "sql": null }, { "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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact...
[ { "role": "user", "content": "List all law firms founded in the year 2015. Show their names, phone numbers, and website.", "sql": null }, { "role": "assistant", "content": "SELECT firm_name, phone, website\nFROM legal_services.law_firms\nWHERE EXTRACT(YEAR FROM founded_date) = 2015;", "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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "I want to see a list of all patients, including their full name and date of birth, along with every doctor they have been diagnosed by and that doctor's specialty.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name || ' ' || p....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure "CREATE TABLE project_fundraising_record (", "id character varying(32) NOT NULL, -- fundrai...
[ { "role": "user", "content": "List the top 5 tokens by 24 hour trading volume on DEX pools.", "sql": null }, { "role": "assistant", "content": "SELECT token_name, token_symbol, volume_24h \nFROM token_dexpool_info \nORDER BY volume_24h DESC LIMIT 5;", "sql": null }, { "role": "us...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description te...
[ { "role": "user", "content": "Show all routes where the estimated duration is at least 120 minutes including their route number, type, and origin and destination location IDs.", "sql": null }, { "role": "assistant", "content": "SELECT route_number, type, origin_location_id, destination_locat...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id text, account_id text, related_acco...
[ { "role": "user", "content": "Show the total incoming and outgoing amounts for each account_id, along with the number of transactions for each type (incoming and outgoing). An incoming transaction is when the account_id appears as related_account_id.", "sql": null }, { "role": "assistant", "...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.medications ( medication_id character varying(64) NOT NULL, medication_na...
[ { "role": "user", "content": "Show the medication_id, medication_name, and manufacturer for all medication entries.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications;", "sql": null }, { "role": "use...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Get the count of unread messages for each participant in each group chat, showing conversation_id, group_name, user_id, and unread_count.", "sql": null }, { "role": "assistant", "content": "SELECT cp.conversation_id, conv.group_name, cp.user_id, COUNT(m.message_...
You are an expert in writing database language. You can write a corresponding 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": "Show me a list of all agencies and the number of distinct citizens who have submitted documents to each agency.", "sql": null }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(DISTINCT d.citizen_id) AS citizen_count\nFROM government_services.docu...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "List document names and versions for documents that share the same case_id, showing each pair of versions.", "sql": null }, { "role": "assistant", "content": "SELECT d1.case_id, d1.document_name AS doc_name_v1, d1.version AS version1, d2.document_name AS doc_nam...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve each patient's full name, total number of appointments, and date of their most recent appointment.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name || ' ' || p.last_name AS patient_name, COUNT(a.appointment_id) AS appointment_coun...
You are an expert in writing database language. You can write a corresponding 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": "Give me the number of vehicles grouped by fuel_type.", "sql": null }, { "role": "assistant", "content": "SELECT fuel_type, COUNT(*) AS vehicle_count\nFROM transportation.vehicles\nGROUP BY fuel_type;", "sql": null }, { "role": "user", "content": ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "For each user, list their username and the total number of filled orders they have placed.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, COUNT(o.order_id) AS filled_order_count\nFROM trading_platform.users u\nJOIN trading_platform.orders...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p...
[ { "role": "user", "content": "Can you list all item names and their types from the in-game items table?", "sql": null }, { "role": "assistant", "content": "SELECT item_name, item_type FROM gaming_technology.in_game_items;", "sql": null }, { "role": "user", "content": "Please ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,...
[ { "role": "user", "content": "List all notifications that are related to group conversations, showing notification ID, recipient user ID, and the associated group name.", "sql": null }, { "role": "assistant", "content": "SELECT n.notification_id, n.recipient_user_id, c.group_name 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "List all property pairs that share the same postal_code, showing each pair's property IDs, names, and the postal_code.", "sql": null }, { "role": "assistant", "content": "SELECT a.property_id AS property_id_1,\n a.property_name AS property_name_1,\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": "I want a list of all users, showing for each user their user_id, username, KYC status, and the date their account was created.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.username, k.status AS kyc_status, u.created_at\nFROM trading_pl...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
2