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.documents ( document_id text, application_id text, citizen_id te...
[ { "role": "user", "content": "List the full names of employees who have verified 'Proof of Identity' documents.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.employees AS T1 JOIN government_services.documents AS T2 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 healthcare.medications ( medication_id character varying(64) NOT NULL, medication_na...
[ { "role": "user", "content": "Show me the names and manufacturers of all medications that have a description provided.", "sql": null }, { "role": "assistant", "content": "SELECT medication_name, manufacturer FROM healthcare.medications WHERE description 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 healthcare.medical_records ( record_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show me all prescriptions made by doctors who have issued diagnoses described as 'Hypertension'. Include the doctor's ID, prescription ID, medication ID, and prescription date.", "sql": null }, { "role": "assistant", "content": "SELECT p.doctor_id, p.prescriptio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "Find all reservations where the total amount is greater than 500 and they have at least one service order. Show the reservation ID and the total amount.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.reservation_id, T1.total_amount FROM h...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w...
[ { "role": "user", "content": "Show me law firms that were founded after 2018 and have a website provided.", "sql": null }, { "role": "assistant", "content": "SELECT firm_name, founded_date, website\nFROM legal_services.law_firms\nWHERE founded_date > '2018-12-31' AND website IS NOT NULL 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 healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointmen...
[ { "role": "user", "content": "I need a list of all chronic diagnoses marked as 'Active', showing diagnosis_id, diagnosis_date, doctor_id, and the associated chief_complaint from medical_records.", "sql": null }, { "role": "assistant", "content": "SELECT d.diagnosis_id,\n d.diagnosis_da...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, p...
[ { "role": "user", "content": "Show me the top 5 users who have the highest total trade volume (quantity * price) as buyers, along with their wallet addresses and the number of distinct assets they traded.", "sql": null }, { "role": "assistant", "content": "SELECT t.buyer_id, w.address, 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 transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "For each fuel_type, can you calculate the total total_cost and the average total_cost from the fuel_logs table?", "sql": null }, { "role": "assistant", "content": "SELECT fuel_type,\n SUM(total_cost) AS total_cost_sum,\n AVG(total_cost) AS average_co...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "For each user, list their username and the total number of filled orders they have placed.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, COUNT(o.order_id) AS filled_order_count\nFROM trading_platform.users u\nJOIN trading_platform.orders...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "List all female patients born before 1990 who have a phone number listed, showing their full names and contact information.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, phone_number, email, emergency_contact_name, emergency_c...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.notifications ( notification_id.text, citizen_id.text, applicati...
[ { "role": "user", "content": "Find pairs of notifications for the same citizen where one was sent via 'Email' and another via 'SMS'. Display citizen_id, email_notification_id, sms_notification_id, email_sent_at, and sms_sent_at.", "sql": null }, { "role": "assistant", "content": "SELECT e.ci...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_a...
[ { "role": "user", "content": "List the transaction IDs that have both an event and a token transfer, along with the name of the event and the value of the token transfer.", "sql": null }, { "role": "assistant", "content": "SELECT T1.transaction_id, T1.event_name, T2.value FROM web3.events 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 manufacturing.materials ( material_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "特定の材料の詳細情報を取得したいです。材料ID、材料名、仕様、密度を取得してください。", "sql": null }, { "role": "assistant", "content": "SELECT material_id, material_name, specification, density_kg_m3\nFROM manufacturing.materials\nWHERE material_id = 'specific_material_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 gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr...
[ { "role": "user", "content": "I need to list pairs of achievements within the same game, showing game_id, the name of the first achievement, and the name of the second achievement.", "sql": null }, { "role": "assistant", "content": "SELECT a1.game_id, a1.name AS achievement1, a2.name AS achi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "Show each asset's symbol and the number of unique addresses that have UTXOs associated with it.", "sql": null }, { "role": "assistant", "content": "SELECT a.symbol, COUNT(DISTINCT u.address) AS unique_addresses\nFROM trading_platform.assets a\nJOIN trading_platf...
You are an expert in writing database language. You can write a corresponding 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.medications ( medication_id character varying(64) NOT NULL, medication_na...
[ { "role": "user", "content": "Which medications do not have a generic name listed? Show their medication_id, medication_name, and manufacturer.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications WHERE generic_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.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_t...
[ { "role": "user", "content": "Find pairs of items within the same game where the cost of one item is at least 10 times the cost of the other. Show the game ID, the name of the more expensive item, and the name of the less expensive item.", "sql": null }, { "role": "assistant", "content": "SE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Count the number of customers grouped by their status.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.customers GROUP 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 hospitality_technology.rooms ( room_id text, property_id text, room_number text, roo...
[ { "role": "user", "content": "List guests who have written reviews, showing their full name and the review comment.", "sql": null }, { "role": "assistant", "content": "SELECT g.first_name || ' ' || g.last_name AS guest_full_name, r.comment FROM hospitality_technology.guests AS g JOIN hospita...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp...
[ { "role": "user", "content": "Find all doctors who have a hospital affiliation and include their full names (concatenated), specialties, and affiliation IDs.", "sql": null }, { "role": "assistant", "content": "SELECT CONCAT(first_name, ' ', last_name) AS full_name, specialty, hospital_affili...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, ticker_symbol text, is...
[ { "role": "user", "content": "Give me the number of securities and the latest update timestamp for each security_type.", "sql": null }, { "role": "assistant", "content": "SELECT security_type,\n COUNT(*) AS security_count,\n MAX(last_updated) AS latest_update\nFROM financial_serv...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.locations ( location_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "For each passenger, show their full name and the total amount they have spent on completed bookings.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, SUM(b.fare) AS total_spent\nFROM transportation.passengers p\nJOIN transpor...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "List all insurance products along with their product type and creation date.", "sql": null }, { "role": "assistant", "content": "SELECT product_name, product_type, created_at\nFROM insurance.insurance_products;", "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_dexpool_info (", "pair_address character varying(512) NOT NULL, -- the ...
[ { "role": "user", "content": "List the top 3 tokens by liquidity on BSC and show their token symbols, prices, market cap, and liquidity.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, price, market_cap, liquidity\nFROM token_dexpool_info\nWHERE chain = 'BSC'\nORDER ...
You are an expert in writing database language. You can write a corresponding 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": "List all active agents with the number of open claims they've handled and the average settlement amount for their closed claims. Include agent_id, first_name, last_name, open_claims_count, and avg_settlement_closed.", "sql": null }, { "role": "assistant", "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 trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "List all users who currently have a 'pending' KYC status, showing their user ID and username.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.username FROM users u JOIN kyc_audit k ON u.user_id = k.user_id WHERE k.status = 'pending';", ...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the title and release_date of all games on the 'PC' platform.", "sql": null }, { "role": "assistant", "content": "SELECT title, release_date\nFROM gaming_technology.games\nWHERE platform = 'PC';", "sql": null }, { "role": "user", "conten...
You are an expert in writing database language. You can write a corresponding 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 each property and the number of public reviews it has received.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, COUNT(r.review_id) AS public_review_count\nFROM hospitality_technology.properties p\nLEFT JOIN hospita...
You are an expert in writing database language. You can write a corresponding 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": "List the username, registration date, and the creation date of the first wallet created by each user who owns at least one wallet.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, u.created_at AS registration_date, MIN(w.created_at) AS firs...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char...
[ { "role": "user", "content": "Show the top 5 transactions with the highest number of token transfers, along with their Ethereum value. Include transaction_id, token_transfer_count, and ether_value.", "sql": null }, { "role": "assistant", "content": "SELECT\n tt.transaction_id,\n COUNT(tt.t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "List all maintenance logs for vehicles acquired in the year 2023. Include log ID, vehicle make, model, service date, and cost.", "sql": null }, { "role": "assistant", "content": "SELECT ml.log_id, v.make, v.model, ml.service_date, ml.cost FROM transportation.mai...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "Show each contract's address along with the total number of events it has emitted and the total number of transactions sent to it.", "sql": null }, { "role": "assistant", "content": "SELECT\n c.address,\n COUNT(e.event_id) AS event_count,\n COUNT(t.transactio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.likes ( like_id text, user_id text, post_id text, comment_id text, crea...
[ { "role": "user", "content": "Show me the conversation ID and creation time for group chats that have received at least one message.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.conversation_id, T1.created_at FROM social_media.conversations AS T1 INNER JOIN social_m...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi...
[ { "role": "user", "content": "Show the full name and job title of employees whose job title includes 'Manager' and who do not have a listed manager.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, job_title FROM government_services.employees WHERE job_title ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE smart_money_token_inflow ( token_address.text, token_symbol.text, token_amount.numer...
[ { "role": "user", "content": "List the top 5 tokens by total USD inflow and outflow, including net flow, sorted by net flow descending.", "sql": null }, { "role": "assistant", "content": "WITH inflow AS (\n SELECT token_symbol, chain, SUM(usd_value) AS usd_in\n FROM smart_money_token_inflo...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve all notifications with status 'failed' along with the citizen's full name and contact_phone for those notifications that occurred in the past 30 days.", "sql": null }, { "role": "assistant", "content": "SELECT n.notification_id,\n n.sent_at,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c...
[ { "role": "user", "content": "For each passenger, compute the count of bookings and average fare for bookings made in February 2024.", "sql": null }, { "role": "assistant", "content": "SELECT p.passenger_id, COUNT(b.booking_id) AS booking_count, AVG(b.fare) AS avg_fare\nFROM transportation.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 social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "I want a report of public posts with images in the last 30 days that shows post_id, content, author's username and email, and the count of likes, ordered by like count descending, limit to top 5.", "sql": null }, { "role": "assistant", "content": "SELECT p.post_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id...
[ { "role": "user", "content": "For each account type and status, can you show the total number of accounts and their combined balance per currency?", "sql": null }, { "role": "assistant", "content": "SELECT account_type, status, currency, COUNT(*) AS total_accounts, SUM(balance) AS total_bala...
You are an expert in writing database language. You can write a corresponding 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 services, showing the service name, category, and the name of the property where it is offered.", "sql": null }, { "role": "assistant", "content": "SELECT T1.service_name, T1.category, T2.property_name FROM hospitality_technology.services AS T1 JOIN hos...
You are an expert in writing database language. You can write a corresponding 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": "List all tokens on the 'BSC' chain with a trend rank between 6 and 20 (inclusive), along with their symbol, price, and liquidity.", "sql": null }, { "role": "assistant", "content": "SELECT t.token_symbol, t.price, d.liquidity\nFROM token_basic_info t\nJOIN token...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "Show all claims handled by agents who have uploaded at least one claim document. Include the claim_id, agent's uploaded document_id, and the incident date.", "sql": null }, { "role": "assistant", "content": "SELECT c.claim_id, cd.document_id, c.incident_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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par...
[ { "role": "user", "content": "How many comments were created in the month of March 2024?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.comments WHERE created_at >= '2024-03-01' AND created_at < '2024-04-01';", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern...
[ { "role": "user", "content": "List the usernames and status of all players who have 'de' as their country_code.", "sql": null }, { "role": "assistant", "content": "SELECT username, status FROM gaming_technology.players WHERE country_code = 'DE';", "sql": null }, { "role": "user",...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative t...
[ { "role": "user", "content": "What is the average ROI for smart money addresses on the Ethereum chain?", "sql": null }, { "role": "assistant", "content": "SELECT AVG(roi) FROM smart_money_token_performance WHERE chain = 'Ethereum';", "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 blockchain.transactions ( transaction_id.text, block_id.text, sender_address.text, r...
[ { "role": "user", "content": "Show me each transaction ID along with the sender's public key, the receiver's balance, and the transaction amount.", "sql": null }, { "role": "assistant", "content": "SELECT t.transaction_id, a_sender.public_key AS sender_public_key, a_receiver.balance AS recei...
You are an expert in writing database language. You can write a corresponding 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": "Find the total number of documents uploaded by each citizen along with their first and last names.", "sql": null }, { "role": "assistant", "content": "SELECT c.citizen_id, c.first_name, c.last_name, COUNT(d.document_id) AS document_count\nFROM government_service...
You are an expert in writing database language. You can write a corresponding 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.securities ( security_id text, ticker_symbol text, isin_code text...
[ { "role": "user", "content": "For each security, find any other security within the same sector that has a later last_updated timestamp. Return a.ticker_symbol, b.ticker_symbol, and b.last_updated.", "sql": null }, { "role": "assistant", "content": "SELECT a.ticker_symbol AS symbol_a, b.tick...
You are an expert in writing database language. You can write a corresponding 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": "Show me the first and last names of clients along with the first and last names of their lead lawyers for all open cases.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name AS client_first, c.last_name AS client_last, l.first_name AS lawyer_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.trips ( trip_id text, route_id text, vehicle_id text, driver_id text,...
[ { "role": "user", "content": "Show the number of trips operated by each driver along with the earliest and latest scheduled departure dates for them.", "sql": null }, { "role": "assistant", "content": "SELECT driver_id, COUNT(*) AS trip_count, MIN(scheduled_departure) AS first_departure, MAX...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a...
[ { "role": "user", "content": "Provide a list of order_id and notification_id for all orders and notifications that occurred on the same day for each user.", "sql": null }, { "role": "assistant", "content": "SELECT o.order_id,\n n.notification_id\nFROM trading_platform.orders o\nJOIN tr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character...
[ { "role": "user", "content": "Find projects from project_fundraising_record that had fundraising rounds in the year 2023 and have a corresponding token in token_dexpool_info. Show the project name, the investment value, the fundraising round name, and the token symbol and current price from the DEX pool tab...
You are an expert in writing database language. You can write a corresponding 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": "How many available rooms and available services are there for each property?", "sql": null }, { "role": "assistant", "content": "SELECT\n r.property_id,\n SUM(CASE WHEN r.status = 'Available' THEN 1 ELSE 0 END) AS available_rooms_count,\n SUM(CASE WHEN s.is_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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text...
[ { "role": "user", "content": "List all active products with a base premium exceeding 1500 that were created after January 1, 2023, including their product name, type, and base premium. Order the results by creation date ascending.", "sql": null }, { "role": "assistant", "content": "SELECT pr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonc...
[ { "role": "user", "content": "Find all blocks where the difficulty is between 1000 and 2000.", "sql": null }, { "role": "assistant", "content": "SELECT * FROM blockchain.blocks WHERE difficulty BETWEEN 1000 AND 2000;", "sql": null }, { "role": "user", "content": "Now filter t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi...
[ { "role": "user", "content": "Show the agency names and the number of active services they currently offer. List only those agencies with more than 2 active services.", "sql": null }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(s.service_id) AS active_service_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 government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "List all pairs of citizens who registered on the same date. Include each citizen's full name and the shared registration date.", "sql": null }, { "role": "assistant", "content": "SELECT c1.first_name || ' ' || c1.last_name AS full_name_1,\n c2.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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "List NFT collections deployed after block number 10000000 with more than 500 tokens, showing contract_address, name, and token_count.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, name, token_count\nFROM nft_collections\nWHERE depl...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text, user_id text, address text, private_key text, created...
[ { "role": "user", "content": "For each user, show the date of their earliest and latest wallet creation.", "sql": null }, { "role": "assistant", "content": "SELECT user_id,\n MIN(created_at) AS first_created,\n MAX(created_at) AS last_created\nFROM web3.wallets\nGROUP BY user_id;...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_l...
[ { "role": "user", "content": "Which routes have their origin and destination in the same city? Show the route number, description, and the origin and destination location IDs.", "sql": null }, { "role": "assistant", "content": "SELECT r.route_number, r.description, r.origin_location_id, r.de...
You are an expert in writing database language. You can write a corresponding 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 who registered at exactly the same timestamp, showing both user IDs, usernames, and the shared registration timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT u1.user_id AS user_id_1, u1.username AS username_1, u2.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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex...
[ { "role": "user", "content": "Find token transfers within the same transaction where the recipient of an earlier transfer (based on log_index) becomes the sender of a later transfer. List the transaction ID, the earlier transfer ID, the later transfer ID, the shared address, and the value transferred in bot...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty...
[ { "role": "user", "content": "List the document ID, file name, document type, and upload date for all documents.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, file_name, document_type, uploaded_at FROM insurance.claim_documents;", "sql": null }, { "role"...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, property_name text...
[ { "role": "user", "content": "Show me the list of all room numbers and their corresponding guest full names for current reservations (status is 'Occupied' or 'CheckedIn').", "sql": null }, { "role": "assistant", "content": "SELECT r.room_number, g.first_name || ' ' || g.last_name AS guest_fu...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFA...
[ { "role": "user", "content": "For each player, count the total number of achievements they've unlocked.", "sql": null }, { "role": "assistant", "content": "SELECT player_id,\n COUNT(*) AS total_achievements\nFROM gaming_technology.player_achievements\nGROUP BY player_id;", "sql": n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "Show me a list of all customers from California along with their full names and phone numbers.", "sql": null }, { "role": "assistant", "content": "SELECT customer_id, first_name || ' ' || last_name AS full_name, phone_number FROM insurance.customers WHERE state ...
You are an expert in writing database language. You can write a corresponding 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 NFT holdings from the `nft_holders` table where the `contract_type` is 'ERC721'. Show the wallet address, contract address, token ID, and amount held.", "sql": null }, { "role": "assistant", "content": "SELECT wallet_address, contract_address, token_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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "Show me the username and registration date for players who do not have a last login recorded.", "sql": null }, { "role": "assistant", "content": "SELECT username, registration_date FROM gaming_technology.players WHERE last_login IS NULL;", "sql": null }, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.trades ( trade_id character varying(64) NOT NULL, account_id char...
[ { "role": "user", "content": "Show me all trades (trade_id, security_id, total_amount) where the trade_type is 'Buy' and the execution_venue is 'NYSE', along with the loan details (loan_type, principal_amount) for accounts that have both trades and loans.", "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 blockchain.blocks ( block_id character varying(64) NOT NULL, previous_block_id chara...
[ { "role": "user", "content": "Show me the block with the earliest timestamp and its corresponding previous block's difficulty level.", "sql": null }, { "role": "assistant", "content": "SELECT b1.block_id, b1.timestamp, b2.difficulty AS previous_block_difficulty FROM blockchain.blocks b1 LEFT...
You are an expert in writing database language. You can write a corresponding 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 all notifications of type 'comment' with the content of the corresponding comment and the author's username.", "sql": null }, { "role": "assistant", "content": "SELECT n.notification_id,\n n.recipient_user_id,\n c.content AS comment_content,\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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo...
[ { "role": "user", "content": "List all rooms with their latest review comment and the date of that review, showing the room number and property id.", "sql": null }, { "role": "assistant", "content": "SELECT r.room_number, r.property_id, rv.comment, rv.review_date\nFROM hospitality_technology...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, roo...
[ { "role": "user", "content": "Show reviews with an overall rating of 5, including the guest's full name and the property ID.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.property_id FROM hospitality_technology.guests AS T1 JOIN hospitality_techno...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "For each employee who acts as a manager, please show the number of employees directly reporting to them.", "sql": null }, { "role": "assistant", "content": "SELECT m.first_name || ' ' || m.last_name AS manager_name, COUNT(e.employee_id) AS direct_report_count 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 hospitality_technology.room_types ( room_type_id text, property_id text, type_name t...
[ { "role": "user", "content": "Get the count of service orders and total payment amount for each reservation.", "sql": null }, { "role": "assistant", "content": "SELECT so.reservation_id,\n COUNT(*) AS order_count,\n SUM(p.amount) AS total_payment\nFROM hospitality_technology.serv...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex...
[ { "role": "user", "content": "For each payment, list its payment_id, guest_id, payment_timestamp, and the next payment_id and next payment_timestamp made by the same guest.", "sql": null }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.guest_id,\n p.payment_timestam...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.applications ( application_id character varying(64) NOT NULL, ci...
[ { "role": "user", "content": "List the reference number and status for all applications, including the registration date of the citizen who submitted it.", "sql": null }, { "role": "assistant", "content": "SELECT a.reference_number, a.status, c.registration_date FROM government_services.appl...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ...
[ { "role": "user", "content": "Give me the product name and description of all insurance products that have been updated in the last 30 days.", "sql": null }, { "role": "assistant", "content": "SELECT product_name, description FROM insurance.insurance_products WHERE updated_at >= NOW() - INTE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type te...
[ { "role": "user", "content": "List all assets that have at least one associated metadata entry, showing the asset name, symbol, and the key and value of each metadata entry.", "sql": null }, { "role": "assistant", "content": "SELECT a.name, a.symbol, m.key, m.value FROM trading_platform.asse...
You are an expert in writing database language. You can write a corresponding 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.medications ( medication_id text PRIMARY KEY, medication_name text, gener...
[ { "role": "user", "content": "List the medication IDs and names for all entries where the description is missing or empty.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name FROM healthcare.medications WHERE description IS NULL OR description = '';", ...
You are an expert in writing database language. You can write a corresponding 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": "Count the number of users whose location is 'London'.", "sql": null }, { "role": "assistant", "content": "SELECT count(*) FROM social_media.users WHERE location = 'London';", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "Show the first and last name of each citizen and the count of their scheduled appointments.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(a.appointment_id) AS scheduled_appointment_count FROM government_services.citi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text,...
[ { "role": "user", "content": "List all policies where the premium_amount exceeds the base_premium of its insurance product. Display the policy_number, premium_amount, product_name, and base_premium. Sort the results by premium_amount descending.", "sql": null }, { "role": "assistant", "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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te...
[ { "role": "user", "content": "Show the first name, last name, and contact information for beneficiaries added before 2023.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, contact_info FROM insurance.policy_beneficiaries WHERE added_at < '2023-01-01';", "...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "Find currently employed employees whose direct manager has been terminated. Display the employee's full name, hire date, manager's full name, and manager's termination date.", "sql": null }, { "role": "assistant", "content": "SELECT e.employee_id,\n CONCAT...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.applications ( application_id.text, citizen_id.text, service_id....
[ { "role": "user", "content": "Show me a list of all appointment IDs, the name of the service associated with each appointment, and the location name where it is scheduled.", "sql": null }, { "role": "assistant", "content": "SELECT appt.appointment_id, srv.service_id, loc.location_name\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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ...
[ { "role": "user", "content": "Find all vehicles that have at least one fuel log and at least one maintenance log. For each vehicle, show vehicle_id, make, model, the date of its most recent maintenance, and the timestamp of its earliest fuel log.", "sql": null }, { "role": "assistant", "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 legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c...
[ { "role": "user", "content": "Show the count of invoices for each case ID.", "sql": null }, { "role": "assistant", "content": "SELECT case_id, COUNT(invoice_id) AS invoice_count FROM legal_services.invoices WHERE case_id IS NOT NULL GROUP BY case_id ORDER BY invoice_count DESC", "sql": n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, rank INT, profit numer...
[ { "role": "user", "content": "How many smart money addresses are in the top 100 rank?", "sql": null }, { "role": "assistant", "content": "SELECT count(address) FROM smart_money_profit WHERE rank <= 100", "sql": null }, { "role": "user", "content": "Okay, can you break that do...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "Can you help me retrieve the details of all bookings for a specific route with route_id 'RT789', including the passenger names and the scheduled departure times?", "sql": null }, { "role": "assistant", "content": "SELECT b.booking_id, p.first_name, p.last_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 blockchain.transactions ( transaction_id text, block_id text, sender_address text, r...
[ { "role": "user", "content": "I want to know how many times each smart contract has been invoked by transactions; also include the contract creator.", "sql": null }, { "role": "assistant", "content": "SELECT sc.contract_id, sc.creator_address, COUNT(t.transaction_id) AS invocation_count\nFRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.payments ( payment_id text, application_id text, citizen_id text...
[ { "role": "user", "content": "How many payments have been made using each payment_method, and what is the total amount for each method?", "sql": null }, { "role": "assistant", "content": "SELECT payment_method, COUNT(*) AS payment_count, SUM(amount) AS total_amount\nFROM government_services....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_i...
[ { "role": "user", "content": "Find all pairs of overlapping reservations for the same room. Show the two reservation IDs, room_id, and both reservations' check-in and check-out dates.", "sql": null }, { "role": "assistant", "content": "SELECT r1.reservation_id AS reservation1_id, r2.reservat...
You are an expert in writing database language. You can write a corresponding 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 patients who have both primary and non-primary insurance plans, showing their full names and the count of each type of plan.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, SUM(CASE WHEN pi.is_primary = true THEN 1 ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "Find the wallet address, user ID, and the contract address of any contract where that wallet is listed as the deployer.", "sql": null }, { "role": "assistant", "content": "SELECT w.address AS wallet_address, w.user_id, c.address AS contract_address\nFROM web3.wa...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id character varying(64) NOT N...
[ { "role": "user", "content": "List all reservations made in the last 6 months, showing the reservation ID, guest ID, and status.", "sql": null }, { "role": "assistant", "content": "SELECT reservation_id, guest_id, status FROM hospitality_technology.reservations WHERE created_at >= current_da...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary...
[ { "role": "user", "content": "Find users with push_notifications_enabled set to false who have unread notifications. Show their username and the count of unread notifications.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, COUNT(n.notification_id) AS unread_count FROM...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha...
[ { "role": "user", "content": "Find the claim ID and the total number of documents associated with each claim ID that has more than 10 documents.", "sql": null }, { "role": "assistant", "content": "SELECT claim_id, COUNT(*) FROM insurance.claim_documents GROUP BY claim_id HAVING COUNT(*) > 10...