system stringlengths 315 8.44k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Find all distinct pairs of locations that are located in the same city. List their IDs, names, and the shared city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.location_id AS location1_id, l1.name AS location1_name, l2.location_id AS location2_... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the name and description of services offered by agencies in the 'Federal' jurisdiction.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T1.description FROM government_services.services AS T1 JOIN government_services.agencies ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, am... | [
{
"role": "user",
"content": "Which wallets currently hold more than 200 units of ERC1155 NFTs on the Ethereum blockchain? Show the contract address, token ID, wallet address, and amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nh.contract_address, nh.token_id, nh.wallet_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 government_services.appointments ( appointment_id text PRIMARY KEY, citizen_id text,... | [
{
"role": "user",
"content": "How many appointments are scheduled to start tomorrow?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT count(*) FROM government_services.appointments WHERE DATE(scheduled_start_time) = CURRENT_DATE + INTERVAL '1 day'",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Find the total payment amount and payment count made by citizen with national ID number 'A123456789'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(p.amount) AS total_amount, COUNT(p.payment_id) AS payment_count\nFROM government_services.citizen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "Can you show me the email addresses of all drivers whose status is 'Inactive'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name, email FROM transportation.drivers WHERE status = 'Inactive';",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE narrative_info (",
"narrative character varying(512) NOT NULL, -- the id of na... | [
{
"role": "user",
"content": "List all tokens from the token_dexpool_info table with a liquidity over $10 million and a positive 6-hour price change percentage on the Ethereum chain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, liquidity, price_change_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.te... | [
{
"role": "user",
"content": "Find reviews that contain the word 'dirty' in the comment section, showing the review ID, comment, and rating.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT review_id, comment, rating_overall FROM hospitality_technology.reviews WHERE LOWER(comment) ... |
You are an expert in writing database language. You can write a corresponding 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": "Can you show me the document types submitted by citizens whose accounts are verified, and for each, the email of the citizen who uploaded it?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_type, c.contact_email\nFROM government_services.do... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address.text, token_name.text, token_symbol.text, chain.te... | [
{
"role": "user",
"content": "Which tokens have the highest liquidity on the Ethereum chain and what are their current prices and 24-hour trading volumes?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, price, liquidity, volume_24h FROM token_dexpool_info WHERE chain... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "I need to find all group chats created after 2024-01-01, showing group_name and the total number of participants in each.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.group_name, COUNT(cp.participant_id) AS participant_count\nFROM social_media.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.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show the total billed hours and total billed amount for each case that has at least one billed and billable time entry.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.case_id, c.case_number, SUM(t.hours_spent) AS total_billed_hours, SUM(t.hours_spe... |
You are an expert in writing database language. You can write a corresponding 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 all active customers who live in the same zip_code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS cust1,\n b.customer_id AS cust2,\n a.zip_code\nFROM financial_services.customers a\nJOIN financial_services.customers... |
You are an expert in writing database language. You can write a corresponding 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": "Summarize the trades by trade type, showing the total quantity and the total amount for each type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trade_type, SUM(quantity) AS total_quantity, SUM(total_amount) AS total_amount FROM financial_services.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 smart_money_token_inflow ( token_address text, token_symbol text, token_amount numer... | [
{
"role": "user",
"content": "List tokens with net outflow (type=2) on the 'Ethereum' chain. Show token_symbol and total usd_value sold.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, SUM(usd_value) AS total_sold\nFROM smart_money_token_inflow\nWHERE type = 2 AND ch... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "Retrieve all prescriptions linked to chronic diagnoses. Show prescription_id, diagnosis_id, diagnosis_code, and prescription_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pr.prescription_id,\n d.diagnosis_id,\n d.diagnosis_code,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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 transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me the trip details including actual and scheduled times, and the difference between them for all trips associated with a specific driver, say driver_id 'DRV789'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n trip_id,\n vehicle_id,\n sched... |
You are an expert in writing database language. You can write a corresponding 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 applications where the notes contain the keyword 'urgent'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT reference_number, status FROM government_services.applications WHERE notes ILIKE '%urgent%';",
"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 hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"role": "user",
"content": "List all payments processed in USD, showing payment_id, guest_id, amount, and payment_timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_id,\n guest_id,\n amount,\n payment_timestamp\nFROM hospitality_technology.payme... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.employees ( employee_id text, agency_id text, first_name text, l... | [
{
"role": "user",
"content": "How many employees have a manager assigned to them?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS employee_count\nFROM government_services.employees\nWHERE manager_employee_id 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Get me a list of upcoming appointments with appointment_id, client full name, case number, and start_time for appointments with status 'scheduled'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id,\n CONCAT(cl.first_name, ' ', cl... |
You are an expert in writing database language. You can write a corresponding 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 usernames of users who have bought or sold assets classified as 'token', along with the name and symbol of the asset they traded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username, T3.name, T3.symbol FROM users AS T1 JOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "What is the average estimated_duration_minutes for each route type?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT type, AVG(estimated_duration_minutes) AS average_duration FROM transportation.routes GROUP BY type;",
"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 cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"role": "user",
"content": "For each exchange, compute the percentage change in total USD value of its holdings between snapshots '2023-01-01 00:00:00' and '2023-02-01 00:00:00'. Show exchange, chain, value_jan, value_feb, and pct_change.",
"sql": null
},
{
"role": "assistant",
"content": ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "List the medical record ID and record date for all medical records that are linked to an appointment whose duration was longer than the average duration of all appointments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.record_id, T1.record_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.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "Find the total unbilled but billable hours for each lawyer. Only include lawyers with more than 10 such hours, and sort by total hours descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lawyer_id, SUM(hours_spent) AS total_unbilled_hours 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 healthcare.diagnoses (
diagnosis_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Can you list all chronic diagnoses made in January 2024, showing diagnosis_id, diagnosis_code, and status, along with the doctor_id who made each diagnosis?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT diagnosis_id, diagnosis_code, status, doctor_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 gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "List pairs of games that share the same publisher but belong to different genres, showing both titles and genres.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g1.game_id AS game1_id,\n g1.title AS title1,\n g1.genre AS genre1,\n 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 government_services.notifications ( notification_id.text, citizen_id.text, applicati... | [
{
"role": "user",
"content": "For each citizen, find the timestamp of their first 'SMS' notification and their first 'Email' notification. Show citizen_id, first_sms_at, and first_email_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT citizen_id,\n MIN(sent_at) FILTER (WH... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, crea... | [
{
"role": "user",
"content": "Can you list each user's theme setting along with the number of likes they have given to posts?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT us.user_id, us.theme, COUNT(l.like_id) AS like_count FROM social_media.user_settings us LEFT JOIN social_me... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id text, user_id text, content text, media_url text, media... | [
{
"role": "user",
"content": "Show the count of posts for each distinct media type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT media_type, COUNT(*) FROM social_media.posts GROUP BY media_type;",
"sql": null
},
{
"role": "user",
"content": "Only include posts 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 transportation.trips ( trip_id text, route_id text, vehicle_id text, driver_id text,... | [
{
"role": "user",
"content": "Show the number of trips operated by each driver along with the earliest and latest scheduled departure dates for them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, COUNT(*) AS trip_count, MIN(scheduled_departure) AS first_departure, MAX... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, p... | [
{
"role": "user",
"content": "Show all law firms along with their phone numbers, sorted by the founding date from oldest to newest.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_id, firm_name, phone, founded_date\nFROM legal_services.law_firms\nORDER BY founded_date ASC;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "Provide a list of all log entries recorded since the start of 2024, including the user ID, action, and the exact time the log occurred.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, action, logged_at FROM logs WHERE logged_at >= '2024-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 trading_platform.logs ( log_id character varying(64) NOT NULL, user_id character var... | [
{
"role": "user",
"content": "Show the earliest and latest timestamp recorded in the logs table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT MIN(logged_at), MAX(logged_at) FROM trading_platform.logs;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Get the total fuel cost per route, showing route_number and the sum of total_cost for all fuel logs associated with trips on that route.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number,\n SUM(fl.total_cost) AS total_fuel_cost\nFRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "List all payments for reservations made at properties with a star rating of 5.0. Include the payment amount, guest ID, reservation ID, and property name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.amount, T1.guest_id, T1.reservation_id, T3.pro... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "For each trip, show the trip_id, vehicle's license plate, total fuel quantity, and number of fueling events.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id, v.license_plate, SUM(f.quantity) AS total_fuel, COUNT(f.fuel_log_id) AS fueling_eve... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"role": "user",
"content": "Find all document types uploaded by citizens whose documents have an expiry date in 2024 and were uploaded at locations located in the state of 'Nevada'. List the document_id, document_type, and location_name.",
"sql": null
},
{
"role": "assistant",
"content": "... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.likes (
like_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "Which users have received both a comment notification and a like notification? List the recipient_user_id and the total number of such users.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT recipient_user_id) AS user_count\nFROM (\n SE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "Show me all upcoming appointments in July 2024, the citizen's full name, the name of the service, and the agency responsible for the service.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.scheduled_start_time, c.first_name || ' '... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_t... | [
{
"role": "user",
"content": "Find pairs of items within the same game where the cost of one item is at least 10 times the cost of the other. Show the game ID, the name of the more expensive item, and the name of the less expensive item.",
"sql": null
},
{
"role": "assistant",
"content": "SE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List the usernames of users who have commented on posts that are not replies to other comments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T2.username FROM social_media.comments AS T1 JOIN social_media.users AS T2 ON T1.user_id = T2.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 financial_services.market_data ( data_point_id bigserial NOT NULL, security_id chara... | [
{
"role": "user",
"content": "Provide for each security its ticker_symbol, the most recent close_price and corresponding timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, md.close_price, md.data_timestamp\nFROM financial_services.market_data md\nJOIN fina... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "List the subscriber names from patient insurance entries where the group number is not provided (is null).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT subscriber_name FROM healthcare.patient_insurance WHERE group_number IS NULL;",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.appointments ( appointment_id character varying(64) NOT NULL, client_... | [
{
"role": "user",
"content": "Show me the subject and start times of all appointments along with the corresponding lawyer IDs for each client.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT client_id, lawyer_id, subject, start_time FROM legal_services.appointments;",
"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.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "List all wallet addresses and the amount of any unspent UTXOs linked to that address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.address, T2.amount FROM wallets AS T1 JOIN utxos AS T2 ON T1.address = T2.address WHERE T2.spent = false;",
"s... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me the total hours spent by each lawyer for each case, along with the case number and lawyer ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.case_id, c.case_number, t.lawyer_id, SUM(t.hours_spent) AS total_hours\nFROM legal_services.time_en... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "Find the deployer address that has deployed the highest number of contracts and report the address and the total count of contracts for that deployer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT deployer_address, COUNT(*) AS contract_count FROM we... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.transactions ( transaction_id text, account_id text, related_acco... | [
{
"role": "user",
"content": "Show the total incoming and outgoing amounts for each account_id, along with the number of transactions for each type (incoming and outgoing). An incoming transaction is when the account_id appears as related_account_id.",
"sql": null
},
{
"role": "assistant",
"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List usernames and email addresses of users who have enabled both email and push notifications.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, T1.email FROM social_media.users AS T1 INNER JOIN social_media.user_settings AS T2 ON T1.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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "I want to see pairs of customers living in the same state but having different risk profiles. Show their customer_ids, states, and risk_profiles.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_a, a.state, a.risk_profile AS r... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List all female patients born before 1990 who have a phone number listed, showing their full names and contact information.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, phone_number, email, emergency_contact_name, emergency_c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Which players have acquired more than 3 different items in their inventory? Show player_id and the count of unique item_ids.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.player_id, COUNT(DISTINCT pi.item_id) AS unique_items\nFROM gaming_technolo... |
You are an expert in writing database language. You can write a corresponding 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": "What are the top 5 tokens by 7-day price change percentage? Show token_symbol, token_name, narrative, and chain, ordered by price_change_percentage_7d descending.",
"sql": null
},
{
"role": "assistant",
"content": "```sql\nSELECT\n token_symbol,\n token_name,\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "Show me the product name, product type, and the first and last name of all agents who have sold policies of each insurance product.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.product_name, ip.product_type, a.first_name, a.last_name\nFROM insur... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen ti... | [
{
"role": "user",
"content": "List all ports along with the count of unique IP addresses that have been seen on each port.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT port, COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes GROUP BY port;",
"sql": null
}... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.accounts (
account_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Provide the average high price for securities on each exchange, using market data from the last 6 months.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.exchange, AVG(md.high_price) AS average_high_price FROM financial_services.market_data AS md JO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, propert... | [
{
"role": "user",
"content": "List all available services along with the property name where they are offered.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_id, s.service_name, p.property_name\nFROM hospitality_technology.services s\nJOIN hospitality_technology.propert... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each user with at least two wallets, calculate the average time difference in hours between consecutive wallet creations. Return user_id and avg_diff_hours.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, AVG(EXTRACT(EPOCH FROM (created_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 trading_platform.logs ( log_id character varying(64) NOT NULL, user_id character var... | [
{
"role": "user",
"content": "Show me all log entries for user ID 'user123'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT log_id, user_id, action, details, logged_at FROM trading_platform.logs WHERE user_id = 'user123' ORDER BY logged_at DESC;",
"sql": null
},
{
"ro... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all public reviews from the past 30 days with the property name and overall rating.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.review_id, p.property_name, r.rating_overall, r.review_date\nFROM hospitality_technology.reviews AS r\nJOIN hosp... |
You are an expert in writing database language. You can write a corresponding 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 wallets that use the same private_key. Display w1.wallet_id, w1.user_id, w2.wallet_id, w2.user_id, and the shared private_key.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet1_id,\n w1.user_id AS user1_... |
You are an expert in writing database language. You can write a corresponding 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.text, patient_id.text, doctor_id.text, appo... | [
{
"role": "user",
"content": "List all appointments and diagnoses associated with doctor 'doctor_123'. Show appointment_id, appointment_time, reason, diagnosis_id, diagnosis_code, description, and diagnosis_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, 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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "Show me the driver first_name, last_name, and the name of the destination location for all trips scheduled to depart between '2024-05-01' and '2024-05-31'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, l.name AS destinatio... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Which users have participated in group chats and also liked comments? Please show their usernames, the group name, and the comment_id they've liked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name, l.comment_id\nFROM social_me... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number contain... | [
{
"role": "user",
"content": "I want to find the top 5 wallets by USD value of their ERC20 holdings. Show wallet_address, token symbol, and USD value based on the latest price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.wallet_address, p.symbol, SUM(CAST(b.amount AS numeric... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex... | [
{
"role": "user",
"content": "Show policy numbers, start dates, and the type of the insurance product for policies with a deductible greater than 500.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T1.start_date, T2.product_type FROM insurance.policies AS T1 JOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id ch... | [
{
"role": "user",
"content": "Show me the total premium amount paid by each customer, grouped by customer_id and payment_method.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, payment_method, SUM(amount_paid) AS total_paid\nFROM insurance.premium_payments\nGROUP BY 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List all medications whose manufacturer field is not null.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, generic_name, manufacturer, ndc_code, description\nFROM healthcare.medications\nWHERE manufacturer IS NOT NULL;"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var... | [
{
"role": "user",
"content": "Which agents, along with their managers' full names, are licensed in 'TX' and are currently active?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agent_last_name, m.first_name AS manager_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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List the names and manufacturers of all medications that do not have an NDC code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_name, manufacturer\nFROM healthcare.medications\nWHERE ndc_code IS NULL;",
"sql": null
},
{
"role"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointmen... | [
{
"role": "user",
"content": "How many medical records have been created by each doctor? Provide doctor_id and the total number of records.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id,\n COUNT(*) AS record_count\nFROM healthcare.medical_records\nGROUP BY 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 gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"role": "user",
"content": "Can you provide a query that lists each game title, its platform, and the name of its developer by joining the games and developers tables?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title,\n g.platform,\n d.name AS developer_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 social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url... | [
{
"role": "user",
"content": "How many posts are currently marked as 'private' visibility?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.posts WHERE visibility = 'private'",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "Show me the average smart money ROI and the total PNL for each narrative category, based on the `smart_money_token_performance` and `token_basic_info` tables.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tbi.narrative, AVG(smp.roi) AS average_roi, ... |
You are an expert in writing database language. You can write a corresponding 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": "List each claim_handler_id along with the number of claims they've handled and the total settlement_amount they've paid out.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_handler_id,\n COUNT(*) AS total_claims,\n SUM(settlement_amo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, crea... | [
{
"role": "user",
"content": "Count the total number of likes each post has received.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT post_id, COUNT(*) AS like_count\nFROM social_media.likes\nWHERE post_id IS NOT NULL\nGROUP BY post_id;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.logs ( log_id character varying(64) NOT NULL, user_id character var... | [
{
"role": "user",
"content": "For each user, list all the distinct actions they have performed along with the count of each action.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, action, COUNT(*) FROM trading_platform.logs GROUP BY user_id, action ORDER BY user_id, actio... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"role": "user",
"content": "List application IDs that have both documents and payments associated with them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.application_id FROM documents AS T1 JOIN payments AS T2 ON T1.application_id = T2.application_id",
"sql": ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, name character va... | [
{
"role": "user",
"content": "Show a list of all asset names along with the current KYC status of each user, including the asset symbol. Join the assets and kyc_audit tables.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.name AS asset_name, a.symbol, k.user_id, k.status AS kyc... |
You are an expert in writing database language. You can write a corresponding 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.logs ( log_id text PRIMARY KEY, user_id text, action text, details ... | [
{
"role": "user",
"content": "Count the number of logs for each distinct action type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT action, COUNT(*) AS log_count FROM trading_platform.logs GROUP BY action;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_i... | [
{
"role": "user",
"content": "For each review, show me the review comment and the associated service names that the guest has ordered during the same reservation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.comment, s.service_name \nFROM hospitality_technology.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 social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, crea... | [
{
"role": "user",
"content": "What is the total number of likes recorded in the system?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.likes;",
"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, -- unique identifi... | [
{
"role": "user",
"content": "How many users have verified profiles and private profiles enabled?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) \nFROM social_media.users u\nJOIN social_media.user_settings s ON u.user_id = s.user_id\nWHERE u.is_verified = true AND s.priv... |
You are an expert in writing database language. You can write a corresponding 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.users ( user_id character varying(64) NOT NULL, username character varyin... | [
{
"role": "user",
"content": "Can you provide a count of users for each unique email domain?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUBSTRING(email FROM POSITION('@' IN email) + 1), COUNT(*) FROM blockchain.users GROUP BY SUBSTRING(email FROM POSITION('@' IN email) + 1);"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me all staff members hired in 2022, including their first name, last name, and hire date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, hire_date FROM hospitality_technology.staff WHERE EXTRACT(YEAR FROM hire_date) = 2022... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.te... | [
{
"role": "user",
"content": "Could you provide a count of services available within each department?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) FROM hospitality_technology.services GROUP BY department;",
"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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Which wallets hold at least 100 units of any ERC1155 NFT, and what is the token ID and contract address of the NFT for each such holding?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT wallet_address, contract_address, token_id, amount\nFROM nft_hold... |
You are an expert in writing database language. You can write a corresponding 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": "Give me a breakdown of the total number of reviews for each review source.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT review_source, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY review_source;",
"sql": null
},
{... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agenc... | [
{
"role": "user",
"content": "Show me all active agents who have handled claims with police reports, along with the count of such claims per agent.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name, a.last_name, COUNT(cd.claim_id) AS police_report_claims_cou... |
You are an expert in writing database language. You can write a corresponding 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 top 5 users by the total number of trades they participated in as sellers, along with their email addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.email, COUNT(t.trade_id) AS total_trades FROM trading_platform.users ... |
You are an expert in writing database language. You can write a corresponding 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 me all properties in California with a star rating above 4.0, along with their room types and base rates, ordered by star rating in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, p.star_rating, rt.type_name, rt... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id... | [
{
"role": "user",
"content": "Compute the co-occurrence count for each hashtag pair across all posts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ph1.hashtag_id AS tag_a, ph2.hashtag_id AS tag_b, COUNT(DISTINCT ph1.post_id) AS co_occurrence_count\nFROM social_media.post_hashta... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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 the asset name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT o.order_id, o.order_type, o.quantity, a.name FROM trading_platform.orders o JOIN trading_platform.assets a ON o.asset_id = a.asset_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Show me the total traded volume and the average price per security for trades executed last month.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol,\n SUM(t.quantity) AS total_volume,\n AVG(t.price_per_unit) AS avg_price\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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "List game titles released on the 'PC' platform along with the count of servers currently 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 WH... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appo... | [
{
"role": "user",
"content": "Show all medical records with the record_id, record_date, the patient's insurance policy_number, and the doctor's ID, for records linked to a currently active insurance policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT mr.record_id, mr.record_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 erc20_balances_historical ( block_number bigint NOT NULL, contract_address varchar N... | [
{
"role": "user",
"content": "Show ERC20 tokens with total supply greater than 100,000,000, displaying symbol, name, contract address, and total supply from the token_metas table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol, name, contract_address, total_supply FROM tok... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.