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... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2