system stringlengths 315 17.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 financial_services.transactions (
transaction_id character varying(64) NOT NULL,... | [
{
"content": "For each transaction, show the transaction_id, amount, and the number of other transactions that have the same related_account_id and happened on the same effective_date.",
"role": "user",
"sql": null
},
{
"content": "SELECT t1.transaction_id, t1.amount, (SELECT COUNT(*) FROM finan... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char... | [
{
"content": "Find all transactions where the from_address is the same as the to_address, indicating self-transactions, and show the transaction_id, value, and gas_used.",
"role": "user",
"sql": null
},
{
"content": "SELECT transaction_id, value, gas_used FROM web3.transactions WHERE from_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 financial_services.trades ( trade_id character varying(64) NOT NULL, account_id char... | [
{
"content": "Find pairs of BUY and SELL trades from the trades table for the same account that occurred on the same settlement_date and had matching quantities.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n a.trade_id AS buy_trade_id,\n b.trade_id AS sell_trade_id,\n a.account_id,\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"content": "Provide a count of appointments grouped by their current status.",
"role": "user",
"sql": null
},
{
"content": "SELECT status, COUNT(*) FROM government_services.appointments GROUP BY status;",
"role": "assistant",
"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 transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ... | [
{
"content": "Show the total number of maintenance logs for each vehicle along with the vehicle's make and model.",
"role": "user",
"sql": null
},
{
"content": "SELECT v.vehicle_id, v.make, v.model, COUNT(m.log_id) AS maintenance_count\nFROM transportation.vehicles v\nLEFT JOIN transportation.ma... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL,... | [
{
"content": "List all room types with their type name, base rate, and the name of the property they belong to.",
"role": "user",
"sql": null
},
{
"content": "SELECT rt.room_type_id, rt.type_name, rt.base_rate, p.property_name\nFROM hospitality_technology.room_types rt\nJOIN hospitality_technolo... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Count the total number of medical records where both assessment and treatment_plan fields are provided.",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) AS total_records\nFROM healthcare.medical_records\nWHERE assessment IS NOT NULL AND treatment_plan IS NOT NULL;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"content": "Show the name, symbol, and total quantity traded for each asset.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.name, a.symbol, COALESCE(SUM(t.quantity), 0) AS total_quantity_traded\nFROM trading_platform.assets a\nLEFT JOIN trading_platform.trades t ON t.asset_id = a.asse... |
You are an expert in writing database language. You can write a corresponding 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, -- ... | [
{
"content": "Can you retrieve the total number of tickets sold for each car type?",
"role": "user",
"sql": null
},
{
"content": "SELECT tc.car_type, COUNT(t.ticket_id) AS total_tickets\nFROM train_station_management.train_cars tc\nJOIN train_station_management.tickets t ON tc.car_id = t.car_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 gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_t... | [
{
"content": "List all items with rarity = 'Legendary', showing item_id, item_name, and cost_amount.",
"role": "user",
"sql": null
},
{
"content": "SELECT item_id,\n item_name,\n cost_amount\nFROM gaming_technology.in_game_items\nWHERE rarity = 'Legendary';",
"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.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"content": "List all appointments along with the patient's full name and the doctor's full name.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n a.appointment_id,\n a.appointment_time,\n p.first_name AS patient_first_name,\n p.last_name AS patient_last_name,\n d.first_name AS doct... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"content": "Show the transaction ID, the transaction value from the transactions table, and the sum of the value from token_transfers for all transactions that have at least one associated token transfer. Name the sum column total_token_transfer_value.",
"role": "user",
"sql": null
},
{
"conte... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"content": "I want to know for each player, what's the average time interval in days between their achievement unlocks? Only show player_ids with at least 2 unlocks.",
"role": "user",
"sql": null
},
{
"content": "SELECT player_id, AVG(unlocked_at - LAG(unlocked_at) OVER (PARTITION BY player_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.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"content": "List all patient insurance entries where the subscriber name is different from the patient's last name. Include patient ID, subscriber name, and patient last name.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.patient_id, T1.subscriber_name, T2.last_name FROM healthcare.... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List all users who have sent messages containing media files in group conversations, showing their username, email, and the group name.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT u.username, u.email, c.group_name\nFROM social_media.messages m\nJOIN social_media.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"content": "For each developer, show their name and the total number of in-game items in all games they've developed.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.name AS developer_name,\n COUNT(i.item_id) AS total_items\nFROM gaming_technology.developers d\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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"content": "I need the full names of guests who have checked out in June 2023. Show reservation_id, guest first and last name, property_id and actual_check_out_ts.",
"role": "user",
"sql": null
},
{
"content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS full_name, r.propert... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me the count of available rooms for each property.",
"role": "user",
"sql": null
},
{
"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.property_id WHERE T2.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 healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointmen... | [
{
"content": "How many medical records have been created by each doctor? Provide doctor_id and the total number of records.",
"role": "user",
"sql": null
},
{
"content": "SELECT doctor_id,\n COUNT(*) AS record_count\nFROM healthcare.medical_records\nGROUP BY doctor_id;",
"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 healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"content": "List the names of all insurance providers who offer at least one plan of type 'EPO'.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT insurance_provider\nFROM healthcare.insurance_plans\nWHERE plan_type = 'EPO';",
"role": "assistant",
"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 blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen ti... | [
{
"content": "List all ports along with the count of unique IP addresses that have been seen on each port.",
"role": "user",
"sql": null
},
{
"content": "SELECT port, COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes GROUP BY port;",
"role": "assistant",
"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.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"content": "What are the top 5 product types by average base premium, showing the product_type and average base_premium, ordered by average base_premium descending?",
"role": "user",
"sql": null
},
{
"content": "SELECT product_type, AVG(base_premium) AS avg_premium FROM insurance.insurance_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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"content": "For each driver, show the driver's full name and the total number of trips they have driven. Only include drivers whose status is 'Active' and sort the result by trip count in descending order.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.driver_id,\n d.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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"content": "Get the five most recent public posts that have media_type = 'video', showing post_id, created_at, and the author's username.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n p.post_id,\n p.created_at,\n u.username\nFROM social_media.posts p\nJOIN social_media.users u\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 transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id ... | [
{
"content": "Show me all maintenance logs that do not have a next service due date recorded. List the log ID, vehicle ID, and service date.",
"role": "user",
"sql": null
},
{
"content": "SELECT log_id, vehicle_id, service_date FROM transportation.maintenance_logs WHERE next_service_due_date IS ... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "For each sector, could you show the sum of volume and the average close price from market_data, including the sector name?",
"role": "user",
"sql": null
},
{
"content": "SELECT s.sector, SUM(md.volume) AS total_volume, AVG(md.close_price) AS avg_close_price\nFROM financial_services... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"content": "List plan_id, plan_name, and contact_phone for all insurance plans whose website ends with '.org' and that have at least one other plan with the same contact_phone.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.plan_id, a.plan_name, a.contact_phone\nFROM healthcare.insura... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var... | [
{
"content": "For the 'DeFi' narrative, what is the average price, average market cap, and average 24-hour trading volume of its tokens?",
"role": "user",
"sql": null
},
{
"content": "SELECT AVG(price) AS avg_price, AVG(market_cap) AS avg_market_cap, AVG(CAST(total_volume AS DOUBLE PRECISION)) A... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"content": "Find all contracts deployed by users who have also conducted transactions with a value greater than 1 ETH (where 1 ETH = 1e18 wei).",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT c.contract_id, c.address, c.deployer_address FROM web3.contracts c JOIN web3.transactio... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"content": "List the ERC20 tokens (from token_metas) with exactly 6 decimals. Show their symbol, contract_address, and name.",
"role": "user",
"sql": null
},
{
"content": "SELECT symbol, contract_address, name FROM token_metas WHERE is_erc20 = 1 AND decimals = 6;",
"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 gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"content": "List all pairs of servers in the same region that are both 'online', showing server1_name, server2_name, and the absolute difference in current_players.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n s1.server_name AS server1_name,\n s2.server_name AS server2_name,\n AB... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"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.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.player_id, p.username, COUNT(pa.achievement_id) AS total_unlocked\nFROM gaming... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "How many passengers were born in each year? Please show the birth year and the count.",
"role": "user",
"sql": null
},
{
"content": "SELECT EXTRACT(YEAR FROM date_of_birth) AS birth_year , COUNT(*) AS passenger_count FROM transportation.passengers WHERE date_of_birth IS NOT NULL G... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"content": "Show me all pairs of active policies for the same customer where their coverage periods overlap. Return customer_id, policy1_id, policy2_id, overlap_start, overlap_end.",
"role": "user",
"sql": null
},
{
"content": "SELECT p1.customer_id,\n p1.policy_id AS policy1_id,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations (
location_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "For each passenger, show their full name and the total amount they have spent on completed bookings.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.first_name, p.last_name, SUM(b.fare) AS total_spent\nFROM transportation.passengers p\nJOIN transportation.bookings b ON p.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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"content": "For each driver status, find the earliest and latest hire date. Show status, earliest hire date, and latest hire date.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n status,\n MIN(hire_date) AS earliest_hire_date,\n MAX(hire_date) AS latest_hire_date\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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"content": "List each verified user's username and their total number of public posts.",
"role": "user",
"sql": null
},
{
"content": "SELECT u.username, COUNT(p.post_id) AS post_count\nFROM social_media.users u\nLEFT JOIN social_media.posts p ON u.user_id = p.user_id AND p.visibility = 'public... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Give me the product name and description of all insurance products that have been updated in the last 30 days.",
"role": "user",
"sql": null
},
{
"content": "SELECT product_name, description FROM insurance.insurance_products WHERE updated_at >= NOW() - INTERVAL '30 days';",
"ro... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Count the number of contracts for each network_id.",
"role": "user",
"sql": null
},
{
"content": "SELECT network_id, COUNT(*) FROM web3.contracts GROUP BY network_id;",
"role": "assistant",
"sql": null
},
{
"content": "Now, only show networks with more than 100 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 hospitality_technology.staff ( staff_id text PRIMARY KEY, property_id text, first_na... | [
{
"content": "Show me all staff members who have a manager assigned, along with each manager's full name.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.staff_id, s.first_name, s.last_name, s.manager_id, m.first_name AS manager_first_name, m.last_name AS manager_last_name\nFROM hospital... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List each staff member who delivered orders, along with the number of orders they delivered.",
"role": "user",
"sql": null
},
{
"content": "SELECT staff_id_delivered, COUNT(order_id) AS delivered_orders FROM hospitality_technology.service_orders WHERE staff_id_delivered IS NOT NULL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text PRIMARY KEY, address text, abi text, bytecode text... | [
{
"content": "List all failed transactions along with the from and to addresses, and the gas used.",
"role": "user",
"sql": null
},
{
"content": "SELECT transaction_id, from_address, to_address, gas_used FROM web3.transactions WHERE status = 'failed';",
"role": "assistant",
"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 transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"content": "Which routes have their origin and destination in the same city? Show the route number, description, and the origin and destination location IDs.",
"role": "user",
"sql": null
},
{
"content": "SELECT r.route_number, r.description, r.origin_location_id, r.destination_location_id\nFR... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me all servers and the total number of achievements available in the game they host. Include the server name and region.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.server_name, s.region, COUNT(a.achievement_id) AS total_achievements\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 healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "Show me a list pairing each medication name with the record_id of any medical record whose treatment_plan mentions that medication.",
"role": "user",
"sql": null
},
{
"content": "SELECT m.medication_name, mr.record_id\nFROM healthcare.medications m\nJOIN healthcare.medical_records ... |
You are an expert in writing database language. You can write a corresponding 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.text, property_id.text, room_number.text, roo... | [
{
"content": "List all rooms with their latest review comment and the date of that review, showing the room number and property id.",
"role": "user",
"sql": null
},
{
"content": "SELECT r.room_number, r.property_id, rv.comment, rv.review_date\nFROM hospitality_technology.rooms r\nLEFT JOIN hospi... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Find the average score for each player who has participated in game sessions.",
"role": "user",
"sql": null
},
{
"content": "SELECT player_id, AVG(score) AS avg_score\nFROM gaming_technology.game_sessions\nGROUP BY player_id;",
"role": "assistant",
"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.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty... | [
{
"content": "List all document IDs, file names, and uploaded timestamps for documents that were uploaded on a weekend.",
"role": "user",
"sql": null
},
{
"content": "SELECT document_id, file_name, uploaded_at FROM insurance.claim_documents WHERE EXTRACT(DOW FROM uploaded_at) IN (0, 6);",
"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.invoices ( invoice_id.text, invoice_number.text, client_id.text, case... | [
{
"content": "I want to find all pairs of invoices belonging to the same client. Show me the client_id, the invoice_number for the earlier invoice and the invoice_number for the later invoice.",
"role": "user",
"sql": null
},
{
"content": "SELECT i1.client_id,\n i1.invoice_number AS earlie... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"content": "Give me the number of patient insurance policies for each plan where the policy is currently active. Return plan_id and policy_count.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n plan_id,\n COUNT(*) AS policy_count\nFROM healthcare.patient_insurance\nWHERE (expiration_... |
You are an expert in writing database language. You can write a corresponding 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(), -... | [
{
"content": "I'd like a list of all games, displaying game title, developer name, and total number of achievements for each game.",
"role": "user",
"sql": null
},
{
"content": "SELECT g.title, d.name AS developer_name, COUNT(a.achievement_id) AS total_achievements\nFROM gaming_technology.games ... |
You are an expert in writing database language. You can write a corresponding 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 character varying(100) NOT NULL, token... | [
{
"content": "For each blockchain (chain), which token symbol has the highest Return on Investment (ROI)? Show the chain, token symbol, and the highest ROI.",
"role": "user",
"sql": null
},
{
"content": "SELECT chain, token_symbol, roi FROM ( SELECT chain, token_symbol, roi, ROW_NUMBER() OVER(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 blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp tim... | [
{
"content": "Show me all smart contracts created by addresses with a balance greater than 1000, along with the contract creation timestamp and the creator's public key.",
"role": "user",
"sql": null
},
{
"content": "SELECT sc.contract_id, sc.timestamp, a.public_key FROM blockchain.smart_contrac... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"content": "For each token listed in token_dexpool_info, can you show the total net_flow and average ROI from smart_money_token_performance, along with the token's symbol and chain?",
"role": "user",
"sql": null
},
{
"content": "SELECT tdi.token_symbol, tdi.chain, SUM(sm.net_flow) AS total_net... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, application_id text, cit... | [
{
"content": "Show me all failed payments along with the application ID, citizen ID, and payment timestamp.",
"role": "user",
"sql": null
},
{
"content": "SELECT payment_id, application_id, citizen_id, payment_timestamp\nFROM government_services.payments\nWHERE status = 'Failed';",
"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.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"content": "Show me the usernames of buyers along with the names of assets they have traded.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT u.username, a.name AS asset_name\nFROM trading_platform.trades t\nJOIN trading_platform.users u ON t.buyer_id = u.user_id\nJOIN 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
CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"content": "Find all pairs of developers who share the exact same founded_year but are from different countries. Show both developer names, their countries, and the founded_year.",
"role": "user",
"sql": null
},
{
"content": "SELECT d1.name AS developer1_name, d1.country AS country1, d2.name 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 blockchain.blocks (
block_id character varying(64) NOT NULL, -- unique identifi... | [
{
"content": "Show me the average difficulty for blocks that have a previous block versus those that don't have a previous block.",
"role": "user",
"sql": null
},
{
"content": "SELECT CASE WHEN previous_block_id IS NULL THEN 'No Previous Block' ELSE 'Has Previous Block' END AS block_type, AVG(di... |
You are an expert in writing database language. You can write a corresponding 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 ... | [
{
"content": "Could you show each in-game item's name, its rarity, and the total quantity acquired by all players?",
"role": "user",
"sql": null
},
{
"content": "SELECT i.item_name, i.rarity, SUM(pi.quantity) AS total_quantity\nFROM gaming_technology.in_game_items i\nJOIN gaming_technology.playe... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, policy_id text, cu... | [
{
"content": "Show me all policy beneficiaries associated with customer ID 'CUST100'.",
"role": "user",
"sql": null
},
{
"content": "SELECT * FROM insurance.policy_beneficiaries WHERE customer_id = 'CUST100';",
"role": "assistant",
"sql": null
},
{
"content": "From those results,... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List each customer along with another customer living at the same address.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.customer_id AS customer_id_a, a.first_name || ' ' || a.last_name AS full_name_a, b.customer_id AS customer_id_b, b.first_name || ' ' || b.last_name 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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"content": "Show the top 5 properties by average overall review rating.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.reviews r\n ON p.property_id = r.property_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 smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the tok... | [
{
"content": "Which token symbols have the highest number of addresses buying them on the Ethereum chain? Show the top 3 symbols, their total address_amount, and narrative.",
"role": "user",
"sql": null
},
{
"content": "SELECT token_symbol, narrative, SUM(address_amount) AS total_buying_addresse... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id tex... | [
{
"content": "Show the invoice_id and total hours logged for each invoice.",
"role": "user",
"sql": null
},
{
"content": "SELECT invoice_id, SUM(hours_spent) AS total_hours FROM legal_services.time_entries WHERE invoice_id IS NOT NULL GROUP BY invoice_id;",
"role": "assistant",
"sql": nu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"content": "List all token symbols on the 'Ethereum' chain with a Realized Ratio greater than 0.9. Show the symbol and realized ratio.",
"role": "user",
"sql": null
},
{
"content": "SELECT token_symbol, realized_ratio FROM smart_money_token_performance WHERE chain = 'Ethereum' AND realized_rat... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"content": "Show me all patients who have received a prescription for a medication with 'cillin' in its generic name, along with their full name, prescription date, and the prescribing doctor's last name.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.patient_id, p.first_name, p.last_... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Count the total number of users who have enabled email notifications but disabled push notifications.",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM social_media.user_settings WHERE email_notifications_enabled = TRUE AND push_notifications_enabled = FALSE;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"content": "List the content of posts that have received comments from verified users, showing the post content and the username of the verified commenter.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT p.content AS post_content, u.username AS commenter_username FROM social_med... |
You are an expert in writing database language. You can write a corresponding 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, chain character va... | [
{
"content": "Show me the top 5 tokens by USD value held on the Binance Smart Chain, along with their average price and total balance.",
"role": "user",
"sql": null
},
{
"content": "SELECT token_symbol, AVG(price) as average_price, SUM(balance) as total_balance, SUM(usd_value) as total_usd_value... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"content": "Which agents have sold policies with a coverage limit over 1,000,000, and what are the policy numbers and their respective coverage limits?",
"role": "user",
"sql": null
},
{
"content": "SELECT agent_id, policy_number, coverage_limit FROM insurance.policies WHERE coverage_limit > 1... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"content": "List the username, registration date, and address of all users who have created a wallet.",
"role": "user",
"sql": null
},
{
"content": "SELECT u.username, u.created_at AS registration_date, w.address AS wallet_address\nFROM web3.users u\nJOIN web3.wallets w ON u.user_id = w.user_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 blockchain.wallets (
wallet_id character varying(64) NOT NULL, -- unique identi... | [
{
"content": "Find all users who have wallets with private keys containing the substring 'abc'.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT user_id FROM blockchain.wallets WHERE private_key LIKE '%abc%';",
"role": "assistant",
"sql": null
},
{
"content": "Now 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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"content": "What is the average balance for each account_type among accounts with status 'Open'?",
"role": "user",
"sql": null
},
{
"content": "SELECT account_type, AVG(balance) AS avg_balance FROM financial_services.accounts WHERE status = 'Open' GROUP BY account_type;",
"role": "assistan... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List each property along with the total revenue generated from all delivered service orders, including the property name and total revenue.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.property_id, p.property_name, SUM(so.total_price) AS total_revenue\nFROM hospitality_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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"content": "What is the average processing time in days for each service category?",
"role": "user",
"sql": null
},
{
"content": "SELECT category, AVG(average_processing_time_days) AS avg_processing_time\nFROM government_services.services\nGROUP BY category;",
"role": "assistant",
"sql... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 5