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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "Which drivers have licenses expiring before 2025-01-01, and what are their first and last names along with the license expiry date?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name, license_expiry_date FROM transportati... |
You are an expert in writing database language. You can write a corresponding 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": "For each employee, could you show their full name alongside the sector and security name of any securities issued by a company with the same name as the employee's department?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.employee_id, e.first_name... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,... | [
{
"role": "user",
"content": "Retrieve a list of agents who were hired in 2024. Include agent_id, first_name, last_name, hire_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agent_id, first_name, last_name, hire_date\nFROM insurance.agents\nWHERE hire_date >= '2024-01-01' AN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"role": "user",
"content": "Show me all invoice numbers and due dates where the amount paid is exactly zero.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_number, due_date FROM legal_services.invoices WHERE amount_paid = 0;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Show the top 5 properties by average overall review rating.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.reviews r\n ON p.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 trading_platform.utxos (
utxo_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "How many UTXOs have the 'spent' flag set to false?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS unspent_utxo_count\nFROM trading_platform.utxos\nWHERE spent = false;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "For each trip, show the trip ID, scheduled departure, and the last name of the driver.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id, t.scheduled_departure, d.last_name\nFROM transportation.trips t\nJOIN transportation.drivers d ON t.drive... |
You are an expert in writing database language. You can write a corresponding 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 of all verified users who have liked any comment and the like creation time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, l.created_at\nFROM social_media.likes l\nJOIN social_media.users u ON l.user_id = u.user_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 legal_services.invoices (
invoice_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Show me the total invoice amount and the number of invoices for each client in 2024, and include the earliest and latest invoice issue date for each client.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT client_id, SUM(total_amount) AS total_invoice_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.payments ( payment_id text PRIMARY KEY, reservation_id text, ... | [
{
"role": "user",
"content": "Find the total amount of payments and the number of payments for each status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, SUM(amount) AS total_amount, COUNT(*) AS payment_count\nFROM hospitality_technology.payments\nGROUP BY status;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address.text, token_name.text, token_symbol.text, chain.te... | [
{
"role": "user",
"content": "Which tokens have the highest liquidity on the Ethereum chain and what are their current prices and 24-hour trading volumes?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, price, liquidity, volume_24h FROM token_dexpool_info WHERE chain... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "Now, sort the results by the date opened, oldest first, and show only the top 10.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND... |
You are an expert in writing database language. You can write a corresponding 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": "Can you list all vehicles acquired in 2023, their make, model, and acquisition date?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, make, model, acquisition_date FROM transportation.vehicles WHERE acquisition_date >= '2023-01-01' AND acqu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List the token symbol, token name, and contract address for all tokens that have no recorded transfers in the token_transfers table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T.token_symbol, T.token_name, T.contract_address FROM web3.tokens 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 government_services.documents ( document_id text, application_id text, citizen_id te... | [
{
"role": "user",
"content": "List the application ID and citizen ID for all documents of type 'Proof of Address'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT application_id, citizen_id FROM government_services.documents WHERE document_type = 'Proof of Address';",
"sql": 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.payments ( payment_id character varying(64) NOT NULL, applicatio... | [
{
"role": "user",
"content": "For each payment method, show the total number of completed payments and the total amount paid.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_method, COUNT(*) AS completed_count, SUM(amount) AS total_paid FROM government_services.payments 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.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_... | [
{
"role": "user",
"content": "Show me the notification ID, recipient user ID, and notification type for notifications received by users that user 'user123' is following.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.recipient_user_id, n.notification_type FRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies (
agency_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "How many documents are set to expire in the year 2025?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS document_count\nFROM government_services.documents\nWHERE expiry_date >= '2025-01-01' AND expiry_date < '2026-01-01';",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Find all citizens who have both uploaded at least one document and made at least one payment. Show their citizen ID, full name, and contact email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.citizen_id, c.first_name || ' ' || c.last_name AS full... |
You are an expert in writing database language. You can write a corresponding 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": "Could you list each service location's name, city, and the total number of appointments scheduled there, only for accessible locations?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sl.location_name, sl.city, COUNT(a.appointment_id) AS appointment_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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a... | [
{
"role": "user",
"content": "Retrieve all orders placed after '2024-06-01', including order_id, user_id, asset_id, quantity, and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT order_id, user_id, asset_id, quantity, price\nFROM trading_platform.orders\nWHERE created_at > '... |
You are an expert in writing database language. You can write a corresponding 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 all patients who have scheduled appointments with doctors specializing in Cardiology, along with their appointment times and the doctors' full names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, a.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 government_services.notifications ( notification_id text, citizen_id text, applicati... | [
{
"role": "user",
"content": "Find all notifications where the message subject contains the word 'Alert'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT notification_id, citizen_id, application_id, message_subject, message_body, channel, sent_at, status, related_entity_type, rela... |
You are an expert in writing database language. You can write a corresponding 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 the full names and dates of birth for all patients who do not have a phone number on record.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE phone_number IS NULL OR TRIM(phone_nu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "For each fueling event, show its fuel_log_id, vehicle_id, log_timestamp, and the previous fueling event's fuel_log_id, log_timestamp, and quantity for the same vehicle.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fl.fuel_log_id,\n fl.vehicle... |
You are an expert in writing database language. You can write a corresponding 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": "For each agent, show the total number of policies they have sold and the sum of the premium amounts. Include the agent_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agent_id, COUNT(*) AS policy_count, SUM(premium_amount) AS total_premium\nFROM i... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.notifications ( notification_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List the application_id and the number of notifications with status 'Pending' for each application.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT application_id, COUNT(*) AS pending_notification_count\nFROM government_services.notifications\nWHERE 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.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Show me all clients along with their email addresses who registered in the year 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM legal_services.clients WHERE EXTRACT(YEAR FROM date_registered) = 2023;",
"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 transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me the count of trips by status for each vehicle, but only include vehicles that have had more than 5 trips total.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, status, COUNT(*) as trip_count FROM transportation.trips GROUP BY vehic... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, cu... | [
{
"role": "user",
"content": "List all beneficiaries who have a null contact_info. Return beneficiary_id, first_name, last_name, policy_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT beneficiary_id, first_name, last_name, policy_id\nFROM insurance.policy_beneficiaries\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 legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, p... | [
{
"role": "user",
"content": "Show all law firms along with their phone numbers, sorted by the founding date from oldest to newest.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_id, firm_name, phone, founded_date\nFROM legal_services.law_firms\nORDER BY founded_date ASC;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments (
payment_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Calculate the average and maximum payment amount grouped by payment status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status,\n AVG(amount_paid) AS avg_amount,\n MAX(amount_paid) AS max_amount\nFROM insurance.premium_payments\nGROUP ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Count how many diagnoses were recorded each month in 2024. Show the month (as the first day of the month) and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', diagnosis_date)::date AS diagnosis_month, COUNT(*) FROM health... |
You are an expert in writing database language. You can write a corresponding 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": "Which achievement_id was unlocked the most times in the first quarter of 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT achievement_id, COUNT(*) as unlock_count FROM gaming_technology.player_achievements WHERE unlocked_at >= '2024-01-01 00:00:0... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each transaction status, what is the average transaction value?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, AVG(value) FROM web3.transactions GROUP BY status",
"sql": null
},
{
"role": "user",
"content": "Could you filt... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Which vehicles have had fueling events at locations of type 'Station'? For each vehicle, list the vehicle_id, license_plate, and the name and city of the fueling station.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT v.vehicle_id, v.license... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me all users who have liked both a comment and a post, including their user IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT l1.user_id\nFROM social_media.likes l1\nJOIN social_media.likes l2 ON l1.user_id = l2.user_id\nWHERE l1.post... |
You are an expert in writing database language. You can write a corresponding 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": "For all claims filed in 2024, show the claim ID, incident date, policy number, and the name of the associated insurance product.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, p.policy_number, ip.product_name\nFROM insura... |
You are an expert in writing database language. You can write a corresponding 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": "For each user, count how many different conversations they have participated in. Show user_id and conversation_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(DISTINCT conversation_id) AS conversation_count\nFROM social_media.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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List all fuel refueling events with the refueled vehicle's make and model, the fuel type used, and the fueling location ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fl.fuel_log_id, fl.log_timestamp, v.make, v.model, fl.fuel_type, fl.quantity, f... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "Show the email address and the creation date for every user, ordered by their username alphabetically.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT email, created_at FROM trading_platform.users ORDER BY username ASC;",
"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.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "Show policy numbers and product names for all policies that started in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, ip.product_name FROM insurance.policies AS p JOIN insurance.insurance_products AS ip ON p.product_id = ip.pro... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "Which tokens have a current price above $20 and belong to the 'DeFi' narrative?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, token_name, chain, price\nFROM token_basic_info\nWHERE price > 20 AND narrative = 'DeFi';",
"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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative t... | [
{
"role": "user",
"content": "Show me the top 5 narratives by market cap, along with their top 3 coins and 24-hour trading volume.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, top_3_coins, volume_24h FROM narrative_info ORDER BY market_cap DESC LIMIT 5;",
"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 character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Show the name of each insurance plan and the total number of patients whose primary insurance policy for that plan is currently active. Include only plans that have at least one such patient.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.plan_nam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.applications ( application_id character varying(64) NOT NULL, ci... | [
{
"role": "user",
"content": "List the application IDs and their submitted dates for applications that have been assigned to an employee in the 'Housing' department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.application_id, T1.submitted_at 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "I need to list pairs of partners working at the same firm, showing each partner's full name and their specialization.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT CONCAT(p1.first_name, ' ', p1.last_name) AS partner1_name, p1.specialization, CONCAT(... |
You are an expert in writing database language. You can write a corresponding 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": "List the names of all clients that are associated with cases led by lawyers specializing in 'Intellectual Property'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name, c.last_name\nFROM legal_services.cases cs\nJOIN legal_services.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors (
doctor_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "List the description and diagnosis date for all diagnoses that are marked as chronic and were made in the year 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT description, diagnosis_date FROM healthcare.diagnoses WHERE is_chronic = true AND diag... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List the usernames of users who have sent messages containing the word 'urgent', along with the message content and sent time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, m.content, m.sent_at FROM social_media.messages m JOIN social_me... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "List the content of posts that have received comments from verified users, showing the post content and the username of the verified commenter.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.content AS post_content, u.username AS commenter... |
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 history of incidents or accidents that occurred on platform 5 at station GHI?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the history of incidents or accidents on platform 5 at station GHI. My ... |
You are an expert in writing database language. You can write a corresponding 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": "Show me document names and upload timestamps for documents linked to cases that were opened after January 1, 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.document_name, T1.upload_timestamp FROM documents AS T1 JOIN cases AS T2 ON T1.case_i... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "Show me the total quantity of fuel consumed and the total cost for each vehicle that has fuel log entries, including the vehicle's make and model.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.vehicle_id, T2.make, T2.model, SUM(T1.quantity) 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 gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ... | [
{
"role": "user",
"content": "I need the total quantity of items each player has acquired, showing player_id and total_quantity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player_id;... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id ch... | [
{
"role": "user",
"content": "Show me all premium payments made by customer with ID 'CUST789'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM insurance.premium_payments WHERE customer_id = 'CUST789';",
"sql": null
},
{
"role": "user",
"content": "From those... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Could you list the top 5 highest average session scores for each game, showing the game title, developer name, and the average score?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title AS game_title,\n d.name AS developer_name,\n AVG(... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NU... | [
{
"role": "user",
"content": "How many service locations do we have in each state?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) AS location_count FROM government_services.service_locations GROUP BY state;",
"sql": null
},
{
"role": "user",
"conte... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me the first name, last name, and email address for passengers who have made a booking with 'Completed' status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.first_name, p.last_name, p.email FROM transportation.passengers p JOIN tran... |
You are an expert in writing database language. You can write a corresponding 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.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen ti... | [
{
"role": "user",
"content": "List all ports along with the count of unique IP addresses that have been seen on each port.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT port, COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes GROUP BY port;",
"sql": null
}... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_... | [
{
"role": "user",
"content": "What's the average session duration for each player for a given server?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, server_id, AVG(duration_seconds) AS avg_session_duration FROM gaming_technology.game_sessions GROUP BY player_id, server... |
You are an expert in writing database language. You can write a corresponding 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 fuel_log_id, vehicle make, and quantity for all fuel logs where the quantity is greater than 100?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.fuel_log_id, v.make, f.quantity\nFROM transportation.fuel_logs f\nJOIN transportation.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List the token symbol and name for all tokens whose associated contract address has emitted at least one event. Also include the contract address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T.token_symbol, T.token_name, T.contract_address FROM we... |
You are an expert in writing database language. You can write a corresponding 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 usernames and email addresses of users who have set their profile to private and have chosen the 'dark' theme.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, u.email FROM social_media.users u JOIN social_media.user_settings us ON... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "What is the average age of customers by risk_profile for those in status 'Active'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT risk_profile,\n AVG(DATE_PART('year', AGE(CURRENT_DATE, date_of_birth))) AS avg_age\nFROM financial_services.custo... |
You are an expert in writing database language. You can write a corresponding 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.text, first_name.text, last_name.text, agency_name.text,... | [
{
"role": "user",
"content": "Find the average commission rate among all agents whose hire date is after '2020-01-01'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(commission_rate) FROM insurance.agents WHERE hire_date > '2020-01-01';",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes (
route_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Find pairs of routes where the destination of one route matches the origin of another. Show the first_route_number, first_description, second_route_number, and second_description.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.route_number AS firs... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What are the maintenance costs for a specific aircraft model like the Airbus A320?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to data regarding maintenance costs for specific aircraft models such as the Airbus A320. 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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name ... | [
{
"role": "user",
"content": "List all guests who have communication consent enabled along with their email addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id,\n first_name || ' ' || last_name AS full_name,\n email\nFROM guests\nWHERE communication_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, contract_id character varying... | [
{
"role": "user",
"content": "List all pairs of transactions where the recipient of the first transaction became the sender in the second, showing the first transaction_id, the second transaction_id, the shared address, and the timestamps of both transactions.",
"sql": null
},
{
"role": "assista... |
You are an expert in writing database language. You can write a corresponding 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": "Show the transfer id, token symbol, and the total supply of the token for every token transfer, but only for transfers where the transferred value is less than 100. Order by transfer_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tt.transfer_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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "Show all currently available rooms along with their room numbers and the number of times each room has been reserved.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rm.room_id, rm.room_number, COUNT(r.reservation_id) AS reservation_count\nFROM hospit... |
You are an expert in writing database language. You can write a corresponding 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": "How many payments were made using the payment method 'Credit Card'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS credit_card_payments\nFROM government_services.payments\nWHERE payment_method = 'Credit Card';",
"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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "Find narrative pairs where the sum of their price_change_percentage_1h is greater than 5. Show narrative1, change1, narrative2, change2, and the sum as total_change.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n1.narrative AS narrative1, n1.price_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_... | [
{
"role": "user",
"content": "List all servers that are currently online. Show their name, region, current player count, and maximum player capacity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_name, region, current_players, max_players FROM gaming_technology.servers 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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "For each state, count the number of customers and display state as state and the count as customer_count, ordered by customer_count descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT state,\n COUNT(*) AS customer_count\nFROM insurance.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.employees ( employee_id text, agency_id text, first_name text, l... | [
{
"role": "user",
"content": "Which employees share the same department with at least one other employee? Please show the employee ID, full name, and department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e1.employee_id, e1.first_name || ' ' || e1.last_name AS full_name, e1.d... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ... | [
{
"role": "user",
"content": "Show me all patients who have received a prescription for a medication with 'cillin' in its generic name, along with their full name, prescription date, and the prescribing doctor's last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.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 government_services.notifications ( notification_id text, citizen_id text, applicati... | [
{
"role": "user",
"content": "List all notifications sent through the 'Email' channel, showing all columns.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT notification_id, citizen_id, application_id, message_subject, message_body, channel, sent_at, status, related_entity_type, re... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me all staff members hired in 2022, including their first name, last name, and hire date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, hire_date FROM hospitality_technology.staff WHERE EXTRACT(YEAR FROM hire_date) = 2022... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ... | [
{
"role": "user",
"content": "I would like to get the total number of sessions and the average score for each game, showing game_id and title.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.game_id, g.title, COUNT(gs.session_id) AS total_sessions, AVG(gs.score) AS average_score... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// PUT /schedules
{
"mappings": {
"properties": {
"schedule_id": { "type": "keyword" ... | [
{
"role": "user",
"content": "能否帮我统计数据库中所有乘客的数量,按忠诚计划ID分组?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loyalty_program_id, COUNT(*) as passenger_count\nFROM passengers\nGROUP BY loyalty_program_id;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "For each asset, calculate the total quantity and average price of orders that have status 'filled'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT o.asset_id,\n SUM(o.quantity) AS total_quantity,\n AVG(o.price) AS average_price\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 smart_money_profit ( address character varying(100) NOT NULL, -- the user's address ... | [
{
"role": "user",
"content": "Calculate the average realized_ratio across all addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(realized_ratio) AS average_realized_ratio\nFROM smart_money_profit;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "What are all the unique job titles listed for employees?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT job_title FROM government_services.employees;",
"sql": null
},
{
"role": "user",
"content": "Could you show the count of ... |
You are an expert in writing database language. You can write a corresponding 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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Which staff members are managing properties, and what are the names and email addresses of those properties?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, p.property_name, p.email_address FROM hospitality_techn... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.transactions ( transaction_id character varying(64) NOT NULL, acc... | [
{
"role": "user",
"content": "Which accounts initiated transfer transactions to related accounts in April 2024, and what is the total amount sent per account?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_id, SUM(amount) AS total_sent\nFROM financial_services.transaction... |
You are an expert in writing database language. You can write a corresponding 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 each policy ID and its customer ID for which there are both premium payments recorded and beneficiaries listed. Include the total amount paid for that policy by that customer and the count of beneficiaries listed for that policy by that customer.",
"sql": null
},
{... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "Show me the top 5 projects by total investment value, along with their latest fundraising round name and valuation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, rounds_name, valuation, SUM(investment_value) AS total_investment_value F... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "Find all pairs of contracts that were deployed on the same network but by different deployer addresses. List the network ID, the addresses of both contracts, and the addresses of their respective deployers.",
"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 healthcare.medications (
medication_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "Count the total number of medications that have a description longer than 100 characters.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM healthcare.medications WHERE description IS NOT NULL AND LENGTH(description) > 100;",
"sql": nu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "Retrieve all prescriptions linked to chronic diagnoses. Show prescription_id, diagnosis_id, diagnosis_code, and prescription_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pr.prescription_id,\n d.diagnosis_id,\n d.diagnosis_code,\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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show me all Sui coins with at least 6 decimal places and status 'exists' from the metadata table. List coin_type, symbol, name, and decimals.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "List the names and email addresses of guests who have made a reservation in the last 60 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT g.first_name, g.last_name, g.email\nFROM hospitality_technology.guests g\nJOIN hospitality_technolog... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i... | [
{
"role": "user",
"content": "Show the customer_id and pairs of payment_ids for any customers who have overlapping payment periods.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.customer_id,\n p1.payment_id AS payment1_id,\n p2.payment_id AS payment2_id\nFROM insu... |
You are an expert in writing database language. You can write a corresponding 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": "Show me all users who started following someone in May 2024, along with both the user ID of the follower and the followed user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT follower_user_id, following_user_id\nFROM social_media.follows\nWHERE creat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "For each fuel type, show the number of unique vehicles that have used it and the total quantity refueled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.fuel_type, COUNT(DISTINCT f.vehicle_id) AS vehicle_count, SUM(f.quantity) AS total_quantity\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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List all time entries showing the lawyer's full name, the case name, hours spent, and description.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT CONCAT(l.first_name, ' ', l.last_name) AS lawyer_name, c.case_name, te.hours_spent, te.description\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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Show me all staff members who are currently active, along with their property name and position.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name \nFROM hospitality_technology.staff s \... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.