system stringlengths 315 8.44k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "List the five most recent claims with their claim_id, incident_date, customer's full name, and estimated_loss, sorted by reported_date descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date,\n cu.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 insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character vary... | [
{
"role": "user",
"content": "I want to retrieve all claims with an estimated loss greater than 10000, including the claim ID, incident date, beneficiary first and last name, and relationship.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, b.first_nam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "Show all policies that were cancelled in 2024, including their policy_number, cancellation_date, and cancellation_reason. Also show the file name of any associated claim documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.can... |
You are an expert in writing database language. You can write a corresponding 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, -- uniqu... | [
{
"role": "user",
"content": "List each patient's first and last medical record entries, showing patient_id, earliest_record_id, earliest_record_date, latest_record_id, and latest_record_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n fl.patient_id,\n fr.record_id AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "List the product_id, product_name, and description of any insurance products created before 2024 whose description contains the word 'theft'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, description\nFROM insurance.insuran... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address t... | [
{
"role": "user",
"content": "What is the average market cap for all tokens belonging to the 'GameFi' narrative?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(market_cap) FROM token_basic_info WHERE narrative = 'GameFi'",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Which properties offer services in the 'Business Center' department, and what are the names and prices of those services?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, s.service_name, s.price\nFROM hospitality_technol... |
You are an expert in writing database language. You can write a corresponding 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 agency_id, agency_name, and main_phone_number for agencies that do not have a main phone number specified.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agency_id, agency_name, main_phone_number\nFROM government_services.agencies\nWHERE main_ph... |
You are an expert in writing database language. You can write a corresponding 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.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i... | [
{
"role": "user",
"content": "List all premium payments with a due date in March 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM insurance.premium_payments WHERE due_date >= '2024-03-01' AND due_date <= '2024-03-31';",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.payments ( payment_id text PRIMARY KEY, application_id text, cit... | [
{
"role": "user",
"content": "Can you show me the total amount paid by each citizen for each service? Please display the citizen_id, service_id, and the total amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT citizen_id, service_id, SUM(amount) AS total_amount\nFROM governme... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "Show me the claim ID, status, and the policy number for all claims with an estimated loss greater than 5000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T1.status, T2.policy_number FROM insurance.claims AS T1 JOIN insurance.policies 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 trading_platform.orders ( order_id character varying(64) NOT NULL, user_id character... | [
{
"role": "user",
"content": "I need the total traded value (quantity * price) for each buyer and asset symbol for trades after '2024-06-01'. List buyer_id, asset symbol, and total_value.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.buyer_id, m.value AS asset_symbol, SUM(t.qu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.room_types (
room_type_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "List all room types with their type name, base rate, and the name of the property they belong to.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rt.room_type_id, rt.type_name, rt.base_rate, p.property_name\nFROM hospitality_technology.room_types rt\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": "List the patient ID, policy number, and effective date for all policies that are marked as primary.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, policy_number, effective_date FROM healthcare.patient_insurance WHERE is_primary = TRUE;",
... |
You are an expert in writing database language. You can write a corresponding 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, token_id text, from_address text, to_addres... | [
{
"role": "user",
"content": "For each transaction, list the total value transferred and the number of different addresses involved (either as sender or receiver).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, SUM(value) AS total_value_transferred, COUNT(DISTINCT... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Show me the top 3 peers by the number of active days (days they were last seen) in the last month, along with their IP addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address, COUNT(DISTINCT DATE(last_seen)) AS active_days FROM ... |
You are an expert in writing database language. You can write a corresponding 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.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"role": "user",
"content": "List the notification ID, message subject, and sent time for all notifications sent through the 'SMS' channel.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT notification_id, message_subject, sent_at FROM government_services.notifications WHERE chann... |
You are an expert in writing database language. You can write a corresponding 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": "Get me the total number of vehicles for each fuel_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fuel_type,\n COUNT(*) AS total_vehicles\nFROM transportation.vehicles\nGROUP BY fuel_type;",
"sql": null
},
{
"role": "user",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Find patients who currently have both a primary and a secondary insurance policy. For each, show patient_id, full name, primary policy_number, and secondary policy_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id,\n p.first_n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "How many distinct users have sent messages in each conversation? Return conversation_id and user_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT conversation_id,\n COUNT(DISTINCT sender_user_id) AS user_count\nFROM social_media.messages\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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"role": "user",
"content": "List all trades, showing the trade ID, account ID, and the ticker symbol and security name of the traded security.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trade_id, t.account_id, s.ticker_symbol, s.security_name FROM financial_services.trade... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers (
transfer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Find cases where an address received tokens in one transfer and then sent tokens in another. List the receive transfer_id, the send transfer_id, the address, and both transfer values.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT recv.transfer_id AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "How many prescriptions exist for each medication? Show medication name and total prescriptions, sorted by total descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.medication_name, COUNT(p.prescription_id) AS total_prescriptions FROM healthc... |
You are an expert in writing database language. You can write a corresponding 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": "Which users participated in more than one conversation? Show their user_id and participant_id for each conversation, along with the joined_at time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, participant_id, conversation_id, joined_at FRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "List games that have servers deployed in more than one geographical region. Show the game title and the count of regions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, count(DISTINCT s.region) AS region_count FROM games AS g JOIN servers 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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all staff members who have responded to at least one review in the last 6 months, including their first and last names and the count of responses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, COUNT(r.revi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE manufacturing.components (
component_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "我想了解某个组件的库存情况,包括库存数量、仓库位置和接收日期。",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ci.quantity, ci.location_warehouse, ci.received_date\nFROM manufacturing.component_inventory ci\nWHERE ci.component_id = 'specific_component_id';",
"sql": null
},
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "List all NFTs on the 'Ethereum' blockchain with a rarity score above 85. Show their name, contract address, token ID, and rarity score.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, contract_address, token_id, rarity_score FROM nft_metadata WH... |
You are an expert in writing database language. You can write a corresponding 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 parent agencies and the number of direct child agencies they have. List the parent agency name and the count of their children.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.agency_name, COUNT(T2.agency_id) FROM government_services.agencies ... |
You are an expert in writing database language. You can write a corresponding 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.trades ( trade_id character varying(64) NOT NULL, order_id characte... | [
{
"role": "user",
"content": "For each asset, show the asset name, symbol, and the latest trade price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name AS asset_name, a.symbol AS asset_symbol, (\n SELECT t1.price FROM trading_platform.trades t1\n WHERE t1.a... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Which vehicles have had fueling events at locations of type 'Station'? For each vehicle, list the vehicle_id, license_plate, and the name and city of the fueling station.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT v.vehicle_id, v.license... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "List all premium payments made by Bank Transfer where the amount_paid is greater than 5000. Show payment_id, policy_id, customer_id, amount_paid, and payment_date, ordered by amount_paid descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT paym... |
You are an expert in writing database language. You can write a corresponding 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 and the full name of the guest who made each reservation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.reservation_id, T2.first_name, T2.last_name FROM hospitality_technology.reservations AS T1 INNER JOIN 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.logs ( log_id text PRIMARY KEY, user_id text, action text, details ... | [
{
"role": "user",
"content": "Count the number of logs for each action type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT action,\n COUNT(*) AS count\nFROM trading_platform.logs\nGROUP BY action;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "List all pairs of citizens who registered on the same date. Include each citizen's full name and the shared registration date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c1.first_name || ' ' || c1.last_name AS full_name_1,\n c2.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 legal_services.documents (
document_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List pairs of documents uploaded by the same lawyer, showing uploader ID and both document names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.uploaded_by_lawyer_id, d1.document_name AS doc1, d2.document_name AS doc2 FROM legal_services.document... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "Show me all pairs of servers that are located in the same region, listing both server names and their region.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1_name, s2.server_name AS server2_name, s1.region FROM gaming_technol... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "Show me the IDs and content of all posts that have at least one comment containing the word 'update', along with the full names of the commenters.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.post_id, p.content, u.full_name\nFROM social_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me the trip_id, status, and passenger_count for all trips where the scheduled_departure and scheduled_arrival are on the same day, but the actual_arrival is later than the scheduled_arrival.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_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 web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "For each event, display its event_id, the event_id of the previous event in the same transaction (if any), and the log_index of both events.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT curr.event_id AS current_event_id,\n prev.event_id 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 legal_services.documents ( document_id text PRIMARY KEY, case_id text, document_name... | [
{
"role": "user",
"content": "Can you list all documents along with their upload timestamp and the lawyer ID who uploaded them, for documents of type 'Memorandum'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name, upload_timestamp, uploaded_by_lawyer_id FROM legal_ser... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "Give me the count of developers per country.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT country,\n COUNT(*) AS developer_count\nFROM gaming_technology.developers\nGROUP BY country;\n",
"sql": null
},
{
"role": "user",
"conte... |
You are an expert in writing database language. You can write a corresponding 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 UTXOs with amount greater than 100 and also include the address and transaction_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT utxo_id, address, transaction_id, amount\nFROM trading_platform.utxos\nWHERE amount > 100;",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_... | [
{
"role": "user",
"content": "Can you show me the total number of sessions and the average score for each server and each game combination?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_id, game_id, COUNT(*) AS total_sessions, AVG(score) AS average_score FROM gaming_techn... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.service_locations ( location_id text, agency_id text, location_n... | [
{
"role": "user",
"content": "List the latitude and longitude coordinates for all service locations located in a city named 'Seattle'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT latitude , longitude FROM government_services.service_locations WHERE city = 'Seattle'",
"sql... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha... | [
{
"role": "user",
"content": "Which document types have been used for more than 100 documents, and what is the total file size across all documents of each such type?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) AS document_count, SUM(file_size_bytes) AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Show me the full names and contact emails of citizens who have received notifications via 'SMS'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name, c.last_name, c.contact_email\nFROM government_services.citizens c\nJOIN government_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, ... | [
{
"role": "user",
"content": "I want to know for each player, what's the average time interval in days between their achievement unlocks? Only show player_ids with at least 2 unlocks.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, AVG(unlocked_at - LAG(unlocked_at) OVE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "Show each player's ID along with the name and quantity of every item they have in their inventory. Join the player inventory with item details.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.player_id, igi.item_name, pi.quantity FROM gaming_techno... |
You are an expert in writing database language. You can write a corresponding 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 varch... | [
{
"role": "user",
"content": "Show me the top 5 NFT collections with the highest token count, along with their names, symbols, and floor prices, but only include collections with a floor price greater than 0.5 ETH.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nc.name, nc.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 government_services.employees ( employee_id.text, agency_id.text, first_name.text, l... | [
{
"role": "user",
"content": "Show a list of departments with more than 5 employees. Include the department name and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS employee_count\nFROM government_services.employees\nGROUP BY department\nHAVING C... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the post_id, content, author's username, and the number of comments for each post where media_type is 'video'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.content, u.username, COUNT(c.comment_id) AS comment_count\nFROM social_... |
You are an expert in writing database language. You can write a corresponding 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.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te... | [
{
"role": "user",
"content": "How many beneficiaries are there for each relationship type in the policy_beneficiaries table?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT relationship, COUNT(*) AS beneficiary_count\nFROM insurance.policy_beneficiaries\nGROUP BY relationship;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "List all locations that serve as either an origin or a destination in any route, including the location name, city, number of routes starting there (origin_count), and number of routes ending there (destination_count).",
"sql": null
},
{
"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.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "List all wallets that were created during the hour of the day which saw the highest number of wallet creations. Show the wallet ID, user ID, address, and creation timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "WITH HourlyCounts AS (\n SELECT E... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers (
transfer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "For each sender address, count how many distinct tokens they have transferred. Show from_address and token_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT from_address, COUNT(DISTINCT token_id) AS token_count\nFROM web3.token_transfers\nGROUP B... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What are the specific job responsibilities and daily tasks for a staff member with the role of Station Master?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the specific job responsibilities or daily tasks f... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id t... | [
{
"role": "user",
"content": "Can you list all patients who switched their primary insurance plan, including the patient_id, old plan_id, new plan_id, and the date of the switch?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.patient_id,\n p1.plan_id AS old_plan_id,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "List all cases that have an invoice issued in July 2024, showing the case name, case number, invoice number, and issue date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.case_name, T1.case_number, T2.invoice_number, T2.issue_date FROM legal_serv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "Could you list all games, show their title and genre, and also include the total number of achievements for each game?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, g.genre, COUNT(a.achievement_id) AS total_achievements FROM gaming_technolo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show me a list of all appointments and the number of prescriptions that were issued on the same day for each appointment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.appointment_time::date AS appointment_date,\n COUNT(pr.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "List each employee's first and last name along with the count of active services offered by their agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS active_service_count\nFROM government_services.... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List all contracts along with the number of tokens deployed at each contract address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.contract_id, c.address AS contract_address, COUNT(t.token_id) AS token_count\nFROM web3.contracts c\nLEFT JOIN web3... |
You are an expert in writing database language. You can write 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": "我想查看所有检查记录中检查员的ID和检查结果,同时统计每个检查员的检查次数。",
"sql": null
},
{
"role": "assistant",
"content": "db.inspections.aggregate([\n {\n $group: {\n _id: '$inspector_employee_id',\n total_inspections: { $count: {} },\n results: { $push: '$result' }\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 government_services.notifications ( notification_id text PRIMARY KEY, citizen_id tex... | [
{
"role": "user",
"content": "For each notification, list its notification_id, message_subject, and the message_subject of the notification it relates to (assuming related_entity_type = 'notification').",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.notification_id,\n n.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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List pairs of verified citizens who share the same primary address city. Show the city, the full name of the first citizen, and the full name of the second citizen.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SPLIT_PART(c1.primary_address, ', ', 2... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reviews ( review_id character varying(64) NOT NULL, property_... | [
{
"role": "user",
"content": "What is the average overall rating for each property?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_id, AVG(rating_overall) AS avg_rating\nFROM hospitality_technology.reviews\nGROUP BY property_id;",
"sql": null
},
{
"role": "us... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Show all cities in the USA that have more than one distinct location type represented. List the city, country, and number of distinct location types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT city, country, COUNT(DISTINCT type) AS distinct_locat... |
You are an expert in writing database language. You can write a corresponding 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": "Please list all buses acquired after 2022-01-01 along with their depot name and city, sorted by acquisition date descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.license_plate, v.type, v.acquisition_date, l.name AS depot_nam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List the medication_name and manufacturer for all medications where the description is null or an empty string.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_name, manufacturer FROM healthcare.medications WHERE description IS NULL OR desc... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "For each game_id and region, show me the server that currently has the highest current_players and the server that has the highest max_players. Return game_id, region, top_current_server_id, top_current_players, top_capacity_server_id, and top_capacity.",
"sql": null
},
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\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
// Use Hashes for platform details. Key format: platform:<platform_id>
// HSET platform:plat_123 ... | [
{
"role": "user",
"content": "Can you help me retrieve the details of all schedules for a specific train with train_id 'train_789', including the route and stops information?",
"sql": null
},
{
"role": "assistant",
"content": "HGETALL train:train_789\nSMEMBERS schedule:sched_*:train:train_78... |
You are an expert in writing database language. You can write a corresponding 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": "List the policy number, premium amount, and the product name for each policy, but only for policies where the associated insurance product is active and has a base premium greater than 1200.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_num... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char... | [
{
"role": "user",
"content": "Show the top 5 transactions with the highest number of token transfers, along with their Ethereum value. Include transaction_id, token_transfer_count, and ether_value.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n tt.transaction_id,\n COUNT(tt.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 blockchain.transactions ( transaction_id text, block_id text, sender_address text, r... | [
{
"role": "user",
"content": "Show me each transaction with its ID, amount, timestamp, and the usernames of both sender and receiver.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.amount, t.timestamp, us.username AS sender_username, ur.username AS receiver_us... |
You are an expert in writing database language. You can write a corresponding 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": "List patient_id, first_name, last_name, and date_of_birth for all patients older than 65 years.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, first_name, last_name, date_of_birth\nFROM healthcare.patients\nWHERE date_of_birth < CURRENT_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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ... | [
{
"role": "user",
"content": "List all pairs of tokens on the same chain where one has positive net_flow and another has negative net_flow, showing their symbols and net_flows.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.chain,\n a.token_symbol AS token_pos,\n 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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"role": "user",
"content": "List all token symbols on the 'Ethereum' chain with a Realized Ratio greater than 0.9. Show the symbol and realized ratio.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, realized_ratio FROM smart_money_token_performance WHERE chain = 'E... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "Show me the top 5 NFT collections on Ethereum with the highest number of unique owners, along with their names and floor prices.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nc.name, nc.floor_price, COUNT(DISTINCT nh.wallet_address) AS unique_owner... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address character varying(100) NOT NULL, -- th... | [
{
"role": "user",
"content": "What is the average ROI for tokens with a realized ratio above 50% across all chains?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(roi) AS average_roi FROM smart_money_token_performance WHERE realized_ratio > 50;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "List the symbol, name, and total supply for all ERC20 tokens.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol, name, total_supply FROM token_metas WHERE is_erc20 = 1;",
"sql": null
},
{
"role": "user",
"content": "Include the de... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "I want to see all open cases, including the number of documents uploaded for each.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_id, c.case_number, c.case_name, COUNT(d.document_id) AS document_count\nFROM legal_services.cases c\nLEFT JOIN le... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the first name and last name of citizens along with the type and verification status of their documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.document_type, T2.verification_status FROM government_service... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "List all insurance products with their product name and base premium, where the product description contains the word 'accident'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_name, base_premium FROM insurance.insurance_products WHERE descri... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir... | [
{
"role": "user",
"content": "What is the minimum, maximum, and average commission rate among all agents?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT MIN(commission_rate) AS min_commission_rate, MAX(commission_rate) AS max_commission_rate, AVG(commission_rate) AS average_commi... |
You are an expert in writing database language. You can write a corresponding 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, -- uniqu... | [
{
"role": "user",
"content": "Show the record_id, patient_id, record_date and systolic blood pressure from vitals for all medical records where the systolic blood pressure is above 140.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT record_id, patient_id, record_date, (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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "Show me all tokens which have a 6-hour price change percentage above 2% and the current price, on the Arbitrum chain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, price, price_change_percentage_6h\nFROM token_dexpool_info\nWHERE chain... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "For properties located in the city 'Los Angeles', list all rooms that are on floor 3. Include the property name and room number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, r.room_number FROM hospitality_technology.properties p JO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.te... | [
{
"role": "user",
"content": "Show me all services grouped by category, including the minimum and maximum price in each category, and the total number of services.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT category, MIN(price) AS min_price, MAX(price) AS max_price, 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 gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "I want to list pairs of games published by the same publisher but on different platforms. Include both game titles, their platforms, and the publisher_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g1.publisher_id, g1.title AS title1, g1.platform... |
You are an expert in writing database language. You can write a corresponding 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": "How many users were registered in each month of 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT date_trunc('month', created_at) AS month, COUNT(*) AS user_count\nFROM social_media.users\nWHERE created_at >= '2024-01-01'\n AND created_at < '2025... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "Count the number of followers for each user and show those users who have more than 100 followers, ordering by follower_count descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT following_user_id AS user_id,\n COUNT(*) AS follower_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 gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name te... | [
{
"role": "user",
"content": "Which achievement has the highest point value for each game?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a1.game_id, a1.achievement_id, a1.name, a1.points FROM gaming_technology.achievements a1 WHERE a1.points = (SELECT MAX(a2.points) FROM gaming_... |
You are an expert in writing database language. You can write a corresponding 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": "List all service orders for spa services in the last month, including the guest ID and total price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT order_id, guest_id, total_price FROM hospitality_technology.service_orders WHERE service_id LIKE 'SPA%'... |
You are an expert in writing database language. You can write a corresponding 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.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_time... | [
{
"role": "user",
"content": "For each vehicle, can you show the vehicle_id, the number of unique fuel types it used, and the maximum quantity recorded in a single fuel log? Only include vehicles that have used more than one type of fuel.",
"sql": null
},
{
"role": "assistant",
"content": "S... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Find all patients who share the same home address with another patient; show the address and both patient IDs and names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.address,\n p1.patient_id,\n p1.first_name,\n p1.last_name,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.metadata ( metadata_id character varying(64) NOT NULL, asset_id cha... | [
{
"role": "user",
"content": "I need to retrieve asset IDs along with their category and website metadata values for assets that have both entries.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m_cat.asset_id,\n m_cat.value AS category,\n m_web.value AS website_url\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 transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ... | [
{
"role": "user",
"content": "Show me all trips along with the city name of their origin and the scheduled departure time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id, l.name AS origin_city, t.scheduled_departure\nFROM transportation.trips t\nJOIN transportation.loca... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty... | [
{
"role": "user",
"content": "Find claims where documents were uploaded by more than one distinct user. Show the claim_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id FROM insurance.claim_documents GROUP BY claim_id HAVING COUNT(DISTINCT uploaded_by) > 1;",
"sql":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.