system stringlengths 315 8.44k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty... | [
{
"role": "user",
"content": "Find claims where documents were uploaded by more than one distinct user. Show the claim_id."
},
{
"role": "assistant",
"content": "SELECT claim_id FROM insurance.claim_documents GROUP BY claim_id HAVING COUNT(DISTINCT uploaded_by) > 1;"
},
{
"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.appointments ( appointment_id text, client_id text, lawyer_id text, c... | [
{
"role": "user",
"content": "How many appointments have been scheduled on weekends?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS weekend_appointments\nFROM legal_services.appointments\nWHERE EXTRACT(DOW FROM start_time) IN (0,6);"
}
] |
You are an expert in writing database language. You can write a corresponding 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, account_id.text, related_acco... | [
{
"role": "user",
"content": "For each day in the past month, can you show the combined total transaction amount and the total volume traded from market data?"
},
{
"role": "assistant",
"content": "SELECT t.effective_date, SUM(t.amount) AS total_transaction_amount, SUM(md.volume) AS total_traded... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Retrieve the document_id, document_type, citizen full name, and verification_status for all documents that have no expiry date set."
},
{
"role": "assistant",
"content": "SELECT d.document_id,\n d.document_type,\n c.first_name || ' ' || c.last_name AS fu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// db.createCollection('platforms')
// Optional: db.platforms.createIndex({ platform_id: 1 }, { u... | [
{
"role": "user",
"content": "Can you help me get the total number of operational platforms across all stations?"
},
{
"role": "assistant",
"content": "db.platforms.countDocuments({ status: 'Operational' });"
}
] |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, route_number charac... | [
{
"role": "user",
"content": "Please provide a list of all trips along with their route details, including the route_number, origin city, and destination city, ordered by scheduled_departure."
},
{
"role": "assistant",
"content": "SELECT t.trip_id,\n t.vehicle_id,\n t.driver_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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "List each appointment with appointment ID, appointment time, doctor's last name, and the patient's primary insurance plan name."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id,\n a.appointment_time,\n d.last_name AS doctor_last_name,\n ... |
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 reason for the termination of employee with ID 'EMP789'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the reason for an employee's termination as it is not stored in the current database table."
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "For narratives listed in `narrative_info`, find the total USD value held by CEXes for tokens that are among their top 3 listed coins. Show the narrative and the total CEX USD value."
},
{
"role": "assistant",
"content": "SELECT T2.narrative, SUM(T1.usd_value) AS 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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "List all job titles of employees who work in the 'Finance' department."
},
{
"role": "assistant",
"content": "SELECT DISTINCT job_title\nFROM government_services.employees\nWHERE department = 'Finance';"
}
] |
You are an expert in writing database language. You can write a corresponding 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 the first name, last name, and email of customers who have filed a claim, along with the status and estimated loss of each claim."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.email, T2.status, T2.estimated_loss FROM insurance.cu... |
You are an expert in writing database language. You can write a corresponding 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": "List each player's ID, username, and the count of items of type 'Consumable' in their inventory. Only include players who have any consumable items."
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, COUNT(pi.item_id) AS consumable_count\nFROM ga... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversation_participants ( participant_id.text, conversation_id.text, ... | [
{
"role": "user",
"content": "Which users participated in more than one conversation? Show their user_id and participant_id for each conversation, along with the joined_at time."
},
{
"role": "assistant",
"content": "SELECT user_id, participant_id, conversation_id, joined_at FROM social_media.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 insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha... | [
{
"role": "user",
"content": "Which document types have been used for more than 100 documents, and what is the total file size across all documents of each such type?"
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) AS document_count, SUM(file_size_bytes) AS total_file_size_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the names of service locations and the names of the agencies they belong to, specifically for locations situated in the state of 'Texas' that are marked as accessible."
},
{
"role": "assistant",
"content": "SELECT t1.location_name, t2.agency_name FROM governmen... |
You are an expert in writing database language. You can write a corresponding 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": "For each claim, retrieve the earliest uploaded document and the latest uploaded document filenames. Return claim_id, earliest_file_name, latest_file_name."
},
{
"role": "assistant",
"content": "SELECT e.claim_id,\n e.file_name AS earliest_file_name,\n 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 healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List patient pairs where the same patient has two distinct insurance plans. Show patient_id, the earlier plan_id as old_plan, the later plan_id as new_plan, and their effective dates."
},
{
"role": "assistant",
"content": "SELECT pi1.patient_id,\n pi1.plan_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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "List patient ID, first name, last name, policy number, and plan name for all patient insurance policies that are not primary and expire after the year 2025."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, pi.policy_number, ip.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 social_media.post_hashtags (
post_hashtag_id character varying(64) NOT NULL, -- ... | [
{
"role": "user",
"content": "Show me all conversation IDs (whether group chat or not) that have at least one hashtag used in posts linked to them."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.conversation_id\nFROM social_media.conversations c\nJOIN social_media.post_hashtags ph ON c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.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."
},
{
"role": "assistant",
"content": "SELECT message_id, sender_user_id, content, sent_at\nFROM social_media.messages\nWHERE sent_at > '2024-07-01';"
},
{
"rol... |
You are an expert in writing database language. You can write a corresponding 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, route_number text, description text, origin_l... | [
{
"role": "user",
"content": "Find pairs of distinct routes that share the same destination location but start from different origins. Include the route ID and route number for both routes and the shared destination location ID."
},
{
"role": "assistant",
"content": "SELECT\n r1.route_id AS rou... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id text, user_id text, content text, media_url text, media... | [
{
"role": "user",
"content": "Show the count of posts for each distinct media type."
},
{
"role": "assistant",
"content": "SELECT media_type, COUNT(*) FROM social_media.posts GROUP BY media_type;"
},
{
"role": "user",
"content": "Only include posts created after June 1, 2024."
},
... |
You are an expert in writing database language. You can write a corresponding 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, tag_name characte... | [
{
"role": "user",
"content": "I need all pairs of hashtags that start with the same first two letters. Show both tag names."
},
{
"role": "assistant",
"content": "SELECT h1.tag_name AS tag1, h2.tag_name AS tag2\nFROM social_media.hashtags h1\nJOIN social_media.hashtags h2\n ON LEFT(h1.tag_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 smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "How many addresses on the Polygon chain have an ROI above 5?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS address_count FROM smart_money_profit WHERE chain = 'Polygon' AND roi > 5;"
},
{
"role": "user",
"content": "Also show the average prof... |
You are an expert in writing database language. You can write a corresponding 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": "Give me a breakdown of the total number of reviews for each review source."
},
{
"role": "assistant",
"content": "SELECT review_source, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY review_source;"
},
{
"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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "Show me the policy number, claim ID, document file name, and document type for all policies that have associated claim documents."
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T2.claim_id, T3.file_name, T3.document_type FROM insurance.policies 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 financial_services.securities ( security_id character varying(64) NOT NULL, ticker_s... | [
{
"role": "user",
"content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector, along with their last_updated timestamp."
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, securi... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "List all services whose eligibility criteria mention 'citizen'."
},
{
"role": "assistant",
"content": "SELECT service_id, service_name, eligibility_criteria FROM government_services.services WHERE eligibility_criteria ILIKE '%citizen%';"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "How many fuel logs were created for each unit of measurement? Show the unit and the corresponding count."
},
{
"role": "assistant",
"content": "SELECT unit, COUNT(*) as log_count\nFROM transportation.fuel_logs\nGROUP BY unit;"
},
{
"role": "user",
"conte... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Please list the full name and status of clients who have not provided a company name."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, status\nFROM legal_services.clients\nWHERE company_name 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 government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "Show me the first and last names of citizens, the appointment id, and the department of the employee who scheduled their appointment."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, a.appointment_id, e.department\nFROM government_services.ap... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, acc... | [
{
"role": "user",
"content": "Show me all transactions with a status of 'FAILED' that occurred within the last 7 days."
},
{
"role": "assistant",
"content": "SELECT * FROM financial_services.transactions WHERE status = 'FAILED' AND transaction_date >= NOW() - INTERVAL '7 day';"
},
{
"rol... |
You are an expert in writing database language. You can write a corresponding 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.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Report the number of employees for each department, broken down by their employment status."
},
{
"role": "assistant",
"content": "SELECT department, status, COUNT(*) AS employee_count FROM financial_services.employees GROUP BY department, status"
},
{
"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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "I would like to see a list of agencies and the names of their respective parent agencies."
},
{
"role": "assistant",
"content": "SELECT a.agency_id, a.agency_name, p.agency_name AS parent_agency_name\nFROM government_services.agencies a\nLEFT JOIN government_service... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_... | [
{
"role": "user",
"content": "Show the game ID and the average session duration in minutes for each game, ordered by average session duration descending."
},
{
"role": "assistant",
"content": "SELECT game_id, AVG(duration_seconds) / 60.0 AS avg_duration_minutes\nFROM gaming_technology.game_sessi... |
You are an expert in writing database language. You can write a corresponding 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.text, contract_id.text, event_name.text, data.text, emitted_a... | [
{
"role": "user",
"content": "For each user, list their username, the number of wallets they have, and the total gas used across all transactions they initiated."
},
{
"role": "assistant",
"content": "SELECT u.username,\n COUNT(w.wallet_id) AS wallet_count,\n COALESCE(SUM(t.gas_used)... |
You are an expert in writing database language. You can write a corresponding 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 game, count the total number of achievements unlocked across all players. Show game title and count."
},
{
"role": "assistant",
"content": "SELECT g.title, COUNT(pa.player_achievement_id) AS total_unlocked_achievements FROM gaming_technology.games AS g JOIN... |
You are an expert in writing database language. You can write a corresponding 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.notifications ( notification_id text, user_id text, message text, s... | [
{
"role": "user",
"content": "Show me all notifications sent in the last 7 days, including the user ID and message."
},
{
"role": "assistant",
"content": "SELECT user_id, message, sent_at FROM trading_platform.notifications WHERE sent_at >= NOW() - INTERVAL '7 days';"
},
{
"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 social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url... | [
{
"role": "user",
"content": "Find posts created in the last 60 days that have received at least one like. Show the post ID, its creation time, and the total number of likes for each such post."
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.created_at, COUNT(l.like_id) AS like_count ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Can you find all appointments where the duration is less than 20 minutes and the status is not 'Cancelled'? For each, show the appointment_id, appointment_time, status, and doctor_id."
},
{
"role": "assistant",
"content": "SELECT appointment_id, appointment_time, st... |
You are an expert in writing database language. You can write a corresponding 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": "List documents uploaded for cases of type 'Intellectual Property', showing the document name, upload timestamp, and the case number."
},
{
"role": "assistant",
"content": "SELECT T1.document_name, T1.upload_timestamp, T2.case_number FROM documents AS T1 JOIN cases 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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "List the full names and contact emails of citizens who have been assigned to applications for services offered by agencies with a jurisdiction_level of 'State'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Show all appointments, including subject, start time, and the billing rate for the lawyer who handled the appointment."
},
{
"role": "assistant",
"content": "SELECT a.subject, a.start_time, te.billing_rate\nFROM legal_services.appointments a\nJOIN legal_services.tim... |
You are an expert in writing database language. You can write a corresponding 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": "List the application ID, citizen ID, assigned employee's full name, and total amount paid for each approved application."
},
{
"role": "assistant",
"content": "SELECT a.application_id,\n a.citizen_id,\n e.first_name || ' ' || e.last_name AS employee_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Find all patients who share the same home address with another patient; show the address and both patient IDs and names."
},
{
"role": "assistant",
"content": "SELECT p1.address,\n p1.patient_id,\n p1.first_name,\n p1.last_name,\n p2.patient_... |
You are an expert in writing database language. You can write a corresponding 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, from_address text, to_address text, value n... | [
{
"role": "user",
"content": "Count the number of transactions for each status."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS tx_count\nFROM web3.transactions\nGROUP BY status;"
},
{
"role": "user",
"content": "Actually, only include statuses with more than 1000 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "Show me the object ID, coin type, and balance for all SUI coins where the status is 'active'."
},
{
"role": "assistant",
"content": "SELECT object_id, coin_type, balance FROM sui_coins WHERE status = 'active'"
},
{
"role": "user",
"content": "Also, inclu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "List all diagnoses made in the last month including diagnosis_date, patient full name, doctor's full name, and description."
},
{
"role": "assistant",
"content": "SELECT d.diagnosis_date,\n p.first_name || ' ' || p.last_name AS patient_name,\n doc.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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "Can you list all patients along with the insurance plan names they are enrolled in? Please include patient ID, first name, last name, and plan name."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, ip.plan_name\nFROM healthcare.... |
You are an expert in writing database language. You can write a corresponding 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": "List all clients with the count of cases they have opened."
},
{
"role": "assistant",
"content": "SELECT\n c.client_id,\n c.first_name,\n c.last_name,\n COUNT(cs.case_id) AS case_count\nFROM legal_services.clients c\nLEFT JOIN legal_services.cases cs ON c.client... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_achievements (
player_achievement_id uuid NOT NULL DEFA... | [
{
"role": "user",
"content": "Calculate for each player the timespan between their earliest and latest achievement unlocks."
},
{
"role": "assistant",
"content": "SELECT pa_min.player_id,\n pa_max.max_time - pa_min.min_time AS span\nFROM (\n SELECT player_id,\n MIN(unlocked_at) 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 legal_services.invoices (
invoice_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Show me the invoice number, total amount, and due date for all invoices, along with the corresponding client ID."
},
{
"role": "assistant",
"content": "SELECT invoice_number, total_amount, due_date, client_id FROM legal_services.invoices;"
},
{
"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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"role": "user",
"content": "For each employee who has verified more than one document, list their employee ID, the first document they verified, and the next document they verified, along with both verification timestamps."
},
{
"role": "assistant",
"content": "SELECT\n d1.verified_by_employe... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "List all pairs of token transfers occurring within the same transaction where one transferred value is greater than the other, showing both transfer IDs, the transaction ID, and both values."
},
{
"role": "assistant",
"content": "SELECT t1.transaction_id,\n 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 government_services.services (
service_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Find the names of service locations where services categorized as 'Licensing' have had appointments scheduled."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.location_name FROM service_locations AS T1 JOIN appointments AS T2 ON T1.location_id = T2.locatio... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, first_name ... | [
{
"role": "user",
"content": "List all guests who have left a public review with an overall rating of 5. Include the guest's first name, last name, the review comment, and the review date."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.comment, T2.review_date FROM ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account... | [
{
"role": "user",
"content": "Count the number of securities by exchange."
},
{
"role": "assistant",
"content": "SELECT exchange, COUNT(*) AS security_count\nFROM financial_services.securities\nGROUP BY exchange;"
},
{
"role": "user",
"content": "Now group the count by sector instead... |
You are an expert in writing database language. You can write a corresponding 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.likes ( like_id text PRIMARY KEY, user_id text, post_id text, comment_i... | [
{
"role": "user",
"content": "Find the total number of likes made on posts versus comments. Show two columns: like_type (either 'post' or 'comment') and like_count."
},
{
"role": "assistant",
"content": "SELECT CASE WHEN post_id IS NOT NULL THEN 'post' ELSE 'comment' END AS like_type, COUNT(*) A... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Find pairs of lawyers who work for the same firm AND share the same specialization, excluding pairs where the lawyer IDs are the same. Show their first names, last names, firm ID, and specialization. Order the results by firm ID and then specialization."
},
{
"role": "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 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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "Show me driver first_name, last_name, route_number and origin city for all trips scheduled to depart between current_date and current_date + interval '7 days'."
},
{
"role": "assistant",
"content": "SELECT d.first_name,\n d.last_name,\n r.route_number,\n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all comment IDs that have not received any likes."
},
{
"role": "assistant",
"content": "SELECT T1.comment_id FROM social_media.comments AS T1 LEFT JOIN social_media.likes AS T2 ON T1.comment_id = T2.comment_id WHERE T2.like_id IS NULL;"
},
{
"role": "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 transportation.trips ( trip_id character varying(64) NOT NULL, route_id character va... | [
{
"role": "user",
"content": "What is the average maintenance cost per vehicle?"
},
{
"role": "assistant",
"content": "SELECT vehicle_id, AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nGROUP BY vehicle_id;"
},
{
"role": "user",
"content": "Only include vehicles with ave... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id text, case_number text, case_name text, client_id tex... | [
{
"role": "user",
"content": "Show me all cases with a status of 'Pending', displaying their case name and court jurisdiction."
},
{
"role": "assistant",
"content": "SELECT case_name, court_jurisdiction FROM legal_services.cases WHERE status = 'Pending';"
},
{
"role": "user",
"conten... |
You are an expert in writing database language. You can write a corresponding 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, player_id uuid, game_id uuid, ser... | [
{
"role": "user",
"content": "Can you show me the average session duration and total score for each server and game combination?"
},
{
"role": "assistant",
"content": "SELECT server_id, game_id, AVG(duration_seconds) AS avg_duration, SUM(score) AS total_score FROM gaming_technology.game_sessions... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me all comments that are replies (i.e., have a parent_comment_id) on posts that include media, along with the comment content and creation time."
},
{
"role": "assistant",
"content": "SELECT c.comment_id, c.parent_comment_id, c.content, c.created_at\nFROM socia... |
You are an expert in writing database language. You can write a corresponding 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.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), g... | [
{
"role": "user",
"content": "Can you show me the count of items and the average cost_amount for each item_type and rarity?"
},
{
"role": "assistant",
"content": "SELECT item_type, rarity, COUNT(*) AS item_count, AVG(cost_amount) AS avg_cost_amount\nFROM gaming_technology.in_game_items\nGROUP 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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title cha... | [
{
"role": "user",
"content": "Show me all achievements with their name and the total number of players who have unlocked each achievement."
},
{
"role": "assistant",
"content": "SELECT a.achievement_id, a.name, COUNT(pa.player_id) AS players_unlocked\nFROM gaming_technology.achievements a\nLEFT ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "Show the usernames and email addresses of users who have commented on their own posts."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, u.email\nFROM social_media.comments c\nJOIN social_media.users u ON c.user_id = u.user_id\nJOIN social_media.pos... |
You are an expert in writing database language. You can write a corresponding 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 financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "List all trades for a given security, showing ticker_symbol, trade_id, account_id, trade_type, and total_amount."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, t.trade_id, t.account_id, t.trade_type, t.total_amount\nFROM financial_services.trades t\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 text, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "List peer IDs and IP addresses for all peers whose IP address starts with '10.'."
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address FROM trading_platform.peers WHERE ip_address LIKE '10.%';"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "List all patients who have received a prescription with the route 'Topical', showing their ID, first name, and last name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT\n p.patient_id,\n p.first_name,\n p.last_name\nFROM\n healthcare.patients p\n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"role": "user",
"content": "List all trips with their ID, vehicle ID, and driver ID."
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, driver_id FROM transportation.trips;"
},
{
"role": "user",
"content": "Can you also include the scheduled departure and actual arr... |
You are an expert in writing database language. You can write a corresponding 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": "For each developer, show their name and the total number of achievements in all games they have developed."
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name, COUNT(a.achievement_id) AS total_achievements\nFROM gaming_technology.developers d\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 financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "Can you give me a breakdown of the number of customers in each country and their average age? I want the result to also show the total number of unique states per country."
},
{
"role": "assistant",
"content": "SELECT country, COUNT(*) AS customer_count, AVG(EXTRACT... |
You are an expert in writing database language. You can write a corresponding 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": "Which servers are currently 'online' and located in the 'us-west-2' region, and what is the title of the game each server is hosting?"
},
{
"role": "assistant",
"content": "SELECT s.server_id, s.server_name, s.region, g.title AS game_title\nFROM gaming_technology.se... |
You are an expert in writing database language. You can write a corresponding 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.follows ( follow_id.text, follower_user_id.text, following_user_id.text... | [
{
"role": "user",
"content": "List all unique pairs of users where one follows the other, showing both the follower and following user ID."
},
{
"role": "assistant",
"content": "SELECT DISTINCT follower_user_id, following_user_id\nFROM social_media.follows;"
},
{
"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 web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List events from contract '0xContractA...' that occurred between '2023-01-01' and '2023-01-31'. Show the event ID, event name, and emitted timestamp."
},
{
"role": "assistant",
"content": "SELECT event_id, event_name, emitted_at FROM web3.events WHERE contract_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.claims ( claim_id character varying(64) NOT NULL, policy_id character vary... | [
{
"role": "user",
"content": "Show me all claims handled by agent 'AG123' along with their settlement details and policy IDs."
},
{
"role": "assistant",
"content": "SELECT claim_id, policy_id, settlement_amount, settlement_date FROM insurance.claims WHERE claim_handler_id = 'AG123';"
},
{
... |
You are an expert in writing database language. You can write a corresponding 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": "List all insurance products with a base premium less than 800, displaying product name, product type, and base premium."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium\nFROM insurance.insurance_products\nWHERE base_premium < 80... |
You are an expert in writing database language. You can write a corresponding 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": "List all users who have participated in group conversations created in April 2024, showing their username, conversation ID, and the group name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, c.conversation_id, c.group_name\nFROM social_media.conv... |
You are an expert in writing database language. You can write a corresponding 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": "For each case, show the total amount of all invoices and the number of scheduled appointments. Only include cases that have both an invoice and at least one appointment."
},
{
"role": "assistant",
"content": "SELECT i.case_id, SUM(i.total_amount) AS total_invoice_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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ... | [
{
"role": "user",
"content": "List all insurance products along with their type and base premium. Also, show whether each product is active."
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, product_type, base_premium, is_active FROM insurance.insurance_products;"
},
{
... |
You are an expert in writing database language. You can write a corresponding 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": "Find all pairs of partners who share the same specialization but work at different firms."
},
{
"role": "assistant",
"content": "SELECT l1.first_name || ' ' || l1.last_name AS partner_one,\n l2.first_name || ' ' || l2.last_name AS partner_two,\n l1.speci... |
You are an expert in writing database language. You can write a corresponding 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": "List the full names and email addresses of users who have liked any comment."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.full_name, u.email\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.user_id\nWHERE l.comment_id IS NOT NULL;"
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the first and last names of citizens who have scheduled appointments for services offered by agencies with a jurisdiction level of 'Municipal'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me the usernames and the group names for each user who has sent at least one message in a group chat."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, c.group_name\nFROM social_media.users u\nJOIN social_media.conversation_participants cp ON 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.service_locations ( location_id text, agency_id text, location_n... | [
{
"role": "user",
"content": "How many service locations are there for each agency? List the agency ID and the count of locations."
},
{
"role": "assistant",
"content": "SELECT agency_id , count(*) FROM government_services.service_locations GROUP BY 1"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "What is the count of payments for each currency code and the total amount paid in each currency?"
},
{
"role": "assistant",
"content": "SELECT\n currency_code,\n COUNT(payment_id) AS payment_count,\n SUM(amount) AS total_amount\nFROM hospitality_technology.paymen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT ... | [
{
"role": "user",
"content": "List all pairs of players who unlocked the same achievement, showing achievement_id, player1_id, player2_id, and player1_unlocked_at."
},
{
"role": "assistant",
"content": "SELECT pa1.achievement_id,\n pa1.player_id AS player1_id,\n pa2.player_id AS play... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all room types and the name of the property manager responsible for that property."
},
{
"role": "assistant",
"content": "SELECT t1.type_name, t3.first_name, t3.last_name FROM hospitality_technology.room_types AS t1 JOIN hospitality_technology.properties AS 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "List all customers who reside in New York and were created in the system before 2023."
},
{
"role": "assistant",
"content": "SELECT customer_id, first_name, last_name, created_at FROM insurance.customers WHERE state = 'NY' AND created_at < '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 web3.events ( event_id text PRIMARY KEY, contract_id text, event_name text, data tex... | [
{
"role": "user",
"content": "Find all events where the data field contains 'amount' and show the event name, contract ID, and transaction ID, along with the log index, sorted by log index in ascending order."
},
{
"role": "assistant",
"content": "SELECT event_name, contract_id, transaction_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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "Show me the names and websites of all developers whose website contains '.com'."
},
{
"role": "assistant",
"content": "SELECT name, website FROM gaming_technology.developers WHERE website LIKE '%.com%';"
},
{
"role": "user",
"content": "Only include deve... |
You are an expert in writing database language. You can write a corresponding 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 me all appointments along with the subject, the appointment's start time, and the full name of the client associated with each appointment."
},
{
"role": "assistant",
"content": "SELECT a.subject, a.start_time, c.first_name, c.last_name FROM legal_services.appo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List the medication_name and manufacturer for all medications where the description is null or an empty string."
},
{
"role": "assistant",
"content": "SELECT medication_name, manufacturer FROM healthcare.medications WHERE description IS NULL OR 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 healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"role": "user",
"content": "Can you show me the total number of diagnosis records for each doctor, along with the doctor's ID? Please include only those diagnoses marked as 'chronic'."
},
{
"role": "assistant",
"content": "SELECT doctor_id, COUNT(*) AS total_chronic_diagnoses FROM healthcare.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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "For each developer, show their name and the total number of in-game items in all games they've developed."
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name,\n COUNT(i.item_id) AS total_items\nFROM gaming_technology.developers d\nJOIN gamin... |
You are an expert in writing database language. You can write a corresponding 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": "Show me all policies that use insurance products of type 'health', and display the policy_number, start_date, and the product's name."
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.start_date, ip.product_name\nFROM insurance.policies p\nJOIN insura... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.