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 healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id ... | [
{
"content": "List all appointments with status 'Completed' and location 'LOC001' that occurred in December 2023. Show appointment ID, time, duration, and notes.",
"role": "user",
"sql": null
},
{
"content": "SELECT appointment_id, appointment_time, duration_minutes, notes FROM healthcare.appoin... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo... | [
{
"content": "Show the details of all UTXOs with an amount greater than 5, ordered by amount descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT utxo_id, transaction_id, output_index, address, amount, spent\nFROM trading_platform.utxos\nWHERE amount > 5\nORDER BY amount DESC;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ... | [
{
"content": "Which citizens have received notifications for applications processed by employees from the 'Legal' department? List the citizen ID, full name, and notification ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT n.citizen_id, CONCAT(e.first_name, ' ', e.last_name) AS full_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 transportation.routes ( route_id text, route_number text, description text, origin_l... | [
{
"content": "Find pairs of distinct routes that share the same destination location but start from different origins. Include the route ID and route number for both routes and the shared destination location ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n r1.route_id AS route1_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.properties ( property_id text, property_name text, address_li... | [
{
"content": "Show me the payment amount and the name of the property associated with each payment record.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n p.amount,\n prop.property_name\nFROM hospitality_technology.payments AS p\nJOIN hospitality_technology.reservations AS r ON p.reser... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me all trades where the traded quantity is less than 2, including the trade_id, quantity, and the buyer and seller IDs.",
"role": "user",
"sql": null
},
{
"content": "SELECT trade_id, quantity, buyer_id, seller_id\nFROM trading_platform.trades\nWHERE quantity < 2;",
"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 social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,... | [
{
"content": "How many unread notifications are there with the type 'mention'?",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM social_media.notifications WHERE read_at IS NULL AND notification_type = 'mention';",
"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.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 gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country tex... | [
{
"content": "List all developers founded before the year 2000, showing their name, country, and the year they were founded.",
"role": "user",
"sql": null
},
{
"content": "SELECT name, country, founded_year FROM gaming_technology.developers WHERE founded_year < 2000;",
"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 web3.token_transfers ( transfer_id text, token_id text, from_address text, to_addres... | [
{
"content": "Which addresses have both sent and received tokens? List them.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT t1.from_address FROM web3.token_transfers t1 INNER JOIN web3.token_transfers t2 ON t1.from_address = t2.to_address;",
"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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"content": "How many documents are there for each document_type? Show document_type and count ordered by the count in descending order.",
"role": "user",
"sql": null
},
{
"content": "SELECT document_type,\n COUNT(*) AS count\nFROM legal_services.documents\nGROUP BY document_type\nORDER B... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"content": "What is the average estimated_loss for claims with status 'Filed' or 'Approved'?",
"role": "user",
"sql": null
},
{
"content": "SELECT AVG(estimated_loss) AS avg_estimated_loss\nFROM insurance.claims\nWHERE status IN ('Filed', 'Approved');",
"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 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 web3.token_transfers (
transfer_id character varying(64) NOT NULL, -- unique id... | [
{
"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.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n t1.transaction_id,\n t1.f... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, name character va... | [
{
"content": "List all UTXO IDs, addresses, and amounts for unspent UTXOs with an amount between 200 and 800.",
"role": "user",
"sql": null
},
{
"content": "SELECT utxo_id, address, amount FROM trading_platform.utxos WHERE spent = false AND amount BETWEEN 200 AND 800;",
"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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"content": "Show me all pairs of usernames for users located in the same city along with their shared location.",
"role": "user",
"sql": null
},
{
"content": "SELECT u1.username AS user1, u2.username AS user2, u1.location\nFROM social_media.users u1\nJOIN social_media.users u2\n ON u1.locatio... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List clients who have appointments with lawyers from law firms founded before the year 2010. Show the client's first name, last name, the appointment subject, the lawyer's first name, last name, and the firm name.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"content": "How many documents were uploaded in the year 2023?",
"role": "user",
"sql": null
},
{
"content": "SELECT count(*) FROM government_services.documents WHERE date_part('year', upload_timestamp) = 2023;",
"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 legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, p... | [
{
"content": "Which law firms were founded in the same year and share the same managing partner? Show the firm names, founding year, and managing partner ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT f1.firm_name AS firm_name_1, f2.firm_name AS firm_name_2, EXTRACT(YEAR FROM f1.found... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show the first name and last name of employees who have a manager, along with the first and last name of their manager.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.first_name , T1.last_name , T2.first_name , T2.last_name FROM employees AS T1 JOIN employees 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 project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... | [
{
"content": "For each project, list the earliest and latest fundraising rounds they completed, along with the investment values for those rounds.",
"role": "user",
"sql": null
},
{
"content": "SELECT project_name, MIN(investment_date) AS earliest_round_date, MAX(investment_date) AS latest_round... |
You are an expert in writing database language. You can write a corresponding 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.smart_contracts (
contract_id character varying(64) NOT NULL, -- uni... | [
{
"content": "List the contract_id and creator_address for all smart contracts created after January 1st, 2023, along with the total number of contracts each creator has created.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.contract_id, s.creator_address, creator_count.total_contracts... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the total fuel quantity and cost for each route, grouped by route number, only for trips that have associated fuel logs.",
"role": "user",
"sql": null
},
{
"content": "SELECT r.route_number, SUM(f.quantity) AS total_quantity, SUM(f.total_cost) AS total_cost\nFROM transporta... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "How many active insurance policies are there for each plan_id? Show plan_id and active_count.",
"role": "user",
"sql": null
},
{
"content": "SELECT plan_id,\n COUNT(*) AS active_count\nFROM healthcare.patient_insurance\nWHERE expiration_date IS NULL OR expiration_date > CURRE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,... | [
{
"content": "I want to retrieve the agent ID, first and last name, along with their manager's contact email and phone number.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.agent_id,\n a.first_name || ' ' || a.last_name AS agent_name,\n m.contact_email AS manager_email,\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 gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr... | [
{
"content": "Get name pairs of achievements for each game where one is hidden and the other is visible.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.achievement_id AS hidden_achievement_id, a.name AS hidden_name, b.achievement_id AS visible_achievement_id, b.name AS visible_name\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 character varying(64) NOT NULL, ... | [
{
"content": "List all reservations made by guests from the 'CAN' country code. Include the reservation ID, guest's first name, last name, and the guest's country code.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.reservation_id, T2.first_name, T2.last_name, T2.country_code FROM hosp... |
You are an expert in writing database language. You can write a corresponding 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 ... | [
{
"content": "Find currently employed employees whose direct manager has been terminated. Display the employee's full name, hire date, manager's full name, and manager's termination date.",
"role": "user",
"sql": null
},
{
"content": "SELECT e.employee_id,\n CONCAT(e.first_name, ' ', e.las... |
You are an expert in writing database language. You can write a corresponding 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,... | [
{
"content": "List group conversation names and the count of messages sent in each conversation after '2024-06-01'.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.group_name, COUNT(T2.message_id) FROM social_media.conversations AS T1 JOIN social_media.messages AS T2 ON T1.conversation_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.hashtags ( hashtag_id.text, tag_name.text, created_at.timestamp )
CREAT... | [
{
"content": "How many notifications are there for each distinct notification type?",
"role": "user",
"sql": null
},
{
"content": "SELECT notification_type, COUNT(*) FROM social_media.notifications GROUP BY notification_type;",
"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 erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, am... | [
{
"content": "For each NFT collection deployed on Ethereum, count the number of distinct wallets that have ever held any token from that collection.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n nc.contract_address,\n nc.name,\n COUNT(DISTINCT nh.wallet_address) AS holder_count\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 legal_services.clients ( client_id.text, first_name.text, last_name.text, company_na... | [
{
"content": "Can you give me a list of all invoices issued in 2024, along with the invoice number, client full name, case number, and total amount?",
"role": "user",
"sql": null
},
{
"content": "SELECT i.invoice_number, cl.first_name || ' ' || cl.last_name AS client_full_name, c.case_number, 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 healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"content": "List all appointments that were marked as 'No-show'. Show appointment ID, patient ID, and appointment time.",
"role": "user",
"sql": null
},
{
"content": "SELECT appointment_id, patient_id, appointment_time FROM healthcare.appointments WHERE status = 'No-show';",
"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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"content": "Provide a count of citizens registered per calendar year.",
"role": "user",
"sql": null
},
{
"content": "SELECT CAST(EXTRACT(YEAR FROM registration_date) AS INTEGER) AS registration_year, COUNT(*) AS citizen_count FROM government_services.citizens GROUP BY 1 ORDER BY 1;",
"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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"content": "Show me the usernames and full names of all users who have liked at least one post that was created in May 2024.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT u.username, u.full_name\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.user_id\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 social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte... | [
{
"content": "List all hashtags created in March 2024 along with their creation timestamps.",
"role": "user",
"sql": null
},
{
"content": "SELECT hashtag_id, tag_name, created_at\nFROM social_media.hashtags\nWHERE created_at BETWEEN '2024-03-01 00:00:00' AND '2024-03-31 23:59:59';",
"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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"content": "Show me the usernames of users who are participating in a conversation but have not sent any messages in that conversation, along with the conversation ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT\n u.username,\n cp.conversation_id\nFROM social_media.convers... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"content": "List all insurance plans and the doctors whose hospital affiliation ID matches the plan ID. Include plan_name, insurance_provider, doctor first_name, and last_name.",
"role": "user",
"sql": null
},
{
"content": "SELECT ip.plan_name, ip.insurance_provider, d.first_name, d.last_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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"content": "Calculate the average premium_amount of all policies, grouped by their status.",
"role": "user",
"sql": null
},
{
"content": "SELECT status,\n AVG(premium_amount) AS average_premium\nFROM insurance.policies\nGROUP 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 social_media.follows ( follow_id.text, follower_user_id.text, following_user_id.text... | [
{
"content": "How many users have followed more than one person in total?",
"role": "user",
"sql": null
},
{
"content": "SELECT follower_user_id, COUNT(DISTINCT following_user_id) AS following_count\nFROM social_media.follows\nGROUP BY follower_user_id\nHAVING COUNT(DISTINCT following_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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"content": "Give me the count of policies grouped by their status.",
"role": "user",
"sql": null
},
{
"content": "SELECT status,\n COUNT(*) AS policy_count\nFROM insurance.policies\nGROUP 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 PRIMARY KEY, license_plate text, vin text,... | [
{
"content": "Which vehicles have been refueled more than 3 times in the last 30 days? Provide the vehicle_id, make, model, and refuel_count.",
"role": "user",
"sql": null
},
{
"content": "SELECT v.vehicle_id,\n v.make,\n v.model,\n COUNT(fl.fuel_log_id) AS refuel_count\nFROM 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 financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, is... | [
{
"content": "What is the count of securities for each security_type in the 'Technology' sector?",
"role": "user",
"sql": null
},
{
"content": "SELECT security_type, COUNT(*) as count FROM financial_services.securities WHERE sector = 'Technology' GROUP BY security_type;",
"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.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text... | [
{
"content": "List each doctor and the total number of unique patients for appointments that have been completed. Return doctor_id, first_name, last_name, and patient_count.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.doctor_id,\n d.first_name,\n d.last_name,\n 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 trading_platform.orders ( order_id text, user_id text, wallet_id text, asset_id text... | [
{
"content": "I want to see the number of 'buy' and 'sell' orders for each asset, along with the asset_id.",
"role": "user",
"sql": null
},
{
"content": "SELECT asset_id, order_type, COUNT(*) AS order_count FROM trading_platform.orders GROUP BY asset_id, order_type;",
"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 token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var... | [
{
"content": "Show tokens with a trend rank worse than 30 (higher number) that also have a positive price change over the last 24 hours. Display their symbol, chain, price, trend rank, and 24h price change.",
"role": "user",
"sql": null
},
{
"content": "SELECT token_symbol, chain, price, trend_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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"content": "Show all documents uploaded in 2024 along with the citizen's full name and the reference number of the associated application.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.document_id, d.upload_timestamp, c.first_name || ' ' || c.last_name AS citizen_full_name, a.referen... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "For each chain, list the address with the highest ROI, showing the address, ROI, profit, and most profitable token.",
"role": "user",
"sql": null
},
{
"content": "SELECT t1.chain, t1.address, t1.roi, t1.profit, t1.most_profit_token FROM smart_money_profit t1 INNER JOIN (SELECT chai... |
You are an expert in writing database language. You can write a corresponding 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 the total number of service orders placed by each staff member who delivered the service.",
"role": "user",
"sql": null
},
{
"content": "SELECT staff_id_delivered, COUNT(*) AS order_count FROM hospitality_technology.service_orders GROUP BY staff_id_delivered;",
"role": "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 financial_services.securities ( security_id.text, ticker_symbol.text, isin_code.text... | [
{
"content": "How many securities are there for each security type?",
"role": "user",
"sql": null
},
{
"content": "SELECT security_type, COUNT(*) AS security_count FROM financial_services.securities GROUP BY security_type;",
"role": "assistant",
"sql": null
},
{
"content": "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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"content": "For each citizen, list the documents they uploaded and the notifications they received. Show citizen ID, document ID, document type, and notification ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.citizen_id, T1.document_id, T1.document_type, T2.notification_id FROM 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 smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"content": "Show the tokens with a negative net flow this month on all chains.",
"role": "user",
"sql": null
},
{
"content": "SELECT token_symbol, chain, net_flow FROM smart_money_token_performance WHERE net_flow < 0 AND date_trunc('month', CURRENT_DATE) = date_trunc('month', now());",
"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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"content": "List all wallet addresses and their amount holding more than 10,000 units of any ERC20 token.",
"role": "user",
"sql": null
},
{
"content": "SELECT wallet_address, contract_address, amount FROM erc20_balances WHERE CAST(amount AS numeric) > 10000;",
"role": "assistant",
"sq... |
You are an expert in writing database language. You can write a corresponding 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 medical record IDs and the record date for records created by doctors specializing in 'Gastroenterology'.",
"role": "user",
"sql": null
},
{
"content": "SELECT mr.record_id, mr.record_date FROM healthcare.medical_records mr JOIN healthcare.doctors d ON mr.doctor_id = d.doc... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t... | [
{
"content": "Show all wallet addresses together with the private key, sorted from the most recent to oldest creation date.",
"role": "user",
"sql": null
},
{
"content": "SELECT address, private_key, created_at FROM web3.wallets ORDER BY created_at DESC;",
"role": "assistant",
"sql": nul... |
You are an expert in writing database language. You can write a corresponding 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": "I want a list of all users, showing for each user their user_id, username, KYC status, and the date their account was created.",
"role": "user",
"sql": null
},
{
"content": "SELECT u.user_id, u.username, k.status AS kyc_status, u.created_at\nFROM trading_platform.users u\nLEFT JOIN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.hashtags ( hashtag_id.text, tag_name.text, created_at.timestamp )
CREAT... | [
{
"content": "List all unread notifications received by users who have a private profile, showing all notification details.",
"role": "user",
"sql": null
},
{
"content": "SELECT n.* FROM social_media.notifications n JOIN social_media.user_settings s ON n.recipient_user_id = s.user_id WHERE n.rea... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL, -- Block number contain... | [
{
"content": "Show me all NFT holders who own more than 10 of the same token, including the contract address, token ID, and wallet address.",
"role": "user",
"sql": null
},
{
"content": "SELECT contract_address, token_id, wallet_address, amount FROM nft_holders WHERE CAST(amount AS decimal) > 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 healthcare.diagnoses ( diagnosis_id text PRIMARY KEY, record_id text, patient_id tex... | [
{
"content": "Show me a list of prescriptions, including the prescription ID, medication ID, and start date, for prescriptions linked to any diagnosis that is marked as chronic.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.prescription_id, T1.medication_id, T1.start_date FROM 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 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
// db.createCollection('passengers')
// Optional: db.passengers.createIndex({ passenger_id: 1 }, ... | [
{
"content": "Can you show me the total number of passengers registered in the database?",
"role": "user",
"sql": null
},
{
"content": "db.passengers.countDocuments({})",
"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 social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url... | [
{
"content": "List all posts created by user 'U789'.",
"role": "user",
"sql": null
},
{
"content": "SELECT post_id, content, created_at, media_type FROM social_media.posts WHERE user_id = 'U789'",
"role": "assistant",
"sql": null
},
{
"content": "Only show me the posts that have ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.applications ( application_id character varying(64) NOT NULL, ci... | [
{
"content": "List the reference number and status for all applications, including the registration date of the citizen who submitted it.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.reference_number, a.status, c.registration_date FROM government_services.applications AS a JOIN citize... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "Show me the total hours and total billed amount for each lawyer and each case, including the lawyer_id and case_id.",
"role": "user",
"sql": null
},
{
"content": "SELECT lawyer_id, case_id, SUM(hours_spent) AS total_hours, SUM(hours_spent * billing_rate) AS total_billed_amount\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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media... | [
{
"content": "Count the number of followers for each user and show those users who have more than 100 followers, ordering by follower_count descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT following_user_id AS user_id,\n COUNT(*) AS follower_count\nFROM social_media.follow... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Which diagnosis codes have been used for more than 5 different patients? Show the diagnosis_code and the patient count.",
"role": "user",
"sql": null
},
{
"content": "SELECT diagnosis_code, COUNT(DISTINCT patient_id) AS patient_count FROM healthcare.diagnoses GROUP BY diagnosis_cod... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"content": "How many games are available on each platform?",
"role": "user",
"sql": null
},
{
"content": "SELECT platform,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY platform;",
"role": "assistant",
"sql": null
},
{
"content": "Only include platforms... |
You are an expert in writing database language. You can write a corresponding 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_inventory ( inventory_id uuid, player_id uuid, item_id uuid... | [
{
"content": "Show me all unique player IDs who have at least one item in their inventory with a quantity greater than 10.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT player_id FROM gaming_technology.player_inventory WHERE quantity > 10;",
"role": "assistant",
"sql": 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 healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "I would like to see a list of all medical records where the chief complaint contains the word 'cough' along with the doctor's ID and the date of the record.",
"role": "user",
"sql": null
},
{
"content": "SELECT record_id, doctor_id, record_date, chief_complaint FROM healthcare.medi... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Identify pairs of routes that share the same origin and destination but have different route_ids.",
"role": "user",
"sql": null
},
{
"content": "SELECT r1.route_id AS route_a, r2.route_id AS route_b, r1.origin_location_id, r1.destination_location_id FROM transportation.routes r1 JO... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, user_id character varyi... | [
{
"content": "Count the total number of group chats.",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = true;",
"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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"content": "List the full names of guests who have made reservations at properties with a star rating of 5. Include the guest ID and the property name.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.first_name, T1.last_name, T1.guest_id, T3.property_name FROM hospitality_technology.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 social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_us... | [
{
"content": "Show all messages that include a media attachment, along with the sender's user ID and the conversation ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT message_id, sender_user_id, conversation_id, media_url, media_type, sent_at FROM social_media.messages WHERE media_url I... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 6