system stringlengths 315 8.44k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character vary... | [
{
"role": "user",
"content": "List all claims that have at least one document of type 'INVOICE', including the claim ID, incident date, estimated loss, and the document's file name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, c.estimated_loss, d.fi... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the most recent log entry for each user, including action and logged_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.user_id,\n l1.action,\n l1.logged_at\nFROM trading_platform.logs l1\nWHERE l1.logged_at = (\n SELECT MAX(... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_time... | [
{
"role": "user",
"content": "Identify all instances where a vehicle's odometer_reading decreased compared to its previous fuel log entry.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT curr.vehicle_id,\n prev.fuel_log_id AS previous_log_id,\n prev.odometer_reading ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "For Avalanche tokens, show me the token `tick`, `creator`, and `max_supply` from the `token_info_avalanche` table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tick, creator, max_supply FROM token_info_avalanche",
"sql": null
},
{
"role... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp... | [
{
"role": "user",
"content": "Compute the average realized_ratio and average pnl for smart money token performance grouped by chain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, AVG(realized_ratio) AS avg_realized_ratio, AVG(pnl) AS avg_pnl\nFROM smart_money_token_perfor... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// Use Hashes to store station details. Key format: station:<station_id>
// Example:
// HSET stat... | [
{
"role": "user",
"content": "能否帮我统计特定车站(station_id 为 'station_xyz')的所有平台数量?",
"sql": null
},
{
"role": "assistant",
"content": "SCARD station:station_xyz:platforms",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "List distinct patient IDs who have received a diagnosis from a doctor with 'Cardiology' specialty.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.patient_id FROM healthcare.diagnoses AS T1 JOIN healthcare.doctors AS T2 ON T1.doctor_id = 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 trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, mes... | [
{
"role": "user",
"content": "Get a list of users who have both read and unread notifications. For each user, show their user_id, the count of unread notifications as unread_count, and the count of read notifications as read_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers (
developer_id uuid NOT NULL DEFAULT gen_random_uui... | [
{
"role": "user",
"content": "Show me all in-game items with the word 'Sword' in their name along with the total number of sessions in those games.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.item_id, i.item_name, COUNT(s.session_id) AS session_count\nFROM gaming_technology.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Show all pairs of patients who share the same email domain. Return patient1_id, patient2_id, and the shared domain, but do not pair a patient with themselves.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.patient_id AS patient1_id, p2.patient_id ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Show all routes where the estimated duration is at least 120 minutes including their route number, type, and origin and destination location IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT route_number, type, origin_location_id, destination_locat... |
You are an expert in writing database language. You can write a corresponding 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": "List all top-level comments, showing their ID, post ID, user ID, and content.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT comment_id, post_id, user_id, content FROM social_media.comments WHERE parent_comment_id 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 social_media.follows ( follow_id.text, follower_user_id.text, following_user_id.text... | [
{
"role": "user",
"content": "Find users who followed at least two different people on the same calendar day. For each such user, list their ID, the IDs of the two people they followed, and the creation times of those two follow events.",
"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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Get each staff member who delivered service orders in the last month and the count of orders they delivered.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id,\n s.first_name,\n s.last_name,\n COUNT(so.order_id) AS delivered... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id t... | [
{
"role": "user",
"content": "For each reservation, find the next reservation made by the same guest and calculate the gap in days between them.",
"sql": null
},
{
"role": "assistant",
"content": "select r1.reservation_id as current_reservation_id, r2.reservation_id as next_reservation_id, 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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "Show me all doctors who are affiliated with 'hospital_123', including their full names and specialties.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, specialty FROM healthcare.doctors WHERE hospital_affiliation_id = 'hospital_... |
You are an expert in writing database language. You can write a corresponding 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 the route number and description for routes that have bookings associated with them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.route_number, T1.description FROM transportation.routes AS T1 JOIN transportation.bookings AS T2 ON 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Show me the case number and case name for all cases, along with the full name of the lawyer who uploaded any document related to those cases.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number, c.case_name, l.first_name || ' ' || l.last_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 social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_... | [
{
"role": "user",
"content": "List pairs of group conversations that were created on the same calendar day, showing their IDs and creation times.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.conversation_id AS convo1_id, T1.created_at AS convo1_created_at, T2.conversation_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.appointments ( appointment_id character varying(64) NOT NULL, client_... | [
{
"role": "user",
"content": "List all appointments that have a location specified and their status is not 'Cancelled'. Show the appointment ID, subject, and location.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, subject, location FROM legal_services.appointment... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "How many passengers were born in each year? Please show the birth year and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM date_of_birth) AS birth_year , COUNT(*) AS passenger_count FROM transportation.passengers WHERE 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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me the post_id, content, author's username, and the number of comments for each post where media_type is 'video'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.content, u.username, COUNT(c.comment_id) AS comment_count\nFROM social_... |
You are an expert in writing database language. You can write a corresponding 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 played sessions on more than one distinct game? Show their player_id, username, and the number of unique games they've played.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, COUNT(DISTINCT gs.game_id) AS un... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "Provide a list of passengers including their passenger_id, first_name, last_name, phone_number, and the total number of bookings they have made. Sort the result by booking count in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "I need to see claims where the incident date is in 2023. Show the claim ID, incident date, and customer ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id, incident_date, customer_id FROM insurance.claims WHERE incident_date >= '2023-01-01' ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.accounts (
account_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Provide the average high price for securities on each exchange, using market data from the last 6 months.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.exchange, AVG(md.high_price) AS average_high_price FROM financial_services.market_data AS md JO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"role": "user",
"content": "List the names and types of all in-game items that have a rarity of 'Epic'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_name, item_type FROM gaming_technology.in_game_items WHERE rarity = 'Epic';",
"sql": null
},
{
"role": "user",... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Can you give me all medical records where the assessment field is not null and not empty?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT record_id, patient_id, doctor_id, record_date, assessment FROM healthcare.medical_records WHERE assessment IS NOT... |
You are an expert in writing database language. You can write a corresponding 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.trades (
trade_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "I want a summary for each user showing their total buy value and total sell value across all trades.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n COALESCE(b.user_id, s.user_id) AS user_id,\n COALESCE(b.total_buy, 0) AS total_buy_value,\n COALE... |
You are an expert in writing database language. You can write a corresponding 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 text, address text, abi text, bytecode text, deployer_a... | [
{
"role": "user",
"content": "For each network, list the deployer address and the number of contracts they have deployed, ordered from most to least.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT network_id, deployer_address, COUNT(*) AS deployed_contracts FROM web3.contracts GR... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the total count and sum of amounts for spent and unspent UTXOs for each asset, including the asset name and symbol.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name AS asset_name, a.symbol, u.spent, COUNT(*) AS utxo_count, SU... |
You are an expert in writing database language. You can write a corresponding 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": "Get a list of appointment_id, start_time, and invoice_number for appointments that have a related invoice.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id,\n a.start_time,\n i.invoice_number\nFROM legal_services.appointmen... |
You are an expert in writing database language. You can write a corresponding 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 all insurance products that have a base premium greater than 1000 and are currently active, showing product name, type, and base premium.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.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 financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account... | [
{
"role": "user",
"content": "List all accounts with a balance below 1000, showing the account_id, account_number, and currency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_id, account_number, currency\nFROM financial_services.accounts\nWHERE balance < 1000;",
"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.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List all vehicles with their assigned driver full names, license plates, and scheduled departure times for upcoming trips, ordered by departure time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id,\n v.license_plate,\n d.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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "List all narratives that have a market cap between 500,000,000 and 5,000,000,000 USD and a positive price change over the last 7 days. Show the narrative name, market cap, and price change percentage for the last 7 days.",
"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.messages ( message_id character varying(64) NOT NULL, conversation_id c... | [
{
"role": "user",
"content": "List `user_id` and `conversation_id` for participants who are in conversations where there is at least one message sent by *another* user that they have not read.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.user_id, T1.conversation_id ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date ti... | [
{
"role": "user",
"content": "Show me all claims with police reports that were handled by agents hired in the last 2 years, along with the agent's full name and agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.policy_id, c.incident_date, c.police_report_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 legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w... | [
{
"role": "user",
"content": "List all law firms that do not have a managing partner listed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_name, phone, address, founded_date\nFROM legal_services.law_firms\nWHERE managing_partner_id 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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Get the total fuel cost per route, showing route_number and the sum of total_cost for all fuel logs associated with trips on that route.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number,\n SUM(fl.total_cost) AS total_fuel_cost\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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "For each document (identified by case_id and document_name), find the latest version number and the ID of the lawyer who uploaded that version.",
"sql": null
},
{
"role": "assistant",
"content": "WITH RankedDocuments AS ( SELECT document_id, case_id, document_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 social_media.notifications ( notification_id character varying(64) NOT NULL, recipie... | [
{
"role": "user",
"content": "Count the number of unread notifications for each notification_type across all users.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n notification_type,\n COUNT(*) AS unread_count\nFROM social_media.notifications\nWHERE read_at IS NULL\nGROUP BY n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "List all servers that are currently marked with a 'offline' status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_id, server_name, region FROM gaming_technology.servers WHERE status = 'offline';",
"sql": null
},
{
"role": "user",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "Which are the top 5 smart money addresses with the highest ROI on the BSC chain, and what are their profit, realized ratio, and most profitable token?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, profit, roi, realized_ratio, most_profit_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 legal_services.cases ( case_id text PRIMARY KEY, case_number text UNIQUE, case_name ... | [
{
"role": "user",
"content": "Retrieve all billable but not yet billed time entries, showing entry_id, lawyer_id, case_id, hours_spent, and billing_rate.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT entry_id, lawyer_id, case_id, hours_spent, billing_rate\nFROM legal_services.ti... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the detailed repair history of equipment u... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Could you provide a report showing each in-game item's name and the total quantity currently held in player inventories?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ii.item_name, SUM(pi.quantity) AS total_held FROM gaming_technology.player_invento... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "Show me all active drivers whose license will expire in the next 60 days, including their full name and contact information.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name, contact_number, email, license_expiry_date 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 government_services.service_locations ( location_id.text, agency_id.text, location_n... | [
{
"role": "user",
"content": "How many service locations are accessible in each state? Provide the state and the count of accessible locations.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) FROM government_services.service_locations WHERE is_accessible = TRUE GRO... |
You are an expert in writing database language. You can write a corresponding 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": "Can you provide a list of all players who have acquired at least one item, along with the item name, its type, and the title of the game that item belongs to?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.player_id, items.item_name, items.item_ty... |
You are an expert in writing database language. You can write a corresponding 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": "Which employees have been assigned to applications for services with a standard fee greater than 200? Show the employee's full name, job title, application ID, and the service name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT 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.premium_payments ( payment_id.text, policy_id.text, customer_id.text, paym... | [
{
"role": "user",
"content": "Find all pairs of payments for the same policy where the payment_periods overlap. Show payment_id1, payment_id2, policy_id, overlap_start, and overlap_end.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.payment_id AS payment_id1,\n p2.paymen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.likes ( like_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "Count the total number of group chats.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = true;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "Show me all pairs of usernames for users located in the same city along with their shared location.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u1.username AS user1, u2.username AS user2, u1.location\nFROM social_media.users u1\nJOIN social_media.... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve each employee with their manager's first_name and last_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.employee_id, e.first_name AS employee_first_name, e.last_name AS employee_last_name, m.first_name AS manager_first_name, m.last_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.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "Which active services have a standard fee less than 100, and what are the agency IDs and categories for these services?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_name, agency_id, category FROM government_services.services WHERE is_active... |
You are an expert in writing database language. You can write a corresponding 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": "Find all clients who do not have a company name listed and show their full name and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM legal_services.clients WHERE company_name 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.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,... | [
{
"role": "user",
"content": "Show the full name of each manager and the average commission rate of the agents who report directly to them. Only include managers who have at least one reporting agent.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T2.first_name AS manager_first_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.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List the full names of patients who have had at least one appointment scheduled with a doctor, along with the medication names they have been prescribed. Please include only patients who have both an appointment and at least one corresponding medication.",
"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.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Show assets of type 'token', including their name, symbol, and any associated metadata key and value.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.name, t1.symbol, t2.key, t2.value FROM trading_platform.assets AS t1 LEFT JOIN trading_platform.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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "List all patients who have been prescribed medications manufactured by 'AstraZeneca', showing patient ID, first and last name, medication name, and manufacturer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.patient_id, p.first_name, p.la... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, case_number character... | [
{
"role": "user",
"content": "Which cases have at least one document uploaded, and what are the names and case numbers of those cases along with the most recent document name for each?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_id, c.case_name, c.case_number, d.documen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id... | [
{
"role": "user",
"content": "Compute the co-occurrence count for each hashtag pair across all posts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ph1.hashtag_id AS tag_a, ph2.hashtag_id AS tag_b, COUNT(DISTINCT ph1.post_id) AS co_occurrence_count\nFROM social_media.post_hashta... |
You are an expert in writing database language. You can write a corresponding 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": "List each user along with how many image-type posts they've made, showing user_id and image_post_count, sorted by the count descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(*) AS image_post_count\nFROM social_media.posts\nWHE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "List all posts that contain a non-empty media_url and show the usernames of their authors.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.media_url, u.username\nFROM social_media.posts p\nJOIN social_media.users u ON p.user_id = u.user_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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "I want to see a list of insurance plans along with the full names of all doctors whose hospital affiliation ID matches the plan ID. For each entry, include the plan name, insurance provider, doctor ID, and the doctor's first and last name.",
"sql": null
},
{
"role":... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Show the total hours spent by each lawyer across all their time entries. Display the lawyer's first name, last name, and the total hours.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, SUM(te.hours_spent) AS total_hours 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 insurance.insurance_products ( product_id character varying(64) NOT NULL, product_na... | [
{
"role": "user",
"content": "Find all pairs of insurance products that belong to the same product_type and are both active, listing the two product IDs and their names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.product_id AS product1_id, p1.product_name AS product1_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 transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, vehicle_id ch... | [
{
"role": "user",
"content": "List consecutive fuel log entries for each vehicle based on log_timestamp. Show vehicle ID, current log ID, previous log ID, current timestamp, previous timestamp, and the quantity difference (current - previous).",
"sql": null
},
{
"role": "assistant",
"content... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text... | [
{
"role": "user",
"content": "List all doctors whose last name begins with 'B', showing their doctor ID, full name, and their hospital affiliation ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id, first_name, last_name, hospital_affiliation_id FROM healthcare.doctors ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE manufacturing.components (
component_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "我想查询所有使用特定材料ID的组件信息,包括组件名称、零件编号和供应商ID,同时还需要获取该材料的名称和规格。",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.component_id, c.component_name, c.part_number, c.supplier_id, m.material_name, m.specification\nFROM manufacturing.components c\nJOIN manufacturi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "List law firm names and the full name and specialization of all lawyers hired after 2020.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.firm_name, T2.first_name || ' ' || T2.last_name AS lawyer_full_name, T2.specialization FROM law_firms AS T1 JO... |
You are an expert in writing database language. You can write a corresponding 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 character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "For each narrative, what is the average smart money ROI and the total 24-hour trading volume of the narrative?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T3.narrative, T4.avg_roi, T3.volume_24h FROM narrative_info AS T3 JOIN ( SELECT T2.narrative... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, game_id uuid, server_name te... | [
{
"role": "user",
"content": "Show me pairs of servers in the same region hosting different games where one has at least 100 more current players than the other.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_id AS server1_id,\n s1.server_name AS server1_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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Which citizens have submitted applications for services offered by agencies established before 2020? Please show the citizen's first name, last name, and the agency's name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, a.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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "List the subscriber names from patient insurance entries where the group number is not provided (is null).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT subscriber_name FROM healthcare.patient_insurance WHERE group_number 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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"role": "user",
"content": "For each account status, what is the total quantity of securities traded?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T2.status, SUM(T1.quantity) FROM financial_services.trades AS T1 JOIN financial_services.accounts AS T2 ON T1.account_id = T2.acc... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "List the token IDs and names of all NFTs minted by the wallet '0x1234...' on Ethereum.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_id, name FROM nft_metadata WHERE minter = '0x1234...' AND blockchain = 'Ethereum';",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Count the number of law firms founded in each decade. Show the decade (e.g., 1990s, 2000s) and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT CONCAT(FLOOR(EXTRACT(YEAR FROM founded_date) / 10) * 10, 's') AS decade, COUNT(*) AS firm_count 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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "How many citizens registered in each year?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE_PART('year', registration_date) AS year,\n COUNT(*) AS registration_count\nFROM government_services.citizens\nGROUP BY DATE_PART('year', registration... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... | [
{
"role": "user",
"content": "特定の組み立てラインに関連するすべての手順を取得したいです。ラインIDと手順名、手順番号、必要なスキルレベルを含めてください。",
"sql": null
},
{
"role": "assistant",
"content": "db.assembly_steps.find(\n { line_id: '<specific_line_id>' },\n { step_id: 1, line_id: 1, step_number: 1, step_name: 1, required_skill_level:... |
You are an expert in writing database language. You can write a corresponding 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": "For hashtag ID 'H789', get each post ID and the number of distinct comments that have been made on those posts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ph.post_id,\n COUNT(DISTINCT c.comment_id) AS comment_count\nFROM social_media.post_h... |
You are an expert in writing database language. You can write a corresponding 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": "Find all bookings along with the first and last name of the passenger and the trip_id, where the booking status is 'Cancelled'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name, p.last_name, b.trip_id\nFROM transportation.boo... |
You are an expert in writing database language. You can write a corresponding 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, username character ... | [
{
"role": "user",
"content": "For each asset, show its name, symbol, and the total trade quantity executed in July 2024. Please also display the username of each buyer for these trades.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.name AS asset_name, a.symbol AS asset_symbol,... |
You are an expert in writing database language. You can write a corresponding 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": "Count the number of diagnoses for each unique diagnosis code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT diagnosis_code, COUNT(*) FROM healthcare.diagnoses GROUP BY diagnosis_code;",
"sql": null
},
{
"role": "user",
"content": "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 transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Identify pairs of routes that share the same origin and destination but have different route_ids.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.route_id AS route_a, r2.route_id AS route_b, r1.origin_location_id, r1.destination_location_id FROM tr... |
You are an expert in writing database language. You can write a corresponding 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": "List the names of law firms whose managing partner has uploaded at least one document, and show the managing partner ID along with the firm's phone number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.firm_name, T1.managing_partner_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 social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte... | [
{
"role": "user",
"content": "List all hashtags created in March 2024 along with their creation timestamps.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT hashtag_id, tag_name, created_at\nFROM social_media.hashtags\nWHERE created_at BETWEEN '2024-03-01 00:00:00' AND '2024-03-31 ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "List all law firms founded in the year 2015. Show their names, phone numbers, and website.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_name, phone, website\nFROM legal_services.law_firms\nWHERE EXTRACT(YEAR FROM founded_date) = 2015;",
"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 hospitality_technology.properties ( property_id.text, property_name.text, address_li... | [
{
"role": "user",
"content": "List all service orders for spa services in the last month, including the guest ID and total price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT order_id, guest_id, total_price FROM hospitality_technology.service_orders WHERE service_id LIKE 'SPA%'... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "For each event recorded, list its ID, name, and the status and value of the transaction in which it occurred.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT E.event_id, E.event_name, E.transaction_id, T.status, T.value FROM web3.events AS E JOIN web3... |
You are an expert in writing database language. You can write a corresponding 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": "List the file name and file size for all claim documents uploaded by agents whose license state is 'CA' and status is 'Active'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.file_name, T1.file_size_bytes FROM insurance.claim_documents AS T1 JOIN ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List property names and the total maximum occupancy across all their room types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.property_name, SUM(T2.max_occupancy) FROM properties AS T1 JOIN room_types AS T2 ON T1.property_id = T2.property_id GRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ... | [
{
"role": "user",
"content": "Find parent agencies and the number of direct child agencies they have. List the parent agency name and the count of their children.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.agency_name, COUNT(T2.agency_id) FROM government_services.agencies ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// Use Hashes to store station details. Key format: station:<station_id>
// Example:
// HSET stat... | [
{
"role": "user",
"content": "能否帮我查询特定路线(route_id 为 'route_ne_corr')上的所有车站信息,并包含每个车站的平台数量?",
"sql": null
},
{
"role": "assistant",
"content": "ZRANGE route:route_ne_corr:stops 0 -1\nHGETALL route_station:<route_station_id> for each route_station_id in result\nHGETALL station:<station_id> for... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid NOT NULL DEFAULT gen_random_uuid(),... | [
{
"role": "user",
"content": "For each server, show its name and the total number of achievements available for the game it hosts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.server_name, s.region, COUNT(a.achievement_id) AS achievement_count\nFROM gaming_technology.servers ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Which games have achievements where the points value is exactly 0? List the game title and the achievement name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title AS game_title, a.name AS achievement_name\nFROM gaming_technology.achievements a\n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "List each game title along with the number of servers currently online for that game, only include games that have more than 3 online servers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, COUNT(s.server_id) AS online_server_count\nFROM gam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "Give me the count of policies grouped by their status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS policy_count\nFROM insurance.policies\nGROUP BY status;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id character varying(64) NOT NULL, name characte... | [
{
"role": "user",
"content": "Show all locations in 'Texas' with their name, city, and type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT location_id, name, city, type\nFROM transportation.locations\nWHERE state_province = 'Texas';",
"sql": null
},
{
"role": "user",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.