system stringlengths 315 8.44k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_i... | [
{
"role": "user",
"content": "Which reservations included at least two different services ordered? Display the reservation ID and a count of distinct services.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT reservation_id, COUNT(DISTINCT service_id) AS distinct_service_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 smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "Show all addresses that made their last trade in 2024, including their chain and profit.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, chain, profit FROM smart_money_profit WHERE last_trade_time LIKE '2024%';",
"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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show me all ERC20 token contracts that have had at least 200 approvals. Include the token symbol and total approval count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.contract_address, m.symbol, COUNT(*) AS approval_count\nFROM erc20_approval 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "List all routes along with the number of unique vehicles assigned to trips on each route.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_id, r.route_number, COUNT(DISTINCT t.vehicle_id) AS unique_vehicles\nFROM transportation.routes r\nLEFT 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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "I need a report showing each doctor's ID, full name, number of completed appointments, and number of medical records they have authored.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.doctor_id,\n d.first_name || ' ' || d.last_name AS 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 healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id t... | [
{
"role": "user",
"content": "Can you list all patients who switched their primary insurance plan, including the patient_id, old plan_id, new plan_id, and the date of the switch?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.patient_id,\n p1.plan_id AS old_plan_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 healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointmen... | [
{
"role": "user",
"content": "How many medical records have been created by each doctor? Provide doctor_id and the total number of records.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id,\n COUNT(*) AS record_count\nFROM healthcare.medical_records\nGROUP BY 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 web3.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address t... | [
{
"role": "user",
"content": "List all transactions that have a value less than 0.1 Ether, returning the transaction_id, from_address, to_address, value, and block_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, from_address, to_address, value, block_number... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, medication_name text, gener... | [
{
"role": "user",
"content": "I want to see pairs of medications that share the same manufacturer. Show each medication's name and its peer's medication_name along with the manufacturer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.medication_name AS med1_name, t2.medication... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "I would like a list of unread notifications, showing the recipient's username, the sender's full name, the notification_type, and the creation timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "```sql\nSELECT\n n.notification_id,\n recipient.userna... |
You are an expert in writing database language. You can write a corresponding 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, -- unique id... | [
{
"role": "user",
"content": "Show the total number of notifications sent per user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(*) AS total_notifications\nFROM trading_platform.notifications\nGROUP BY user_id;",
"sql": null
},
{
"role": "user",
"... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "List all unique claim handler IDs present in the claims table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT claim_handler_id FROM insurance.claims WHERE claim_handler_id IS NOT NULL",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.services ( service_id.text, agency_id.text, service_name.text, d... | [
{
"role": "user",
"content": "Count the number of documents submitted for each service. Show the service_name and the document_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_name, COUNT(d.document_id) AS document_count\nFROM government_services.services s\nJOIN 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 gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country tex... | [
{
"role": "user",
"content": "Show me all players who have acquired items from games that have running servers in the 'ap-northeast-1' region, and the item names they acquired.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT pi.player_id, igi.item_name \nFROM gaming_techn... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show me each user's username, their wallet address, and the total quantity of open orders they have placed, along with the name of the asset for each order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, w.address, o.asset_id, SUM(o.quant... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Find patients who currently have both a primary and a secondary insurance policy. For each, show patient_id, full name, primary policy_number, and secondary policy_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id,\n p.first_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.medications ( medication_id character varying(64) NOT NULL, medication_na... | [
{
"role": "user",
"content": "List the NDC code and description for any medication that has an NDC code starting with '5'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ndc_code, description FROM healthcare.medications WHERE ndc_code LIKE '5%';",
"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, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "How many posts have been updated after they were created?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS updated_post_count\nFROM social_media.posts\nWHERE updated_at IS NOT NULL AND updated_at > created_at;",
"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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "List all ERC20 tokens from the `token_metas` table that have a total supply greater than 1 followed by 21 zeros. Show their contract address, symbol, name, and total supply.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, symbol, 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 PRIMARY KEY, plan_name text, insurance_pro... | [
{
"role": "user",
"content": "Show me all pairs of plans offered by the same insurance provider but of different plan types, including the provider name, first plan ID and type, and second plan ID and type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.insurance_provider,\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 blockchain.users ( user_id character varying(64) NOT NULL, username character varyin... | [
{
"role": "user",
"content": "List the username and email for all users whose email address ends with '@example.com'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, email FROM blockchain.users WHERE email LIKE '%@example.com';",
"sql": null
},
{
"role": "use... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser... | [
{
"role": "user",
"content": "What is the average number of game sessions started per hour of the day (0-23), considering all recorded sessions? Show the hour and the average count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(HOUR FROM start_time) AS session_hour, 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 cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"role": "user",
"content": "List smart money addresses with a realized ratio greater than 0.9 and a profit greater than 50000. Show the address, chain, realized ratio, and profit.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, chain, realized_ratio, profit FROM smart_m... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text... | [
{
"role": "user",
"content": "Show me all wallet addresses that belong to user_id 'U12345'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address_id FROM blockchain.wallets WHERE user_id = 'U12345';",
"sql": null
},
{
"role": "user",
"content": "Now join this wit... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "List users who have email notifications disabled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username FROM social_media.users AS T1 JOIN social_media.user_settings AS T2 ON T1.user_id = T2.user_id WHERE T2.email_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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Show all bookings with the booking ID, status, and booking time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT booking_id, status, booking_time FROM transportation.bookings;",
"sql": null
},
{
"role": "user",
"content": "Now, only 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 trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id charact... | [
{
"role": "user",
"content": "Find all assets that have metadata linking them to a DApp (where metadata value is a DApp ID), showing asset name, symbol, and the linked DApp name. Assume the metadata key used is 'linked_dapp_id'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "List all peer logs, showing the user_id and the action taken, ordered by the most recent log entry.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, action, logged_at\nFROM trading_platform.logs\nORDER BY logged_at DESC;",
"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.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "List document names, types, and upload timestamps for documents uploaded after '2024-01-01'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name , document_type , upload_timestamp FROM legal_services.documents WHERE upload_timestamp > '2... |
You are an expert in writing database language. You can write a corresponding 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, product_na... | [
{
"role": "user",
"content": "Show product_id, product_name, and base_premium for the five most recently created active insurance products.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, base_premium\nFROM insurance.insurance_products\nWHERE is_active = ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Show the names and URLs of all DApps along with the name and symbol of any asset associated to them via a metadata entry where the metadata key starts with 'link'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name AS dapp_name, d.url AS dapp_url,... |
You are an expert in writing database language. You can write a corresponding 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,... | [
{
"role": "user",
"content": "For each employee who serves as a relationship manager, what is the total transaction amount processed for the accounts they manage?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, SUM(t.amount) AS total_managed_transaction_... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List the usernames of users who have commented on posts that are not replies to other comments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T2.username FROM social_media.comments AS T1 JOIN social_media.users AS T2 ON T1.user_id = T2.user... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Show all users along with the number of different assets they have traded as buyers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COUNT(DISTINCT t.asset_id) AS assets_traded\nFROM trading_platform.users u\nLEFT JOIN trading_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 hospitality_technology.room_types (
room_type_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "List all staff members hired in 2024, showing their first name, last name, and hire date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, hire_date FROM hospitality_technology.staff WHERE EXTRACT(YEAR FROM hire_date) = 2024",
... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List all trades, showing the trade ID, account ID, and the ticker symbol and security name of the traded security.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trade_id, t.account_id, s.ticker_symbol, s.security_name FROM financial_services.trade... |
You are an expert in writing database language. You can write a corresponding 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, token_id characte... | [
{
"role": "user",
"content": "For each token, list the number of distinct sender addresses that have sent that token. Show the token ID and the count of distinct senders.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_id, COUNT(DISTINCT from_address) AS distinct_sender_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 financial_services.loans ( loan_id text, account_id text, loan_type text, principal_... | [
{
"role": "user",
"content": "Show me all loans with a term longer than 36 months, including their loan_id, account_id, and principal_amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loan_id, account_id, principal_amount FROM financial_services.loans WHERE term_months > 36;... |
You are an expert in writing database language. You can write a corresponding 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": "For policies issued in the current year, show me the total premium_amount and the average deductible grouped by policy status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status,\n SUM(premium_amount) AS total_premium,\n AVG(deductible... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me the content of all comments that have received at least one like.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.content FROM social_media.comments AS T1 JOIN social_media.likes AS T2 ON T1.comment_id = T2.comment_id;",
"sql":... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.email FROM 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.diagnoses ( diagnosis_id text PRIMARY KEY, record_id text, patient_id tex... | [
{
"role": "user",
"content": "Give me all diagnosis_id and diagnosis_codes for chronic diagnoses made using the ICD-9 code type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT diagnosis_id, diagnosis_code\nFROM healthcare.diagnoses\nWHERE is_chronic = TRUE AND code_type = 'ICD-9'... |
You are an expert in writing database language. You can write a corresponding 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": "List all game sessions that lasted longer than 30 minutes. Show the session_id, player_id, game_id, and duration_seconds.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT session_id, player_id, game_id, duration_seconds FROM gaming_technology.game_sess... |
You are an expert in writing database language. You can write a corresponding 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, product_na... | [
{
"role": "user",
"content": "Show the payment_id and amount_paid for all premium payments where the status is 'pending'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_id, amount_paid\nFROM insurance.premium_payments\nWHERE status = 'pending';",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text, name text, type text, address_line1 tex... | [
{
"role": "user",
"content": "Show me the log timestamp, fuel type, quantity, and the name of the location for all fuel logs recorded at locations with type 'Warehouse'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.log_timestamp, f.fuel_type, f.quantity, l.name FROM transport... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"role": "user",
"content": "Show the total amount of payments processed by each payment_method.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_method,\n SUM(amount) AS total_amount\nFROM hospitality_technology.payments\nGROUP BY payment_method;",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "How many citizens are there in each gender?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT gender, COUNT(*) AS citizen_count\nFROM government_services.citizens\nGROUP BY gender;",
"sql": null
},
{
"role": "user",
"content": "Filter to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c... | [
{
"role": "user",
"content": "Can you help me fetch the inventory records for components stored in a specific warehouse, along with their expiry dates?",
"sql": null
},
{
"role": "assistant",
"content": "HGETALL inv:<inventory_record_id>\nZRANGE component_expiry:<component_id> 0 -1 WITHSCORE... |
You are an expert in writing database language. You can write a corresponding 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 text, agency_id text, first_name text, l... | [
{
"role": "user",
"content": "Which employees are managers themselves? Show their employee ID, full name, and job title.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT m.employee_id, m.first_name || ' ' || m.last_name AS full_name, m.job_title\nFROM government_services.e... |
You are an expert in writing database language. You can write a corresponding 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 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, AVG(unlocked_at - LAG(unlocked_at) OVE... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Which lawyers have handled cases in the 'Federal Court' jurisdiction? Return each lawyer's first and last name, the case number, and the court jurisdiction.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, c.case_number, c.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.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "Find the average settlement_amount of closed claims for each claim handler. Return claim_handler_id and avg_settlement_amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_handler_id, AVG(c.settlement_amount) AS avg_settlement_amount\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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the employee full names, the department they work in, and the number of notifications sent to citizens who have made payments for the services managed by these employees' agencies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.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 web3.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address t... | [
{
"role": "user",
"content": "Show all transactions where the transaction value is greater than the average value of all transactions, including transaction_id, from_address, to_address, value, and timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, from_add... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id ... | [
{
"role": "user",
"content": "Show me each staff member's first and last name along with their manager's first and last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id,\n s.first_name,\n s.last_name,\n m.staff_id AS manager_id,\n m.first_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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "List all ERC20 tokens that have exactly 18 decimal places. Show their symbol, name, and total supply from the metadata table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol, name, total_supply FROM token_metas WHERE is_erc20 = 1 AND decimals =... |
You are an expert in writing database language. You can write a corresponding 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id FROM web3.events GROUP BY transaction_id HAVING COUNT(DISTINCT event_name) > 1;",
"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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "What is the average project valuation for each round name in 2023?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rounds_name, AVG(valuation) AS avg_valuation\nFROM project_fundraising_record\nWHERE investment_date LIKE '2023-%'\nGROUP BY rounds_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 financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account... | [
{
"role": "user",
"content": "Show the average current_principal_balance for each loan_type, and include the number of active loans per type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loan_type,\n COUNT(*) AS active_loan_count,\n AVG(current_principal_balance) 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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "List all pairs of clients who registered in the same year. Show each client's first_name, last_name, and the registration year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first_name_1, c1.last_name AS last_name_1, c2.first_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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "For each conversation, how many participants have joined before January 1, 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT conversation_id, COUNT(user_id) AS participant_count\nFROM social_media.conversation_participants\nWHERE joined_at < '2024... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.bookings ( booking_id character varying(64) NOT NULL, passenger_id ch... | [
{
"role": "user",
"content": "List all unique pairs of passenger_id and trip_id where a passenger booked more than one seat on the same trip. For each pair, show the booking_ids involved.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b1.passenger_id, b1.trip_id, b1.booking_id 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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash... | [
{
"role": "user",
"content": "For each game, show the game ID, title, and the total number of players who have unlocked at least one achievement in that game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.game_id, g.title, COUNT(DISTINCT pa.player_id) AS total_players\nFROM ga... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,... | [
{
"role": "user",
"content": "How many conversations are there where the last message was sent before January 1, 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.conversations WHERE last_message_at < '2024-01-01';",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Count the number of documents for each document type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) FROM government_services.documents GROUP BY document_type;",
"sql": null
},
{
"role": "user",
"content": "Onl... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Provide the total number of room types and the average base_rate for each property that has a star_rating of at least 4.0.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id,\n p.property_name,\n COUNT(rt.room_type_id) AS room_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.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Which securities have had the largest maximum single-day trading volume in the market_data table? Show me the ticker symbol, security name, and that maximum volume.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, MAX(... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "List the names and cities of all locations that have at least one fuel log entry recorded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT l.name, l.city\nFROM transportation.locations l\nJOIN transportation.fuel_logs f ON l.location_id = f.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 transportation.routes ( route_id text, route_number text, description text, origin_l... | [
{
"role": "user",
"content": "List all routes with a total distance traveled greater than 10,000 km, showing the route number and total distance accumulated across all trips on that route.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number, SUM(r.distance_km) AS total_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "List all comment IDs and their content for comments made by users who have 'dark' as their theme.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.comment_id, c.content\nFROM social_media.comments c\nJOIN social_media.user_settings s ON c.user_id = 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 blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, time... | [
{
"role": "user",
"content": "Find all smart contracts where the contract code contains the keyword 'proxy'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE code LIKE '%proxy%';",
"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 token_basic_info ( coin_id text, token_name text, token_symbol text, token_address t... | [
{
"role": "user",
"content": "Which are the top 3 tokens on BSC by total USD value held by all CEXs, and what is their narrative and current price?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ctb.token_symbol, tbi.narrative, tbi.price, SUM(ctb.usd_value) AS total_usd_value\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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"role": "user",
"content": "List all employees and the department their manager belongs to. Include the employee's full name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, m.department AS manager_department FROM financial_services.employees AS e LEFT... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, medication_name text, gener... | [
{
"role": "user",
"content": "Show the medication ID, medication name, and manufacturer for all entries where the generic name is not listed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications WHERE generic_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 legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w... | [
{
"role": "user",
"content": "Find all pairs of law firms founded in the same year, showing both firm names and the shared founding year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.firm_name AS firm1, f2.firm_name AS firm2, EXTRACT(YEAR FROM f1.founded_date) AS founding_ye... |
You are an expert in writing database language. You can write a corresponding 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(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "List all ERC20 tokens where the total supply is between '1000000000' and '5000000000'. Show the symbol and name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol, name FROM token_metas WHERE is_erc20 = 1 AND total_supply >= '1000000000' AND tota... |
You are an expert in writing database language. You can write a corresponding 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 ... | [
{
"role": "user",
"content": "Show the average maintenance cost for vehicles of each make, including only vehicles that have had at least one maintenance log.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.make, AVG(ml.cost) AS average_maintenance_cost FROM transportation.vehic... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Calculate the total PNL and total Net Flow for all tokens recorded on the 'Arbitrum' chain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(pnl) as total_pnl, SUM(net_flow) as total_net_flow FROM smart_money_token_performance WHERE chain = 'Arbitr... |
You are an expert in writing database language. You can write a corresponding 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": "Can you list the names of agencies that do not have a parent agency assigned, ordered by their established date?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agency_id, agency_name, established_date\nFROM government_services.agencies\nWHERE parent_... |
You are an expert in writing database language. You can write a corresponding 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 text, token_name text, token_symbol text, token_address t... | [
{
"role": "user",
"content": "Find tokens on the 'Polygon' chain with a market cap greater than $1,000,000,000 and a positive price change in the last 24 hours. List their symbol, name, market cap, and 24h price change.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show me the total amount held and number of unique wallets for each ERC20 token with a symbol ending in 'X'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tm.symbol, SUM(CAST(ebh.amount AS DECIMAL)) AS total_amount, COUNT(DISTINCT ebh.wallet_address... |
You are an expert in writing database language. You can write a corresponding 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": "Find all in-game items that have a 'mana_cost' attribute in their attributes JSON. Show the item ID, item name, and the value of the 'mana_cost'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_id, item_name, attributes ->> 'mana_cost' AS mana_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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "List pairs of drivers whose license expiry dates fall within 30 days of each other. Show both driver_ids, names, and the two expiry dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.driver_id AS driver1_id, d1.first_name AS driver1_first, d1.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 hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "For each reservation, show the guest's first and last name, the property name, and the names of all services ordered during that reservation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, g.first_name, g.last_name, p.property_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 web3.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address t... | [
{
"role": "user",
"content": "For each block, compute the total number of transactions and the average gas_price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT block_number, COUNT(*) AS total_txs, AVG(gas_price) AS avg_gas_price FROM web3.transactions GROUP BY block_number;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "Find all distinct pairs of customers having the same first_name but living in different cities. Display a.customer_id, a.first_name, a.city AS city_a, b.customer_id, b.city AS city_b.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS cu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List all patients along with their primary insurance plan name and the first and last name of their prescribing doctor for any prescription they have received.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name AS patient_first... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List all players and the number of distinct games they have grabbed in-game items from, as well as the name of each game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, g.game_id, g.title, COUNT(DISTINCT pi.item_id) AS distin... |
You are an expert in writing database language. You can write a corresponding 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": "List all transactions along with the user_id of the sender when the sender’s address matches a wallet. Return transaction_id, from_address, and user_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.from_address, w.user_id FROM w... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "What is the average commission rate for agents whose status is 'Terminated'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(commission_rate) FROM insurance.agents WHERE status = 'Terminated' AND commission_rate IS NOT NULL;",
"sql": null
}
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "For each room, list the room number, property name, and the type name of the room.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_number, p.property_name, rt.type_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.propertie... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List all game titles and the count of online servers hosting each game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.title, count(T2.server_id) FROM games AS T1 JOIN servers AS T2 ON T1.game_id = T2.game_id WHERE T2.status = 'online' GROUP BY 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 government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "List the first and last names of citizens who have submitted documents with a verification status of 'Rejected', along with the document type and application reference number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.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... | [
{
"role": "user",
"content": "List all policies that have at least one beneficiary with a 'Child' relationship, showing policy number, policy status, and the number of child beneficiaries for that policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T1.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.doctors (
doctor_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Can you provide the number of doctors grouped by their medical specialty?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT specialty, COUNT(*) AS doctor_count\nFROM healthcare.doctors\nGROUP BY specialty;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "How many prescriptions are there for each refills_allowed value?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT refills_allowed,\n COUNT(*) AS prescription_count\nFROM healthcare.prescriptions\nGROUP BY refills_allowed;",
"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,... | [
{
"role": "user",
"content": "For each passenger, show their passenger_id, first_name, last_name, the date and time of their earliest booking, and the date and time of their latest booking.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.passenger_id,\n p.first_name,\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 token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp... | [
{
"role": "user",
"content": "List tokens with trend rank 5 or better and a price below $1. Show symbol, price, and trend rank.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, price, trend_rank FROM token_dexpool_info WHERE trend_rank IS NOT NULL AND trend_rank <= 5 ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "Show the license numbers and full names of all doctors who were registered before January 1, 2020 and work at 'hospital_789'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT license_number, first_name, last_name FROM healthcare.doctors WHERE created_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 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n property_id,\n department,\n COUNT(*) AS available_services_count\nFRO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.