system stringlengths 315 8.35k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ... | [
{
"role": "user",
"content": "Show each passenger's first_name, last_name, and the total number of bookings they have made.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.passenger_id, p.first_name, p.last_name, COUNT(b.booking_id) AS booking_count\nFROM transportation.passenge... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Show me all male patients who have received more than one prescription, including their full name, date of birth, and the total number of prescriptions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, p.date_of... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.users ( user_id.text, username.text, email.text, password_hash.text, created_at... | [
{
"role": "user",
"content": "Find all pairs of users where the registration times are within 30 minutes of each other, and show both user IDs, usernames, and the time difference in minutes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u1.user_id AS user1_id, u1.username AS use... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a... | [
{
"role": "user",
"content": "Show the top 5 contracts by number of events emitted, including contract_id and event_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_id,\n COUNT(event_id) AS event_count\nFROM web3.events\nGROUP BY contract_id\nORDER BY event_co... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the average delay time for trains departing from platform 4 at station LMN during the past year?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on train delay times as this data is not stored in the platfor... |
You are an expert in writing database language. You can write a corresponding 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 documents which have a version greater than 2, along with the case number and name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_id, d.document_name, d.version, c.case_number, c.case_name\nFROM legal_services.documents d\nJOIN 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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"role": "user",
"content": "For each citizen, list the documents they uploaded and the notifications they received. Show citizen ID, document ID, document type, and notification ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.citizen_id, T1.document_id, T1.document_type, ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id... | [
{
"role": "user",
"content": "List all distinct pairs of hashtag_id that are applied to the same post_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ph1.post_id, ph1.hashtag_id AS hashtag1_id, ph2.hashtag_id AS hashtag2_id\nFROM social_media.post_hashtags ph1\nJOIN social_med... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id text PRIMARY KEY, property_id text, first_na... | [
{
"role": "user",
"content": "Which staff members have terminated employment? Show their names, hire and termination dates, and the property ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT staff_id, first_name, last_name, hire_date, termination_date, property_id\nFROM hospital... |
You are an expert in writing database language. You can write a corresponding 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(), title cha... | [
{
"role": "user",
"content": "List all games along with the count of in-game items they have. Only include games with more than 10 items and sort by the item count in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.game_id, g.title, COUNT(i.item_id) AS item_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 government_services.payments ( payment_id character varying(64) NOT NULL, applicatio... | [
{
"role": "user",
"content": "For each payment method, show the total number of completed payments and the total amount paid.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_method, COUNT(*) AS completed_count, SUM(amount) AS total_paid FROM government_services.payments 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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number contain... | [
{
"role": "user",
"content": "For each Bitcoin token tick, find the wallet address holding the largest amount and include the creator from token_info_bitcoin.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.tick,\n b.wallet_address,\n CAST(b.amount AS DECIMAL) AS 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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List the license plate, make, and current status of all vehicles acquired after January 1, 2021.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT license_plate, make, status \nFROM transportation.vehicles\nWHERE acquisition_date > '2021-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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "List all insurance policies that are set as secondary (is_primary = false) and expired before today, showing the policy number, expiration date, patient ID, and the corresponding plan name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.policy_num... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers (
customer_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Show me the count of completed transactions and the sum of their amounts grouped by currency for May 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT currency,\n COUNT(*) AS transaction_count,\n SUM(amount) AS total_amount\nFROM finan... |
You are an expert in writing database language. You can write a corresponding 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 social_media.follows ( follow_id.text, follower_user_id.text, following_user_id.text... | [
{
"role": "user",
"content": "For each user, count how many different conversations they have participated in. Show user_id and conversation_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(DISTINCT conversation_id) AS conversation_count\nFROM social_media.con... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.room_types (
room_type_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "Show properties and the names of their room types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.property_name , T2.type_name FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_types AS T2 ON T1.property_id = T2.prop... |
You are an expert in writing database language. You can write a corresponding 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": "I need to calculate the total premium and average deductible for each agent for policies issued this year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agent_id,\n SUM(premium_amount) AS total_premium,\n AVG(deductible) AS ave... |
You are an expert in writing database language. You can write a corresponding 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 NULL, ... | [
{
"role": "user",
"content": "Provide a list of all future appointments showing appointment_id, scheduled_start_time, location_name, city, and state.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n a.appointment_id,\n a.scheduled_start_time,\n sl.location_name,\n sl.city,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t... | [
{
"role": "user",
"content": "For each subscriber, count the number of insurance plans they have where the plan type is 'HMO'. Show the subscriber name and their count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.subscriber_name, COUNT(T2.plan_id) FROM healthcare.patient_in... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.securities ( security_id text, ticker_symbol text, isin_code text... | [
{
"role": "user",
"content": "Can you list all securities that have had at least one trade in the past 30 days? Please include the ticker_symbol, security_name, exchange, and the total number of trades for each security.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_sym... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the make and model of vehicles used on routes longer than 150 kilometers, and include the route number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.make, v.model, r.route_number \nFROM transportation.trips t\nJOIN transportation.vehicles... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.orders ( order_id text, user_id text, wallet_id text, asset_id text... | [
{
"role": "user",
"content": "I want to see the number of 'buy' and 'sell' orders for each asset, along with the asset_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT asset_id, order_type, COUNT(*) AS order_count FROM trading_platform.orders GROUP BY asset_id, order_type;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Can you show me the count of players from each country who have unlocked at least one achievement developed by studios based in France?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.country_code, COUNT(DISTINCT p.player_id) AS player_count\nFROM 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 healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ... | [
{
"role": "user",
"content": "List appointment_id, appointment_time, patient\\u2019s full name, and doctor\\u2019s specialty for all appointments scheduled in the next 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.appointment_time, p.first_name || ' '... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the current operational status of the train car with car_id 'CAR123'?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the current operational status of the train car with car_id 'CAR123'. The data in the ... |
You are an expert in writing database language. You can write a corresponding 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": "For each private conversation (is_group_chat = false), list the conversation_id and the usernames of its two participants.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id,\n u1.username AS participant_one,\n u2.username 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 gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_u... | [
{
"role": "user",
"content": "For each player, show the total quantity of all items they have ever acquired and their earliest acquisition date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(quantity) AS total_quantity, MIN(acquired_at) AS earliest_acquisition FRO... |
You are an expert in writing database language. You can write a corresponding 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 Avalanche token has the largest total supply currently held by wallets, and who is its creator?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tb.tick, SUM(tb.amount) AS total_amount, ti.creator\nFROM token_balances_avalanche tb\nJOIN token_inf... |
You are an expert in writing database language. You can write a corresponding 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, user_id character varyi... | [
{
"role": "user",
"content": "List user IDs and the creation timestamp of likes made by users who have email notifications enabled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.user_id, T1.created_at FROM social_media.likes AS T1 JOIN social_media.user_settings AS T2 ON T1.u... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all agents who have sold policies with a coverage limit above 500000. Show agent_id, first_name, last_name, and the count of such policies as policy_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name, a.last_name, 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 hospitality_technology.room_types ( room_type_id text, property_id text, type_name t... | [
{
"role": "user",
"content": "List all public reviews with a rating_overall of at least 4, including review_id, guest_id, property_id, reservation_id, and review_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT review_id, guest_id, property_id, reservation_id, review_date\nFR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "Can you find the contract that has emitted the most events, and show its contract ID along with the total number of events emitted?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_id, COUNT(*) AS total_events FROM web3.events GROUP BY contrac... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List all rooms on the 5th floor for every property, showing room number and property name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_number, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.properties p ON... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "List all group conversation names along with the number of different users who have sent a message in each group.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.group_name, COUNT(DISTINCT m.sender_user_id) AS unique_senders\nFROM social_media.conve... |
You are an expert in writing database language. You can write a corresponding 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 each partner’s full name along with the full name of a non-partner lawyer in the same firm.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.lawyer_id,\n CONCAT(p.first_name, ' ', p.last_name) AS partner_full_name,\n CONCAT(n.first_n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Calculate the total sum of hours spent across all time entries that are billable but have not yet been billed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(hours_spent) FROM legal_services.time_entries WHERE is_billable = TRUE AND is_billed = F... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me the top 5 hashtags by number of distinct public posts they're used in. Return tag_name and post_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h.tag_name,\n COUNT(DISTINCT ph.post_id) AS post_count\nFROM social_media.hashtags AS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "Show tokens held by CEX addresses that have a positive ROI from smart money. Display the token symbol, chain, the exchange holding it, the CEX USD value of the holding, and the smart money ROI. Limit the results to the top 10 tokens ranked by smart money ROI in descending order... |
You are an expert in writing database language. You can write a corresponding 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.transactions (
transaction_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all transactions where the recipient address is not specified (i.e., to_address is NULL), showing transaction_id, from_address, value, and block_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, from_address, value, block_nu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character vary... | [
{
"role": "user",
"content": "Retrieve all pairs of nodes where one node was last seen before '2023-06-01' and the other after '2023-06-01', and they share the same IP address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.node_id AS node_before,\n b.node_id AS node_afte... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List each patient's first and last medical record entries, showing patient_id, earliest_record_id, earliest_record_date, latest_record_id, and latest_record_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n fl.patient_id,\n fr.record_id AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List all property pairs that share the same postal_code, showing each pair's property IDs, names, and the postal_code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.property_id AS property_id_1,\n a.property_name AS property_name_1,\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": "Show me the top 5 users with the most wallet addresses, along with the count of their wallets.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(wallet_id) AS wallet_count FROM blockchain.wallets WHERE user_id IS NOT NULL GROUP BY user_id... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "For each passenger, list their email along with the total amount spent on fares across all their bookings.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.passenger_id, p.email, SUM(b.fare) AS total_fare_spent\nFROM transportation.passengers p\nJOIN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Show the average maintenance cost for vehicles of each make, including only vehicles that have had at least one maintenance log.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.make, AVG(ml.cost) AS average_maintenance_cost FROM transportation.vehic... |
You are an expert in writing database language. You can write a corresponding 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": "List all agents who have been terminated, showing their full name, agency name, and termination date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, agency_name, termination_date\nFROM insurance.agents\nWHERE status <> 'Active'... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me the usernames of users who have commented on posts that were created in group chat conversations, along with the names of those group chats.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name\nFROM social_media.comments 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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "Retrieve the average base premium of insurance products for each product_type, including only types that have more than 5 products.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_type, AVG(base_premium) AS avg_premium\nFROM insurance.insuranc... |
You are an expert in writing database language. You can write a corresponding 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": "List all UTXO IDs, addresses, and amounts for unspent UTXOs with an amount between 200 and 800.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT utxo_id, address, amount FROM trading_platform.utxos WHERE spent = false AND amount BETWEEN 200 AND 800;",
... |
You are an expert in writing database language. You can write a corresponding 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.guests ( guest_id.text, first_name.text, last_name.text, emai... | [
{
"role": "user",
"content": "How many guests are there in each city? Show the city and the guest count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT city, COUNT(guest_id) FROM hospitality_technology.guests GROUP BY city;",
"sql": null
},
{
"role": "user",
"cont... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, property_id text, ser... | [
{
"role": "user",
"content": "For each department, what is the highest priced available service? Please show department, service_name, and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, service_name, price FROM hospitality_technology.services WHERE is_available... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show all claims and the full name of the customer who filed each claim.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T1.incident_date, T1.description, T2.first_name, T2.last_name FROM insurance.claims AS T1 JOIN insurance.customers AS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "Find customers who have at least two policies with overlapping coverage periods. Show customer_id, policy1_id, policy2_id, overlap_start and overlap_end.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.customer_id,\n p1.policy_id AS policy1_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "For all trips, show the trip ID, the route number, and the make and model of the vehicle used.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id, r.route_number, v.make, v.model\nFROM transportation.fuel_logs t\nJOIN transportation.vehicles v ... |
You are an expert in writing database language. You can write a corresponding 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 via credit card in the last 30 days, along with their policy IDs and payment amounts, sorted by payment date in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, amount_paid, payment_date FR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "Show narratives with a 24-hour trading volume greater than $10,000,000 and a positive 24-hour price change percentage. List the narrative name, volume_24h, and price_change_percentage_24h.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, vol... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the first and last names of citizens along with their dates of birth and contact emails for all citizens who registered after January 1, 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth, contact_email ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List each vehicle's ID, make, and model along with the count of trips scheduled to depart in the next 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.make, v.model, COUNT(t.trip_id) AS trip_count\nFROM transportation.vehicles v... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "List all users who commented on posts tagged with hashtag 'spring', showing user_id, comment_id, content, and tag_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.user_id, c.comment_id, c.content, h.tag_name\nFROM social_media.comments c\nJOIN ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, -- the user's address ... | [
{
"role": "user",
"content": "Show the top 3 addresses by ROI on the Polygon chain, including profit and the most profitable token.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, roi, profit, most_profit_token FROM smart_money_profit WHERE chain = 'Polygon' ORDER BY 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 smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the tok... | [
{
"role": "user",
"content": "How many distinct tokens did smart money buy on the 'BSC' chain in 2023?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT token_address) AS distinct_tokens_bought\nFROM smart_money_token_inflow\nWHERE type = 1\n AND chain = 'BSC'\n AND... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "I need a summary of fueling events grouped by fuel_type: count of events and total quantity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n fuel_type,\n COUNT(*) AS event_count,\n SUM(quantity) AS total_quantity\nFROM transportation.fuel_logs\nG... |
You are an expert in writing database language. You can write a corresponding 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 all doctors whose last name begins with 'B', showing their doctor ID, full name, and their hospital affiliation ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id, first_name, last_name, hospital_affiliation_id FROM healthcare.doctors ... |
You are an expert in writing database language. You can write a corresponding 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 comments does each post have? Return the post_id and number of comments as comment_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT post_id, COUNT(comment_id) AS comment_count\nFROM social_media.comments\nGROUP BY post_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 gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.t... | [
{
"role": "user",
"content": "Find all pairs of servers in the same region hosting different games. Show the server names as server1 and server2 and their respective game_ids.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1, s1.game_id AS game1, s2.server... |
You are an expert in writing database language. You can write a corresponding 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": "For each user, show their username and how many unique conversations they have sent at least one message in where the conversation is a group chat.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username , COUNT(DISTINCT T2.conversation_id) 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 legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"role": "user",
"content": "Compute the total invoiced amount and average payment delay (in days) by status for invoices issued between 2024-01-01 and 2024-06-30.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status,\n SUM(total_amount) AS total_invoiced,\n AVG(EXT... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "Give me the vehicle ID, make, model, year, and the total number of trips made by each vehicle.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.make, v.model, v.year, COUNT(t.trip_id) AS total_trips\nFROM transportation.vehicles v\nLEFT... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Show me a list of all clients and their invoices, including the client's full name, email, invoice number, total amount, and invoice status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, c.email, i.invoice_number, i.total_... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2