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 legal_services.documents (
document_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List the document name, type, version, and description for all documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name, document_type, version, description FROM documents;",
"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 trading_platform.orders ( order_id.text, user_id.text, wallet_id.text, asset_id.text... | [
{
"role": "user",
"content": "Count the number of orders in each status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS order_count\nFROM trading_platform.orders\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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title cha... | [
{
"role": "user",
"content": "List the total number of sessions and total score per server, showing both the server name and the associated game title.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.server_name, g.title AS game_title, COUNT(gs.session_id) AS total_sessions, SUM... |
You are an expert in writing database language. You can write a corresponding 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": "Calculate the average length of stay in days for completed reservations for each property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id,\n p.property_name,\n AVG(res.check_out_date - res.check_in_date) AS avg_stay_days\nFR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List all past appointments, including the scheduled time, the name of the service, and the name of the location where they took place.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.scheduled_start_time, T2.service_name, T3.location_name FROM gove... |
You are an expert in writing database language. You can write a corresponding 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": "Show me each player's last_login and the end_time of their most recent game session.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id,\n p.username,\n p.last_login,\n gs.last_end_time\nFROM gaming_technology.players p\nLEF... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "List each transaction ID that includes token transfers, along with the distinct symbols of the tokens transferred in that transaction.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.transaction_id, STRING_AGG(DISTINCT T3.token_symbol, ', ') FROM 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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the first name and last name of citizens who have scheduled appointments at accessible service locations, along with the scheduled start time of the appointment and the location name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.loans ( loan_id text, account_id text, loan_type text, principal_... | [
{
"role": "user",
"content": "Show all loans with a maturity date in the next 60 days, along with their account_id, principal_amount, interest_rate, and maturity_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loan_id, account_id, principal_amount, interest_rate, maturity_da... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "Which customers have more than one active policy at the same time? Show the customer ID and the number of active policies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, COUNT(policy_id) AS active_policy_count\nFROM insurance.policies\nW... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "List all unspent UTXOs with an amount greater than 10.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT utxo_id, transaction_id, address, amount FROM utxos WHERE spent = FALSE AND amount > 10;",
"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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var... | [
{
"role": "user",
"content": "How many agents were hired in the current year and what is their average commission rate?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS hired_this_year, AVG(commission_rate) AS average_commission_rate FROM insurance.agents WHERE 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 token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp... | [
{
"role": "user",
"content": "Find tokens that have a positive price change percentage over the last 1 hour, 6 hours, and 24 hours. Display their symbol and chain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain FROM token_dexpool_info WHERE price_change_percen... |
You are an expert in writing database language. You can write a corresponding 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 pairs of routes where the origin location of one route is the destination location of the other, showing both route numbers and their types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.route_number AS route_number_1, r1.type AS type_1,... |
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 performance review score for employee with ID 'EMP456' for the last quarter?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't assist with information about performance review scores as this data is not included in the employ... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "Find the average settlement_amount of closed claims for each claim handler. Return claim_handler_id and avg_settlement_amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_handler_id, AVG(c.settlement_amount) AS avg_settlement_amount\nFROM ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.notifications ( notification_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "How many notifications are there for each status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n status,\n COUNT(*) AS notification_count\nFROM government_services.notifications\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, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "List the first name, last name, prescription ID, diagnosis code, and diagnosis description for patients who have both an ongoing prescription and an active chronic diagnosis.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Can you write a SQL statement that returns each server’s name, its region, and the average duration in seconds of all game sessions that took place on that server? Only include servers that have handled at least 5 sessions.",
"sql": null
},
{
"role": "assistant",
... |
You are an expert in writing database language. You can write a corresponding 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 me the number of notifications sent by each sender in March 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sender_user_id, COUNT(notification_id) AS notification_count\nFROM social_media.notifications\nWHERE created_at >= '2024-03-01'::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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show me all notifications that are related to posts created by users who have a verified profile. Include the notification type, the recipient username, and the post ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n n.notification_type,\n u_reci... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the medication_id, medication_name, and manufacturer for all medications where the generic_name contains the word 'azole'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonc... | [
{
"role": "user",
"content": "Show me the block with the earliest timestamp and its corresponding previous block's difficulty level.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b1.block_id, b1.timestamp, b2.difficulty AS previous_block_difficulty\nFROM blockchain.blocks b1\nLE... |
You are an expert in writing database language. You can write a corresponding 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": "Show the ticker_symbol, security_name, and the number of loans that have that ticker_symbol as their collateral_description.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, COUNT(l.loan_id) AS collateral_loan_count\nF... |
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 schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not 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 financial_services.transactions ( transaction_id character varying(64) NOT NULL, acc... | [
{
"role": "user",
"content": "Show me the total amount of 'Deposit' and 'Withdrawal' transactions for each account in March 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_id, transaction_type, SUM(amount) AS total_amount\nFROM financial_services.transactions\nWHERE ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "Show me a list of all customers from California along with their full names and phone numbers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, first_name || ' ' || last_name AS full_name, phone_number FROM insurance.customers WHERE state ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "Show me the driver_id and full name for all drivers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name FROM transportation.drivers;",
"sql": null
},
{
"role": "user",
"content": "Only show drivers whose 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 legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "List all cases opened in the 'State Court' jurisdiction in the year 2023, including their name, number, and client ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_name, case_number, client_id FROM legal_services.cases WHERE court_jurisdiction... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id.text, name.text, type.text, address_line1.tex... | [
{
"role": "user",
"content": "Show me the booking ID, fare, and the city of the destination location for all bookings with 'Confirmed' status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id, b.fare, dl.city AS destination_city FROM transportation.bookings AS b JOIN 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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List maintenance logs including vehicle make, model, service_date, cost, and next_service_due_date for vehicles that are currently 'Active'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ml.log_id,\n v.make,\n v.model,\n ml.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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "Can you show the driver first name, last name, and the make and model of the vehicle for each trip, along with the scheduled departure time?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, v.make, v.model, t.scheduled_depart... |
You are an expert in writing database language. You can write a corresponding 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": "How many documents exist for each document_type? Return document_type and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_type,\n COUNT(*) AS document_count\nFROM insurance.claim_documents\nGROUP BY document_type;",
"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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title cha... | [
{
"role": "user",
"content": "List each game title with the number of servers that are currently 'online'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title,\n COUNT(s.server_id) AS online_servers\nFROM gaming_technology.games g\nLEFT JOIN gaming_technology.servers s\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.passengers ( passenger_id text PRIMARY KEY, first_name text, last_nam... | [
{
"role": "user",
"content": "I want to see how many passengers were created each month.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT date_trunc('month', created_at) AS month, COUNT(*) AS passenger_count FROM transportation.passengers GROUP BY month;",
"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 NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "List all in-game items' names, types, and rarity along with their total cost in USD, for items that belong to games released on or after 2021-01-01.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.item_name, i.item_type, i.rarity, i.cost_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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"role": "user",
"content": "Show the total and average balance for each account_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_type, SUM(balance) AS total_balance, AVG(balance) AS avg_balance FROM financial_services.accounts GROUP BY account_type;",
"sql": nul... |
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'?",
"sql": null
},
{
"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 healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id ch... | [
{
"role": "user",
"content": "Show me the record_id, patient_id, prescription_id, medication_id, start_date, and the systolic blood pressure from the associated medical record for all prescriptions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.prescription_id,\n p.medic... |
You are an expert in writing database language. You can write a corresponding 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": "List all pairs of clients who registered in the same year. Show each client's first_name, last_name, and the registration year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first_name_1, c1.last_name AS last_name_1, c2.first_name 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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex... | [
{
"role": "user",
"content": "List policy IDs and policy numbers for policies that have a null cancellation reason.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number FROM insurance.policies WHERE cancellation_reason IS NULL;",
"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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "Retrieve the average base premium of insurance products for each product_type, including only types that have more than 5 products.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_type, AVG(base_premium) AS avg_premium\nFROM insurance.insuranc... |
You are an expert in writing database language. You can write a corresponding 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 all lawyers along with the full name of another lawyer from the same firm.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.lawyer_id,\n CONCAT(a.first_name, ' ', a.last_name) AS full_name,\n CONCAT(b.first_name, ' ', b.last_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 social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte... | [
{
"role": "user",
"content": "List all hashtag names and their creation dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tag_name, created_at FROM social_media.hashtags;",
"sql": null
},
{
"role": "user",
"content": "Please only include hashtags created in th... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "For every customer, show their first name, last name, and the policy number of any policies they own.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.policy_number FROM insurance.customers AS T1 JOIN insurance.policies ... |
You are an expert in writing database language. You can write a corresponding 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n r... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "Can you find the contract that has emitted the most events, and show its contract ID along with the total number of events emitted?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_id, COUNT(*) AS total_events FROM web3.events GROUP BY contrac... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show all wallet addresses that have ever received a UTXO.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT address\nFROM trading_platform.utxos;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.documents (
document_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Show the document type, verification status, and the full name of the citizen who uploaded each document.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_type, d.verification_status, CONCAT(c.first_name, ' ', c.last_name) AS citizen_full_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 gaming_technology.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uuid()... | [
{
"role": "user",
"content": "I want to list all sessions for player with ID '123e4567-e89b-12d3-a456-426614174000' and display their session start time, end time, and score, along with the game_id and server_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT session_id, game_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Show pairs of customers who live in the same state but different cities. Include their IDs, full names, and state.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_a_id, a.first_name AS customer_a_first_name, a.last_name AS cu... |
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 average speed of train number T9876 during its last journey?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the average speed of train number T9876 during its last journey. The data in the trains tab... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "List all active products with a base premium exceeding 1500 that were created after January 1, 2023, including their product name, type, and base premium. Order the results by creation date ascending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"role": "user",
"content": "Which players have not logged in in the last 30 days but have unlocked any achievements? Show player_id, username, and total unlocked achievements.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, COUNT(pa.achievement_id) AS to... |
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 current address of the employee with ID 'EMP234'?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the current address of an employee as this information is not stored in the database table.",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id te... | [
{
"role": "user",
"content": "List each staff member who delivered orders, along with the number of orders they delivered.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT staff_id_delivered, COUNT(order_id) AS delivered_orders FROM hospitality_technology.service_orders WHERE staff... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, vehicle_id ch... | [
{
"role": "user",
"content": "Find all pairs of fuel log entries for the same vehicle that occurred on the same calendar day. Show vehicle ID, the two log IDs, and their timestamps.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n f1.vehicle_id,\n f1.fuel_log_id AS log_id_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 trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show for every asset the usernames of users who have both bought and sold that asset, along with the asset name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.asset_id, a.name AS asset_name, u.username\nFROM trading_platform.assets a\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 web3.wallets ( wallet_id text, user_id text, address text, private_key text, created... | [
{
"role": "user",
"content": "For each user, what is the average time difference in days between their wallet creations? Return user_id and avg_diff_days.",
"sql": null
},
{
"role": "assistant",
"content": "WITH diffs AS (\n SELECT\n user_id,\n EXTRACT(EPOCH FROM (created_at - LAG(cre... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, application_id text, c... | [
{
"role": "user",
"content": "Can you list pairs of documents uploaded by the same citizen? Show both document IDs and the citizen ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.document_id AS document1, d2.document_id AS document2, d1.citizen_id\nFROM government_services.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w... | [
{
"role": "user",
"content": "List all billable but unbilled time entries including entry_id, lawyer_id, case_id, date_worked, hours_spent, and billing_rate.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT entry_id, lawyer_id, case_id, date_worked, hours_spent, billing_rate\nFROM ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "Show me the balance history of wallet '0xdeadbeef' for token at contract '0xaaaa...' .",
"sql": null
},
{
"role": "assistant",
"content": "SELECT block_number, amount\nFROM erc20_balances_historical\nWHERE wallet_address = '0xdeadbeef'\n AND contract_address = ... |
You are an expert in writing database language. You can write a corresponding 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": "Give me a list of users who follow more than one other user, including their username and the count of people they follow.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(f.following_user_id) AS following_count\nFROM social_media.fol... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE train_station_management.train_cars (
car_id character varying(64) NOT NULL, -- ... | [
{
"role": "user",
"content": "I need to find all tickets for a specific route 'RT456' along with the car details and route information.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.ticket_id, t.seat_number, t.price, tc.car_number, tc.car_type, r.route_name, r.description\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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ... | [
{
"role": "user",
"content": "Show me all insurance products of type 'Health' or 'Dental'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT *\nFROM insurance.insurance_products\nWHERE product_type IN ('Health', 'Dental');",
"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 government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "List application reference numbers and the total amount paid for each application that has at least one completed payment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.reference_number, SUM(p.amount) AS total_paid FROM government_services.applica... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "For each staff member who placed a service order, show their full name and the total revenue generated from those orders.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT S.first_name, S.last_name, SUM(SO.total_price) AS total_generated_revenue FROM ho... |
You are an expert in writing database language. You can write a corresponding 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 ERC20 token contracts that have had at least 200 approvals. Include the token symbol and total approval count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.contract_address, m.symbol, COUNT(*) AS approval_count\nFROM erc20_approval a\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_l... | [
{
"role": "user",
"content": "Show me the total fuel quantity and cost for each route, grouped by route number, only for trips that have associated fuel logs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number, SUM(f.quantity) AS total_quantity, SUM(f.total_cost) AS to... |
You are an expert in writing database language. You can write a corresponding 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 loan, show the loan_id, the account_id, the principal_amount, and the ticker_symbol and security_name of any associated collateral, if the collateral_description matches a security's ticker_symbol.",
"sql": null
},
{
"role": "assistant",
"content": "SEL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "Find all tokens with their contract addresses and the number of wallets that hold each token, sorted by wallet count in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.token_id, t.contract_address, COUNT(DISTINCT w.wallet_id) AS wa... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w... | [
{
"role": "user",
"content": "Show me the names and websites of all law firms founded before 2000, along with their managing partner IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_name, website, managing_partner_id FROM legal_services.law_firms WHERE founded_date < '200... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "For each upcoming appointment in the next 7 days, list the appointment_id, scheduled_start_time, full name of the citizen, and the name of the service.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.scheduled_start_time, \n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.service_locations ( location_id text PRIMARY KEY, agency_id text... | [
{
"role": "user",
"content": "Get the number of service locations per state.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) AS location_count\nFROM service_locations\nGROUP BY state;",
"sql": null
},
{
"role": "user",
"content": "Now only include 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 gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country tex... | [
{
"role": "user",
"content": "Show me the developer(s) who were founded in the most recent year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, country, founded_year FROM gaming_technology.developers WHERE founded_year = (SELECT MAX(founded_year) FROM gaming_technology.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.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Show me all lawyers' full names, their bar number, and if they are partners, the full name of another partner from their firm.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.first_name || ' ' || l1.last_name AS lawyer_full_name, l1.bar_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 healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "I need to find doctors whose phone number contains the digit '7'. Display their full name and phone number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, phone_number FROM healthcare.doctors WHERE phone_number LIKE '%7%';",
... |
You are an expert in writing database language. You can write a corresponding 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": "Show me tokens with a 24-hour trading volume over $1,000,000 from DEX pools that also have a positive net flow from smart money addresses. Display the token symbol, chain, 24h volume, and net flow.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tdi.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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show me the usernames of users who are participating in a conversation but have not sent any messages in that conversation, along with the conversation ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT\n u.username,\n cp.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 healthcare.diagnoses ( diagnosis_id text PRIMARY KEY, record_id text, patient_id tex... | [
{
"role": "user",
"content": "List all prescriptions where the dosage text contains the word 'unit'. Show the prescription ID, medication ID, and dosage.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT prescription_id, medication_id, dosage FROM healthcare.prescriptions WHERE dosa... |
You are an expert in writing database language. You can write a corresponding 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 the total balance for each SUI coin across all owners. Group by coin_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT coin_type,\n SUM(CAST(balance AS DECIMAL)) AS total_balance\nFROM sui_coins\nGROUP BY coin_type;",
"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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all PDF claim documents larger than 1MB, showing document_id, claim_id, file_name, and file_size_bytes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, file_name, file_size_bytes\nFROM insurance.claim_documents\nWHERE mime_... |
You are an expert in writing database language. You can write a corresponding 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 rooms that have not been cleaned in the last 7 days, showing their room number, property ID, and last cleaned date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT room_number, property_id, last_cleaned_at FROM hospitality_technology.rooms WH... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id text, user_id text, content text, media_url text, media... | [
{
"role": "user",
"content": "What are the top 5 posts by number of likes, showing post_id, media_type and like_count, ordered by like_count descending?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.media_type, COUNT(l.like_id) AS like_count\nFROM social_media.posts... |
You are an expert in writing database language. You can write a corresponding 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, medication_name text, generic_name text... | [
{
"role": "user",
"content": "Show all medications that share a manufacturer with at least one other medication. Return the medication_id, medication_name, and manufacturer for each.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.medication_id,\n m.medication_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 transportation.maintenance_logs ( log_id text PRIMARY KEY, vehicle_id text, service_... | [
{
"role": "user",
"content": "Show me all maintenance logs for vehicles that had an 'Oil Change' service in the last 3 months, including the vehicle ID, service date, and cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, cost FROM transportation.maint... |
You are an expert in writing database language. You can write a corresponding 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 all applications including the application reference number, the first and last name of the citizen who submitted it, and the name of the service the application is for.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.reference_number, T2.firs... |
You are an expert in writing database language. You can write a corresponding 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.prescriptions ( prescription_id text PRIMARY KEY, record_id text, patient... | [
{
"role": "user",
"content": "List all distinct medication IDs that have been prescribed with more than 5 refills allowed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT medication_id FROM healthcare.prescriptions WHERE refills_allowed > 5;",
"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 trading_platform.notifications ( notification_id.text, user_id.text, message.text, s... | [
{
"role": "user",
"content": "Find all notifications that were sent more than 24 hours ago and are still unread. Show the notification ID, user ID, and sent_at timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT notification_id, user_id, sent_at FROM notifications WHERE rea... |
You are an expert in writing database language. You can write a corresponding 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 24-hour trading volume greater than $10,000,000 and a negative price change percentage over the last 24 hours. Show the token symbol, chain, total volume, and the 24-hour price change percentage.",
"sql": null
},
{
"role": "assistant",
"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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Find all pairs of citizens who share the same first name and gender but have different last names. Display the shared first name, gender, the full name of the first citizen in the pair, and the full name of the second citizen.",
"sql": null
},
{
"role": "assistant",... |
You are an expert in writing database language. You can write a corresponding 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": "List the route number, description, and the name of both the origin and destination locations for all routes where the origin and destination are in different countries.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number, r.description, l1... |
You are an expert in writing database language. You can write a corresponding 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'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id, COUNT(*) AS total_chronic_diagnoses ... |
You are an expert in writing database language. You can write a corresponding 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": "What is the average ROI and total profit for smart money addresses on the Arbitrum chain?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(roi) AS avg_roi, SUM(profit) AS total_profit\nFROM smart_money_profit\nWHERE chain = 'Arbitrum';",
"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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "Show me the first name, last name, and date of birth for all patients who are male.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE gender = 'Male';",
"sql": null
},
{
"ro... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Can you show me the name, city, and type for all locations that are in the same city but have different types?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.name, l1.city, l1.type FROM transportation.locations l1 JOIN transportation.locations l2 ... |
You are an expert in writing database language. You can write a corresponding 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, can you list the total number of achievements they have unlocked and the total number of sessions they have played, along with their username?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, COUNT(DISTINCT pa.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "For each booking, show the booking_id, passenger's first name and last name, the trip_id, and the route_number associated with the trip.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name, p.last_name, b.trip_id, r.route_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 government_services.agencies (
agency_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Which agencies offer more than three services? List the agency ID and the total number of services they provide.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agency_id, COUNT(service_id) AS total_services\nFROM government_services.services\nGROUP 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 project_fundraising_record ( id text, project_id text, project_name text, rounds_nam... | [
{
"role": "user",
"content": "Which projects raised more than 10 million in their fundraising rounds, and what are their round names and valuations?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, rounds_name, investment_value, valuation FROM project_fundraising_reco... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.