conversations listlengths 2 8 | system stringlengths 288 8.08k |
|---|---|
[
{
"role": "user",
"content": "Find appointments that are longer than 30 minutes."
},
{
"role": "assistant",
"content": "SELECT * FROM legal_services.appointments WHERE end_time IS NOT NULL AND start_time IS NOT NULL AND end_time > start_time + INTERVAL '30 minutes'"
}
] | 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.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ... |
[
{
"role": "user",
"content": "Find pairs of customers who share the same last name and live in the same city. List the two customer IDs as customer1_id, customer2_id, their first names as first_name1, first_name2, and city."
},
{
"role": "assistant",
"content": "SELECT c1.customer_id AS customer... | 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 text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,... |
[
{
"role": "user",
"content": "Count the total number of premium payments made in the year 2024."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM premium_payments WHERE EXTRACT(YEAR FROM payment_date) = 2024"
}
] | 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 text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,... |
[
{
"role": "user",
"content": "What is the maintenance schedule for platform 3 at station DEF for the next month?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the maintenance schedule for platforms. The data I have only includes static information about platform de... | 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.p... |
[
{
"role": "user",
"content": "Show a list of diagnoses along with the chief complaint noted in the corresponding medical record. Display diagnosis description, diagnosis date, and the chief complaint."
},
{
"role": "assistant",
"content": "SELECT T1.description, T1.diagnosis_date, T2.chief_compl... | 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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ch... |
[
{
"role": "user",
"content": "Can you help me fetch the inventory details for components associated with a specific aircraft build, including the batch number, quantity, and warehouse location?"
},
{
"role": "assistant",
"content": "MATCH (ab:AircraftBuild {build_id: 'specific_build_id'})-[:IS_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
Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str... |
[
{
"role": "user",
"content": "Show me the top 3 tokens by 24-hour trading volume in the 'NFT' narrative, along with their price and market cap."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, total_volume, price, market_cap FROM token_basic_info WHERE narrative = 'NFT' OR... | 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_basic_info ( coin_id character varying(100) NOT NULL, token_name character varying(100) NOT NULL, token_symbol ch... |
[
{
"role": "user",
"content": "List the names of employees and the agency they work for who have scheduled at least one appointment. Show the employee's first name, last name, and agency_id."
},
{
"role": "assistant",
"content": "SELECT DISTINCT e.first_name, e.last_name, e.agency_id\nFROM govern... | 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.services ( service_id text, agency_id text, service_name text, description text, category text, eli... |
[
{
"role": "user",
"content": "Show the IDs and registration dates of all verified citizens who could be eligible for at least one active service. Display the citizen ID and registration date."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.citizen_id, c.registration_date\nFROM governmen... | 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... |
[
{
"role": "user",
"content": "List the content and sent time for messages sent by user 'U101'."
},
{
"role": "assistant",
"content": "SELECT content, sent_at FROM social_media.messages WHERE sender_user_id = 'U101';"
},
{
"role": "user",
"content": "Could you also include the group 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 social_media.messages (
message_id character varying(64) NOT NULL, -- unique identifier for the message
convers... |
[
{
"role": "user",
"content": "List the first name, last name, license number, and status for all drivers whose license expires in the next 6 months."
},
{
"role": "assistant",
"content": "SELECT\n first_name,\n last_name,\n license_number,\n status\nFROM transportation.drivers\nWHERE\n lice... | 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.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ... |
[
{
"role": "user",
"content": "What is the average ROI for all smart money addresses on the Binance chain?"
},
{
"role": "assistant",
"content": "SELECT AVG(roi) FROM smart_money_profit WHERE chain = 'Binance';"
}
] | 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 smart_money_profit ( address character varying(100) NOT NULL, -- the user's address rank INT, -- the rank of the addres... |
[
{
"role": "user",
"content": "Show me assets along with their associated 'symbol' metadata value. Assume an assets table with asset_id exists."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, m.value FROM assets a JOIN metadata m ON a.asset_id = m.asset_id WHERE m.key = 'symbol'"
},
... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.utxos ( utxo_id text PRIMARY KEY, transaction_id text, output_index... |
[
{
"role": "user",
"content": "List all medical records, showing the record ID, record date, and the full name of the doctor who created the record. Include the patient ID as well."
},
{
"role": "assistant",
"content": "SELECT mr.record_id, mr.record_date, mr.patient_id, d.first_name, d.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 healthcare.medical_records (
record_id character varying(64) NOT NULL, -- unique identifier for the medical record... |
[
{
"role": "user",
"content": "Show me all business center services (category = 'Business Center') along with their property IDs and descriptions, where the service is available."
},
{
"role": "assistant",
"content": "SELECT service_name, property_id, description FROM hospitality_technology.servi... | 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.services (
service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ... |
[
{
"role": "user",
"content": "What is the number of guests per country, grouped by country_code?"
},
{
"role": "assistant",
"content": "SELECT country_code,\n COUNT(*) AS guest_count\nFROM hospitality_technology.guests\nGROUP BY country_code;"
},
{
"role": "user",
"content": "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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la... |
[
{
"role": "user",
"content": "What is the performance review score for employee with ID 'EMP456' for the last quarter?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't assist with information about performance review scores as this data is not included in the employees table."
}
] | 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.employees ( ... |
[
{
"role": "user",
"content": "List NFT collections deployed after block number 10000000 with more than 500 tokens, showing contract_address, name, and token_count."
},
{
"role": "assistant",
"content": "SELECT contract_address, name, token_count\nFROM nft_collections\nWHERE deploy_block_number >... | 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 varchar, transaction_index bigint, from_... |
[
{
"role": "user",
"content": "What is the current location of train number Acela 2151?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to real-time location data for trains. The database only contains static information such as train ID, model, capacity, and maintenance... | 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... |
[
{
"role": "user",
"content": "List all accounts for customers who have at least one account with a balance over 10000 and another account with a balance under 1000. Show customer_id, account_id, account_type, balance, and currency."
},
{
"role": "assistant",
"content": "SELECT account_id , cust... | 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, customer_id text, account_number text, account_type text, balance numeri... |
[
{
"role": "user",
"content": "List all medical record entries where the treatment_plan mentions a medication name. Return patient_id, record_id, and the matching medication_name."
},
{
"role": "assistant",
"content": "SELECT mr.patient_id,\n mr.record_id,\n m.medication_name\nFROM he... | 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... |
[
{
"role": "user",
"content": "Show the number of employees in each department."
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS employee_count\nFROM financial_services.employees\ngroup BY department;"
},
{
"role": "user",
"content": "Exclude departments that have... | 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... |
[
{
"role": "user",
"content": "Show me all wallets that were created before 2024 and their associated user IDs."
},
{
"role": "assistant",
"content": "SELECT wallet_id, user_id, address, created_at\nFROM trading_platform.wallets\nWHERE created_at < '2024-01-01';"
}
] | 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... |
[
{
"role": "user",
"content": "What are the environmental impact assessments for the production of the Airbus A350 model?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to data regarding the environmental impact assessments for the production of specific aircraft models... | 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... |
[
{
"role": "user",
"content": "Find all pairs of contracts deployed by the same deployer on the same day, showing the deployer_address, the deployment date, and both contract IDs."
},
{
"role": "assistant",
"content": "SELECT c1.deployer_address,\n DATE(c1.deployed_at) AS deploy_date,\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.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,... |
[
{
"role": "user",
"content": "For each driver, find the other driver whose license_expiry_date is the next one after theirs. Show both IDs, names and their expiry dates."
},
{
"role": "assistant",
"content": "SELECT\n d1.driver_id AS driver_id,\n d1.first_name || ' ' || d1.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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens... |
[
{
"role": "user",
"content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table."
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.valuation, tbi.token_symbol,... | 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... |
[
{
"role": "user",
"content": "List each guest’s full name and the total number of service orders they have placed, ordered by order count descending."
},
{
"role": "assistant",
"content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n COUNT(so.order_id) AS 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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te... |
[
{
"role": "user",
"content": "For each citizen who has made at least one payment, show the citizen's full name, number of payments, and total amount paid, grouped by currency."
},
{
"role": "assistant",
"content": "SELECT\n c.first_name || ' ' || c.last_name AS full_name,\n p.currency,\n COUN... | 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... |
[
{
"role": "user",
"content": "Retrieve the product_id, product_name, base_premium, and created_at for all active insurance products with a base_premium greater than 1000, ordered by base_premium descending."
},
{
"role": "assistant",
"content": "SELECT\n product_id,\n product_name,\n base_pre... | 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.insurance_products (
product_id character varying(64) NOT NULL, -- unique identifier for the insurance pr... |
[
{
"role": "user",
"content": "I need to retrieve asset IDs along with their category and website metadata values for assets that have both entries."
},
{
"role": "assistant",
"content": "SELECT m_cat.asset_id,\n m_cat.value AS category,\n m_web.value AS website_url\nFROM trading_plat... | 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.metadata ( metadata_id character varying(64) NOT NULL, asset_id character varying(64) NOT NULL, key ch... |
[
{
"role": "user",
"content": "Count how many posts have media attachments."
},
{
"role": "assistant",
"content": "SELECT count(*) FROM social_media.posts WHERE media_url IS NOT NULL"
}
] | 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 text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "What is the history of incidents or accidents that occurred on platform 5 at station GHI?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the history of incidents or accidents on platform 5 at station GHI. My data is limited t... | 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.p... |
[
{
"role": "user",
"content": "Find all pairs of different insurance records that share the same group_number, and show group_number, the patient_insurance_id of both records, and their corresponding patient_ids."
},
{
"role": "assistant",
"content": "SELECT a.group_number,\n a.patient_insu... | 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 text, patient_id text, plan_id text, policy_number text, group_numb... |
[
{
"role": "user",
"content": "List all appointments scheduled in the next 30 days with appointment_id, client_id, case_id, and any invoice_id linked to that case."
},
{
"role": "assistant",
"content": "SELECT\n a.appointment_id,\n a.client_id,\n a.case_id,\n i.invoice_id\nFROM legal_services... | 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.law_firms (
firm_id character varying(64) NOT NULL, -- unique identifier for the law firm
firm_... |
[
{
"role": "user",
"content": "List all transfers of the token named 'Wrapped Ether', showing the transfer id, token id, value, and the contract address of the token."
},
{
"role": "assistant",
"content": "SELECT tt.transfer_id, tt.token_id, tt.value, t.contract_address\nFROM web3.token_transfers... | 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.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "What are the maintenance costs for a specific aircraft model like the Airbus A320?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to data regarding maintenance costs for specific aircraft models such as the Airbus A320. The information in ... | 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... |
[
{
"role": "user",
"content": "What is the fuel consumption rate of train number T1234?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have information on the fuel consumption rate of train number T1234. The data available in the system only includes details such as train ID, model... | 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... |
[
{
"role": "user",
"content": "What is the current market cap and 7-day price change percentage for the top 3 narratives by trend rank?"
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap, price_change_percentage_7d FROM narrative_info ORDER BY trend_rank ASC LIMIT 3;"
}
] | 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_basic_info (",
"coin_id character varying(100) NOT NULL, -- the id of the token",
"token_name character... |
[
{
"role": "user",
"content": "Find all pairs of transactions that occurred in the same block and were sent to the same address. Show both transaction IDs, the shared recipient address, and the block number."
},
{
"role": "assistant",
"content": "SELECT t1.transaction_id AS tx1,\n t2.transa... | 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.transactions ( transaction_id text, from_address text, to_address text, value numeric, gas_used integer, gas_price... |
[
{
"role": "user",
"content": "Show me all lawyers' full names, their bar number, and if they are partners, the full name of another partner from their firm."
},
{
"role": "assistant",
"content": "SELECT l1.first_name || ' ' || l1.last_name AS lawyer_full_name, l1.bar_number,\n CASE WHEN l1... | 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.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph... |
[
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and amount."
},
{
"role": "assistant",
"content": "SELECT wallet_address, token_id, amount FROM nft_holders WHERE contract_type = 'ERC1155' AND CAST(amount AS decimal... | 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... |
[
{
"role": "user",
"content": "List patient_id, full name, policy_number, plan_type, and insurance_provider for all active primary insurance policies."
},
{
"role": "assistant",
"content": "SELECT pi.patient_id,\n p.first_name,\n p.last_name,\n pi.policy_number,\n ip.plan_... | 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 text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 100 of any ERC1155 token, along with the token ID and amount."
},
{
"role": "assistant",
"content": "SELECT wallet_address, token_id, amount FROM erc20_balances WHERE CAST(amount AS decimal) > 100 AND contract_address... | 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... |
[
{
"role": "user",
"content": "特定の職種の従業員情報を取得したいです。従業員ID、名前、職種、雇用日を表示してください。"
},
{
"role": "assistant",
"content": "db.employees.find(\n { job_title: '<specific_job_title>' },\n { employee_id: 1, first_name: 1, last_name: 1, job_title: 1, hire_date: 1, _id: 0 }\n).sort({ hire_date: -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
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... |
[
{
"role": "user",
"content": "List the document ID, file name, and size for all documents uploaded in the last 30 days by user 'agent_smith' that are larger than 5 megabytes, ordered by upload time descending."
},
{
"role": "assistant",
"content": "SELECT document_id, file_name, file_size_bytes ... | 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.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_type text, file_name text, file_path ... |
[
{
"role": "user",
"content": "What are the training programs or certifications completed by a staff member with the role of Platform Supervisor?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about the training programs or certifications completed by sta... | 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.s... |
[
{
"role": "user",
"content": "List each patient's first_name, last_name, and the plan_name and policy_number of their primary insurance plan."
},
{
"role": "assistant",
"content": "SELECT p.first_name,\n p.last_name,\n ip.plan_name,\n pi.policy_number\nFROM healthcare.patients ... | 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 text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "How many reviews does each staff member respond to, along with their full name and the average response time in hours?"
},
{
"role": "assistant",
"content": "SELECT st.staff_id,\n st.first_name || ' ' || st.last_name AS staff_full_name,\n COUNT(*) AS res... | 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 text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "Find all wallets created by users in the last 7 days along with any tokens that have a total supply greater than 10 million, showing the wallet address and token details."
},
{
"role": "assistant",
"content": "SELECT w.address AS wallet_address, t.token_name, t.toke... | 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, contract_address character varying(128) NOT NULL, token_name cha... |
[
{
"role": "user",
"content": "What are the fuel consumption rates per hour for the Boeing 747-8 model?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the fuel consumption rates for the Boeing 747-8 model as this data is not included in the aircraft_models ta... | 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... |
[
{
"role": "user",
"content": "List all wallets holding the NFT with contract_address '0xabc123' and token_id '100' and the amount held."
},
{
"role": "assistant",
"content": "SELECT wallet_address, amount\nFROM nft_holders\nWHERE contract_address = '0xabc123'\n AND token_id = '100';"
},
{
... | 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... |
[
{
"role": "user",
"content": "List all properties and the room types they offer, including the base rate for each room type."
},
{
"role": "assistant",
"content": "SELECT T1.property_name, T2.type_name, T2.base_rate FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_ty... | 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.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... |
[
{
"role": "user",
"content": "List all appointments that are currently scheduled and show their appointment time."
},
{
"role": "assistant",
"content": "SELECT appointment_id, patient_id, doctor_id, appointment_time FROM healthcare.appointments WHERE status = 'Scheduled';"
}
] | 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, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "List all appointments scheduled for '2024-07-25' with a status of 'Scheduled'."
},
{
"role": "assistant",
"content": "SELECT * FROM legal_services.appointments WHERE DATE(start_time) = '2024-07-25' AND status = 'Scheduled'"
}
] | 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.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ... |
[
{
"role": "user",
"content": "List the names of services and the total number of times each service has been ordered. Only include services that have been ordered at least once."
},
{
"role": "assistant",
"content": "SELECT T1.service_name, count(T2.order_id) AS order_count FROM hospitality_tech... | 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... |
[
{
"role": "user",
"content": "I need to find all bookings for a specific schedule with schedule_id 'sched_1122' and include the passenger and ticket details."
},
{
"role": "assistant",
"content": "SMEMBERS schedule:sched_1122:bookings\nHGETALL booking:book_*\nHGETALL passenger:pass_*\nSMEMBERS 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
// Use Hashes for platform details. Key format: platform:<platform_id>
// HSET platform:plat_123 ... |
[
{
"role": "user",
"content": "How many notifications have been sent for comments in total?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM social_media.notifications\nWHERE target_entity_type = 'comment';"
}
] | 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.text, username.text, email.text, password_hash.text, full_name.text, profile_picture_url.t... |
[
{
"role": "user",
"content": "List the full names and dates of birth for all patients who do not have a phone number on record."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE phone_number IS NULL OR TRIM(phone_number) = '';"
}
... | 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, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount, sorted by amount in descending order."
},
{
"role": "assistant",
"content": "SELECT b.wallet_address, t.symbol, b.amount FROM erc20_balances b JOIN sui_coin... | 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... |
[
{
"role": "user",
"content": "List all claims along with the first and last names of the agent who is currently handling each claim."
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.policy_id, c.incident_date, a.first_name AS agent_first_name, a.last_name AS agent_last_name\nFROM insu... | 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... |
[
{
"role": "user",
"content": "For each ERC1155 NFT contract on Ethereum, show the `contract_address`, `token_id`, total amount held across all wallets, and number of unique holders."
},
{
"role": "assistant",
"content": "SELECT nh.contract_address,\n nh.token_id,\n SUM(CAST(nh.amount... | 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... |
[
{
"role": "user",
"content": "For each patient, show the total number of diagnoses they have received, along with their patient ID and the ID of their latest diagnosis. Join with the diagnoses table."
},
{
"role": "assistant",
"content": "SELECT patient_id, COUNT(diagnosis_id) AS diagnosis_count... | 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.appointments ( appointment_id text, patient_id text, doctor_id text, appointment_time timestamp, duration_mi... |
[
{
"role": "user",
"content": "Show me the total transaction amount by transaction_type for all transactions processed by employees in the 'Trading' department, along with their department name."
},
{
"role": "assistant",
"content": "SELECT t.transaction_type, SUM(t.amount) AS total_amount, e.dep... | 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... |
[
{
"role": "user",
"content": "For each employee, find their first and last name along with the number of applications they've been assigned. Only include employees with at least 5 assigned applications."
},
{
"role": "assistant",
"content": "SELECT e.first_name,\n e.last_name,\n COUN... | 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 text, national_id_number text, first_name text, last_name text, date_of_birth... |
[
{
"role": "user",
"content": "For each vehicle, list its vehicle_id, license_plate, and any older vehicle of the same type (showing older_vehicle_id and older year)."
},
{
"role": "assistant",
"content": "SELECT cur.vehicle_id,\n cur.license_plate,\n old.vehicle_id AS older_vehicle_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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2