conversations listlengths 2 8 | system stringlengths 298 8.24k |
|---|---|
[
{
"content": "List the diagnosis code, diagnosis description, and dosage of each prescription for cases where prescriptions are linked to diagnoses for the same patient and doctor.",
"role": "user"
},
{
"content": "SELECT d.diagnosis_code, d.description AS diagnosis_description, p.dosage\nFROM healt... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, patient_i... |
[
{
"content": "List the full name of patients whose primary insurance plan is provided by 'BlueCross BlueShield', along with the plan name.",
"role": "user"
},
{
"content": "SELECT T1.first_name, T1.last_name, T3.plan_name FROM healthcare.patients AS T1 JOIN healthcare.patient_insurance AS T2 ON T1.p... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patient_insurance (
patient_insurance_id character varying(64) NOT NULL, -- unique identifier for this p... |
[
{
"content": "Can you list all group conversations and the number of participants in each?",
"role": "user"
},
{
"content": "SELECT c.conversation_id, c.group_name, COUNT(cp.user_id) AS participant_count\nFROM social_media.conversations c\nJOIN social_media.conversation_participants cp ON c.conversa... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"content": "Find pairs of claims filed by the same customer where the incident dates are within 7 days of each other. Return customer_id, both claim IDs, and their incident dates.",
"role": "user"
},
{
"content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_id,\n c1.incident_date ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier for the claim
policy_id charac... |
[
{
"content": "What is the total sum of all amounts for all UTXOs in the system, regardless of whether they are spent or unspent?",
"role": "user"
},
{
"content": "SELECT SUM(amount) FROM trading_platform.utxos",
"role": "assistant"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ... |
[
{
"content": "For each doctor, count the number of chronic diagnoses they have made. Show the doctor's full name and the count.",
"role": "user"
},
{
"content": "SELECT doc.first_name, doc.last_name, COUNT(d.diagnosis_id) FROM healthcare.doctors doc JOIN healthcare.diagnoses d ON doc.doctor_id = d.d... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number... |
[
{
"content": "I want the list of participants in group chats who have unread messages, including conversation ID, group name, user ID, and the timestamp of the last message that the user hasn’t read.",
"role": "user"
},
{
"content": "SELECT cp.conversation_id,\n c.group_name,\n cp.user_i... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_id text, content text, created_at t... |
[
{
"content": "List the post_id and the count of distinct hashtags associated with each post that has at least 3 hashtags.",
"role": "user"
},
{
"content": "SELECT ph.post_id, COUNT(DISTINCT ph.hashtag_id) AS hashtag_count FROM social_media.post_hashtags ph GROUP BY ph.post_id HAVING COUNT(DISTINCT p... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"content": "List all unspent UTXOs with an amount greater than 10.",
"role": "user"
},
{
"content": "SELECT utxo_id, transaction_id, address, amount FROM utxos WHERE spent = FALSE AND amount > 10;",
"role": "assistant"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
CREATE ... |
[
{
"content": "Which wallets hold at least 100 units of any ERC1155 NFT, and what is the token ID and contract address of the NFT for each such holding?",
"role": "user"
},
{
"content": "SELECT wallet_address, contract_address, token_id, amount\nFROM nft_holders\nWHERE contract_type = 'ERC1155' AND C... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"content": "List for each fuel type the number of unique vehicle models available. Show the fuel_type and the model count.",
"role": "user"
},
{
"content": "SELECT fuel_type, COUNT(DISTINCT model) AS model_count FROM transportation.vehicles GROUP BY fuel_type ORDER BY fuel_type;",
"role": "ass... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text... |
[
{
"content": "Show me all claim documents that are PDFs and were uploaded in the last 30 days, along with their claim IDs and file sizes.",
"role": "user"
},
{
"content": "SELECT cd.document_id, cd.claim_id, cd.file_size_bytes, c.policy_id FROM insurance.claim_documents cd JOIN insurance.claims c ON... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ... |
[
{
"content": "List all ERC20 tokens where the total supply is between 1 million and 10 million, including their names, symbols, and contract addresses.",
"role": "user"
},
{
"content": "SELECT ti.tick as name, ti.tick as symbol, tb.tick as contract_address FROM token_info ti JOIN token_balances tb O... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transaction_index.integer, transaction_hash.... |
[
{
"content": "I need to list the top 5 ERC20 tokens by total supply, including symbol, contract_address, and name.",
"role": "user"
},
{
"content": "SELECT tm.contract_address, tm.symbol, tm.name, CAST(tm.total_supply AS DECIMAL) AS total_supply\nFROM token_metas tm\nWHERE tm.is_erc20 = 1\nORDER BY ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"content": "How many documents of each type exist in the system? Show the document type and the count.",
"role": "user"
},
{
"content": "SELECT document_type, COUNT(*) AS document_count\nFROM legal_services.documents\ngroup BY document_type;",
"role": "assistant"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad... |
[
{
"content": "Show me the top 3 tokens by liquidity on the Binance chain, along with their price and 1-hour price change percentage.",
"role": "user"
},
{
"content": "SELECT token_name, token_symbol, price, price_change_percentage_1h, liquidity FROM token_dexpool_info WHERE chain = 'Binance' ORDER B... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, token_name character varying(100) NOT NULL, token_sy... |
[
{
"content": "What is the average number of wallets each user owns?",
"role": "user"
},
{
"content": "SELECT\n AVG(wallet_count) AS avg_wallets_per_user\nFROM (\n SELECT user_id, COUNT(*) AS wallet_count\n FROM web3.wallets\n GROUP BY user_id\n) AS sub;",
"role": "assistant"
},
{
"co... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"content": "List the full names and email addresses of citizens who have submitted an application but have not uploaded any documents for that application. Display the citizen's full name, application_id, and submitted_at.",
"role": "user"
},
{
"content": "SELECT c.first_name || ' ' || c.last_name... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"content": "What are the qualifications or training history of the staff member who performed the maintenance with record_id 'REC123'?",
"role": "user"
},
{
"content": "I'm sorry, but I can't provide information about the qualifications or training history of staff members as this data is not stor... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.m... |
[
{
"content": "I want to list each security alongside another security issued by the same issuer.",
"role": "user"
},
{
"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_services.securities a\nJOIN fin... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, isin_code text, cusip_code text, secu... |
[
{
"content": "I need to get the inventory quantity and location for a specific batch number. Can you help with that?",
"role": "user"
},
{
"content": "HGETALL inv:<inventory_record_id>",
"role": "assistant"
},
{
"content": "Can you also show me the component ID associated with this batch... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c... |
[
{
"content": "Count the number of logs for each action type.",
"role": "user"
},
{
"content": "SELECT action,\n COUNT(*) AS count\nFROM trading_platform.logs\nGROUP BY action;",
"role": "assistant"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.logs ( log_id text PRIMARY KEY, user_id text, action text, details text, logged_at timestamp )
|
[
{
"content": "List the five most recently issued policies with their policy_id, policy_number, issued_at, and status.",
"role": "user"
},
{
"content": "SELECT policy_id, policy_number, issued_at, status\nFROM insurance.policies\nORDER BY issued_at DESC\nLIMIT 5;",
"role": "assistant"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ... |
[
{
"content": "Count the number of trips for each route type.",
"role": "user"
},
{
"content": "SELECT R.type, COUNT(T.trip_id) FROM transportation.trips AS T JOIN transportation.routes AS R ON T.route_id = R.route_id GROUP BY R.type;",
"role": "assistant"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_location_id.text, destination_locati... |
[
{
"content": "Show me all active staff members with their property_id, position, and hire_date.",
"role": "user"
},
{
"content": "SELECT staff_id, property_id, position, hire_date FROM hospitality_technology.staff WHERE is_active = true;",
"role": "assistant"
},
{
"content": "Now only in... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"content": "Show me all documents uploaded by lawyers from the 'Smith Legal Group' firm, including document_name, upload_timestamp, and the lawyer's first and last name.",
"role": "user"
},
{
"content": "SELECT d.document_name, d.upload_timestamp, l.first_name, l.last_name\nFROM legal_services.doc... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients (
client_id character varying(64) NOT NULL, -- unique identifier for the client
first_n... |
[
{
"content": "I want to know each player's username, country code, number of unique items they own, and total quantity of items in their inventory.",
"role": "user"
},
{
"content": "SELECT p.username, p.country_code,\n COUNT(DISTINCT pi.item_id) AS unique_items,\n COALESCE(SUM(pi.quantit... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player
... |
[
{
"content": "Show all SUI coins that are marked as 'exists' in both sui_coins and sui_coins_metadata, displaying their coin_type, symbol, name, and balance.",
"role": "user"
},
{
"content": "SELECT sc.coin_type, scm.symbol, scm.name, sc.balance FROM sui_coins sc JOIN sui_coins_metadata scm ON sc.co... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"content": "Can you show me, for each player, the total number of different in-game items they have acquired, along with the names and types of these items?",
"role": "user"
},
{
"content": "SELECT pi.player_id, COUNT(DISTINCT pi.item_id) AS unique_items_acquired, STRING_AGG(igi.item_name || ' (' ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.game_sessions (
session_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ... |
[
{
"content": "Show me the username and email of all users who own at least one wallet.",
"role": "user"
},
{
"content": "SELECT DISTINCT T1.username, T1.email FROM blockchain.users AS T1 JOIN blockchain.wallets AS T2 ON T1.user_id = T2.user_id;",
"role": "assistant"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text )
CREATE TABLE blockchain.users ( ... |
[
{
"content": "Now, sort the results by the date opened, oldest first, and show only the top 10.",
"role": "user"
},
{
"content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Criminal' ORDER BY date_open... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t... |
[
{
"content": "Find all prescriptions for patients who have at least one appointment scheduled in the future. Show the prescription ID, patient ID, medication name, and the earliest future appointment time for that patient.",
"role": "user"
},
{
"content": "SELECT pr.prescription_id, pr.patient_id, m... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number... |
[
{
"content": "Show me all users who have wallets but have never placed any orders, along with their wallet addresses and creation dates.",
"role": "user"
},
{
"content": "SELECT u.user_id, u.email, w.address AS wallet_address, w.created_at FROM trading_platform.users u JOIN trading_platform.wallets ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"content": "What are the safety ratings or crash statistics for the Boeing 787 Dreamliner?",
"role": "user"
},
{
"content": "I'm sorry, but I don't have access to safety ratings or crash statistics for specific aircraft models like the Boeing 787 Dreamliner. My data is limited to the information i... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE manufacturing.aircraft_mod... |
[
{
"content": "Show me all transactions (transaction_id, amount, transaction_type) where the transaction_type is 'Transfer' and the status is 'Completed', along with the account_id and related_account_id.",
"role": "user"
},
{
"content": "SELECT transaction_id, amount, transaction_type, account_id, r... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.transactions (
transaction_id character varying(64) NOT NULL, -- unique identifier for the trans... |
[
{
"content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address.",
"role": "user"
},
{
"content": "SELECT wallet_address, token_id, contract_address FROM nft_holders WHERE contract_type = 'ERC1155' AND CAST(amount AS decimal) > 1... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas (
block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded
... |
[
{
"content": "Show me the deployer address and the count of contracts they have deployed on the 'mainnet' network, but only for deployers who have deployed more than 5 contracts on mainnet. Sort the results by the count in descending order.",
"role": "user"
},
{
"content": "SELECT deployer_address, ... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text PRIMARY KEY, address text, abi text, bytecode text... |
[
{
"content": "I need a list of all SUI coins with their object ID, coin type, and balance.",
"role": "user"
},
{
"content": "SELECT object_id, coin_type, balance FROM sui_coins;",
"role": "assistant"
},
{
"content": "Only include coins where status is 'exists'.",
"role": "user"
},
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ... |
[
{
"content": "What is the fuel efficiency of the train car with car_id 'TC456'?",
"role": "user"
},
{
"content": "I'm sorry, but I don't have access to information about the fuel efficiency of specific train cars. The data available in the train_cars table only includes details such as car_id, train... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.t... |
[
{
"content": "Find all pairs of overlapping payment periods for the same customer. Return customer_id, first payment_id as payment1_id, second payment_id as payment2_id, and both periods' start and end dates.",
"role": "user"
},
{
"content": "SELECT p1.customer_id,\n p1.payment_id AS payment1_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.premium_payments (
payment_id character varying(64) NOT NULL, -- unique identifier for the payment
po... |
[
{
"content": "Show me all users who have both bought and sold the same cryptocurrency asset, along with the asset details and their total buy/sell volumes.",
"role": "user"
},
{
"content": "SELECT u.user_id, u.email, a.asset_id, a.name AS asset_name, a.symbol, SUM(CASE WHEN t.buyer_id = u.user_id TH... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
CREATE TAB... |
[
{
"content": "For each transaction, list the total value transferred and the number of different addresses involved (either as sender or receiver).",
"role": "user"
},
{
"content": "SELECT transaction_id, SUM(value) AS total_value_transferred, COUNT(DISTINCT addr) AS num_addresses_involved\nFROM (\n... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text, token_id text, from_address text, to_address text, value numeric, transaction_... |
[
{
"content": "List the payment ID, amount paid, and due date for all premium payments with a status of 'overdue'.",
"role": "user"
},
{
"content": "SELECT payment_id, amount_paid, due_date FROM premium_payments WHERE status = 'overdue'",
"role": "assistant"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d... |
[
{
"content": "Show the total trade amount for each account. Include the account_id and account_number.",
"role": "user"
},
{
"content": "SELECT\n T1.account_id,\n T1.account_number,\n SUM(T2.total_amount) AS total_traded_amount\nFROM financial_services.accounts AS T1\nINNER JOIN financial_service... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad... |
[
{
"content": "Can you help me find all bookings made by passengers from a specific city, say 'Boston', including the passenger details and the scheduled trip information?",
"role": "user"
},
{
"content": "MATCH (p:Passenger)-[:MADE_BOOKING]->(b:Booking)-[:FOR_TRIP]->(st:ScheduledTrip)\nMATCH (p)-[:B... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// Node Label: :Station
// Properties:
// station_id: String (Constraint: UNIQUE)
// station_... |
[
{
"content": "For each group conversation, show its name and the creation time of the earliest notification associated with it.",
"role": "user"
},
{
"content": "SELECT c.group_name, MIN(n.created_at) AS earliest_notification_time FROM social_media.conversations AS c JOIN social_media.notifications ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp, last_message_at timestamp, is_grou... |
[
{
"content": "I need a list of claim_ids that have at least one document of type 'Photo' and at least one of type 'Invoice'.",
"role": "user"
},
{
"content": "SELECT DISTINCT cd.claim_id\nFROM insurance.claim_documents cd\nWHERE cd.document_type IN ('Photo', 'Invoice');",
"role": "assistant"
}... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
first_... |
[
{
"content": "For each token, show its token_id, decimals, and the average total_supply of all tokens with the same decimals.",
"role": "user"
},
{
"content": "SELECT t.token_id,\n t.decimals,\n avg_data.avg_total_supply\nFROM web3.tokens t\nJOIN (\n SELECT decimals,\n AVG(total... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for the token
contract_address cha... |
[
{
"content": "List all accounts (account_id, account_number, balance) that have at least one trade with a total_amount greater than $50,000, along with the count of such trades for each account.",
"role": "user"
},
{
"content": "SELECT a.account_id, a.account_number, a.balance, COUNT(t.trade_id) AS ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba... |
[
{
"content": "Show me all patients who have been prescribed medications with dosage greater than 100mg, along with their full names and the medication details, including the prescribing doctor's last name.",
"role": "user"
},
{
"content": "SELECT p.first_name, p.last_name, m.medication_name, m.gener... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"content": "Show me the top 3 narratives by trend rank, along with their top 3 tokens and 7-day price change percentage.",
"role": "user"
},
{
"content": "SELECT ni.narrative, ni.top_3_coins, ni.price_change_percentage_7d FROM narrative_info ni ORDER BY ni.trend_rank ASC LIMIT 3;",
"role": "as... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundraising record id",
"project_id ch... |
[
{
"content": "Can you provide the total capacity of all train cars for a specific train with train_id 'TR789'?",
"role": "user"
},
{
"content": "SELECT SUM(capacity) AS total_capacity\nFROM train_cars\nWHERE train_id = 'TR789';",
"role": "assistant"
}
] | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// PUT /stations
{
"mappings": {
"properties": {
"station_id": { "type": "keyword" },... |
[
{
"content": "Show me the first name, last name, and email address for all passengers who are part of the loyalty program with ID 'Gold'.",
"role": "user"
},
{
"content": "SELECT first_name , last_name , email FROM transportation.passengers WHERE loyalty_program_id = 'Gold'",
"role": "assist... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description text, origin_location_id text, destin... |
[
{
"content": "Show me all claims with police reports that were filed in the last 3 months, along with the policy details and customer information.",
"role": "user"
},
{
"content": "SELECT c.claim_id, c.policy_id, c.customer_id, c.incident_date, c.reported_date, c.description, c.estimated_loss, c.sta... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara... |
[
{
"content": "Show me each loyalty program ID along with the full names of all passengers enrolled in that program.",
"role": "user"
},
{
"content": "SELECT loyalty_program_id, first_name, last_name FROM transportation.passengers WHERE loyalty_program_id IS NOT NULL ORDER BY loyalty_program_id, last... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.passengers (
passenger_id character varying(64) NOT NULL, -- unique identifier for the passenger
... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 5