system stringlengths 336 8.35k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "Can you find the contract that has emitted the most events, and show its contract ID along with the total number of events emitted?"
},
{
"role": "assistant",
"content": "SELECT contract_id, COUNT(*) AS total_events FROM web3.events GROUP BY contract_id ORDER BY tot... |
You are an expert in writing database language. You can write a corresponding 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": "For each server, what is the earliest and latest start time of its sessions?"
},
{
"role": "assistant",
"content": "SELECT server_id, MIN(start_time), MAX(start_time) FROM gaming_technology.game_sessions GROUP BY server_id;"
},
{
"role": "user",
"content... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "List the first and last names of all doctors whose email address ends with '@hospital.org'."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name FROM healthcare.doctors WHERE email LIKE '%@hospital.org';"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List the usernames and registration dates for all players from Germany ('DE') who are currently 'online'."
},
{
"role": "assistant",
"content": "SELECT username, registration_date FROM gaming_technology.players WHERE country_code = 'DE' AND status = 'online';"
},
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "For each guest, show their full name and the total quantity of services they have ordered in the last 30 days."
},
{
"role": "assistant",
"content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n SUM(so.quantity) AS total_quanti... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "How many players are there in each country?"
},
{
"role": "assistant",
"content": "SELECT country_code, COUNT(*) AS player_count\nFROM gaming_technology.players\nGROUP BY country_code;"
},
{
"role": "user",
"content": "Only include countries with more th... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "Show me a list of all policy numbers that have a deductible exactly equal to 0."
},
{
"role": "assistant",
"content": "SELECT policy_number\nFROM insurance.policies\nWHERE deductible = 0;"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "How many approval-for-all events have been recorded for each ERC1155 contract address?"
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS approval_count\nFROM erc1155_approval_for_all\nGROUP BY contract_address;"
},
{
"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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam... | [
{
"role": "user",
"content": "For each driver, show their driver_id, email, and the number of days until their license expires."
},
{
"role": "assistant",
"content": "SELECT driver_id, email, (license_expiry_date - CURRENT_DATE) AS days_until_expiry\nFROM transportation.drivers;"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "List all servers that are currently marked with a 'offline' status."
},
{
"role": "assistant",
"content": "SELECT server_id, server_name, region FROM gaming_technology.servers WHERE status = 'offline';"
},
{
"role": "user",
"content": "For those offline ... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, property_id text,... | [
{
"role": "user",
"content": "Show me all room types with 'King' in the bed_type field, along with their property IDs and base rates."
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, type_name, bed_type, base_rate FROM hospitality_technology.room_types WHERE bed_type LIKE... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "For each driver status, find the earliest and latest hire date. Show status, earliest hire date, and latest hire date."
},
{
"role": "assistant",
"content": "SELECT\n status,\n MIN(hire_date) AS earliest_hire_date,\n MAX(hire_date) AS latest_hire_date\nFROM trans... |
You are an expert in writing database language. You can write a corresponding 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": "List all claim documents where the description contains the word 'invoice'."
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, file_name, description FROM insurance.claim_documents WHERE description ILIKE '%invoice%';"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "For each token listed in token_dexpool_info, can you show the total net_flow and average ROI from smart_money_token_performance, along with the token's symbol and chain?"
},
{
"role": "assistant",
"content": "SELECT tdi.token_symbol, tdi.chain, SUM(sm.net_flow) AS 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 healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id charac... | [
{
"role": "user",
"content": "Show me all diagnoses that correspond to a medication based on matching the diagnosis_code with the medication's NDC code, and include diagnosis_id, patient_id, diagnosis_date, medication_name, and status."
},
{
"role": "assistant",
"content": "SELECT d.diagnosis_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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "Show me a list of all customers from California along with their full names and phone numbers."
},
{
"role": "assistant",
"content": "SELECT customer_id, first_name || ' ' || last_name AS full_name, phone_number FROM insurance.customers WHERE state = 'CA';"
},
{... |
You are an expert in writing database language. You can write 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 ticket details. Key format: ticket:<ticket_id>
// HSET ticket:tkt_1a2b ticket_i... | [
{
"role": "user",
"content": "特定の予約ID 'book_zyx' に関連するすべてのチケットの詳細を取得するのを手伝っていただけますか?また、関連する車両情報も含めてください。"
},
{
"role": "assistant",
"content": "SMEMBERS booking:book_zyx:tickets\nHGETALL ticket:<ticket_id>\nHGETALL car:<car_id>"
},
{
"role": "user",
"content": "チェックイン済みのチケットだけを表示するよう... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "How many games are available on each platform?"
},
{
"role": "assistant",
"content": "SELECT platform, COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY platform;"
},
{
"role": "user",
"content": "Exclude platforms with fewer than five games... |
You are an expert in writing database language. You can write a corresponding 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": "Get the total number of logs per user for July 2024."
},
{
"role": "assistant",
"content": "SELECT user_id,\n COUNT(*) AS log_count\nFROM trading_platform.logs\nWHERE logged_at BETWEEN '2024-07-01' AND '2024-07-31'\nGROUP BY user_id;"
},
{
"role": "use... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "Which countries have the highest number of developer companies founded after 2005? Please show country, the number of developers, and order by developer count descending."
},
{
"role": "assistant",
"content": "SELECT country, COUNT(*) AS developer_count\nFROM 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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "I want to get the number of servers and the average current players for each game, including the game title."
},
{
"role": "assistant",
"content": "SELECT g.title,\n COUNT(s.server_id) AS server_count,\n AVG(s.current_players) AS avg_current_players\nFRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "Show me all items and the total quantity held by players for each item."
},
{
"role": "assistant",
"content": "SELECT pi.item_id, SUM(pi.quantity) AS total_quantity\nFROM gaming_technology.player_inventory pi\nGROUP BY pi.item_id;"
},
{
"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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Show all law firms with more than one partner assigned. Display the law firm name and the number of partners."
},
{
"role": "assistant",
"content": "SELECT lf.firm_name, COUNT(l.lawyer_id) AS partner_count\nFROM legal_services.law_firms lf\nJOIN legal_services.lawye... |
You are an expert in writing database language. You can write a corresponding 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": "Find pairs of servers that are currently 'online' and share the same game_id, listing their server names and the shared game_id."
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1_name, s2.server_name AS server2_name, s1.game_id FROM gaming_tech... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Show me the list of all guests who have reservations along with the room number, room type name, and property name for each reservation."
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, r.room_number, rt.type_name AS room_type_name, p.propert... |
You are an expert in writing database language. You can write a corresponding 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": "Show the first name, last name, and position of all staff members who are not currently active."
},
{
"role": "assistant",
"content": "SELECT first_name , last_name , position FROM hospitality_technology.staff WHERE is_active = false"
}
] |
You are an expert in writing database language. You can write a corresponding 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'."
},
{
"role": "assistant",
"content": "SELECT latitude , longitude FROM government_services.service_locations WHERE city = 'Seattle'"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "List patient insurance details, including patient ID, policy number, and subscriber name, along with the corresponding plan name for each entry."
},
{
"role": "assistant",
"content": "SELECT T1.patient_id, T1.policy_number, T1.subscriber_name, T2.plan_name FROM heal... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, applicatio... | [
{
"role": "user",
"content": "For each payment method, show the total number of completed payments and the total amount paid."
},
{
"role": "assistant",
"content": "SELECT payment_method, COUNT(*) AS completed_count, SUM(amount) AS total_paid FROM government_services.payments WHERE status = 'Com... |
You are an expert in writing database language. You can write a corresponding 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 that have a status of 'pending'. Show the payment_id, policy_id, customer_id, and amount_paid."
},
{
"role": "assistant",
"content": "SELECT payment_id, policy_id, customer_id, amount_paid FROM insurance.premium_payments WHERE status = 'pen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "List all securities along with their latest close price and volume from the market data."
},
{
"role": "assistant",
"content": "SELECT m.security_id, s.security_name, m.close_price, m.volume\nFROM financial_services.market_data m\nJOIN (\n SELECT security_id, MAX(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 financial_services.loans ( loan_id text, account_id text, loan_type text, principal_... | [
{
"role": "user",
"content": "Show all loans with a maturity date in the next 60 days, along with their account_id, principal_amount, interest_rate, and maturity_date."
},
{
"role": "assistant",
"content": "SELECT loan_id, account_id, principal_amount, interest_rate, maturity_date FROM financial... |
You are an expert in writing database language. You can write a corresponding 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": "Which games have the highest average item cost for Legendary rarity items? Please show the game title, genre, and the average cost of those items."
},
{
"role": "assistant",
"content": "SELECT g.title, g.genre, AVG(igi.cost_amount) AS avg_legendary_cost\nFROM 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 social_media.hashtags (
hashtag_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all hashtags created after '2024-06-01', showing hashtag_id and tag_name."
},
{
"role": "assistant",
"content": "SELECT hashtag_id, tag_name\nFROM social_media.hashtags\nWHERE created_at > '2024-06-01';"
},
{
"role": "user",
"content": "Now also inc... |
You are an expert in writing database language. You can write a corresponding 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 text, property_id text, reservation_id te... | [
{
"role": "user",
"content": "Give me a breakdown of the number of reviews per day for the last 14 days, including the review_date and review count."
},
{
"role": "assistant",
"content": "SELECT DATE(review_date) AS review_day, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nWHERE... |
You are an expert in writing database language. You can write a corresponding 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.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List all guests who placed a service order with a total price greater than 200, including their first name, last name, and the order ID."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.order_id FROM hospitality_technology.guests AS T1 J... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List the number of trips and the average passenger count per vehicle."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, COUNT(t.trip_id) AS trip_count, AVG(t.passenger_count) AS avg_passenger_count\nFROM transportation.vehicles v\nLEFT JOIN transportation.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Please provide each follow relationship, including the follower's username, the followed user's username, and the follow creation timestamp."
},
{
"role": "assistant",
"content": "SELECT\n u1.username AS follower_username,\n u2.username AS following_username,\n 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 hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, emai... | [
{
"role": "user",
"content": "List all guests who have placed service orders for services in the 'Transportation' department, along with their full names and the service names."
},
{
"role": "assistant",
"content": "SELECT g.guest_id, g.first_name, g.last_name, s.service_name\nFROM hospitality_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Count the number of medications for each unique generic name. Show the generic name and the count."
},
{
"role": "assistant",
"content": "SELECT\n generic_name,\n COUNT(medication_id) AS medication_count\nFROM healthcare.medications\nWHERE\n generic_name IS NOT N... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts."
},
{
"role": "assistant",
"content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE status = 'expired' AND end_date >= CURRENT_DATE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Which customers have accounts with a balance over 500,000 USD? Please include the customer's first and last name along with the account number and current balance."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, a.account_number, a.balance 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 financial_services.transactions ( transaction_id text PRIMARY KEY, account_id text, ... | [
{
"role": "user",
"content": "I want to find pairs of transactions where one transaction’s related_account_id matches the other’s account_id, indicating reciprocal transfers between accounts."
},
{
"role": "assistant",
"content": "SELECT t1.transaction_id AS outgoing_txn, t2.transaction_id AS in... |
You are an expert in writing database language. You can write a corresponding 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": "Can you list the names of agencies that do not have a parent agency assigned, ordered by their established date?"
},
{
"role": "assistant",
"content": "SELECT agency_id, agency_name, established_date\nFROM government_services.agencies\nWHERE parent_agency_id IS NULL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List maintenance logs including vehicle make, model, service_date, cost, and next_service_due_date for vehicles that are currently 'Active'."
},
{
"role": "assistant",
"content": "SELECT ml.log_id,\n v.make,\n v.model,\n ml.service_date,\n ml... |
You are an expert in writing database language. You can write a corresponding 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_dexpool_info ( pair_address character varying(512) NOT NULL, token_name charac... | [
{
"role": "user",
"content": "Show me the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their price and 24-hour price change percentage."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, price_change_percentage_24h, volume_24h FROM token_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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash... | [
{
"role": "user",
"content": "For each player, show their player_id and the number of unique games they have played sessions on."
},
{
"role": "assistant",
"content": "SELECT player_id, COUNT(DISTINCT game_id) AS unique_games\nFROM gaming_technology.game_sessions\nGROUP BY player_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 insurance.claim_documents (
document_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Find the earliest uploaded document for each claim. Show the claim_id, document_id, file_name, and uploaded_at."
},
{
"role": "assistant",
"content": "SELECT cd.claim_id, cd.document_id, cd.file_name, cd.uploaded_at\nFROM insurance.claim_documents cd\nINNER JOIN (\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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List each player along with the number of achievements they have unlocked in game 'SuperQuest'."
},
{
"role": "assistant",
"content": "SELECT p.player_id,\n p.username,\n COUNT(pa.achievement_id) AS achievement_count\nFROM gaming_technology.player_achiev... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uuid(),... | [
{
"role": "user",
"content": "Provide for each game_id the count of hidden and visible achievements."
},
{
"role": "assistant",
"content": "SELECT game_id,\n SUM(CASE WHEN hidden THEN 1 ELSE 0 END) AS hidden_count,\n SUM(CASE WHEN hidden = false THEN 1 ELSE 0 END) AS visible_count\nF... |
You are an expert in writing database language. You can write a corresponding 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": "I need the count of messages each user has sent per conversation, along with the conversation's group_name when it's a group chat."
},
{
"role": "assistant",
"content": "SELECT m.sender_user_id,\n u.username,\n m.conversation_id,\n CASE WHEN c.is_g... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Calculate the total amount billed for each client, showing their first name, last name, and the total amount."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, SUM(i.total_amount) FROM legal_services.clients c JOIN legal_services.invoices i ON... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "How many lawyers are there per specialization?"
},
{
"role": "assistant",
"content": "SELECT specialization, COUNT(*) AS lawyer_count\nFROM legal_services.lawyers\nGROUP BY specialization;"
},
{
"role": "user",
"content": "Please exclude specializations ... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the number of fuel logs per location, including the location name and city."
},
{
"role": "assistant",
"content": "SELECT fl.location_id, loc.name AS location_name, loc.city, COUNT(*) AS fuel_log_count\nFROM transportation.fuel_logs fl\nJOIN transportation.l... |
You are an expert in writing database language. You can write a corresponding 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 user IDs with approved KYC status and the addresses of their wallets."
},
{
"role": "assistant",
"content": "SELECT DISTINCT w.user_id, w.address FROM trading_platform.wallets w JOIN trading_platform.kyc_audit k ON w.user_id = k.user_id WHERE k.status = 'approv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the tok... | [
{
"role": "user",
"content": "Which narrative had the highest total USD token inflow during Q1 of 2024, and which chain did these inflows primarily occur on?"
},
{
"role": "assistant",
"content": "SELECT narrative, chain, SUM(usd_value) AS total_inflow FROM smart_money_token_inflow WHERE type = ... |
You are an expert in writing database language. You can write a corresponding 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.comments ( comment_id text, post_id text, user_id text, parent_comment_... | [
{
"role": "user",
"content": "List pairs of group conversations that were created on the same calendar day, showing their IDs and creation times."
},
{
"role": "assistant",
"content": "SELECT T1.conversation_id AS convo1_id, T1.created_at AS convo1_created_at, T2.conversation_id AS convo2_id, T2... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w... | [
{
"role": "user",
"content": "List all billable but unbilled time entries including entry_id, lawyer_id, case_id, date_worked, hours_spent, and billing_rate."
},
{
"role": "assistant",
"content": "SELECT entry_id, lawyer_id, case_id, date_worked, hours_spent, billing_rate\nFROM legal_services.ti... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "Find appointments and prescriptions associated with the same patient and doctor. Show the appointment ID, prescription ID, patient ID, and doctor ID."
},
{
"role": "assistant",
"content": "SELECT T1.appointment_id , T2.prescription_id , T1.patient_id , T1.doctor_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.loans ( loan_id text, account_id text, loan_type text, principal_... | [
{
"role": "user",
"content": "What is the average interest rate for auto loans (loan_type = 'Auto') with a principal amount between $20,000 and $50,000?"
},
{
"role": "assistant",
"content": "SELECT AVG(interest_rate) AS avg_interest_rate FROM financial_services.loans WHERE loan_type = 'Auto' AN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, docum... | [
{
"role": "user",
"content": "Show me all documents along with the document name and type, together with both the upload_timestamp and the lawyer ID who uploaded them."
},
{
"role": "assistant",
"content": "SELECT document_id, document_name, document_type, upload_timestamp, uploaded_by_lawyer_id... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam... | [
{
"role": "user",
"content": "List all maintenance logs for vehicles that had 'Oil Change' service in the last 3 months, showing vehicle ID, service date, and cost."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE service_typ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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."
},
{
"role": "assistant",
"content": "SELECT DISTINCT v.vehicle_id, v.license_plate, l.name AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Can you give me all locations in Los Angeles?"
},
{
"role": "assistant",
"content": "SELECT location_id, name, type, address_line1, city, state_province, postal_code, country, latitude, longitude, timezone\nFROM transportation.locations\nWHERE city = 'Los Angeles';"... |
You are an expert in writing database language. You can write a corresponding 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 all ERC1155 NFT contracts and the total number of wallet addresses that currently hold at least one NFT from each contract."
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(DISTINCT wallet_address) as holder_count FROM nft_holders WHERE ... |
You are an expert in writing database language. You can write a corresponding 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": "Which customers have policies that expired in the last month? Please show the customer ID, policy number, and expiration date."
},
{
"role": "assistant",
"content": "SELECT c.customer_id, p.policy_number, p.end_date\nFROM insurance.customers c\nJOIN insurance.polici... |
You are an expert in writing database language. You can write a corresponding 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 text, application_id text, citizen_id te... | [
{
"role": "user",
"content": "For each employee who has verified documents, show their full name and the total number of documents they have verified with a status of 'Verified'."
},
{
"role": "assistant",
"content": "SELECT e.full_name, COUNT(d.document_id) FROM government_services.documents 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 trading_platform.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, p... | [
{
"role": "user",
"content": "Show me the top 5 users who have the highest total trade volume (quantity * price) as buyers, along with their wallet addresses and the number of distinct assets they traded."
},
{
"role": "assistant",
"content": "SELECT t.buyer_id, w.address, COUNT(DISTINCT t.asset... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Show me the full name of every lawyer, their specialization, and the number of cases they are the lead lawyer for."
},
{
"role": "assistant",
"content": "SELECT CONCAT(l.first_name, ' ', l.last_name) AS lawyer_name, l.specialization, COUNT(c.case_id) AS lead_case_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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "Which services have 'Eligibility' mentioned in their eligibility_criteria field?"
},
{
"role": "assistant",
"content": "SELECT service_name, eligibility_criteria\nFROM government_services.services\nWHERE eligibility_criteria ILIKE '%Eligibility%';"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "Calculate the average age of customers grouped by risk_profile."
},
{
"role": "assistant",
"content": "SELECT risk_profile, AVG(EXTRACT(YEAR FROM AGE(current_date, date_of_birth)))::numeric(5,2) AS average_age, COUNT(*) AS customer_count\nFROM financial_services.cus... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha... | [
{
"role": "user",
"content": "List all claim IDs that have both an 'Accident Report' and a 'Damage Assessment' document type."
},
{
"role": "assistant",
"content": "SELECT claim_id\nFROM insurance.claim_documents\nWHERE document_type IN ('Accident Report', 'Damage Assessment')\nGROUP BY claim_id... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi... | [
{
"role": "user",
"content": "Show me the daily number of notifications sent in March 2024."
},
{
"role": "assistant",
"content": "SELECT DATE(sent_at) AS date, COUNT(*) AS notification_count\nFROM government_services.notifications\nWHERE sent_at >= '2024-03-01' AND sent_at < '2024-04-01'\nGROUP... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Show me the first_name, last_name, and firm_id of all lawyers whose email domain is 'legalfirm.com'."
},
{
"role": "assistant",
"content": "SELECT first_name,\n last_name,\n firm_id\nFROM legal_services.lawyers\nWHERE SPLIT_PART(email, '@', 2) = 'legalfi... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2