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 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, COUNT(DISTINCT game_id) AS unique_games\nFROM gaming_technology.game_sessions\nGROUP BY playe... |
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": "Count the number of events for each hour of the day based on the emitted_at timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(HOUR FROM emitted_at) AS event_hour, COUNT(*) AS event_count FROM web3.events GROUP BY event_hour ORDER BY 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.users (
user_id character varying(64) NOT NULL, -- unique identifier for t... | [
{
"role": "user",
"content": "Count the number of users for each email domain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT split_part(email, '@', 2) AS domain, COUNT(*) AS user_count\nFROM web3.users\nGROUP BY domain;",
"sql": null
},
{
"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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "How many clients are registered with an active status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM legal_services.clients WHERE status = 'active';",
"sql": null
},
{
"role": "user",
"content": "Could you also tell me ... |
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(), title cha... | [
{
"role": "user",
"content": "Show the first 5 games released before 2015, displaying game_id and title.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT game_id, title\nFROM gaming_technology.games\nWHERE release_date < '2015-01-01'\nLIMIT 5;",
"sql": null
},
{
"role":... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversation_participants ( participant_id text, conversation_id text, ... | [
{
"role": "user",
"content": "How many participants are there in each conversation? Return conversation_id and participant_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT conversation_id,\n COUNT(*) AS participant_count\nFROM social_media.conversation_participants\nGR... |
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 PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "Could you provide a list of each diagnosis, the full name of the doctor who made it, and the name of the insurance plan whose contact phone number matches the doctor's phone number? Please include diagnosis_id, description, doctor full name, and insurance plan name.",
"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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "List all pairs of law firms founded in the same year, showing the two firm names and the shared year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.firm_name AS firm1, f2.firm_name AS firm2, EXTRACT(YEAR FROM f1.founded_date) AS year FROM law_fir... |
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": "List all fundraising rounds where the average investment amount exceeded $10M, and show how many projects participated in each round.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rounds_name, COUNT(DISTINCT project_id) AS project_count, AVG(investm... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Find the total balance per coin_type for active SUI coins, including coin_type, symbol, name, and SUM(balance) as total_balance. Sort by total_balance descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c.coin_type,\n m.symbol,\n m.name,\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "Show all users who follow both user 'U100' and user 'U101'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.follower_user_id\nFROM social_media.follows f1\nJOIN social_media.follows f2 ON f1.follower_user_id = f2.follower_user_id\nWHERE f1.followin... |
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 PRIMARY KEY, property_id text, ser... | [
{
"role": "user",
"content": "Which available services in the 'Wellness' category are offered by each property? Please show property_id, service_name, and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_id, service_name, price FROM hospitality_technology.services W... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.service_orders ( order_id.text, reservation_id.text, guest_id... | [
{
"role": "user",
"content": "List each guest and the number of distinct services they have ordered, along with their guest_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id, COUNT(DISTINCT service_id) AS distinct_services_ordered\nFROM hospitality_technology.service_or... |
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.text, patient_id.text, appointment_id.text, d... | [
{
"role": "user",
"content": "For each patient, find the date of their most recent medical record and the effective date of their current primary insurance plan. Return patient_id, last_record_date, and effective_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.patient_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.services ( service_id text, agency_id text, service_name text, d... | [
{
"role": "user",
"content": "For each agency, how many services are currently inactive? Return the agency_id and the count of inactive services.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n agency_id,\n COUNT(*) AS inactive_service_count\nFROM government_services.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 healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ... | [
{
"role": "user",
"content": "Show me all insurance plans that have the word 'Managed' in their plan_name, including the plan_id, plan_name, and insurance_provider.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT plan_id, plan_name, insurance_provider\nFROM healthcare.insurance_pl... |
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": "Get the total transfer volume and number of transfers for each Avalanche token tick over the past 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.tick,\n SUM(a.amt) AS total_volume,\n COUNT(*) AS transfer_count\nFROM token_activi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "List each user and their total number of followers, including username, ordered by follower count descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COUNT(f.follower_user_id) AS follower_count FROM social_media.users u ... |
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 character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "Show all documents uploaded in 2024 along with the citizen's full name and the reference number of the associated application.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_id, d.upload_timestamp, c.first_name || ' ' || c.last_name AS cit... |
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": "Count the number of group conversations created after '2024-05-01'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = true AND created_at > '2024-05-01'",
"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.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'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id,\n p.username,\n COUNT(pa.achievement_id) AS achievement_count\nFROM 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 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'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, registration_date FROM gaming_technology.players WHERE country_code = 'DE' AND status =... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid NOT NULL DEFAULT gen_random_uuid(),... | [
{
"role": "user",
"content": "For each server, show its name and the total number of achievements available for the game it hosts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.server_name, s.region, COUNT(a.achievement_id) AS achievement_count\nFROM gaming_technology.servers ... |
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": "I need to see claims where the incident date is in 2023. Show the claim ID, incident date, and customer ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id, incident_date, customer_id FROM insurance.claims WHERE incident_date >= '2023-01-01' ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "Show me projects that raised funds in 2022 and have a corresponding token held by CEXes on the 'Ethereum' chain. Display the project name, fundraising round name, investment value, the associated token symbol, and the total USD value of that token held by CEXes on Ethereum.",
... |
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.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "List all passengers born before 1990 with their first and last names and email addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM transportation.passengers WHERE date_of_birth < '1990-01-01';",
"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_basic_info ( coin_id text, token_name text, token_symbol text, token_address t... | [
{
"role": "user",
"content": "List tokens that have a price increase of more than 10% in the last 24 hours and belong to a narrative with a trend rank of 10 or better. For these tokens, show their symbol, chain, 24h price change, the narrative, and the narrative's trend rank.",
"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 social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_us... | [
{
"role": "user",
"content": "Show me all messages sent after July 1, 2024, including the sender_user_id, content, and sent_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT message_id, sender_user_id, content, sent_at\nFROM social_media.messages\nWHERE sent_at > '2024-07-01';",... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.users ( user_id text PRIMARY KEY, username text, email text, password_hash text... | [
{
"role": "user",
"content": "List all users whose usernames start with 'alice' and show their creation dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, created_at FROM web3.users WHERE username LIKE 'alice%';",
"sql": null
},
{
"role": "user",
"con... |
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.reservations ( reservation_id.text, property_id.text, guest_i... | [
{
"role": "user",
"content": "Show me each guest's reservation count and average stay length in days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id,\n COUNT(*) AS reservation_count,\n AVG(check_out_date - check_in_date) AS avg_stay_days\nFROM hospitality_tec... |
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 ERC20 tokens (from token_metas) that have 'Governance' in their name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, symbol, name FROM token_metas WHERE is_erc20 = 1 AND name ILIKE '%Governance%';",
"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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "Provide each trip's ID, vehicle license plate, driver's full name, origin city, and destination city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id,\n v.license_plate,\n CONCAT(d.first_name, ' ', d.last_name) AS driver_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.wallets ( wallet_id character varying(64) NOT NULL, user_id charact... | [
{
"role": "user",
"content": "Show me, for each wallet address, the total sum of amounts for all unspent UTXOs, along with the user ID who owns the wallet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w.address, w.user_id, COALESCE(SUM(u.amount), 0) AS total_unspent_amount\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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "How many 'ApprovalForAll' events are recorded for each ERC1155 contract address in the `erc1155_approval_for_all` table?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_for_all GROUP B... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "List all wallet addresses holding NFT contract '0xbbbb...' and token ID '99'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT wallet_address, amount\nFROM nft_holders\nWHERE contract_address = '0xbbbb...'\n AND token_id = '99';",
"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 legal_services.clients ( client_id.text, first_name.text, last_name.text, company_na... | [
{
"role": "user",
"content": "Show all cases with their case number and name, along with the number of documents uploaded for each case.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number, c.case_name, COUNT(d.document_id) AS document_count\nFROM legal_services.cases 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 healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ... | [
{
"role": "user",
"content": "Show me a list of all doctors and the names of patients who have had an appointment with them, including doctor ID, doctor full name, patient full name, and appointment time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.doctor_id, d.first_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.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Show me the first name, last name, and email address for all passengers who are part of the loyalty program with ID 'Gold'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name , last_name , email FROM transportation.passengers WHERE loyalty_p... |
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.time_entries ( entry_id.text, case_id.text, lawyer_id.text, date_work... | [
{
"role": "user",
"content": "How many billable hours has each lawyer logged in July 2024? Return the lawyer_id and the total billable hours, only including entries that have been billed, sorted by total hours descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT 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 insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, cu... | [
{
"role": "user",
"content": "List all beneficiaries added in the last 6 months with a percentage share greater than 25%. Include their beneficiary ID, policy ID, customer ID, first name, last name, relationship, and percentage share. Order the results by the date they were added, oldest first.",
"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.agents ( agent_id character varying(64) NOT NULL, first_name character var... | [
{
"role": "user",
"content": "List all agents whose commission rate is higher than their manager's commission rate, including the agent's full name, their commission rate, the manager's full name, and the manager's commission rate.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT 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 web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char... | [
{
"role": "user",
"content": "Find the top 5 transactions with the highest gas prices that were successful, including the from_address, to_address, and block_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT from_address, to_address, block_number, gas_price FROM web3.transac... |
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": "I’d like to get the count of notifications each user received for their own posts in the last 30 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COUNT(n.notification_id) AS notification_count\nFROM social_media.notificatio... |
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, property_id c... | [
{
"role": "user",
"content": "List the names and prices of all services available in the 'Food & Beverage' department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_name, price\nFROM hospitality_technology.services\nWHERE department = 'Food & Beverage' AND is_available =... |
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": "How many unique medications have ever been prescribed to each patient? Show patient_id and medication_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, COUNT(DISTINCT medication_id) AS medication_count\nFROM healthcare.prescriptions\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.medications ( medication_id text PRIMARY KEY, medication_name text, gener... | [
{
"role": "user",
"content": "Retrieve all pairs of medications that share the same generic_name but have different NDC codes. Show the first medication's ID, name, the second medication's ID, name, and the shared generic_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m1.me... |
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, license_plate c... | [
{
"role": "user",
"content": "List all trips including the name of the origin location and the name of the destination location.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id, origin.name AS origin_location_name, destination.name AS destination_location_name FROM 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.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "Give me the count of policies grouped by their status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS policy_count\nFROM insurance.policies\nGROUP BY status;",
"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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "List all insurance plans and the doctors whose hospital affiliation ID matches the plan ID. Include plan_name, insurance_provider, doctor first_name, and last_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, ip.insurance_provider, 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 healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"role": "user",
"content": "Show prescription_id, medication_name, and dosage for all prescriptions where the medication manufacturer is 'Pfizer'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.prescription_id, m.medication_name, p.dosage\nFROM healthcare.prescriptions p\nJOI... |
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_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, ... | [
{
"role": "user",
"content": "List all players who acquired any items in the last 30 days. Show their username, the item name, and the exact date and time of acquisition.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, T3.item_name, T2.acquired_at FROM players AS T1 I... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions (
session_id uuid NOT NULL DEFAULT gen_random_uu... | [
{
"role": "user",
"content": "Can you show me the total score and number of sessions for each player and each game they played?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, game_id, COUNT(session_id) AS session_count, SUM(score) AS total_score\nFROM gaming_technology... |
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": "Count how many users have not specified a value for their bio.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.users WHERE bio IS NULL OR bio = '';",
"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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "Which projects raised funds in January 2022?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, rounds_name, investment_value, investment_date FROM project_fundraising_record WHERE investment_date >= '2022-01-01' AND investment_date < '2022... |
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": "I need to find the average maintenance cost per service type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_type, AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nGROUP BY service_type;",
"sql": null
},
{
"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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex... | [
{
"role": "user",
"content": "Show the agent_id and the total number of policies managed by each agent, but only include agents with at least 5 policies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agent_id, COUNT(*) AS policy_count FROM insurance.policies GROUP BY agent_id HA... |
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.wallets ( wallet_id character varying(64) NOT NULL, user_id character var... | [
{
"role": "user",
"content": "I want to find all pairs of wallets that belong to the same user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet1, w2.wallet_id AS wallet2, w1.user_id\nFROM blockchain.wallets w1\nJOIN blockchain.wallets w2\n ON w1.user_id = w... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "For each property in the 'USA' country, list the property name and the total count of services that cost more than 50.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.property_name, COUNT(T2.service_id) FROM hospitality_technology.properties AS T1 ... |
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": "List all invoices with a total amount between 1000 and 2000, including the invoice number, total amount, and the associated client's email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, i.total_amount, c.email\nFROM legal_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 legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case... | [
{
"role": "user",
"content": "Calculate the average total amount for invoices issued in each calendar year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM issue_date) AS issue_year, AVG(total_amount) AS average_total_amount FROM legal_services.invoices GROUP BY ... |
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 ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest 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 government_services.employees ( employee_id text, agency_id text, first_name text, l... | [
{
"role": "user",
"content": "Show me the first name, last name, and job title of employees along with the first name and last name of their managers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, e.job_titl... |
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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.sender_user_id,\n u.username,\n m.conversation_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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Show me the count of available services and average price for each department across all properties.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS service_count, AVG(price) AS avg_price\nFROM hospitality_technology.services\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 hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, pro... | [
{
"role": "user",
"content": "Show me all reservations with more than 2 adults that are confirmed (status = 'Confirmed'), including their check-in dates and total amounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, r.property_id, r.guest_id, r.check_in_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 government_services.documents ( document_id text, application_id text, citizen_id te... | [
{
"role": "user",
"content": "List the full names of citizens who have uploaded documents with a verification status of 'Pending' and the type of document they uploaded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.document_type FROM government_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "Show me all ERC1155 NFTs on Ethereum with their contract address, token_id, and the total amount held by all current holders.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nh.contract_address, nh.token_id, SUM(CAST(nh.amount AS NUMERIC)) AS total_am... |
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": "Retrieve each vehicle's make and model along with the date and description of its latest maintenance service.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id,\n v.make,\n v.model,\n m.service_date,\n m.description\... |
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 all pairs of servers in the same region hosting different games. Show the server names as server1 and server2 and their respective game_ids.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1, s1.game_id AS game1, s2.server... |
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 is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the detailed repair history of equipment u... |
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, -- unique identifier... | [
{
"role": "user",
"content": "Show the number of claims filed for each distinct status, ordered by the count in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS claim_count\nFROM insurance.claims\nGROUP BY status\nORDER BY claim_count 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Get the number of distinct wallet holders and total amount held for each NFT collection on Ethereum. Include collection name and contract_address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nc.contract_address, nc.name, COUNT(DISTINCT nh.wallet_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 financial_services.customers ( customer_id character varying(64) NOT NULL, first_nam... | [
{
"role": "user",
"content": "Show me all accounts along with their associated customers' full names and the account status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.account_id, a.account_number, a.account_type, a.status, c.first_name || ' ' || c.last_name AS customer_ful... |
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 pairs of token transfers within the same transaction and for the same token, where the value of one transfer is exactly twice the value of the other. Show the transaction ID, token ID, and both transfer IDs and their values.",
"sql": null
},
{
"role": "assistan... |
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": "Find customers who have accounts in more than one currency. List their customer_id and the count of distinct currencies they hold accounts in.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, COUNT(DISTINCT currency) AS distinct_currency_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 web3.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address t... | [
{
"role": "user",
"content": "List all transactions that have a value less than 0.1 Ether, returning the transaction_id, from_address, to_address, value, and block_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, from_address, to_address, value, block_number... |
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.",
"sql": null
},
{
"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 finan... |
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": "List the full name and firm name for all lawyers who are not partners.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.firm_name FROM legal_services.lawyers AS T1 JOIN legal_services.law_firms AS T2 ON T1.firm_id = T2.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.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"role": "user",
"content": "List all rooms with their latest review comment and the date of that review, showing the room number and property id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_number, r.property_id, rv.comment, rv.review_date\nFROM hospitality_technology... |
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(), usern... | [
{
"role": "user",
"content": "For each player, show the player_id and the count of inventory items they acquired with a quantity greater than 1.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, COUNT(inventory_id) AS items_qty_gt_1_count FROM gaming_technology.player_inv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Use Hashes. Key pattern: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_numbe... | [
{
"role": "user",
"content": "Can you help me retrieve the list of components made of a specific material along with their supplier details?",
"sql": null
},
{
"role": "assistant",
"content": "SMEMBERS material_components:mat:TI64\nHGETALL component:<component_id>\nHGET component:<component_... |
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": "Which chain has the highest average ROI among all tokens in smart_money_token_performance? Show the chain and the average ROI.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, AVG(roi) AS avg_roi\nFROM smart_money_token_performance\nGROUP BY cha... |
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": "List all Sui NFTs with 'exists' status from the 'Gaming' collection type. Show the object_id, name, and owner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT object_id, name, owner FROM sui_nfts WHERE status = 'exists' AND collection_type = '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.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List all room numbers with their room type name and property name for rooms that have a Jacuzzi feature.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_number, rt.type_name, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitalit... |
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.market_data ( data_point_id bigserial NOT NULL, security_id chara... | [
{
"role": "user",
"content": "How many market data points are there per day?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT date(md.data_timestamp) AS day, COUNT(*) AS data_point_count\nFROM financial_services.market_data md\nGROUP BY date(md.data_timestamp)\nORDER BY day;",
... |
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": "List all drivers hired after January 1, 2021, with their driver_id, full name, and hire_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name || ' ' || last_name AS full_name, hire_date FROM transportation.drivers WHERE hire_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 web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List the username and email of users whose first wallet creation date is the same day as their user registration date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, u.email FROM web3.users u JOIN (SELECT user_id, MIN(created_at) as first... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id.text, first_name.text, last_name.text, company_na... | [
{
"role": "user",
"content": "Show me the full name and email of each client along with the subject and location of all appointments they have, and include the name of the lawyer for each appointment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name || ' ' || c.last_na... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case... | [
{
"role": "user",
"content": "List all invoices where the amount paid is less than the total amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_number, client_id, total_amount, amount_paid, status FROM legal_services.invoices WHERE amount_paid < total_amount",
"sq... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "Count how many tokens exist for each contract_address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address,\n COUNT(*) AS token_count\nFROM web3.tokens\nGROUP BY contract_address;",
"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 gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country tex... | [
{
"role": "user",
"content": "Show me all players who have acquired items from games that have running servers in the 'ap-northeast-1' region, and the item names they acquired.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT pi.player_id, igi.item_name \nFROM 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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "What is the total USD value of tokens held by CEXes for tokens belonging to the 'DeFi' narrative on the 'Ethereum' chain? Show the narrative, chain, and total value.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T2.narrative, T1.chain, SUM(T1.usd_va... |
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.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,... | [
{
"role": "user",
"content": "List group conversation names and the count of messages sent in each conversation after '2024-06-01'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.group_name, COUNT(T2.message_id) FROM social_media.conversations AS T1 JOIN social_media.messages ... |
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": "Show properties and the names of their room types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.property_name , T2.type_name FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_types AS T2 ON T1.property_id = T2.prop... |
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": "List the user IDs and the date they joined their most recent conversation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, MAX(joined_at) AS most_recent_joined_at\nFROM social_media.conversation_participants\nGROUP BY user_id;",
"sql": nu... |
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": "Show me all non-smoking rooms on the first floor, including their room number and the property name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_number, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.prope... |
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 me properties that are listed as type 'Hotel' and are located in 'Canada'. List the property name, city, and postal code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_name, city, postal_code FROM hospitality_technology.properties WHER... |
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": "List all players who have unlocked achievements in the last 7 days, showing their username and the number of achievements unlocked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, COUNT(pa.achievement_id) AS unlocked_count\nFROM gaming_tec... |
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": "List all pairs of games developed by the same developer, returning developer_id, title of the first game, and title of the second game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g1.developer_id, g1.title AS game1, g2.title AS game2\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 government_services.applications ( application_id text, citizen_id text, service_id ... | [
{
"role": "user",
"content": "For each application, show the application ID, the full name of the assigned employee, and the number of payments made for that application.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.application_id, CONCAT(e.first_name, ' ', e.last_name) AS em... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.