system stringlengths 315 7.62k | 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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "List the top 5 addresses that have received the most token transfers."
},
{
"role": "assistant",
"content": "SELECT to_address, COUNT(*) AS transfer_count FROM web3.token_transfers GROUP BY to_address ORDER BY transfer_count DESC LIMIT 5;"
},
{
"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
Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id... | [
{
"role": "user",
"content": "Can you help me retrieve all inspection records for a specific build ID, including the inspection type, result, and the timestamp of the inspection, along with the associated component ID if available?"
},
{
"role": "assistant",
"content": "db.inspections.find({ bui... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.notifications ( notification_id.text, citizen_id.text, applicati... | [
{
"role": "user",
"content": "For each application that has at least one failed notification, provide the application ID, the total number of notifications received for that application, and the count of failed notifications."
},
{
"role": "assistant",
"content": "SELECT application_id, 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 blockchain.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonc... | [
{
"role": "user",
"content": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own."
},
{
"role": "assistant",
"content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.users ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Show me all users who have never commented on any post."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username\nFROM social_media.users u\nLEFT JOIN social_media.comments c ON u.user_id = c.user_id\nWHERE c.comment_id IS 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.conversation_participants ( participant_id text, conversation_id text, ... | [
{
"role": "user",
"content": "Show me the usernames of users who have joined more than one conversation, and list the conversation IDs for each user."
},
{
"role": "assistant",
"content": "SELECT user_id, ARRAY_AGG(conversation_id) AS conversation_ids\nFROM social_media.conversation_participants... |
You are an expert in writing database language. You can write a corresponding 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": "For each exchange, compute the percentage change in total USD value of its holdings between snapshots '2023-01-01 00:00:00' and '2023-02-01 00:00:00'. Show exchange, chain, value_jan, value_feb, and pct_change."
},
{
"role": "assistant",
"content": "SELECT t1.exchan... |
You are an expert in writing database language. You can write a corresponding 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": "Show the usernames of players and a count of how many different item types they have in their inventory."
},
{
"role": "assistant",
"content": "SELECT T1.username, count(DISTINCT T3.item_type) FROM gaming_technology.players AS T1 JOIN gaming_technology.player_invent... |
You are an expert in writing database language. You can write a corresponding 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, first_name characte... | [
{
"role": "user",
"content": "Show the names of all insurance plans and the number of patients enrolled in each plan."
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, COUNT(pi.patient_id) AS enrolled_patients FROM healthcare.insurance_plans ip JOIN healthcare.patient_insurance pi ON i... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha... | [
{
"role": "user",
"content": "List all claim IDs that have both an 'Accident Report' and a 'Damage Assessment' document type."
},
{
"role": "assistant",
"content": "SELECT claim_id\nFROM insurance.claim_documents\nWHERE document_type IN ('Accident Report', 'Damage Assessment')\nGROUP BY claim_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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "List all drivers whose licenses expire in the next 30 days, along with their contact information."
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name, license_number, license_expiry_date, contact_number, email FROM transportation.drivers 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.insurance_products ( product_id character varying(64) NOT NULL, product_na... | [
{
"role": "user",
"content": "Show me the total premium paid by each customer for insurance products where the base premium is less than 2000. I want to see customer_id, product_id, and total_premium_paid."
},
{
"role": "assistant",
"content": "SELECT pp.customer_id, ip.product_id, SUM(pp.amount... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil... | [
{
"role": "user",
"content": "How many distinct users have uploaded claim documents of type 'ACCIDENT_REPORT'?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT uploaded_by) FROM insurance.claim_documents WHERE document_type = 'ACCIDENT_REPORT';"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"role": "user",
"content": "Show me claim_id, incident_date, policy_number, and customer full name for all claims where settlement_amount is null."
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, p.policy_number, cu.first_name || ' ' || cu.last_name AS customer_full_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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var... | [
{
"role": "user",
"content": "Retrieve the agent ID, first and last name, agency name, and their manager's first and last name for every agent."
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agent_last_name, a.agency_name, m.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 smart_money_token_inflow (",
"token_address character varying(100) NOT NULL, ... | [
{
"role": "user",
"content": "What are the top 3 narratives with the highest total USD buy value?"
},
{
"role": "assistant",
"content": "SELECT narrative,\n SUM(usd_value) AS total_buy_usd\nFROM smart_money_token_inflow\nWHERE type = 1\nGROUP BY narrative\nORDER BY total_buy_usd DESC\nLIMI... |
You are an expert in writing database language. You can write a corresponding 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": "Which services charge more than the average standard fee of their category? Show the service name, its fee, and the average fee for that category."
},
{
"role": "assistant",
"content": "SELECT\n s.service_name,\n s.standard_fee,\n avg_fees.avg_fee\nFROM governmen... |
You are an expert in writing database language. You can write a corresponding 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": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount."
},
{
"role": "assistant",
"content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas tm ON eb.contract_address = tm... |
You are an expert in writing database language. You can write a corresponding 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": "Show the latest version number of each document_name for every case."
},
{
"role": "assistant",
"content": "SELECT case_id,\n document_name,\n MAX(version) AS latest_version\nFROM legal_services.documents\nGROUP BY case_id, document_name;"
},
{
"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "List the content and creation time of posts made by users who have a private profile."
},
{
"role": "assistant",
"content": "SELECT T1.content, T1.created_at FROM social_media.posts AS T1 JOIN social_media.users AS T2 ON T1.user_id = T2.user_id JOIN social_media.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 insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil... | [
{
"role": "user",
"content": "Find pairs of claim documents for the same claim where the upload time difference is less than 5 minutes. List the document IDs of the pairs and the claim ID."
},
{
"role": "assistant",
"content": "SELECT a.document_id AS document1_id, b.document_id AS document2_id,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "I want to see a list of all patients, including their full name and date of birth, along with every doctor they have been diagnosed by and that doctor's specialty."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name || ' ' || p.last_name AS pati... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"role": "user",
"content": "Show me pairs of invoice numbers for the same case."
},
{
"role": "assistant",
"content": "SELECT T1.invoice_number, T2.invoice_number, T1.case_id FROM legal_services.invoices AS T1 JOIN legal_services.invoices AS T2 ON T1.case_id = T2.case_id AND T1.invoice_id <> 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "List all SUI coins that have status 'exists' in both `sui_coins` and `sui_coins_metadata`. Show their `coin_type`, `balance`, and `owner`."
},
{
"role": "assistant",
"content": "SELECT sc.coin_type, sc.balance, sc.owner FROM sui_coins sc JOIN sui_coins_metadata scm ... |
You are an expert in writing database language. You can write a corresponding 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, first_name characte... | [
{
"role": "user",
"content": "Show me the top 5 most recent medical records with a fever recorded. Return record_id, patient_id, record_date, and the temperature value from vitals."
},
{
"role": "assistant",
"content": "SELECT record_id,\n patient_id,\n record_date,\n vitals->>... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve all reservations with status 'Cancelled' and show the reservation_id, property_name, and room_type_name."
},
{
"role": "assistant",
"content": "SELECT res.reservation_id,\n p.property_name,\n rt.type_name AS room_type_name\nFROM hospitality_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 healthcare.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appo... | [
{
"role": "user",
"content": "Show all appointments that have 'follow-up' mentioned in the notes field."
},
{
"role": "assistant",
"content": "SELECT * FROM healthcare.appointments WHERE notes LIKE '%follow-up%';"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Retrieve each patient's full name, total number of appointments, and date of their most recent appointment."
},
{
"role": "assistant",
"content": "SELECT p.first_name || ' ' || p.last_name AS patient_name, COUNT(a.appointment_id) AS appointment_count, MAX(a.appointm... |
You are an expert in writing database language. You can write a corresponding 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.prescriptions ( prescription_id.text, record_id.text, patient_id.text, do... | [
{
"role": "user",
"content": "What is the average quantity_dispensed per route for prescriptions with start_date in 2024? Return route and avg_quantity."
},
{
"role": "assistant",
"content": "SELECT route,\n AVG(quantity_dispensed) AS avg_quantity\nFROM healthcare.prescriptions\nWHERE star... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, name character va... | [
{
"role": "user",
"content": "Show me all assets whose symbol starts with 'BTC' or 'ETH', along with their full names and types."
},
{
"role": "assistant",
"content": "SELECT asset_id, name, symbol, type FROM trading_platform.assets WHERE symbol LIKE 'BTC%' OR symbol LIKE 'ETH%';"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "Calculate the average length of stay in days for completed reservations for each property."
},
{
"role": "assistant",
"content": "SELECT p.property_id,\n p.property_name,\n AVG(res.check_out_date - res.check_in_date) AS avg_stay_days\nFROM hospitality_te... |
You are an expert in writing database language. You can write a corresponding 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 the user ID and username for users who have placed orders for assets of type 'cryptocurrency'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.user_id, T1.username FROM trading_platform.users AS T1 JOIN trading_platform.orders AS T2 ON T1.user_id = 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 legal_services.documents ( document_id text, case_id text, document_name text, docum... | [
{
"role": "user",
"content": "Show me all documents that have a version greater than 2 and include the document name, upload timestamp, and description."
},
{
"role": "assistant",
"content": "SELECT document_id, document_name, upload_timestamp, description FROM legal_services.documents WHERE ver... |
You are an expert in writing database language. You can write a corresponding 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": "List all failed payments (status = 'failed') with their reservation IDs and amounts, ordered by the payment timestamp."
},
{
"role": "assistant",
"content": "SELECT payment_id, reservation_id, amount, payment_timestamp FROM hospitality_technology.payments WHERE stat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "List all log entries associated with users who have participated in any trade, showing the log details and the trade ID."
},
{
"role": "assistant",
"content": "SELECT T1.log_id, T1.action, T1.details, T1.logged_at, T2.trade_id, T2.buyer_id, T2.seller_id FROM logs 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.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Show me case number, case name, and the lead lawyer's full name for all cases in the 'State Court' jurisdiction."
},
{
"role": "assistant",
"content": "SELECT T1.case_number, T1.case_name, T2.first_name, T2.last_name FROM cases AS T1 JOIN lawyers AS T2 ON T1.lead_la... |
You are an expert in writing database language. You can write a corresponding 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.service_locations ( location_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List the number of appointments for each booking method."
},
{
"role": "assistant",
"content": "SELECT\n a.booking_method,\n COUNT(*) AS appointment_count\nFROM appointments a\nGROUP BY a.booking_method;"
},
{
"role": "user",
"content": "Filter this to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medications (
medication_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "List the medication_id, medication_name, and description for all medications whose generic_name starts with 'A'."
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, description\nFROM healthcare.medications\nWHERE generic_name LIKE '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 healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id ch... | [
{
"role": "user",
"content": "For each patient, find their latest medical record and show patient_id, latest_record_id, and record_date."
},
{
"role": "assistant",
"content": "SELECT a.patient_id,\n a.record_id AS latest_record_id,\n a.record_date\nFROM healthcare.medical_records a\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.patient_insurance (
patient_insurance_id character varying(64) NOT NU... | [
{
"role": "user",
"content": "Retrieve a list of all patient insurance policies, showing the subscriber name and the name of the insurance provider for the plan."
},
{
"role": "assistant",
"content": "SELECT T1.subscriber_name, T2.insurance_provider FROM healthcare.patient_insurance AS T1 JOIN h... |
You are an expert in writing database language. You can write a corresponding 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.dapps (
dapp_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List the names of all DApps whose description contains the word 'auction' along with the user IDs of anyone who has had a KYC audit."
},
{
"role": "assistant",
"content": "SELECT d.name AS dapp_name, k.user_id\nFROM trading_platform.dapps d\nJOIN trading_platform.ky... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Get the usernames of users who have created any public posts, and count how many public posts each user has made. Order the results by the post count in descending order."
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(p.post_id) AS public_post_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 financial_services.securities (
security_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Show me all securities listed on the 'NYSE' exchange with their ticker symbol and most recent close price."
},
{
"role": "assistant",
"content": "SELECT s.security_name, s.ticker_symbol, md.close_price\nFROM financial_services.securities s\nJOIN financial_services.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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List all completed trips, including each trip's scheduled and actual arrival times, along with the make and model of the assigned vehicle."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, t.scheduled_arrival, t.actual_arrival, v.make, v.model\nFROM 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 insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil... | [
{
"role": "user",
"content": "Find all PDF claim documents uploaded in May 2024, showing document_id, claim_id, and file_size_bytes, and also list who uploaded each document."
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, file_size_bytes, uploaded_by FROM insurance.claim_do... |
You are an expert in writing database language. You can write a corresponding 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": "I want to get the number of servers and the average current players for each game, including the game title."
},
{
"role": "assistant",
"content": "SELECT g.title,\n COUNT(s.server_id) AS server_count,\n AVG(s.current_players) AS avg_current_players\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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List all passengers with their first name, last name, and email."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM transportation.passengers;"
},
{
"role": "user",
"content": "Can you also include their phone number in the r... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "Find pairs of appointment IDs that were scheduled at the same location. Show the IDs of the two appointments."
},
{
"role": "assistant",
"content": "SELECT t1.appointment_id, t2.appointment_id FROM appointments AS t1 JOIN appointments AS t2 ON t1.location_id = t2.lo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List the first name, last name, specialization, and the name of the law firm for all lawyers hired before January 1, 2020."
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , T1.specialization , T2.firm_name FROM legal_services.lawyers 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "What is the total number of ERC20 tokens in the `token_metas` table that are marked as a proxy (is_proxy = 1)?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM token_metas WHERE is_erc20 = 1 AND is_proxy = 1;"
},
{
"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 blockchain.smart_contracts ( contract_id text, creator_address text, code text, time... | [
{
"role": "user",
"content": "Show me all smart contracts created by addresses that have created more than 3 contracts, along with the total number of contracts each creator has made."
},
{
"role": "assistant",
"content": "SELECT sc.contract_id, sc.creator_address, COUNT(*) OVER (PARTITION BY sc... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "Provide a list of all log entries recorded since the start of 2024, including the user ID, action, and the exact time the log occurred."
},
{
"role": "assistant",
"content": "SELECT user_id, action, logged_at FROM logs WHERE logged_at >= '2024-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
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "Show the distribution of total supply for tokens, grouped into ranges like < 1 million, 1 million to 1 billion, and > 1 billion. Count how many tokens fall into each range."
},
{
"role": "assistant",
"content": "SELECT CASE WHEN total_supply < 1000000 THEN '< 1 mill... |
You are an expert in writing database language. You can write a corresponding 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": "For each booking, show the booking ID, passenger's full name, booking status, and the email of the passenger."
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name, p.last_name, b.status, p.email\nFROM transportation.bookings b\nJOIN transportatio... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "How many total documents are recorded in the system?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM government_services.documents;"
},
{
"role": "user",
"content": "Show me the count of documents for each verification_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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "For each fundraising round in 2022 and 2023, list the round name, the year, the total investment_value, and the count of distinct projects. Also include the average market_cap of associated tokens by matching project_name to token_symbol in token_basic_info."
},
{
"role... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List all applications that have at least one document with a verification status of 'Verified'. Show the application reference number and the name of the service associated with the application."
},
{
"role": "assistant",
"content": "SELECT\n T1.reference_number,\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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all documents uploaded for cases handled in the 'District Court' jurisdiction, showing the document name, case number, and upload timestamp."
},
{
"role": "assistant",
"content": "SELECT d.document_name, cs.case_number, d.upload_timestamp\nFROM legal_services.d... |
You are an expert in writing database language. You can write a corresponding 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 all cases where the client and the lead lawyer belong to companies or law firms with the same phone number. For each such case, please show the case name, client name, client company, lead lawyer name, and the shared phone number."
},
{
"role": "assistant",
"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 web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a... | [
{
"role": "user",
"content": "Show the top 5 contracts by number of events emitted, including contract_id and event_count."
},
{
"role": "assistant",
"content": "SELECT contract_id,\n COUNT(event_id) AS event_count\nFROM web3.events\nGROUP BY contract_id\nORDER BY event_count DESC\nLIMIT 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.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t... | [
{
"role": "user",
"content": "Count how many insurance policies have an effective date in the year 2023."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM healthcare.patient_insurance WHERE EXTRACT(YEAR FROM effective_date) = 2023;"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "Show all achievements for games developed in Germany, including achievement names and their point values."
},
{
"role": "assistant",
"content": "SELECT a.name AS achievement_name, a.points\nFROM gaming_technology.achievements a\nJOIN gaming_technology.games g ON a.g... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id text, product_name text, product_type text... | [
{
"role": "user",
"content": "Show the product name, type, and creation date for products created before January 1st, 2023."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, created_at FROM insurance.insurance_products WHERE created_at < '2023-01-01';"
},
{
"role"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Find the total balance per coin_type for active SUI coins, including coin_type, symbol, name, and SUM(balance) as total_balance. Sort by total_balance descending."
},
{
"role": "assistant",
"content": "SELECT\n c.coin_type,\n m.symbol,\n m.name,\n SUM(CAST(c.bal... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, is... | [
{
"role": "user",
"content": "I want to list each security alongside another security issued by the same issuer."
},
{
"role": "assistant",
"content": "SELECT a.security_id, a.ticker_symbol, b.security_id AS other_security_id, b.ticker_symbol AS other_ticker, a.issuer_name\nFROM financial_servic... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "What is the average processing time in days for each service category?"
},
{
"role": "assistant",
"content": "SELECT category, AVG(average_processing_time_days) AS avg_processing_time\nFROM government_services.services\nGROUP BY category;"
},
{
"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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "List all SUI coins with 'active' status, showing their owner address and balance."
},
{
"role": "assistant",
"content": "SELECT owner, balance FROM sui_coins WHERE status = 'active';"
},
{
"role": "user",
"content": "Add the coin type and object ID to th... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id te... | [
{
"role": "user",
"content": "List each staff member who delivered orders, along with the number of orders they delivered."
},
{
"role": "assistant",
"content": "SELECT staff_id_delivered, COUNT(order_id) AS delivered_orders FROM hospitality_technology.service_orders WHERE staff_id_delivered IS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_... | [
{
"role": "user",
"content": "Find pairs of servers in the same region where one server's last heartbeat was recorded within the last hour, and the other server's last heartbeat was recorded between 1 and 2 hours ago. Show the server names, regions, and last heartbeat timestamps for both servers in each pai... |
You are an expert in writing database language. You can write a corresponding 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": "How many unique email domains are there among all registered users?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT SUBSTRING(email FROM '@(.*)$')) AS unique_domains FROM blockchain.users;"
},
{
"role": "user",
"content": "Can you list these... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers (
customer_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Show me the count of completed transactions and the sum of their amounts grouped by currency for May 2024."
},
{
"role": "assistant",
"content": "SELECT currency,\n COUNT(*) AS transaction_count,\n SUM(amount) AS total_amount\nFROM financial_services.tra... |
You are an expert in writing database language. You can write a corresponding 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, -- uniq... | [
{
"role": "user",
"content": "List all staff members along with their manager's full name."
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name\nFROM hospitality_technology.staff s\nLEFT JOIN hos... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "List the asset names and symbols for all assets of type 'token'."
},
{
"role": "assistant",
"content": "SELECT name, symbol FROM trading_platform.assets WHERE type = 'token';"
}
] |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me a summary per loan_type with the minimum interest_rate, maximum interest_rate, and the average current_principal_balance."
},
{
"role": "assistant",
"content": "SELECT loan_type,\n MIN(interest_rate) AS min_interest_rate,\n MAX(interest_rate) 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 trading_platform.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, p... | [
{
"role": "user",
"content": "Show a summary of each user, including their user_id, the count of orders they've placed, and the total traded value as buyers."
},
{
"role": "assistant",
"content": "SELECT o.user_id,\n COUNT(o.order_id) AS order_count,\n SUM(t.quantity * t.price) AS to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "Show me all trades for a given security ID 'SEC123', displaying trade_id, account_id, trade_type, quantity, and total_amount."
},
{
"role": "assistant",
"content": "SELECT trade_id, account_id, trade_type, quantity, total_amount\nFROM financial_services.trades\nWHER... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "List all documents which have a version greater than 2, along with the case number and name."
},
{
"role": "assistant",
"content": "SELECT d.document_id, d.document_name, d.version, c.case_number, c.case_name\nFROM legal_services.documents d\nJOIN legal_services.cas... |
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 reason behind the cost variation for maintenance of asset_id 'ASSET456' over the past year?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the reasons behind cost variations for maintenance. The data in the maintenan... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "List pairs of games that share the same publisher but belong to different genres, showing both titles and genres."
},
{
"role": "assistant",
"content": "SELECT g1.game_id AS game1_id,\n g1.title AS title1,\n g1.genre AS genre1,\n g2.game_id AS 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 web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each token, list its symbol and the number of transfers recorded in token_transfers."
},
{
"role": "assistant",
"content": "SELECT\n t.token_symbol,\n COUNT(tt.transfer_id) AS transfer_count\nFROM web3.tokens t\nLEFT JOIN web3.token_transfers tt\n ON t.token_... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"role": "user",
"content": "List each property name with the count of active staff members currently employed at that property."
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(s.staff_id) AS active_staff_count\nFROM hospitality_technology.properties p\nLEFT JOIN hospitalit... |
You are an expert in writing database language. You can write a corresponding 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 the user IDs who own more than one wallet and show how many wallets each of them has."
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(*) FROM web3.wallets GROUP BY user_id HAVING COUNT(*) > 1;"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Show all active staff members' full names and their positions."
},
{
"role": "assistant",
"content": "SELECT staff_id, first_name || ' ' || last_name AS staff_full_name, position\nFROM hospitality_technology.staff\nWHERE is_active = true;"
},
{
"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 blockchain.transactions ( transaction_id text, block_id text, sender_address text, r... | [
{
"role": "user",
"content": "Show me each transaction with its ID, amount, timestamp, and the usernames of both sender and receiver."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.amount, t.timestamp, us.username AS sender_username, ur.username AS receiver_username\nFROM bloc... |
You are an expert in writing database language. You can write a corresponding 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.trips ( trip_id character varying(64) NOT NULL, route_id character va... | [
{
"role": "user",
"content": "List all maintenance logs for vehicles that had 'Oil Change' service in the last 3 months, showing vehicle ID, service date, and cost."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE service_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 insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil... | [
{
"role": "user",
"content": "List the claim_id and the total number of documents uploaded for each claim, but only include claims with between 3 and 7 documents."
},
{
"role": "assistant",
"content": "SELECT claim_id, COUNT(*) AS document_count FROM insurance.claim_documents GROUP BY claim_id H... |
You are an expert in writing database language. You can write a corresponding 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": "List the names of active services offered by agencies with at least one accessible service location in the state of 'New York'. Show the service name, category, agency name, and the location name."
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T1.cat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Show me the different types of routes available and the total number of routes for each type."
},
{
"role": "assistant",
"content": "SELECT type, COUNT(*) AS route_count FROM transportation.routes GROUP BY type;"
},
{
"role": "user",
"content": "Can you ... |
You are an expert in writing database language. You can write a corresponding 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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List all vehicles that have no associated fuel logs. Include the vehicle's make, model, and license plate."
},
{
"role": "assistant",
"content": "SELECT T1.make , T1.model , T1.license_plate FROM transportation.vehicles AS T1 LEFT JOIN transportation.fuel_logs 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.agencies (
agency_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Show me a list of all agencies and the number of distinct citizens who have submitted documents to each agency."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, COUNT(DISTINCT d.citizen_id) AS citizen_count\nFROM government_services.documents d\nJOIN gov... |
You are an expert in writing database language. You can write a corresponding 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.services ( service_id text, property_id text, service_name te... | [
{
"role": "user",
"content": "List all food and beverage services (category = 'Food & Beverage') with their names, prices, and units, where the price is less than $20."
},
{
"role": "assistant",
"content": "SELECT service_name, price, unit FROM hospitality_technology.services WHERE category = 'F... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "For each Avalanche token tick, calculate the total transfer volume and transaction count over the past 7 days using token_activities_avalanche. Include the token tick, total_volume, and tx_count."
},
{
"role": "assistant",
"content": "SELECT\n tick,\n SUM(amt) 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "Show me all diesel vehicles with a capacity greater than 20, including their make, model, and year."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, make, model, year, capacity FROM transportation.vehicles WHERE fuel_type = 'diesel' AND capacity > 20;"
},... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"role": "user",
"content": "List all reservations along with their guest's full name and the total amount, for reservations that have more than 2 adults."
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS guest_full_name, r.total_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 social_media.conversation_participants (
participant_id character varying(64) NO... | [
{
"role": "user",
"content": "Find all users who share a conversation with user 'user123', listing their user_id and the conversation_id."
},
{
"role": "assistant",
"content": "SELECT DISTINCT cp2.user_id, cp2.conversation_id\nFROM social_media.conversation_participants cp1\nJOIN social_media.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.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty... | [
{
"role": "user",
"content": "Show the top 5 largest documents by file size, including document_id, claim_id, file_name, and file_size_bytes."
},
{
"role": "assistant",
"content": "SELECT document_id,\n claim_id,\n file_name,\n file_size_bytes\nFROM insurance.claim_documents\nO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "Could you list the title of each game and the total quantity of items acquired by players for that specific game?"
},
{
"role": "assistant",
"content": "SELECT g.title, SUM(pi.quantity) AS total_acquired_quantity FROM gaming_technology.games g JOIN gaming_technology... |
You are an expert in writing database language. You can write a corresponding 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_uu... | [
{
"role": "user",
"content": "Find the date (calendar day) with the highest total number of game sessions. Show the date and the total session count."
},
{
"role": "assistant",
"content": "SELECT CAST(start_time AS DATE) AS session_date, COUNT(*) AS total_sessions\nFROM gaming_technology.game_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 insurance.agents ( agent_id text, first_name text, last_name text, agency_name text,... | [
{
"role": "user",
"content": "I need a report of how many documents each agent has uploaded in the past month. Include agent_id, agent full name, and the document count."
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name || ' ' || a.last_name AS full_name, COUNT(cd.document_i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.