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 smart_money_token_inflow ( token_address.text, token_symbol.text, token_amount.numer... | [
{
"role": "user",
"content": "For each chain, find the token with the highest net USD inflow (buys minus sells). Show token_symbol, chain, and net_inflow.",
"sql": null
},
{
"role": "assistant",
"content": "WITH inflow AS (\n SELECT token_symbol, chain, SUM(usd_value) AS usd_in\n FROM smar... |
You are an expert in writing database language. You can write a corresponding 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": "Please list the top 5 players by number of achievements unlocked since 2023-01-01. Show each player's username and the total count of achievements they unlocked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, COUNT(*) AS unlock_count\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.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Show the full name of lawyers who are the lead attorney on cases for clients registered in 2023. List each lawyer's full name and the client's registration date for such cases.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "For each property, show the number of guests who have checked in since the start of this year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(DISTINCT res.guest_id) AS guest_count\nFROM hospitality_technology.reservations res\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 PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List the usernames and countries for players who are located in a country where at least one developer is also registered.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, country_code FROM gaming_technology.players WHERE country_code IN (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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "List all policies that have a coverage_limit exactly equal to the deductible. Show policy_id, policy_number, coverage_limit, and deductible.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number, coverage_limit, deductible\nFROM ins... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the average interest rate for each account_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_type, AVG(interest_rate) AS average_interest_rate\nFROM financial_services.accounts\nGROUP BY account_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 social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "Which hashtags have never been used in any post? Show their tag_name and creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h.tag_name, h.created_at\nFROM social_media.hashtags h\nLEFT JOIN social_media.post_hashtags ph ON h.hashtag_id = 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 insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil... | [
{
"role": "user",
"content": "Find all PDF claim documents uploaded in May 2024, showing document_id, claim_id, and file_size_bytes, and also list who uploaded each document.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, file_size_bytes, uploaded_by FROM 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.prescriptions ( prescription_id character varying(64) NOT NULL, record_id... | [
{
"role": "user",
"content": "Find the total quantity dispensed and the number of refills allowed for each dosage type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT dosage, SUM(quantity_dispensed) AS total_quantity_dispensed, SUM(refills_allowed) AS total_refills_allowed FROM 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 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 narrative_info ( narrative character varying(512) NOT NULL, top_3_coins text, price_... | [
{
"role": "user",
"content": "Show the top 5 narratives by 24 hour trading volume. Include the narrative name and volume.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, volume_24h FROM narrative_info ORDER BY volume_24h DESC LIMIT 5;",
"sql": null
},
{
"rol... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me the content and creation time of comments made on posts authored by the user with ID 'user_X'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.content, T1.created_at FROM social_media.comments AS T1 JOIN social_media.posts AS T2 ON T1.post_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// db.createCollection('passengers')
// Optional: db.passengers.createIndex({ passenger_id: 1 }, ... | [
{
"role": "user",
"content": "I need to find passengers who have a specific phone number prefix '+1555'. Can you help with that?",
"sql": null
},
{
"role": "assistant",
"content": "db.passengers.find({ phone_number: { $regex: '^\\+1555' } }, { first_name: 1, last_name: 1, phone_number: 1, em... |
You are an expert in writing database language. You can write a corresponding 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": "I want a list of all users, showing for each user their user_id, username, KYC status, and the date their account was created.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, k.status AS kyc_status, u.created_at\nFROM trading_pl... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "For each trip, show the trip ID, vehicle ID, driver ID, and both the actual starting and ending location IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, driver_id, origin_location_id, destination_location_id FROM transportati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.accounts (
account_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Can you provide a breakdown of total and average account balance by account_type and currency for each account status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_type, currency, status, COUNT(*) AS total_accounts, SUM(balance) AS total_ba... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.tokens ( token_id text PRIMARY KEY, contract_address text, token_name text, tok... | [
{
"role": "user",
"content": "List all tokens along with the contract addresses for symbols that appear more than once.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.token_id, t.token_symbol, t.contract_address\nFROM web3.tokens t\nJOIN (\n SELECT token_symbol\n FROM web3.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 government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "Find all top-level agencies that do not have a parent agency. Display their agency_id and agency_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agency_id, agency_name\nFROM government_services.agencies\nWHERE parent_agency_id IS NULL;",
"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 transportation.passengers ( passenger_id text, first_name text, last_name text, emai... | [
{
"role": "user",
"content": "List the first and last names of passengers who share the same loyalty_program_id with at least one other passenger.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p1.first_name, p1.last_name\nFROM transportation.passengers p1\nJOIN transpor... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "List the full names and dates of birth for all patients who do not have a phone number on record.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE phone_number IS NULL OR TRIM(phone_nu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id.text, token_name.text, token_symbol.text, token_address.t... | [
{
"role": "user",
"content": "List the top 5 tokens by price_change_percentage_7d, showing token_symbol, narrative, and price_change_percentage_7d.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, narrative, price_change_percentage_7d\nFROM token_basic_info\nORDER BY ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Node Label ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St... | [
{
"role": "user",
"content": "Can you help me get a list of inspections performed on a specific aircraft build, including the employee who performed them and the inspected component details?",
"sql": null
},
{
"role": "assistant",
"content": "MATCH (ab:AircraftBuild {build_id: 'specific_buil... |
You are an expert in writing database language. You can write a corresponding 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 each agent along with their manager's contact_email. Include agent_id, first_name, last_name, manager_id, and manager's contact_email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agent_id,\n a.first_name,\n a.last_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 gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_t... | [
{
"role": "user",
"content": "Find pairs of items from the same game, where one item is of type 'Weapon' and the other is of type 'Consumable'. List the game ID, the name of the weapon, and the name of the consumable.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i1.game_id, i1.... |
You are an expert in writing database language. You can write a corresponding 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, -- uniqu... | [
{
"role": "user",
"content": "For each passenger, show their full name and the total amount they have spent on completed bookings.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, SUM(b.fare) AS total_spent\nFROM transportation.passengers p\nJOIN transpor... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Which patients have both a primary and at least one secondary insurance policy and how many of each do they have?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n p.patient_id,\n SUM(CASE WHEN p.is_primary THEN 1 ELSE 0 END) AS primary_count,\n 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 healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id charac... | [
{
"role": "user",
"content": "List each insurance provider along with the number of distinct plan types they offer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT insurance_provider, COUNT(DISTINCT plan_type) AS type_count\nFROM healthcare.insurance_plans\nGROUP BY insurance_prov... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created... | [
{
"role": "user",
"content": "List all pairs of wallet addresses that were created by the same user but on different dates. Show both wallet IDs, their addresses, the user ID, and their creation dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet_id_1, w1... |
You are an expert in writing database language. You can write a corresponding 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
CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser... | [
{
"role": "user",
"content": "What is the average number of game sessions started per hour of the day (0-23), considering all recorded sessions? Show the hour and the average count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(HOUR FROM start_time) AS session_hour, COUN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "List each appointment with appointment ID, appointment time, doctor's last name, and the patient's primary insurance plan name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id,\n a.appointment_time,\n d.last_name AS doctor... |
You are an expert in writing database language. You can write a corresponding 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 fundraising round type had the highest total valuation across all projects, and which projects are in that round?",
"sql": null
},
{
"role": "assistant",
"content": "WITH round_valuations AS (\n SELECT\n rounds_name,\n SUM(valuation) AS to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "How many unique customers are there in the system?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT customer_id) AS unique_customer_count\nFROM insurance.customers;",
"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 PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "Could you provide the number of vehicles for each fuel_type?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fuel_type, COUNT(*) AS vehicle_count\nFROM transportation.vehicles\nGROUP BY fuel_type;",
"sql": null
},
{
"role": "user",
"co... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "Retrieve the document_id and file_name for all claim documents with file size larger than 1 MB, ordered by file size descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_id, file_name\nFROM insurance.claim_documents\nWHERE file_size_by... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Get the count of room types and the average area_sqft per property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_id,\n COUNT(room_type_id) AS room_type_count,\n AVG(area_sqft) AS avg_area\nFROM hospitality_technology.room_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "List all orders, showing order ID, type, quantity, and price, that were placed using a wallet created after '2024-01-01'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.order_id, T1.order_type, T1.quantity, T1.price FROM orders AS T1 JOIN wallets ... |
You are an expert in writing database language. You can write a corresponding 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": "List all service orders along with the quantity, unit price, and total price for each order. Filter for orders placed on or after the start of the year 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT order_id, quantity, unit_price, total_price 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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "Which users participated in conversations where the hashtag 'AI' was used in associated posts? I want both usernames and conversation IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cp.user_id, cp.conversation_id\nFROM social_media.conversation_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 transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "For each booking, show the booking ID, passenger's full name, booking status, and the email of the passenger.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name, p.last_name, b.status, p.email\nFROM transportation.bookings b\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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "Show me all trades where the traded quantity is less than 2, including the trade_id, quantity, and the buyer and seller IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trade_id, quantity, buyer_id, seller_id\nFROM trading_platform.trades\nWHERE q... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "List documents uploaded for cases of type 'Intellectual Property', showing the document name, upload timestamp, and the case number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.document_name, T1.upload_timestamp, T2.case_number FROM documents 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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_i... | [
{
"role": "user",
"content": "What is the total revenue (sum of total_amount) and total amount_paid for each booking_source?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT booking_source,\n SUM(total_amount) AS total_revenue,\n SUM(amount_paid) AS total_paid\nFROM res... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "Show me the usernames and the group names of group chats where each user has posted at least one post containing a hashtag.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name\nFROM social_media.users u\nJOIN social_media.posts 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 government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ... | [
{
"role": "user",
"content": "Which agencies offer services in the 'Social Assistance' category? Show the agency name and the service name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agency_name, s.service_name\nFROM government_services.services s\nJOIN government_services.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "List all appointments that were marked as 'No-show'. Show appointment ID, patient ID, and appointment time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, patient_id, appointment_time FROM healthcare.appointments WHERE status = 'No-sh... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "Which customers have accounts in more than one state? Please show their customer_id, full name, and the list of states where they hold accounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name || ' ' || c.last_name AS full_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri... | [
{
"role": "user",
"content": "For each passenger, show their full name, email, and the number of unique trips they have participated in.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, p.email, COUNT(DISTINCT b.trip_id) AS unique_trips\nFROM transportati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text, token_id text, from_address text, to_addres... | [
{
"role": "user",
"content": "Show the total amount of tokens transferred for each token_id along with the number of transfers involving each token.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_id, SUM(value) AS total_transferred, COUNT(*) AS transfer_count FROM web3.toke... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "List all customers along with any employees who have the same last name. For each pair, display customer_id, customer full name, employee_id, employee full name, and their respective emails.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.customer_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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "List all time entries with their entry ID, lawyer ID, and the billing rate where the hours spent is greater than 4.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT entry_id, lawyer_id, billing_rate\nFROM legal_services.time_entries\nWHERE hours_spent ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Count how many diagnoses were recorded each month in 2024. Show the month (as the first day of the month) and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', diagnosis_date)::date AS diagnosis_month, COUNT(*) FROM health... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser... | [
{
"role": "user",
"content": "For each game, which server has hosted the most sessions?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT game_id, server_id, COUNT(*) AS session_count FROM gaming_technology.game_sessions GROUP BY game_id, server_id;",
"sql": null
},
{
"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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all premium payments along with the customer's first and last name for payments made after July 1, 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pp.payment_id, pp.payment_date, pp.amount_paid, cu.first_name, cu.last_name\nFROM insurance.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 hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "Show all rooms that are on floor 3.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT room_id, property_id, room_number FROM hospitality_technology.rooms WHERE floor = 3;",
"sql": null
},
{
"role": "user",
"content": "For these rooms, 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 insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil... | [
{
"role": "user",
"content": "List the claim_id and the total number of documents uploaded for each claim, but only include claims with between 3 and 7 documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id, COUNT(*) AS document_count FROM insurance.claim_documents 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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "How many notifications across the entire system have been read?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM social_media.notifications\nWHERE read_at IS NOT 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.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "For all currently active policies, show the policy number, the customer's first and last name, and the total amount paid for that policy across all premium payments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T2.first_name, T2.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.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Retrieve the usernames and email addresses of users who updated their profiles in the last 30 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, email\nFROM social_media.users\nWHERE updated_at >= NOW() - INTERVAL '30 days';",
"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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the full name (first name and last name) of all citizens who have uploaded documents whose expiry date is in the past.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 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 financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account... | [
{
"role": "user",
"content": "Can you provide a list of all trades in the past 90 days, including the security_id, account_id, trade_type, quantity, total_amount, and the current balance of the involved account?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trade_id, t.securit... |
You are an expert in writing database language. You can write a corresponding 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 the document ID, file name, document type, and upload date for all documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_id, file_name, document_type, uploaded_at FROM insurance.claim_documents;",
"sql": null
},
{
"role"... |
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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Show medication ID, name, and description for medications manufactured by 'Novartis' where the generic name is missing.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, description FROM healthcare.medications WHERE manuf... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, -- the user's address ... | [
{
"role": "user",
"content": "How many distinct addresses achieved a realized_ratio higher than 0.9 last month?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT address) FROM smart_money_profit WHERE realized_ratio > 0.9;",
"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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "List all narratives with a trend rank better than 50, showing the narrative name and their listed 'Top 3 Coins'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, top_3_coins FROM narrative_info WHERE trend_rank < 50",
"sql": null
},
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers (
developer_id uuid NOT NULL DEFAULT gen_random_uui... | [
{
"role": "user",
"content": "Could you list all pairs of developers that are based in the same country and share the same website domain?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n d1.name AS developer1_name,\n d2.name AS developer2_name,\n d1.country,\n d1.website\nFR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Show me the first_name, last_name, and firm_id of all lawyers whose email domain is 'legalfirm.com'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name,\n last_name,\n firm_id\nFROM legal_services.lawyers\nWHERE SPLIT_PART(email, '... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "For each vehicle that has both maintenance and fuel log records, show the vehicle_id, make, model, count of maintenance_logs as maintenance_count, and count of fuel_logs as fuel_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.ma... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_... | [
{
"role": "user",
"content": "List all servers that are currently online and have a player count greater than their average player count across all servers in the same region.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.server_id, s.server_name, s.region, s.current_players\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.premium_payments (
payment_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "How many premium payments are currently in 'Pending' status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM insurance.premium_payments WHERE 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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Show pairs of customers who share the same email domain but have different last names. Include their IDs, full names, and email domain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_a_id, a.first_name AS customer_a_first_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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List all case numbers and names, along with the full name of the client associated with each case.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.case_number, T1.case_name, T2.first_name, T2.last_name FROM cases AS T1 JOIN clients AS T2 ON T1.clie... |
You are an expert in writing database language. You can write a corresponding 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 contact phone and website for all insurance plans provided by 'Continental Health'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT plan_name, contact_phone, website\nFROM healthcare.insurance_plans\nWHERE insurance_provider = 'Continental He... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case... | [
{
"role": "user",
"content": "Show me invoices where the total amount is greater than 5000. Display the invoice number, total amount, and client ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_number, total_amount, client_id FROM invoices WHERE total_amount > 5000;",
... |
You are an expert in writing database language. You can write a corresponding 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 routes start and end in the same city?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS same_city_routes\nFROM transportation.routes AS r\nJOIN transportation.locations AS o ON r.origin_location_id = o.location_id\nJOIN 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.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "For each citizen who has made a payment for an application that is still in 'Processing' status, list their full name, application_id, payment_id, amount, currency, and the application status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "List the usernames and registration dates for users who registered before the earliest deployed contract.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, T1.created_at FROM web3.users AS T1 JOIN (SELECT MIN(deployed_at) AS earliest_deploy... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, patient_id text, appointmen... | [
{
"role": "user",
"content": "I need a list of all chronic diagnoses marked as 'Active', showing diagnosis_id, diagnosis_date, doctor_id, and the associated chief_complaint from medical_records.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.diagnosis_id,\n d.diagnosis_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 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. You can write a corresponding 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, contract_address text, wallet_address text, am... | [
{
"role": "user",
"content": "List all SUI coins that have 'active' status, showing object ID, coin type, and balance.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT object_id, coin_type, balance FROM sui_coins WHERE status = 'active'",
"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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te... | [
{
"role": "user",
"content": "Show the first name, last name, and contact information for beneficiaries added before 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, contact_info FROM insurance.policy_beneficiaries WHERE added_at < '2023-01-01';",
"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "How many citizens are marked as not verified?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM government_services.citizens WHERE is_verified = FALSE;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "Show me the contract address and symbol for all ERC20 tokens that have at least one approval recorded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT ea.contract_address, tm.symbol\nFROM erc20_approval ea\nLEFT JOIN token_prices_latest tm 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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"role": "user",
"content": "For each chain, what is the average price of tokens recorded in the smart_money_token_performance table?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, AVG(price) AS average_token_price FROM smart_money_token_performance GROUP BY chain;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show me all wallets holding SUI coins with a balance greater than 2,000,000. Include the coin_type, balance, and owner address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT coin_type, balance, owner FROM sui_coins WHERE status = 'exists' AND CAST(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 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 financial_services.loans ( loan_id.text, account_id.text, loan_type.text, principal_... | [
{
"role": "user",
"content": "Show me the total principal amount for each loan type, along with the count of loans and average monthly payment, but only for loans originated in the last 5 years.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loan_type, SUM(principal_amount) AS to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List all game titles and the count of online servers hosting each game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.title, count(T2.server_id) FROM games AS T1 JOIN servers AS T2 ON T1.game_id = T2.game_id WHERE T2.status = 'online' GROUP BY 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 trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type te... | [
{
"role": "user",
"content": "Show the names and types of all assets whose symbol is exactly 3 characters long.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, type, symbol FROM trading_platform.assets WHERE LENGTH(symbol) = 3;",
"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_token_inflow ( token_address character varying(100) NOT NULL, -- the tok... | [
{
"role": "user",
"content": "For each chain, show the total token_amount and usd_value for selling transactions (type=2).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, SUM(token_amount) AS total_sold_amount, SUM(usd_value) AS total_sold_usd_value\nFROM smart_money_token_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a... | [
{
"role": "user",
"content": "Find all token transfers where the value is greater than 5000, including the token_id and transaction details like from_address and gas_used, sorted by value in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tt.token_id, tt.value, 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 blockchain.blocks ( block_id character varying(64) NOT NULL, previous_block_id chara... | [
{
"role": "user",
"content": "Find all pairs of distinct block IDs that were mined at the exact same timestamp. Show both block IDs and the shared timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.block_id AS block_id_1, t2.block_id AS block_id_2, t1.timestamp FROM blo... |
You are an expert in writing database language. You can write a corresponding 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": "What is the average balance for each account_type among accounts with status 'Open'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_type, AVG(balance) AS avg_balance FROM financial_services.accounts WHERE status = 'Open' GROUP BY account_type... |
You are an expert in writing database language. You can write a corresponding 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": "List pairs of documents uploaded by the same lawyer but for different cases, showing both document names, their case IDs, and the lawyer ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.document_name AS document1_name, t1.case_id AS document1_ca... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Show me each developer's name and the number of different games they have published on each platform.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name, g.platform, COUNT(DISTINCT g.game_id) AS game_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 social_media.hashtags (
hashtag_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "How many hashtags are currently stored in the hashtags table?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS total_hashtags\nFROM social_media.hashtags;",
"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.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Retrieve the patient_id, email, and phone_number for all patients whose email ends with '@gmail.com'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, email, phone_number FROM healthcare.patients WHERE email LIKE '%@gmail.com';",
"sql":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.