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.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List all vehicles that have no associated fuel logs. Include the vehicle's make, model, and license plate.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.make , T1.model , T1.license_plate FROM transportation.vehicles AS T1 LEFT JOIN transportat... |
You are an expert in writing database language. You can write a corresponding 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": "Show me a list of all agencies and the number of distinct citizens who have submitted documents to each agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agency_name, COUNT(DISTINCT d.citizen_id) AS citizen_count\nFROM government_services.docu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id text, property_id text, service_name te... | [
{
"role": "user",
"content": "List all food and beverage services (category = 'Food & Beverage') with their names, prices, and units, where the price is less than $20.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_name, price, unit FROM hospitality_technology.services 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "For each Avalanche token tick, calculate the total transfer volume and transaction count over the past 7 days using token_activities_avalanche. Include the token tick, total_volume, and tx_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n tick... |
You are an expert in writing database language. You can write a corresponding 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": "Show me all diesel vehicles with a capacity greater than 20, including their make, model, and year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, make, model, year, capacity FROM transportation.vehicles WHERE fuel_type = 'diesel' AND cap... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all reservations along with their guest's full name and the total amount, for reservations that have more than 2 adults.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS guest_full_name, r.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 social_media.conversation_participants (
participant_id character varying(64) NO... | [
{
"role": "user",
"content": "Find all users who share a conversation with user 'user123', listing their user_id and the conversation_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT cp2.user_id, cp2.conversation_id\nFROM social_media.conversation_participants cp1\nJOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty... | [
{
"role": "user",
"content": "Show the top 5 largest documents by file size, including document_id, claim_id, file_name, and file_size_bytes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_id,\n claim_id,\n file_name,\n file_size_bytes\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 gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "Could you list the title of each game and the total quantity of items acquired by players for that specific game?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, SUM(pi.quantity) AS total_acquired_quantity FROM gaming_technology.games g JOIN ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions (
session_id uuid NOT NULL DEFAULT gen_random_uu... | [
{
"role": "user",
"content": "Find the date (calendar day) with the highest total number of game sessions. Show the date and the total session count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT CAST(start_time AS DATE) AS session_date, COUNT(*) AS total_sessions\nFROM gaming_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 insurance.agents ( agent_id text, first_name text, last_name text, agency_name text,... | [
{
"role": "user",
"content": "I need a report of how many documents each agent has uploaded in the past month. Include agent_id, agent full name, and the document count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name || ' ' || a.last_name AS full_name, CO... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not inclu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_nam... | [
{
"role": "user",
"content": "List each security and the total amount traded for it, with ticker symbol and security name. Only include trades from the last 90 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, SUM(t.total_amount) AS total_trad... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.diagnoses ( diagnosis_id text PRIMARY KEY, record_id text, patient_id tex... | [
{
"role": "user",
"content": "Show me a list of prescriptions, including the prescription ID, medication ID, and start date, for prescriptions linked to any diagnosis that is marked as chronic.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.prescription_id, T1.medication_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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number contain... | [
{
"role": "user",
"content": "List all ERC20 tokens with their names and symbols where the price is greater than $10, sorted by price in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.symbol, t.name, p.price FROM sui_coins_metadata t JOIN token_prices_latest 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.dapps (
dapp_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "How many unique users have a KYC audit record with status 'pending'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT user_id) AS pending_kyc_users\nFROM trading_platform.kyc_audit\nWHERE status = 'pending';",
"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.appointments ( appointment_id.text, client_id.text, lawyer_id.text, c... | [
{
"role": "user",
"content": "Find all pairs of appointments that are scheduled for the same case and overlap in time. Show the IDs of the two overlapping appointments and the shared case ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.appointment_id AS appointment1_id, t2.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "How many users registered in 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM trading_platform.users WHERE DATE_PART('year', created_at) = 2024;",
"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.staff ( staff_id text PRIMARY KEY, property_id text, first_na... | [
{
"role": "user",
"content": "List staff members who were hired in the last calendar year, showing their full name, position, and hire date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, position, hire_date FROM hospitality_technology.staff WHERE hire_date... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "I want the number of achievements unlocked per country_code by active players, showing only countries with at least 100 unlocks.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.country_code, COUNT(*) AS unlock_count\nFROM gaming_technology.players 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 erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transacti... | [
{
"role": "user",
"content": "Show me the top 5 Sui NFT collections with the highest number of unique owners, along with their names and collection types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, collection_type, COUNT(DISTINCT owner) AS unique_owners FROM sui_nfts 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 web3.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(6... | [
{
"role": "user",
"content": "Can you show me all wallet address pairs that are owned by the same user but have different private keys, along with their wallet_ids and user_id?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.user_id, w1.wallet_id AS wallet_id_1, w1.address AS 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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "How many 'ApprovalForAll' events are recorded for each ERC1155 contract address in the `erc1155_approval_for_all` table?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_for_all GROUP B... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.loans ( loan_id text, account_id text, loan_type text, principal_... | [
{
"role": "user",
"content": "For each loan type, show the total outstanding principal balance and the number of active loans.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loan_type, SUM(current_principal_balance) AS total_outstanding_balance, COUNT(*) AS active_loan_count FROM... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "Show each user's username and the total number of notifications they have received.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, count(T2.notification_id) FROM users AS T1 LEFT JOIN notifications AS T2 ON T1.user_id = T2.user_id GROUP ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc20_balances ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wa... | [
{
"role": "user",
"content": "For each wallet that currently holds more than 5000 units of any ERC20 token, show the wallet address and contract address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, wallet_address, CAST(amount AS numeric) AS amount\nFROM erc20... |
You are an expert in writing database language. You can write a corresponding 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": "List all documents, including their name and upload timestamp, along with the first and last name of the client associated with the case they belong to.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_name, d.upload_timestamp, c.first_name ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w... | [
{
"role": "user",
"content": "Show me the names and websites of all law firms founded before 2000, along with their managing partner IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_name, website, managing_partner_id FROM legal_services.law_firms WHERE founded_date < '200... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id text, product_name text, product_type text... | [
{
"role": "user",
"content": "List the name and type for all insurance products with a base premium over 5000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_name, product_type FROM insurance.insurance_products WHERE base_premium > 5000;",
"sql": null
},
{
"ro... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all policy beneficiaries, showing their first name, last name, relationship, percentage share, and the first and last name of the customer associated with the beneficiary record.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.l... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List the content and comment ID for all comments made by users with private profiles.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.comment_id, c.content FROM social_media.comments AS c JOIN social_media.user_settings AS us ON c.user_id = us.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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "Find narratives from the narrative_info table where the top 3 coins list contains either 'BTC' or 'ETH'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative FROM narrative_info WHERE top_3_coins LIKE '%BTC%' OR top_3_coins LIKE '%ETH%';",
"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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the service names and the count of completed payments for each service.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_id, s.service_name, COUNT(p.payment_id) AS completed_payment_count\nFROM government_services.services s\nLEFT JOIN g... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Node Label ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St... | [
{
"role": "user",
"content": "I need to check the inventory status of components, including their batch details and warehouse location.",
"sql": null
},
{
"role": "assistant",
"content": "MATCH (i:InventoryBatch)-[:IS_INSTANCE_OF]->(c:Component)\nRETURN c.component_id, c.component_name, i.in... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.likes ( like_id text PRIMARY KEY, user_id text, post_id text, comment_i... | [
{
"role": "user",
"content": "Show me all users who have liked both a post and a comment. Please include their user IDs, the post IDs, and the comment IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT l1.user_id, l1.post_id, l2.comment_id\nFROM social_media.likes l1\nJ... |
You are an expert in writing database language. You can write a corresponding 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": "Show the names of group conversations and how many participants they have.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.group_name, count(cp.user_id) AS participant_count FROM social_media.conversations AS c JOIN social_media.conversation_partici... |
You are an expert in writing database language. You can write a corresponding 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 partners who were hired in the same year. Show their first name, last name, hire year, and firm ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.first_name, l1.last_name, EXTRACT(YEAR FROM l1.hire_date) AS hire_year, l1.firm_id FROM leg... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "Show me a list of all policy numbers that have a deductible exactly equal to 0.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_number\nFROM insurance.policies\nWHERE deductible = 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.reviews ( review_id.text, property_id.text, reservation_id.te... | [
{
"role": "user",
"content": "Count reviews with an overall rating of 5 for each property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_id, COUNT(*) AS five_star_review_count FROM hospitality_technology.reviews WHERE rating_overall = 5 GROUP BY property_id;",
"sql"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "List all premium payments with status 'Completed', showing the payment ID, payment date, amount paid, and the first and last name of the customer who made the payment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.payment_id, T1.payment_date, T1.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List all depots (location type 'Depot') and the number of vehicles assigned to each. Include the depot name and city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.name , T1.city , COUNT(T2.vehicle_id) FROM transportation.locations AS T1 LEFT J... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the current market price of a Boeing 737 MAX aircraft?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and gener... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Display the name and type of each location, as well as the earliest and latest maintenance service_date for vehicles assigned to that location (assuming vehicle_id matches location_id).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.name, l.type,\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
Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str... | [
{
"role": "user",
"content": "I need to get a list of employees assigned to a specific assembly line, including their job title and hire date.",
"sql": null
},
{
"role": "assistant",
"content": "MATCH (e:Employee)-[:ASSIGNED_TO]->(al:AssemblyLine {line_id: 'specific_line_id'})\nRETURN e.empl... |
You are an expert in writing database language. You can write a corresponding 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 chain, which token has the lowest average cost as reported by smart money, and what is its current price and ROI?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT smtp.chain, smtp.token_symbol, MIN(smtp.avg_cost) AS lowest_avg_cost, smtp.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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List lawyers who have any unbilled time entries. Show their first name, last name, and the count of their unbilled entries.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, COUNT(T2.entry_id) FROM lawyers AS T1 JOIN time_en... |
You are an expert in writing database language. You can write a corresponding 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 each property with the count of rooms that are currently marked as 'Occupied', including the property_name and occupied_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(r.room_id) AS occupied_count\nFROM properties 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
Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id... | [
{
"role": "user",
"content": "Can you help me retrieve inspection records for a specific step ID, including the inspection type, result, timestamp, and the associated build ID?",
"sql": null
},
{
"role": "assistant",
"content": "db.inspections.find({ step_id: 'specific_step_id' }, { inspecti... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "List the order ID, type, and quantity for all orders placed using the wallet with ID 'wallet123'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT order_id, order_type, quantity FROM orders WHERE wallet_id = 'wallet123'",
"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 character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "List the doctor ID, last name, and the date they were updated, for all doctors updated in the year 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id, last_name, updated_at FROM healthcare.doctors WHERE updated_at >= '2024-01-01' AND upda... |
You are an expert in writing database language. You can write a corresponding 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": "List all active insurance products, including their product name, type, and base premium.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WHERE is_active = TRUE;",
"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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "List all pairs of narratives where the first narrative has a higher market_cap than the second. Display narrative1, narrative2, cap1, cap2.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n1.narrative AS narrative1, n2.narrative AS narrative2, n1.mark... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Show me the count of game servers available for each game platform. Include the platform name and the server count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.platform, COUNT(s.server_id) AS server_count FROM gaming_technology.servers AS s 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 web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_a... | [
{
"role": "user",
"content": "List all users who created a wallet on the same day they registered. Show user ID, username, and the wallet address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, w.address FROM web3.users AS u JOIN web3.wallets AS w ON u.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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "Which month in 2022 saw the highest total fundraising amount, and which project contributed the most to that month's total?",
"sql": null
},
{
"role": "assistant",
"content": "WITH monthly_totals AS (\n SELECT \n to_char(to_date(investment_date, 'YYYY-... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "List the first and last names of all drivers with status 'Active' along with the route number and type of all Express routes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, r.route_number, r.type\nFROM transportation.driver... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty... | [
{
"role": "user",
"content": "특정 국가의 모든 공급업체 정보를 조회하고 싶습니다. 국가 이름, 공급업체 이름, 주소, 품질 등급을 포함해 주세요.",
"sql": null
},
{
"role": "assistant",
"content": "GET suppliers/_search\n{\n \"query\": {\n \"term\": {\n \"country\": \"Korea\"\n }\n },\n \"_source\": [\"supplier_name\", \"addre... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "Show me the incident date, estimated loss, and the associated product name for all claims with an estimated loss greater than 20000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.incident_date, c.estimated_loss, p.product_name\nFROM insurance.clai... |
You are an expert in writing database language. You can write a corresponding 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": "Show me all pairs of medications that share the same manufacturer. Include each medication's medication_id, medication_name, and the manufacturer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m1.medication_id AS med1_id, m1.medication_name AS med1_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.users ( user_id text, username text, email text, password_hash text, created_at... | [
{
"role": "user",
"content": "Find pairs of users who registered on the same weekday but in different years. List the user ID and registration date for both users, and the weekday name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u1.user_id, u1.created_at AS user1_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 trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type te... | [
{
"role": "user",
"content": "Show the number of UTXOs associated with each unique address in the system.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, COUNT(utxo_id) FROM trading_platform.utxos GROUP BY address;",
"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 text, property_name text, address_li... | [
{
"role": "user",
"content": "Calculate the average star rating for each property type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_type, AVG(star_rating) AS average_star_rating FROM hospitality_technology.properties GROUP BY property_type;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "For each property, compute the average price and count of available services grouped by department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, s.department, COUNT(*) AS service_count, AVG(s.price) AS avg_price\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 social_media.follows ( follow_id character varying(64) NOT NULL, follower_user_id ch... | [
{
"role": "user",
"content": "How many users is each user following? Provide follower_user_id and the count of followings.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT follower_user_id, COUNT(*) AS following_count\nFROM social_media.follows\nGROUP BY follower_user_id;",
"sq... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.notifications ( notification_id.text, user_id.text, message.text, s... | [
{
"role": "user",
"content": "Find all notifications that were sent more than 24 hours ago and are still unread. Show the notification ID, user ID, and sent_at timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT notification_id, user_id, sent_at FROM notifications WHERE rea... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Could you provide the number of customers in each state who currently have at least one active policy? Return the state and customer_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.state, COUNT(DISTINCT c.customer_id) AS customer_count\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 blockchain.transactions ( transaction_id text, block_id text, sender_address text, r... | [
{
"role": "user",
"content": "List all address IDs with a balance under 50, along with the count of transactions they have received.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.address_id, a.balance, COUNT(t.transaction_id) AS received_count\nFROM blockchain.addresses a\nLEF... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc20_balances_historical (
block_number bigint NOT NULL, -- Block number contai... | [
{
"role": "user",
"content": "For each Avalanche token tick, find its total transfer volume and transfer count in the last 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n a.tick,\n SUM(a.amt) AS total_volume,\n COUNT(*) AS transfer_count\nFROM token_activities_avalanc... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.prescriptions ( prescription_id text, record_id text, patient_id text, do... | [
{
"role": "user",
"content": "Can you show me all prescriptions along with each patient's policy number and insurance plan ID?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.prescription_id, p.patient_id, p.medication_id, pi.policy_number, pi.plan_id\nFROM healthcare.prescripti... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "For each player, list their username together with the titles of games they have any items from in their inventory.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.username, g.title\nFROM gaming_technology.players p\nJOIN 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 narrative_info ( narrative text, top_3_coins text, price_change_percentage_1h numeri... | [
{
"role": "user",
"content": "List narratives with a market cap over $1,000,000,000, ordered by market cap descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap FROM narrative_info WHERE market_cap > 1000000000 ORDER BY market_cap DESC;",
"sql": nul... |
You are an expert in writing database language. You can write a corresponding 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 number of wallets created for each user. Return user_id and wallet_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(*) AS wallet_count\nFROM web3.wallets\nGROUP BY user_id;",
"sql": null
},
{
"role": "user",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ... | [
{
"role": "user",
"content": "Show total session duration and average score for each player across all their sessions. Display the player ID, total duration, and average score.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(duration_seconds) AS total_duration, 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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "Show me the driver_id and full name for all drivers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name FROM transportation.drivers;",
"sql": null
},
{
"role": "user",
"content": "Only show drivers whose s... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.orders ( order_id character varying(64) NOT NULL, user_id character... | [
{
"role": "user",
"content": "I need the total traded value (quantity * price) for each buyer and asset symbol for trades after '2024-06-01'. List buyer_id, asset symbol, and total_value.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.buyer_id, m.value AS asset_symbol, SUM(t.qu... |
You are an expert in writing database language. You can write a corresponding 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 each vehicle along with the city of the station where it had its most recent fueling and the timestamp of that fueling.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id,\n v.license_plate,\n l.city AS last_fuel_city,\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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "For each relationship type among policy beneficiaries, count how many beneficiaries exist of that type. Provide relationship and count, ordered by count descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT relationship,\n COUNT(*) AS bene... |
You are an expert in writing database language. You can write a corresponding 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": "Which wallets currently hold more than 100 units of any ERC1155 NFT on Ethereum? Please show contract address, token id, wallet address, and amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, token_id, wallet_address, CAST(amoun... |
You are an expert in writing database language. You can write a corresponding 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": "Get a list of all patients and all medications they could potentially take. Include patient_id, full name, medication_id, and medication_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name || ' ' || p.last_name AS full_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "For each guest, show their full name and the total quantity of services they have ordered in the last 30 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n SUM(so.quantity... |
You are an expert in writing database language. You can write a corresponding 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": "For each player who has unlocked at least two achievements, find the time difference in minutes between their first and last achievement unlock. Show player_id and the difference labeled last_minus_first_minutes.",
"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.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"role": "user",
"content": "Count how many prescriptions exist for each medication_id and order the results by the highest count first.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, COUNT(*) AS prescription_count\nFROM healthcare.prescriptions\nGROUP BY medicati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "List all insurance plans and the doctors whose hospital affiliation ID matches the plan ID. Include plan_name, insurance_provider, doctor first_name, and last_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, ip.insurance_provider, d... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "Show all tokens on the 'Arbitrum' chain from DEX pools that have a 24-hour trading volume between $100,000 and $500,000. Display token symbol, price, and volume_24h.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n token_symbol,\n price,\n volume_... |
You are an expert in writing database language. You can write a corresponding 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 each wallet address, the user who owns it, and the number of UTXOs associated with that address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w.address, w.user_id, COUNT(u.utxo_id) AS utxo_count\nFROM trading_platform.wallets w\nLEFT JOIN trad... |
You are an expert in writing database language. You can write a corresponding 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.text, tag_name.text, created_at.timestamp )
CREAT... | [
{
"role": "user",
"content": "List all group conversations that were created after January 1st, 2023, and for each, show the names of hashtags that were created within the same month as the conversation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id, c.group_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 government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "For each employee, find their first and last name along with the number of applications they've been assigned. Only include employees with at least 5 assigned applications.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name,\n e.last_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 insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty... | [
{
"role": "user",
"content": "List pairs of documents uploaded by the same user for the same claim. Return uploaded_by, claim_id, document_id AS doc1_id, and the paired document_id AS doc2_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cd1.uploaded_by,\n cd1.claim_id,\n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "List all guests who have a loyalty_member_id, showing their guest_id, first_name, last_name, and loyalty_member_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id,\n first_name,\n last_name,\n loyalty_member_id\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 legal_services.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me all cases along with the names and types of documents associated with them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_id, c.case_number, c.case_name, d.document_name, d.document_type\nFROM legal_services.cases c\nLEFT JOIN legal_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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative t... | [
{
"role": "user",
"content": "Show me the top 3 narratives by 24-hour trading volume, along with their 1-hour and 24-hour price change percentages.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, volume_24h, price_change_percentage_1h, price_change_percentage_24h FROM n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.maintenance_logs (
log_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me all maintenance logs for 'Oil Change' services performed in the last 6 months, including the vehicle ID, service date, and cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_log... |
You are an expert in writing database language. You can write a corresponding 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": "Show me all servers where current_players is 0, and include their server_id, server_name, and region.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_id, server_name, region FROM gaming_technology.servers WHERE current_players = 0;",
"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 the number of trips and the average passenger count per vehicle.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, COUNT(t.trip_id) AS trip_count, AVG(t.passenger_count) AS avg_passenger_count\nFROM transportation.vehicles v\nLEFT JOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.securities ( security_id.text, ticker_symbol.text, isin_code.text... | [
{
"role": "user",
"content": "List pairs of securities from the same issuer where one security was updated within the last 30 days, and the other was updated more than 90 days ago. Show issuer name, ticker symbols, and last_updated timestamps for both.",
"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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Show me all male patients who have received more than one prescription, including their full name, date of birth, and the total number of prescriptions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, p.date_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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "List all group chats created in 2024, showing the group_name, conversation_id, and creation time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT conversation_id, group_name, created_at\nFROM social_media.conversations\nWHERE is_group_chat = true 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 character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List vehicle make, model, maintenance service date, and cost for all maintenance logs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.make, v.model, ml.service_date, ml.cost FROM transportation.vehicles AS v JOIN transportation.maintenance_logs AS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "Show each policy number and the total amount paid for it across all premium payments received so far.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, SUM(T2.amount_paid) FROM insurance.policies AS T1 JOIN insurance.premium_payments 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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "I want to know the usernames of users who have followed more than three different people, along with the date they created their accounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, u.created_at, COUNT(DISTINCT f.following_user_id) AS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.