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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Count the number of active services provided by each agency. Show the agency name and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agency_name, COUNT(s.service_id) AS active_service_count FROM government_services.agencies AS a JOIN gov... |
You are an expert in writing database language. You can write a corresponding 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": "List all SUI coins with status 'exists' in both tables, showing owner, coin_type, symbol, name, and balance.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sc.owner,\n sc.coin_type,\n scm.symbol,\n scm.name,\n sc.balance\nFROM... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.t... | [
{
"role": "user",
"content": "Show each region and the total number of current_players across all its servers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT region, SUM(current_players) AS total_current_players\nFROM gaming_technology.servers\nGROUP BY region;",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me all users and the posts they have created, including the user's username and the post content.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, p.post_id, p.content\nFROM social_media.users u\nJOIN social_media.posts p ON u.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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "List all hashtags that have been used on posts created in the last 90 days. Show the tag_name and the date it was first used on a post within this period.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h.tag_name, MIN(p.created_at) AS first_use_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.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me all cases where the description contains the word 'agreement'. Display the case ID, case name, and description.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_id, case_name, description FROM legal_services.cases WHERE description ILIKE '... |
You are an expert in writing database language. You can write a corresponding 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": "For each loan, calculate the number of days until maturity. Display loan_id, account_id, maturity_date, and days_to_maturity as the difference between maturity_date and CURRENT_DATE.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loan_id,\n acc... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id ch... | [
{
"role": "user",
"content": "Show me all premium payments made by customer with ID 'CUST789'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM insurance.premium_payments WHERE customer_id = 'CUST789';",
"sql": null
},
{
"role": "user",
"content": "From those... |
You are an expert in writing database language. You can write a corresponding 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": "How many insurance policies does each patient have? Return patient_id and policy_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id,\n COUNT(*) AS policy_count\nFROM healthcare.patient_insurance\nGROUP BY patient_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 hospitality_technology.payments ( payment_id text PRIMARY KEY, reservation_id text, ... | [
{
"role": "user",
"content": "Show me all payments along with the currency code and payment method for each payment, and include the amount and status. Group the results by payment method and currency code, and order by total payment amount descending.",
"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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "Give me the max supply, creator, and current supply for all Avalanche tokens by their tick.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tia.tick, tia.max_supply, tia.creator, tb.total_supply\nFROM token_info_avalanche tia\nLEFT JOIN token_balances... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "For each notification, list the next notification sent to the same citizen (if any). Show citizen_id, notification_id, sent_at, next_notification_id, and next_sent_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n n1.citizen_id,\n n1.notificatio... |
You are an expert in writing database language. You can write a corresponding 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": "How many addresses have a realized_ratio below 0.5?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS address_count FROM smart_money_profit WHERE realized_ratio < 0.5;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Show me the usernames and full names of all users who have updated their profile after April 1, 2024, and have specified a location.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, full_name FROM social_media.users WHERE updated_at > '2024-0... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "For each service category, show the category and the number of distinct citizens who have scheduled at least one appointment for a service in that category. Order the results by the number of citizens in descending order.",
"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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "I want to find pairs of developers who share the same website domain. Show each pair's names and the domain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.name AS dev1,\n d2.name AS dev2,\n SPLIT_PART(SPLIT_PART(d1.website, '://', 2),... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers (
driver_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Show each maintenance log with the vehicle ID, make, model, service date, and the cost, including the city where the maintenance was performed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ml.log_id, ml.vehicle_id, v.make, v.model, ml.service_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 transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ... | [
{
"role": "user",
"content": "For each booking, list the booking_id, fare, and the total quantity of fuel consumed on its associated trip.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id,\n b.fare,\n SUM(fl.quantity) AS total_fuel_quantity\nFROM transporta... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List all citizens who registered in the last 90 days but haven't scheduled any appointments. Display their citizen_id, full name, and registration_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.citizen_id,\n c.first_name || ' ' || c.las... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "Count how many achievements were unlocked on each calendar day. Show the date and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE(unlocked_at) AS unlock_date, COUNT(*) AS achievement_count FROM gaming_technology.player_achievements GRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "For each insurance product, can you list its product name, the number of unique agents who have sold policies for that product, and the total premium paid across those policies?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.product_name, COUNT(DI... |
You are an expert in writing database language. You can write a corresponding 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": "List all appointments with their subject and associated case number for appointments that have both a case_id and a non-null location.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.subject, a.case_id, c.case_number\nFROM legal_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 transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "List the names and cities of all locations that have at least one fuel log entry recorded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT l.name, l.city\nFROM transportation.locations l\nJOIN transportation.fuel_logs f ON l.location_id = f.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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "For claims reported after January 1st, 2024, show the claim ID, incident date, the policy number associated, and the full name of the agent who handled each claim.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, p.policy_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 erc20_balances_historical (
block_number bigint NOT NULL, -- Block number contai... | [
{
"role": "user",
"content": "For Sui NFTs with status 'exists', list their object_id, name, and owner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT object_id, name, owner\nFROM sui_nfts\nWHERE status = 'exists';",
"sql": null
},
{
"role": "user",
"content": "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 social_media.comments ( comment_id character varying(64) NOT NULL, post_id character... | [
{
"role": "user",
"content": "How many likes were given to comments in June 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS comment_likes_count\nFROM social_media.likes\nWHERE comment_id IS NOT NULL \n AND DATE_TRUNC('month', created_at) = '2024-06-01';",
"s... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.notifications ( notification_id text PRIMARY KEY, citizen_id tex... | [
{
"role": "user",
"content": "Find application IDs that have received notifications with both a 'Sent' status and a 'Failed' status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT application_id FROM government_services.notifications WHERE status IN ('Sent', 'Failed') GROUP BY ap... |
You are an expert in writing database language. You can write a corresponding 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": "List the citizen ID, full name, and registration date for all unverified citizens who registered in the year 2022.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT citizen_id, first_name, last_name, registration_date FROM government_services.citizens W... |
You are an expert in writing database language. You can write a corresponding 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": "For projects that have completed more than one fundraising round, calculate the average investment value across all their recorded rounds. Display the project name and this average value.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, 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 text, property_name text, address_li... | [
{
"role": "user",
"content": "List all public review comments along with the full name of the guest who submitted the review.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.review_id, T2.first_name, T2.last_name, T1.comment FROM hospitality_technology.reviews AS T1 JOIN hospit... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "Show all trips along with the vehicle's make and model, the driver full name, and the route distance in kilometers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id, v.make, v.model, d.first_name || ' ' || d.last_name AS driver_full_name, r.d... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Calculate the total transfer volume and number of transfers for each Avalanche token tick over the past 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ta.tick,\n SUM(ta.amt) AS total_volume,\n COUNT(*) AS transfer_count\nFROM to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.nodes (
node_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "Retrieve all users and their associated wallet identifiers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username , T2.wallet_id FROM blockchain.users AS T1 JOIN blockchain.wallets AS T2 ON T1.user_id = T2.user_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 social_media.messages (
message_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "How many messages currently have a media file attached?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.messages WHERE media_url IS NOT NULL;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "List all unique claim handler IDs present in the claims table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT claim_handler_id FROM insurance.claims WHERE claim_handler_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.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "List all pairs of lawyers with the same specialization.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.lawyer_id AS lawyer1_id,\n l1.first_name AS lawyer1_first_name,\n l1.last_name AS lawyer1_last_name,\n l2.lawyer_id AS lawyer2... |
You are an expert in writing database language. You can write a corresponding 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_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_u... | [
{
"role": "user",
"content": "List the usernames of players who own at least one item from the game with title 'Game Title X'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username FROM players AS T1 INNER JOIN player_inventory AS T2 ON T1.player_id = T2.player_id 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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show the full names and emails of staff members who have delivered at least one service order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT s.first_name, s.last_name, s.work_email\nFROM hospitality_technology.staff s\nJOIN hospitality_tech... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "List all narratives that have a market cap between 500,000,000 and 5,000,000,000 USD and a positive price change over the last 7 days. Show the narrative name, market cap, and price change percentage for the last 7 days.",
"sql": null
},
{
"role": "assistant",
"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "Show me all case numbers along with the firm_name of the law firm where the lead lawyer is the managing partner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number, l.firm_name\nFROM legal_services.cases c\nJOIN legal_services.law_firms l\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 blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text... | [
{
"role": "user",
"content": "List all users whose password hash contains the substring 'abc'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, username, password_hash FROM blockchain.users WHERE password_hash LIKE '%abc%';",
"sql": null
},
{
"role": "user",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List the full name of patients who have prescriptions ending within the next 30 days, along with the medication ID and the prescription end date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.medication_id, T2.end_dat... |
You are an expert in writing database language. You can write a corresponding 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": "List the full names of employees hired after January 1, 2022, and show the full name of their manager.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS employee_name, m.first_name || ' ' || m.last_name AS manager_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 legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "Show me the number of cases for each case_type that were closed in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_type,\n COUNT(*) AS case_count\nFROM legal_services.cases\nWHERE date_closed BETWEEN '2023-01-01' AND '2023-12-31'\nGRO... |
You are an expert in writing database language. You can write a corresponding 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 text, property_id text, room_number text, roo... | [
{
"role": "user",
"content": "Show me all rooms with their type names and base rates for property 'P001'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_id, r.room_number, rt.type_name, rt.base_rate\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.room_typ... |
You are an expert in writing database language. You can write a corresponding 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": "I want to see pairs of fundraising rounds for projects that have at least two rounds. Please list project_name, earlier_round, earlier_investment, later_round, and later_investment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n earlier.project_na... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, ... | [
{
"role": "user",
"content": "List each player's most recent achievement unlock, showing the player_id, achievement_id, and unlocked_at timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pa.player_id, pa.achievement_id, pa.unlocked_at FROM gaming_technology.player_achievem... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_... | [
{
"role": "user",
"content": "How many comments does each post have? Return post_id and comment_count for posts with more than 5 comments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT post_id,\n COUNT(*) AS comment_count\nFROM social_media.comments\nGROUP BY post_id\nHAVI... |
You are an expert in writing database language. You can write a corresponding 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": "How many lawyers are there per specialization?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT specialization, COUNT(*) AS lawyer_count\nFROM legal_services.lawyers\nGROUP BY specialization;",
"sql": null
},
{
"role": "user",
"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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "List all open cases with case_number, case_name, and the client's email and phone.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number,\n c.case_name,\n cl.email,\n cl.phone\nFROM legal_services.cases c\nJOIN legal_services... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.hashtags ( hashtag_id.text, tag_name.text, created_at.timestamp )
CREAT... | [
{
"role": "user",
"content": "List all unread notifications received by users who have a private profile, showing all notification details.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.* FROM social_media.notifications n JOIN social_media.user_settings s ON n.recipient_user_i... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "List each customer along with another customer living at the same address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_id_a, a.first_name || ' ' || a.last_name AS full_name_a, b.customer_id AS customer_id_b, b.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 transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me the email and full name of passengers who are enrolled in a loyalty program, along with the date they joined, ordered by most recent sign-up.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT email, CONCAT(first_name, ' ', last_name) AS full_nam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.loans ( loan_id character varying(64) NOT NULL, account_id charac... | [
{
"role": "user",
"content": "List all auto loans (loan_id, principal_amount, interest_rate) where the current principal balance is less than 40% of the original principal amount, along with the account_id and the difference between principal_amount and current_principal_balance.",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"role": "user",
"content": "I want to see each active agent and the total premium_amount of the policies they sold in 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name, a.last_name, SUM(p.premium_amount) AS total_premium\nFROM insurance.agents a\nJOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me all time entries from the last 90 days, including the entry description, hours spent, the name of the case, and the name of the client.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.description, T1.hours_spent, T2.case_name, T3.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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "List all projects that raised funds in March 2023. For each project, show its name, amount raised, fundraising round, and the token symbol and price of its associated token.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.project_name, p.investment_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "List all pairs of users who follow each other, including their usernames.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n u1.username AS user_a,\n u2.username AS user_b\nFROM\n social_media.follows f1\n JOIN social_media.follows f2\n ON f1.fo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "Display each product alongside the most recently updated product of the same type. Return original_id, original_updated_at, recent_id, recent_updated_at, and product_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.product_id AS original_id, p.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.logs ( log_id text PRIMARY KEY, user_id text, action text, details ... | [
{
"role": "user",
"content": "Get the total number of logs per user for July 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id,\n COUNT(*) AS log_count\nFROM trading_platform.logs\nWHERE logged_at BETWEEN '2024-07-01' AND '2024-07-31'\nGROUP BY user_id;",
"sq... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "Find the address that has the highest total amount across all its UTXOs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address FROM utxos GROUP BY address ORDER BY SUM(amount) DESC LIMIT 1;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "For each patient, find the next appointment after each one. Return patient_id, appointment_id AS current_appointment, next_appointment_id, and waiting_time in minutes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.patient_id,\n a.appointment... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List the message_id, content, sender's username, and group_name for all messages in group chats.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.message_id, m.content, u.username, c.group_name\nFROM social_media.messages m\nJOIN social_media.convers... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Node Label ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St... | [
{
"role": "user",
"content": "I need to check the inventory status of components, including their batch details and warehouse location.",
"sql": null
},
{
"role": "assistant",
"content": "MATCH (i:InventoryBatch)-[:IS_INSTANCE_OF]->(c:Component)\nRETURN c.component_id, c.component_name, i.in... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "List the top 5 ERC20 tokens by total supply, showing their symbol, contract_address, name, and total_supply.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol, contract_address, name, total_supply\nFROM token_metas\nWHERE is_erc20 = 1\nORDER 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 hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.te... | [
{
"role": "user",
"content": "Show me reviews from 'Expedia' that have an overall rating of 1 or 2.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT review_id, property_id, guest_id, rating_overall, review_date, comment FROM hospitality_technology.reviews WHERE review_source = 'Exp... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, case_id text, document_name... | [
{
"role": "user",
"content": "Provide a list of all documents and their versions for a specific case, say with case_id = 'CASE789'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name, version FROM legal_services.documents WHERE case_id = 'CASE789';",
"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.transactions (
transaction_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "Show daily total transaction amounts and counts for completed 'Payment' transactions in USD for the last 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.effective_date AS date,\n SUM(t.amount) AS total_amount,\n COUNT(*) ... |
You are an expert in writing database language. You can write a corresponding 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": "For each doctor, show their full name along with all plan names of insurance plans that have a 'contact_phone' beginning with '+44'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, ip.plan_name\nFROM healthcare.doctors d\nCR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "Show the total transaction amount for each customer, including their full name and risk profile. Join customers to accounts and then to transactions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n T2.first_name,\n T2.last_name,\n T2.risk_profile... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.service_locations (
location_id character varying(64) NOT NU... | [
{
"role": "user",
"content": "How many service locations do we have in each state?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) AS location_count FROM government_services.service_locations GROUP BY state;",
"sql": null
},
{
"role": "user",
"conte... |
You are an expert in writing database language. You can write a corresponding 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 a list of all trips along with the first and last names of all passengers who have booked on those trips. Each result should have the trip_id, passenger first name and last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id, p.first_... |
You are an expert in writing database language. You can write a corresponding 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": "I need to list patients' full names along with the description and date of their most recent chronic diagnosis, including the diagnosing doctor's full name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name || ' ' || p.last_name AS 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 smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "Show the tokens with a negative net flow this month on all chains.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain, net_flow FROM smart_money_token_performance WHERE net_flow < 0 AND date_trunc('month', CURRENT_DATE) = date_trunc('... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date ti... | [
{
"role": "user",
"content": "What is the total estimated_loss and average settlement_amount for all claims with status 'Approved'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(estimated_loss) AS total_estimated_loss,\n AVG(settlement_amount) AS average_settlement\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 healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Show me the total number of appointments grouped by each unique duration in minutes. Include only durations with more than 5 appointments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT duration_minutes, COUNT(*) AS appointment_count\nFROM healthcare... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "I’d like to see, for each customer, the total balance of their accounts by currency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.customer_id,\n c.first_name || ' ' || c.last_name AS customer_name,\n a.currency,\n SUM(a.balance)... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_us... | [
{
"role": "user",
"content": "List the sender_user_id and the total number of messages they have sent that include media attachments, along with the conversation_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sender_user_id, conversation_id, COUNT(*) AS media_message_count\nF... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i... | [
{
"role": "user",
"content": "Show the customer_id and pairs of payment_ids for any customers who have overlapping payment periods.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.customer_id,\n p1.payment_id AS payment1_id,\n p2.payment_id AS payment2_id\nFROM insu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"role": "user",
"content": "Show the diagnosis codes, descriptions, and their corresponding insurance plan names for all chronic diagnoses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.diagnosis_code, d.description, ip.plan_name\nFROM healthcare.diagnoses d\nJOIN healthcare... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the names of services available at service locations that are accessible and located in the state of 'California'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T2.location_name FROM government_services.services AS T1 JOIN gove... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.te... | [
{
"role": "user",
"content": "Count reviews with an overall rating of 5 for each property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_id, COUNT(*) AS five_star_review_count FROM hospitality_technology.reviews WHERE rating_overall = 5 GROUP BY property_id;",
"sql"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "Show me the customer ID, payment ID, payment amount, and payment date for all premium payments with an amount paid over 2000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, payment_id, amount_paid, payment_date\nFROM insurance.premium_pa... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.services (
service_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "List the service name, category, and standard fee for all services offered by agencies that have at least one accessible service location in the state of 'California'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.service_name, T1.catego... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.messages (
message_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List the usernames of users who have sent messages containing the word 'urgent', along with the message content and sent time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, m.content, m.sent_at FROM social_media.messages m 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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "Calculate the average length of the description for each case_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_type,\n AVG(LENGTH(description)) AS avg_desc_length\nFROM legal_services.cases\nGROUP BY case_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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Show the total hours spent by each lawyer, based on the time entries.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lawyer_id, SUM(hours_spent) FROM legal_services.time_entries GROUP BY lawyer_id",
"sql": null
},
{
"role": "user",
"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 project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... | [
{
"role": "user",
"content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.valuation, ... |
You are an expert in writing database language. You can write a corresponding 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": "List the service names, agency names, and standard fees for all services that are active and have a standard fee between 50 and 100 inclusive.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_name, ag.agency_name, s.standard_fee\nFROM governm... |
You are an expert in writing database language. You can write a corresponding 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 all insurance products along with the number of distinct agents whose handled claims are for policies using that product. Include product_id, product_name, and agent_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.product_id, ip.prod... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, username text, email text, passwo... | [
{
"role": "user",
"content": "How many distinct ports have been used by peers in the system?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT port) AS distinct_port_count\nFROM trading_platform.peers;",
"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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show me all SUI NFTs with status 'exists' and their name and owner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT object_id, name, owner FROM sui_nfts WHERE status = 'exists';",
"sql": null
},
{
"role": "user",
"content": "Also inclu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "Show me all reservations with their reservation_id, room_number, room status, and check_in_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id,\n rm.room_number,\n rm.status AS room_status,\n r.check_in_date\nFROM ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "What is the average estimated_loss for each claim status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, AVG(estimated_loss) AS avg_estimated_loss\nFROM insurance.claims\nGROUP BY status;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Show me all appointments for doctor 'doctor_100' in June 2024, including the appointment time and the patient ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, patient_id, appointment_time\nFROM healthcare.appointments\nWHERE 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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "I need to get the total trading volume for each asset along with the asset name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, SUM(t.quantity * t.price) AS total_volume\nFROM trading_platform.trades t\nJOIN trading_platform.asset... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the names of all properties that have listed room types, along with the name of each room type available at that property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.property_name, t2.type_name FROM hospitality_technology.properties 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.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Find all bookings along with the first and last name of the passenger and the trip_id, where the booking status is 'Cancelled'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name, p.last_name, b.trip_id\nFROM transportation.boo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Show me every guest along with their country code and the number of reviews they have submitted.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, g.country_code, COUNT(r.review_id) AS review_count\nFROM hospitality_technology... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.