system stringlengths 336 7.84k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, roo... | [
{
"role": "user",
"content": "Show me the count of rooms by status."
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS room_count\nFROM hospitality_technology.rooms\nGROUP BY status;"
},
{
"role": "user",
"content": "Actually, I need that breakdown by property ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan."
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) AS enrolled_patie... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the salary or compensation package for a staff member with the role of Ticket Inspector?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about salary or compensation packages as this data is not included in the staff table. ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List each wallet that has received tokens of more than one distinct token type. Show wallet_id, address, the number of distinct tokens received as distinct_token_count, and the total received value, ordered by total_received_value descending."
},
{
"role": "assistant",
... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What are the specific tools or equipment used during the maintenance with record_id 'REC456'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the specific tools or equipment used during a maintenance record. The data in the 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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List the case_number, case_name, and the total amount invoiced for each case."
},
{
"role": "assistant",
"content": "SELECT ca.case_number, ca.case_name, SUM(i.total_amount) AS total_invoiced\nFROM legal_services.cases ca\nLEFT JOIN legal_services.invoices i ON ca.c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE manufacturing.components (
component_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "我想了解某个组件的库存情况,包括库存数量、仓库位置和接收日期。"
},
{
"role": "assistant",
"content": "SELECT ci.quantity, ci.location_warehouse, ci.received_date\nFROM manufacturing.component_inventory ci\nWHERE ci.component_id = 'specific_component_id';"
},
{
"role": "user",
"content... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medications ( medication_id character varying(64) NOT NULL, medication_na... | [
{
"role": "user",
"content": "How many medications does each manufacturer have?"
},
{
"role": "assistant",
"content": "SELECT manufacturer, COUNT(*) AS med_count\nFROM healthcare.medications\nGROUP BY manufacturer;"
},
{
"role": "user",
"content": "Only include manufacturers with mor... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List all pairs of record_id for the same patient that were created on the same day. Show the two record_ids, patient_id, and the date."
},
{
"role": "assistant",
"content": "SELECT\n mr1.patient_id,\n date_trunc('day', mr1.record_date) AS record_day,\n mr1.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ... | [
{
"role": "user",
"content": "Show me product_id, product_name, and base_premium for products created after '2023-01-01'."
},
{
"role": "assistant",
"content": "SELECT product_id,\n product_name,\n base_premium\nFROM insurance.insurance_products\nWHERE created_at > '2023-01-01';"
}... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Node Label ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St... | [
{
"role": "user",
"content": "Can you help me retrieve the details of all components supplied by suppliers from a specific country, along with the supplier's contact information?"
},
{
"role": "assistant",
"content": "MATCH (c:Component)-[:SUPPLIED_BY]->(s:Supplier)\nWHERE s.country = 'specific_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "Show all diagnoses recorded by doctor with ID 'doc789'. Include the diagnosis ID, patient ID, description, and diagnosis date."
},
{
"role": "assistant",
"content": "SELECT diagnosis_id, patient_id, description, diagnosis_date FROM healthcare.diagnoses WHERE doctor_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "List tokens on the 'Arbitrum' chain with a 24-hour price change percentage greater than 10% and a market cap above 1,000,000 USD. Show their symbol, name, price, 24-hour change percentage, and market cap. Order the results by the 24-hour change percentage in descending order."
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.guests (
guest_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Find guests who have made at least one payment using a 'CreditCard'. List their full name (first and last name) and email address."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.email FROM hospitality_technology.guests AS T1 J... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_i... | [
{
"role": "user",
"content": "How many reservations have been booked each month in 2023?"
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', created_at) AS month,\n COUNT(*) AS reservation_count\nFROM hospitality_technology.reservations\nWHERE created_at >= '2023-01-01' AND c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show each contract's address along with the total number of events it has emitted and the total number of transactions sent to it."
},
{
"role": "assistant",
"content": "SELECT\n c.address,\n COUNT(e.event_id) AS event_count,\n COUNT(t.transaction_id) AS tx_count... |
You are an expert in writing database language. You can write a corresponding 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, user_id text, address text, private_key text, created... | [
{
"role": "user",
"content": "List all pairs of wallets that use the same private_key. Display w1.wallet_id, w1.user_id, w2.wallet_id, w2.user_id, and the shared private_key."
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet1_id,\n w1.user_id AS user1_id,\n w2.wa... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "List the case number, case name, and the full name of the client for cases that have uploaded documents."
},
{
"role": "assistant",
"content": "SELECT T1.case_number , T1.case_name , T2.full_name FROM legal_services.cases AS T1 JOIN legal_services.clients 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 hospitality_technology.reviews ( review_id text, property_id text, reservation_id te... | [
{
"role": "user",
"content": "Give me a breakdown of the number of reviews per day for the last 14 days, including the review_date and review count."
},
{
"role": "assistant",
"content": "SELECT DATE(review_date) AS review_day, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nWHERE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.appointments ( appointment_id text, client_id text, lawyer_id text, c... | [
{
"role": "user",
"content": "How many appointments have been scheduled on weekends?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS weekend_appointments\nFROM legal_services.appointments\nWHERE EXTRACT(DOW FROM start_time) IN (0,6);"
}
] |
You are an expert in writing database language. You can write a corresponding 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, contract_id character varying... | [
{
"role": "user",
"content": "List the transaction IDs which have had more than one unique event emitted inside them."
},
{
"role": "assistant",
"content": "SELECT transaction_id FROM web3.events GROUP BY transaction_id HAVING COUNT(DISTINCT event_name) > 1;"
},
{
"role": "user",
"co... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"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": "assistant",
"content": "SELECT p1.customer_id,\n p1.policy_id AS policy1_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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me the usernames and full names of users who are followed by someone with a verified account."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u2.username, u2.full_name\nFROM social_media.users u1\nJOIN social_media.follows f ON u1.user_id = f.follower_us... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "Retrieve the policy_number, claim_id, incident_date, and document_type for all claims that have at least one \"Damage Assessment\" document. Sort the results by incident_date descending."
},
{
"role": "assistant",
"content": "SELECT p.policy_number, c.claim_id, c.in... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ... | [
{
"role": "user",
"content": "I want to identify pairs of players who unlocked the same achievement within one hour of each other. List player1_id, player2_id, achievement_id, and the time difference in minutes."
},
{
"role": "assistant",
"content": "SELECT pa1.player_id AS player1_id,\n p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "List all cases that have an invoice issued in July 2024, showing the case name, case number, invoice number, and issue date."
},
{
"role": "assistant",
"content": "SELECT T1.case_name, T1.case_number, T2.invoice_number, T2.issue_date FROM legal_services.cases AS T1 ... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uuid()... | [
{
"role": "user",
"content": "Show each player's total session count and the date of their earliest acquired inventory item."
},
{
"role": "assistant",
"content": "SELECT gs.player_id,\n COUNT(gs.session_id) AS session_count,\n MIN(pi.acquired_at) AS first_item_date\nFROM gaming_tech... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List each claim_handler_id along with the number of claims they've handled and the total settlement_amount they've paid out."
},
{
"role": "assistant",
"content": "SELECT claim_handler_id,\n COUNT(*) AS total_claims,\n SUM(settlement_amount) AS total_set... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Can you show me the number of unique item types and the average cost amount for each game?"
},
{
"role": "assistant",
"content": "SELECT game_id, COUNT(DISTINCT item_type) AS unique_item_types, AVG(cost_amount) AS avg_cost_amount FROM gaming_technology.in_game_items... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "Show me all replies to comments, including the reply's comment ID, the parent comment ID, and the content."
},
{
"role": "assistant",
"content": "SELECT comment_id, parent_comment_id, content FROM social_media.comments WHERE parent_comment_id 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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"role": "user",
"content": "How many available services are there per department for each property? Include property_id, department, and the service count."
},
{
"role": "assistant",
"content": "SELECT\n property_id,\n department,\n COUNT(*) AS available_services_count\nFROM hospitality_tec... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Find all cities that contain at least one location of type 'Depot' and at least one location of type 'Station'."
},
{
"role": "assistant",
"content": "SELECT city FROM transportation.locations WHERE type IN ('Depot', 'Station') GROUP BY city HAVING COUNT(DISTINCT CA... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "For each chain, show the total token_amount and usd_value for selling transactions (type=2)."
},
{
"role": "assistant",
"content": "SELECT chain, SUM(token_amount) AS total_sold_amount, SUM(usd_value) AS total_sold_usd_value\nFROM smart_money_token_inflow\nWHERE typ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.likes ( like_id text, user_id text, post_id text, comment_id text, crea... | [
{
"role": "user",
"content": "Show me the conversation ID and creation time for group chats that have received at least one message."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.conversation_id, T1.created_at FROM social_media.conversations AS T1 INNER JOIN social_media.messages AS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Provide a breakdown of the total number of applications submitted for each service category."
},
{
"role": "assistant",
"content": "SELECT T2.category, count(T1.application_id) FROM applications AS T1 JOIN services AS T2 ON T1.service_id = T2.service_id GROUP BY T2.... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List the product ID and product name for all insurance products where the coverage details mention 'warranty'."
},
{
"role": "assistant",
"content": "SELECT product_id, product_name FROM insurance.insurance_products WHERE coverage_details LIKE '%warranty%';"
},
... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Show me all failed payments along with the application ID, citizen ID, and payment timestamp."
},
{
"role": "assistant",
"content": "SELECT payment_id, application_id, citizen_id, payment_timestamp\nFROM government_services.payments\nWHERE status = 'Failed';"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ... | [
{
"role": "user",
"content": "Show me all maintenance logs for vehicles of make 'Toyota' performed after January 1, 2024. Include the log ID, vehicle ID, service date, and service type."
},
{
"role": "assistant",
"content": "SELECT ml.log_id, ml.vehicle_id, ml.service_date, ml.service_type\nFROM... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir... | [
{
"role": "user",
"content": "List customers who have active 'Auto' policies, showing their first name, last name, the policy number, and the product name."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.policy_number, T3.product_name FROM insurance.customers AS T1 ... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "For each customer, show their full name and the average amount of all transactions linked to any of their accounts."
},
{
"role": "assistant",
"content": "SELECT c.first_name || ' ' || c.last_name AS customer_full_name, AVG(t.amount) AS average_transaction_amount FR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir... | [
{
"role": "user",
"content": "Show me the policy number, start date, end date, product name, and product type for all policies."
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T1.start_date, T1.end_date, T2.product_name, T2.product_type FROM insurance.policies AS T1 JOIN insuranc... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Show all cases with at least one billed and billable time entry, including case number, case name, total billed amount, and billed hours."
},
{
"role": "assistant",
"content": "SELECT cs.case_number, cs.case_name, SUM(te.hours_spent * te.billing_rate) AS total_bille... |
You are an expert in writing database language. You can write a corresponding 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.trades ( trade_id character varying(64) NOT NULL, order_id characte... | [
{
"role": "user",
"content": "List all trades that occurred on July 10, 2024, showing the trade ID, asset symbol, quantity, and trade price."
},
{
"role": "assistant",
"content": "SELECT t.trade_id, a.symbol AS asset_symbol, t.quantity, t.price\nFROM trading_platform.trades t\nJOIN trading_platf... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "List all insurance products with a base premium greater than 1000 and less than 5000. Show the product name, product type, and base premium."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WHER... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ... | [
{
"role": "user",
"content": "Which service locations are not accessible and belong to agencies with a jurisdiction level of 'Local'? Show the location name and city."
},
{
"role": "assistant",
"content": "SELECT sl.location_name, sl.city\nFROM government_services.service_locations sl\nINNER JOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents (
document_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List all claim documents for claims handled by the claim handler with ID 'HANDLER_007'. Show document ID, file name, upload time, and claim ID."
},
{
"role": "assistant",
"content": "SELECT cd.document_id, cd.file_name, cd.uploaded_at, cd.claim_id FROM insurance.cla... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "I need to know how many distinct wallets hold each ERC20 token. Please show the token contract_address, symbol, and holder_count, sorted by holder_count descending."
},
{
"role": "assistant",
"content": "SELECT eb.contract_address, tm.symbol, COUNT(DISTINCT eb.walle... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Show item_id, item_name, and the damage attribute extracted from attributes JSON for items of type 'Weapon'."
},
{
"role": "assistant",
"content": "SELECT item_id,\n item_name,\n (attributes->>'damage')::numeric AS damage\nFROM gaming_technology.in_game_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Find the total number of distinct lawyers and distinct documents in the database."
},
{
"role": "assistant",
"content": "SELECT (SELECT COUNT(DISTINCT lawyer_id) FROM legal_services.lawyers) AS distinct_lawyer_count, (SELECT COUNT(DISTINCT document_id) FROM legal_se... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Show pairs of customers who live in the same state but different cities. Include their IDs, full names, and state."
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_a_id, a.first_name AS customer_a_first_name, a.last_name AS customer_a_last_nam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, ... | [
{
"role": "user",
"content": "Count the total number of unique insurance providers in the system."
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT insurance_provider) FROM healthcare.insurance_plans;"
}
] |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, claim_id cha... | [
{
"role": "user",
"content": "For each claim, retrieve the earliest uploaded document and the latest uploaded document filenames. Return claim_id, earliest_file_name, latest_file_name."
},
{
"role": "assistant",
"content": "SELECT e.claim_id,\n e.file_name AS earliest_file_name,\n l.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ... | [
{
"role": "user",
"content": "List each achievement with the very next achievement unlocked by the same player using a self-join. Show player_id, current_ach, current_unlocked_at, next_ach, and next_unlocked_at."
},
{
"role": "assistant",
"content": "SELECT pa1.player_id,\n pa1.achievement... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case... | [
{
"role": "user",
"content": "List all invoice numbers and their total amount for invoices that are overdue. Show the client ID and the due date as well."
},
{
"role": "assistant",
"content": "SELECT invoice_number, total_amount, client_id, due_date FROM legal_services.invoices WHERE due_date < ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "List the top 5 ERC20 tokens by total_supply along with their latest USD price."
},
{
"role": "assistant",
"content": "SELECT tm.symbol, tm.contract_address, tm.total_supply, tpl.price\nFROM token_metas tm\nJOIN token_prices_latest tpl ON tm.contract_address = tpl.ad... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "For each service location in Texas, provide the location name, city, and the number of appointments scheduled there by verified citizens."
},
{
"role": "assistant",
"content": "SELECT sl.location_name, sl.city, COUNT(a.appointment_id) AS appointment_count\nFROM gove... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Find users who followed at least two different people on the same calendar day. For each such user, list their ID, the IDs of the two people they followed, and the creation times of those two follow events."
},
{
"role": "assistant",
"content": "SELECT f1.follower_u... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "List all premium payments made by Bank Transfer where the amount_paid is greater than 5000. Show payment_id, policy_id, customer_id, amount_paid, and payment_date, ordered by amount_paid descending."
},
{
"role": "assistant",
"content": "SELECT payment_id,\n p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "Which agencies have at least one service with a standard fee equal to zero? Show the agency name and the service name."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, s.service_name\nFROM government_services.agencies a\nJOIN government_services.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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Show the names and emails of all guests who have communication consent enabled."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM hospitality_technology.guests WHERE communication_consent = TRUE;"
},
{
"role": "user",
"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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Show all cities in the USA that have more than one distinct location type represented. List the city, country, and number of distinct location types."
},
{
"role": "assistant",
"content": "SELECT city, country, COUNT(DISTINCT type) AS distinct_location_types\nFROM t... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What are the specific job responsibilities and daily tasks for a staff member with the role of Station Master?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the specific job responsibilities or daily tasks for a Station Mast... |
You are an expert in writing database language. You can write a corresponding 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.text, from_address.text, to_address.text, value.n... | [
{
"role": "user",
"content": "Find all pairs of transactions where the gas price of the first transaction is lower than the gas price of the second transaction, but they are both from the same sender address. Show both transaction IDs, the common sender address, and the gas price for each."
},
{
"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 insurance.insurance_products (
product_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me the product ID, name, and description for insurance products where the description contains the word 'policy'."
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, description FROM insurance.insurance_products WHERE description LIKE '%poli... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "Find all policies that were cancelled due to 'Non-payment'. Show the policy number, cancellation date, and premium amount for these policies."
},
{
"role": "assistant",
"content": "SELECT policy_number , cancellation_date , premium_amount FROM insurance.policies W... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "For each chain, which token has the lowest average cost as reported by smart money, and what is its current price and ROI?"
},
{
"role": "assistant",
"content": "SELECT smtp.chain, smtp.token_symbol, MIN(smtp.avg_cost) AS lowest_avg_cost, smtp.price, smtp.roi\nFROM ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, rank INT, profit numer... | [
{
"role": "user",
"content": "How many smart money addresses are in the top 100 rank?"
},
{
"role": "assistant",
"content": "SELECT count(address) FROM smart_money_profit WHERE rank <= 100"
},
{
"role": "user",
"content": "Okay, can you break that down by `chain`? Show the count for ... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List pairs of distinct routes that originate from the same location but go to different destinations. Show the route ID and route number for both routes and the common origin location ID."
},
{
"role": "assistant",
"content": "SELECT\n r1.route_id AS route1_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Show me the total traded volume and the average price per security for trades executed last month."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol,\n SUM(t.quantity) AS total_volume,\n AVG(t.price_per_unit) AS avg_price\nFROM financial_serv... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List all available services in the 'Housekeeping' department that cost less than 20."
},
{
"role": "assistant",
"content": "SELECT service_id, service_name, price\nFROM hospitality_technology.services\nWHERE department = 'Housekeeping' AND is_available = true AND pr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "List usernames of users who participate in any group chat and also have a private profile. Include the name of the group chat."
},
{
"role": "assistant",
"content": "SELECT DISTINCT\n U.username,\n C.group_name\nFROM\n social_media.users AS U\nJOIN\n soc... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List the full name of employees and the names of the agencies they work for, but only for employees who are currently employed."
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, a.agency_name\nFROM government_ser... |
You are an expert in writing database language. You can write a corresponding 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, agency_id text, service_name text, d... | [
{
"role": "user",
"content": "For each agency, how many services are currently inactive? Return the agency_id and the count of inactive services."
},
{
"role": "assistant",
"content": "SELECT\n agency_id,\n COUNT(*) AS inactive_service_count\nFROM government_services.services\nWHERE is_active ... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 1