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 trading_platform.dapps (
dapp_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List the names of all DApps whose description contains the word 'auction' along with the user IDs of anyone who has had a KYC audit.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name AS dapp_name, k.user_id\nFROM trading_platform.dapps d\nJOIN tr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "Show me the policy number, claim ID, document file name, and document type for all policies that have associated claim documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T2.claim_id, T3.file_name, T3.document_type FROM insura... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance (
patient_insurance_id character varying(64) NOT NU... | [
{
"role": "user",
"content": "List the patient ID, policy number, and effective date for all policies that are marked as primary.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, policy_number, effective_date FROM healthcare.patient_insurance WHERE is_primary = TRUE;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"role": "user",
"content": "List all trips for routes of type 'Express', showing the trip ID and route number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T.trip_id, R.route_number FROM transportation.trips AS T JOIN transportation.routes AS R ON T.route_id = R.route_id WHER... |
You are an expert in writing database language. You can write a corresponding 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, name text, country text, founded_y... | [
{
"role": "user",
"content": "List all developer names and their countries.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, country FROM gaming_technology.developers;",
"sql": null
},
{
"role": "user",
"content": "Filter the list to only include developers fr... |
You are an expert in writing database language. You can write a corresponding 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": "I'd like to know how many sessions were hosted on each server, and the average duration of those sessions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_id, COUNT(session_id) AS session_count, AVG(duration_seconds) AS avg_duration\nFROM gamin... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "For each ERC1155 contract in erc1155_approval_for_all, show contract_address, the count of approval-for-all events, and the number of unique current holders from nft_holders. Order by holder_count descending and limit to 5.",
"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 legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Get the total number and total amount of invoices issued in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS invoice_count,\n SUM(total_amount) AS total_amount\nFROM legal_services.invoices\nWHERE issue_date BETWEEN '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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "List the latest version of each document (identified by case_id and document_name), showing the version number and its upload_timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.case_id,\n d.document_name,\n d.version AS latest_... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 6 months, along with their narrative information if available.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.rounds_name, pfr.valuation, pfr.... |
You are an expert in writing database language. You can write a corresponding 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 addresses (address_line1, city, state) where more than one customer resides, and show how many customers share each address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address_line1,\n city,\n state,\n COUNT(*) AS resid... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.payments ( payment_id text PRIMARY KEY, application_id text, cit... | [
{
"role": "user",
"content": "Can you show me the total amount paid by each citizen for each service? Please display the citizen_id, service_id, and the total amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT citizen_id, service_id, SUM(amount) AS total_amount\nFROM governme... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_l... | [
{
"role": "user",
"content": "Show the route number, route type, and the names of the origin and destination locations for all routes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number, r.type, l1.name AS origin_name, l2.name AS destination_name\nFROM transportation.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 transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri... | [
{
"role": "user",
"content": "Show all trips with their trip ID, route ID, the ID of their origin location, and the ID of their destination location, where the route ID starts with 'EX'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, route_id, origin_location_id, destina... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte... | [
{
"role": "user",
"content": "Show me the hashtag IDs and their names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT hashtag_id, tag_name FROM social_media.hashtags;",
"sql": null
},
{
"role": "user",
"content": "I also want to see when each hashtag was created."... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "For each chain in the smart money token inflow data, calculate the total number of addresses involved in buy transactions and the total number of addresses involved in sell transactions. Display the chain, total buy addresses, and total sell addresses.",
"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 NOT NULL, block_timestamp timestamp(3... | [
{
"role": "user",
"content": "Show me the top 5 token balances by amount for wallet '0xabc123abcdef' in the erc20_balances table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, amount\nFROM erc20_balances\nWHERE wallet_address = '0xabc123abcdef'\nORDER BY CAST(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.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List all room types along with their property name, bed type, and base rate for properties located in Canada, ordered by base rate descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rt.type_name, p.property_name, rt.bed_type, rt.base_rate\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 financial_services.loans (
loan_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "I need a report that shows, for each account status and loan type, how many loans there are and the average principal amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.status,\n l.loan_type,\n COUNT(*) AS total_loans,\n AVG(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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "List all appointments along with their subject and start time for lawyers specializing in 'Criminal Law'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.subject, T1.start_time FROM legal_services.appointments AS T1 JOIN legal_services.lawyers AS T... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Find all medical records associated with an appointment, and show the record_id, appointment_id, and the record_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT record_id, appointment_id, record_date\nFROM healthcare.medical_records\nWHERE appoin... |
You are an expert in writing database language. You can write a corresponding 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 the names of services and the total number of times each service has been ordered. Only include services that have been ordered at least once.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.service_name, count(T2.order_id) AS order_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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "Could you list each service location's name, city, and the total number of appointments scheduled there, only for accessible locations?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sl.location_name, sl.city, COUNT(a.appointment_id) AS appointment_c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "Get the five most recent public posts that have media_type = 'video', showing post_id, created_at, and the author's username.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n p.post_id,\n p.created_at,\n u.username\nFROM social_media.posts p\nJOIN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "For each chain, show the total number of smart money addresses and the count of addresses with positive profit.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, COUNT(address) AS total_addresses, COUNT(CASE WHEN profit > 0 THEN address END) AS 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.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "Retrieve the daily total fare collected for bookings with status 'Completed' in March 2024. Display the booking_date and total_fare.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n DATE(booking_time) AS booking_date,\n SUM(fare) AS total_fare\nFRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"role": "user",
"content": "Show me the first name, last name, and policy number for all customers who have filed a claim with an estimated loss over $50,000, along with the agent's full name who sold the policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.la... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "List the case name, case number, and date opened for all cases with a status of 'Pending'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_name, case_number, date_opened FROM legal_services.cases 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 government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "Show the full name and contact email of citizens who have submitted at least one application for services that are currently inactive.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_... |
You are an expert in writing database language. You can write a corresponding 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": "Show user_id and post_id for users who have created posts and have a private profile.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.user_id, p.post_id FROM social_media.posts AS p JOIN social_media.user_settings AS us ON p.user_id = us.user_id WHE... |
You are an expert in writing database language. You can write a corresponding 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 cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"role": "user",
"content": "List smart money addresses with a realized ratio greater than 0.9 and a profit greater than 50000. Show the address, chain, realized ratio, and profit.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, chain, realized_ratio, profit FROM smart_m... |
You are an expert in writing database language. You can write a corresponding 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": "For each route, list the route_number, origin city, destination city, and the total fare collected from completed bookings.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n r.route_number,\n lo.city AS origin_city,\n ld.city AS desti... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "Show me all ERC20 tokens (from token_metas) with a total supply over 1,000,000, including their contract address and symbol.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, symbol FROM token_metas WHERE is_erc20 = 1 AND CAST(total_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.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Show the names of all insurance plans and the number of patients enrolled in each plan.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, COUNT(pi.patient_id) AS enrolled_patients FROM healthcare.insurance_plans ip JOIN healthcare.patient_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "Calculate the average number of days between when an incident occurred and when the claim was reported, but only for claims that were settled in the year 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n AVG(EXTRACT(EPOCH FROM (reported_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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir... | [
{
"role": "user",
"content": "Show the total number of customers in each state.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n state,\n COUNT(customer_id)\nFROM insurance.customers\nGROUP BY\n state;",
"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 train_station_management.platforms (
platform_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "Can you help me retrieve the details of all platforms at a specific station with station_id 'STATION_001', including the platform status and whether they are accessible?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT platform_id, platform_number, tra... |
You are an expert in writing database language. You can write a corresponding 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": "How many notifications have been sent by each sender? Show sender_user_id and notification count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sender_user_id, COUNT(*) AS notification_count\nFROM social_media.notifications\nWHERE sender_user_id IS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id.text, name.text, type.text, address_line1.tex... | [
{
"role": "user",
"content": "How many locations are there in each city?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n city,\n COUNT(*)\nFROM transportation.locations\nGROUP BY\n city;",
"sql": null
},
{
"role": "user",
"content": "Filter this to only includ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.transactions (
transaction_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "For each transaction, show the transaction_id, amount, and the number of other transactions that have the same related_account_id and happened on the same effective_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.transaction_id, t1.amount, (S... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "For each player and game, how many achievements has the player unlocked? Display the player's username, the game title, and the number of achievements unlocked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, g.title, COUNT(pa.player_achie... |
You are an expert in writing database language. You can write a corresponding 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.room_types (
room_type_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "List properties and the average base rate of their room types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.property_name , AVG(T2.base_rate) FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_types AS T2 ON T1.proper... |
You are an expert in writing database language. You can write a corresponding 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.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,... | [
{
"role": "user",
"content": "List group conversation names and the count of messages sent in each conversation after '2024-06-01'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.group_name, COUNT(T2.message_id) FROM social_media.conversations AS T1 JOIN social_media.messages ... |
You are an expert in writing database language. You can write a corresponding 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, -- fundrai... | [
{
"role": "user",
"content": "Show me the total USD value of tokens held by each centralized exchange on the 'Polygon' chain for the most recent snapshot time. List the exchange name and the total USD value.",
"sql": null
},
{
"role": "assistant",
"content": "WITH LatestSnapshot AS ( SELECT ... |
You are an expert in writing database language. You can write a corresponding 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.room_types ( room_type_id character varying(64) NOT NULL, pro... | [
{
"role": "user",
"content": "Show me all reservations with more than 2 adults that are confirmed (status = 'Confirmed'), including their check-in dates and total amounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, r.property_id, r.guest_id, r.check_in_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 legal_services.law_firms (
firm_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Show the number of law firms founded each year, with the founding year and the count of firms, ordered by year in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM founded_date) AS founding_year, COUNT(*) AS firm_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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "List all routes along with the number of unique vehicles assigned to trips on each route.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_id, r.route_number, COUNT(DISTINCT t.vehicle_id) AS unique_vehicles\nFROM transportation.routes r\nLEFT J... |
You are an expert in writing database language. You can write a corresponding 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 government_services.applications ( application_id character varying(64) NOT NULL, ci... | [
{
"role": "user",
"content": "List the reference number and status for all applications, including the registration date of the citizen who submitted it.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.reference_number, a.status, c.registration_date FROM government_services.appl... |
You are an expert in writing database language. You can write a corresponding 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.text, patient_id.text, plan_id.t... | [
{
"role": "user",
"content": "List the patient_id and policy_number for all policies belonging to patients who have more than one insurance policy record in the system.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.patient_id, T1.policy_number FROM healthcare.patient... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "List pairs of drivers who share the same hire_date, showing both driver IDs and the hire_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.driver_id AS driver1_id,\n d2.driver_id AS driver2_id,\n d1.hire_date\nFROM transportation.dr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address text, token_name text, token_symbol text, chain te... | [
{
"role": "user",
"content": "What is the total USD value of tokens held by Binance exchange on the Ethereum chain according to the cex_token_balance table?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(usd_value) AS total_usd_value FROM cex_token_balance WHERE exchange = '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.transactions ( transaction_id text PRIMARY KEY, account_id text, ... | [
{
"role": "user",
"content": "List transactions where the description includes another transaction's reference_number, showing both transaction IDs and the referenced reference_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.transaction_id AS source_id, t2.transaction_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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Give me all unspent UTXOs for address '1A2b3C4d5E', sorted by amount descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT utxo_id, transaction_id, output_index, address, amount\nFROM trading_platform.utxos\nWHERE address = '1A2b3C4d5E' AND spen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,... | [
{
"role": "user",
"content": "List the file name and file size for all claim documents uploaded by agents whose license state is 'CA' and status is 'Active'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.file_name, T1.file_size_bytes FROM insurance.claim_documents AS T1 JOIN ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "For each fuel type, show the number of unique vehicles that have used it and the total quantity refueled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.fuel_type, COUNT(DISTINCT f.vehicle_id) AS vehicle_count, SUM(f.quantity) AS total_quantity\nFR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List all tokens with a total supply greater than 1,000,000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_id, token_name, token_symbol, contract_address, total_supply\nFROM web3.tokens\nWHERE total_supply > 1000000;",
"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 web3.wallets ( wallet_id text, user_id text, address text, private_key text, created... | [
{
"role": "user",
"content": "For each user, show the date of their earliest and latest wallet creation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id,\n MIN(created_at) AS first_created,\n MAX(created_at) AS last_created\nFROM web3.wallets\nGROUP BY user_id;... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "I need the average capacity of vehicles for each fuel_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fuel_type,\n AVG(capacity) AS avg_capacity\nFROM transportation.vehicles\nGROUP BY fuel_type;",
"sql": null
},
{
"role": "use... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"role": "user",
"content": "Count the number of trips for each route type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT R.type, COUNT(T.trip_id) FROM transportation.trips AS T JOIN transportation.routes AS R ON T.route_id = R.route_id GROUP BY R.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 gaming_technology.player_achievements (
player_achievement_id uuid NOT NULL DEFA... | [
{
"role": "user",
"content": "For each player, count the total number of achievements they've unlocked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id,\n COUNT(*) AS total_achievements\nFROM gaming_technology.player_achievements\nGROUP BY player_id;",
"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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "Show me the user ID and the total count of wallets associated with each user who owns at least one wallet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.user_id, COUNT(T2.wallet_id) FROM trading_platform.users AS T1 JOIN trading_platform.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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "Can you list each fundraising round name along with the project that raised the smallest amount in that round? Show the project name, round, and investment value.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.rounds_name, t1.project_name, t1.inve... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 4