system
stringlengths
323
8.11k
conversations
listlengths
2
8
You are a expert in writing database language. You can write a corresponding 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, username character v...
[ { "role": "user", "content": "For each peer port, count how many peers have used that port." }, { "role": "assistant", "content": "SELECT port,\n COUNT(*) AS peer_count\nFROM trading_platform.peers\nGROUP BY port;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media...
[ { "role": "user", "content": "Count the number of followers for each user and show those users who have more than 100 followers, ordering by follower_count descending." }, { "role": "assistant", "content": "SELECT following_user_id AS user_id,\n COUNT(*) AS follower_count\nFROM social_medi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "Count the number of registered citizens by gender." }, { "role": "assistant", "content": "SELECT\n gender,\n COUNT(*) AS citizen_count\nFROM government_services.citizens\nGROUP BY gender;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_...
[ { "role": "user", "content": "Count the total number of comments each user has made." }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) AS comment_count FROM comments 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 hospitality_technology.staff ( staff_id text PRIMARY KEY, property_id text, first_na...
[ { "role": "user", "content": "List staff members who responded to public reviews with an overall rating of 3 or less. Include the staff member's first name, last name, and the review ID." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.review_id FROM staff AS T1 JOIN...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_...
[ { "role": "user", "content": "Can you retrieve the total number of train cars for each train in the database?" }, { "role": "assistant", "content": "MATCH (t:Train)<-[:PART_OF_TRAIN]-(tc:TrainCar)\nRETURN t.train_id, t.train_number, COUNT(tc) AS total_cars\nORDER BY t.train_id" } ]
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 location of a specific train car with car_id 'TC123'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the current location of a specific train car as this information is not stored in the database table. The table only conta...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Find cases where an address received tokens in one transfer and then sent tokens in another. List the receive transfer_id, the send transfer_id, the address, and both transfer values." }, { "role": "assistant", "content": "SELECT recv.transfer_id AS receive_transfer...
You are an expert in writing database language. You can write a corresponding 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": "Show me the first_name, last_name, and firm_id of all lawyers whose email domain is 'legalfirm.com'." }, { "role": "assistant", "content": "SELECT first_name,\n last_name,\n firm_id\nFROM legal_services.lawyers\nWHERE SPLIT_PART(email, '@', 2) = 'legalfi...
You are an expert in writing database language. You can write a corresponding 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": "List all law firms that do not have a website registered, including their firm name and phone." }, { "role": "assistant", "content": "SELECT firm_name, phone\nFROM legal_services.law_firms\nWHERE website IS NULL OR website = '';" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da...
[ { "role": "user", "content": "Which customers have accounts in more than one state? Please show their customer_id, full name, and the list of states where they hold accounts." }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name || ' ' || c.last_name AS full_name, STRING_AGG(...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Use Hashes for platform details. Key format: platform:<platform_id> // HSET platform:plat_123 ...
[ { "role": "user", "content": "Can you help me retrieve the details of all schedules for a specific train with train_id 'train_789', including the route and stops information?" }, { "role": "assistant", "content": "HGETALL train:train_789\nSMEMBERS schedule:sched_*:train:train_789\nHGETALL schedu...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, first_name ...
[ { "role": "user", "content": "Show me the number of guests registered in each city. Order the results by city name." }, { "role": "assistant", "content": "SELECT city, COUNT(guest_id) AS guest_count FROM guests GROUP BY city ORDER BY city;" } ]
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'?" }, { "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 train_cars table ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id...
[ { "role": "user", "content": "Show all insurance plans where the plan name includes the word 'Care'." }, { "role": "assistant", "content": "SELECT plan_id, plan_name, insurance_provider, plan_type\nFROM healthcare.insurance_plans\nWHERE plan_name ILIKE '%Care%';" } ]
You are an expert in writing database language. You can write a corresponding 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": "What are the top 5 product types by average base premium, showing the product_type and average base_premium, ordered by average base_premium descending?" }, { "role": "assistant", "content": "SELECT product_type, AVG(base_premium) AS avg_premium FROM insurance.insur...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for...
[ { "role": "user", "content": "List the username and email of users whose first wallet creation date is the same day as their user registration date." }, { "role": "assistant", "content": "SELECT u.username, u.email FROM web3.users u JOIN (SELECT user_id, MIN(created_at) as first_wallet_created_a...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name te...
[ { "role": "user", "content": "Show me all servers that are currently full, meaning current players equals max players. List the server name, region, and max players." }, { "role": "assistant", "content": "SELECT server_name, region, max_players FROM gaming_technology.servers WHERE current_player...
You are an expert in writing database language. You can write a corresponding 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": "Can you provide a list of all medical records created by doctors for patients who are associated with 'PPO' type insurance plans? I need the record ID, patient ID, doctor ID, record date, and insurance plan name." }, { "role": "assistant", "content": "SELECT mr.reco...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number...
[ { "role": "user", "content": "List all invoices that were paid within 7 days of their issue date. Show invoice number, issue date, payment date, and total amount." }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, payment_date, total_amount FROM legal_services.invoices WHE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id...
[ { "role": "user", "content": "Count the total number of chronic diagnoses for each code_type." }, { "role": "assistant", "content": "SELECT\n code_type,\n COUNT(*) AS chronic_diagnosis_count\nFROM healthcare.diagnoses\nWHERE is_chronic = TRUE\nGROUP BY code_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 train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "Can you help me get the total number of passenger cars for each train car type in the database?" }, { "role": "assistant", "content": "SELECT car_type, COUNT(*) as total_cars\nFROM train_station_management.train_cars\nWHERE car_type = 'Passenger'\nGROUP BY car_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 transportation.routes ( route_id text, route_number text, description text, origin_l...
[ { "role": "user", "content": "Which route numbers connect locations with a distance less than 80 km and more than 5 words in their description? Include the route type in the results." }, { "role": "assistant", "content": "SELECT route_number, type FROM transportation.routes WHERE distance_km < 8...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Show assets of type 'token', including their name, symbol, and any associated metadata key and value." }, { "role": "assistant", "content": "SELECT t1.name, t1.symbol, t2.key, t2.value FROM trading_platform.assets AS t1 LEFT JOIN trading_platform.metadata AS t2 ON t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo...
[ { "role": "user", "content": "For each patient, show the total number of diagnoses they have received, along with their patient ID and the ID of their latest diagnosis. Join with the diagnoses table." }, { "role": "assistant", "content": "SELECT patient_id, COUNT(diagnosis_id) AS diagnosis_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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Show each service's name along with the total number of appointments scheduled and the number of unique locations these appointments are scheduled at." }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(a.application_id) AS appointment_count, COUNT(D...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount." }, { "role": "assistant", "content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas tm ON eb.contract_address = tm...
You are an expert in writing database language. You can write a corresponding 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": "How many users have their profile pictures set and also have written a bio?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS user_count\nFROM social_media.users\nWHERE profile_picture_url IS NOT NULL AND profile_picture_url <> ''\n AND bio 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "Show the IDs and registration dates of all verified citizens who could be eligible for at least one active service. Display the citizen ID and registration date." }, { "role": "assistant", "content": "SELECT DISTINCT c.citizen_id, c.registration_date\nFROM governmen...
You are an expert in writing database language. You can write a corresponding 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, medication_name text, generic_name text...
[ { "role": "user", "content": "Show all medications that share a manufacturer with at least one other medication. Return the medication_id, medication_name, and manufacturer for each." }, { "role": "assistant", "content": "SELECT m.medication_id,\n m.medication_name,\n m.manufacturer\...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.conversations ( conversation_id character varying(64) NOT NULL, created...
[ { "role": "user", "content": "Provide a breakdown of the total number of conversations, showing how many are group chats and how many are not. Also, show the count of conversations that have a recorded last message time." }, { "role": "assistant", "content": "SELECT COUNT(*) AS total_conversatio...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, game_id uuid, name...
[ { "role": "user", "content": "Show me, for each game, the achievement that has been unlocked by the most players. Include the game title, achievement name, and the number of players who unlocked it." }, { "role": "assistant", "content": "WITH RankedAchievements AS ( SELECT pa.achievement_id, 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 smart_money_token_inflow ( token_address.text, token_symbol.text, token_amount.numer...
[ { "role": "user", "content": "What is the average USD value per address for each narrative across all chains?" }, { "role": "assistant", "content": "SELECT\n narrative,\n AVG(usd_value / NULLIF(address_amount, 0)) AS avg_usd_per_address\nFROM smart_money_token_inflow\nGROUP BY narrative;" } ...
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 detailed repair history for train number T5678?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the detailed repair history for train number T5678 as this information is not available in the current database table. The table only 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 legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex...
[ { "role": "user", "content": "Can you narrow this down to only show cases where the case type is 'Criminal'?" }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Crimin...
You are an expert in writing database language. You can write a corresponding 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": "Find all pairs of different insurance records that share the same group_number, and show group_number, the patient_insurance_id of both records, and their corresponding patient_ids." }, { "role": "assistant", "content": "SELECT a.group_number,\n a.patient_insu...
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 location of train number Acela 2151?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to real-time location data for trains. The database only contains static information such as train ID, model, capacity, and maintenance...
You are an expert in writing database language. You can write a corresponding 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": "List all pairs of vehicles in the same depot with different status. Include both vehicle IDs with their statuses and the depot_id." }, { "role": "assistant", "content": "SELECT v1.vehicle_id AS vehicle1_id,\n v1.status AS status1,\n v2.vehicle_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 // Use Hashes for ticket details. Key format: ticket:<ticket_id> // HSET ticket:tkt_1a2b ticket_i...
[ { "role": "user", "content": "特定の予約ID 'book_zyx' に関連するすべてのチケットの詳細を取得するのを手伝っていただけますか?また、関連する車両情報も含めてください。" }, { "role": "assistant", "content": "SMEMBERS booking:book_zyx:tickets\nHGETALL ticket:<ticket_id>\nHGETALL car:<car_id>" }, { "role": "user", "content": "チェックイン済みのチケットだけを表示するよう...
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 salary or compensation package for a staff member with the role of Ticket Inspector?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about salary or compensation packages as this data is not included in the staff table. ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Use Hashes for ticket details. Key format: ticket:<ticket_id> // HSET ticket:tkt_1a2b ticket_i...
[ { "role": "user", "content": "特定の列車ID 'train_789' に関連するすべてのメンテナンス記録の詳細を取得するのを手伝っていただけますか?" }, { "role": "assistant", "content": "SMEMBERS train:train_789:maintenance\nHGETALL maintenance_record:<record_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 web3.users ( user_id text, username text, email text, password_hash text, created_at...
[ { "role": "user", "content": "Show the usernames and registration dates for all users whose email ends with '@gmail.com'." }, { "role": "assistant", "content": "SELECT username, created_at FROM web3.users WHERE email LIKE '%@gmail.com';" }, { "role": "user", "content": "Actually, can...
You are an expert in writing database language. You can write a corresponding 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": "Count the number of posts that have received at least one comment." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT post_id) FROM social_media.comments" } ]
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 are the fuel consumption rates per hour for the Boeing 747-8 model?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the fuel consumption rates for the Boeing 747-8 model as this data is not included in the aircraft_models ta...
You are an expert in writing database language. You can write a corresponding 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": "Show me all insurance plans where the website includes 'secure'." }, { "role": "assistant", "content": "SELECT * FROM healthcare.insurance_plans WHERE website ILIKE '%secure%';" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid NOT NULL DEFAULT gen_random_uui...
[ { "role": "user", "content": "Could you list all pairs of developers that are based in the same country and share the same website domain?" }, { "role": "assistant", "content": "SELECT\n d1.name AS developer1_name,\n d2.name AS developer2_name,\n d1.country,\n d1.website\nFROM\n gaming_tech...
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 address of the employee with ID 'EMP234'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the current address of an employee as this information is not stored in the database table." } ]
You are an expert in writing database language. You can write a corresponding 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 the names and URLs of all available decentralized applications (DApps)." }, { "role": "assistant", "content": "SELECT name, url FROM dapps;" } ]
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 total revenue generated by ticket sales at the station with ID 'ST101' for the past month?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the revenue generated by ticket sales as this data is not available in the cur...
You are an expert in writing database language. You can write a corresponding 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, username character ...
[ { "role": "user", "content": "List the name and symbol for all assets that do not have a corresponding entry with the key 'website' in the metadata table." }, { "role": "assistant", "content": "SELECT T1.name , T1.symbol FROM trading_platform.assets AS T1 LEFT JOIN trading_platform.metadata AS T...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Use Hashes for platform details. Key format: platform:<platform_id> // HSET platform:plat_123 ...
[ { "role": "user", "content": "I need to find all bookings for a specific schedule with schedule_id 'sched_1122' and include the passenger and ticket details." }, { "role": "assistant", "content": "SMEMBERS schedule:sched_1122:bookings\nHGETALL booking:book_*\nHGETALL passenger:pass_*\nSMEMBERS b...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "For each event, display its event_id, the event_id of the previous event in the same transaction (if any), and the log_index of both events." }, { "role": "assistant", "content": "SELECT curr.event_id AS current_event_id,\n prev.event_id AS previous_event_...
You are an expert in writing database language. You can write a corresponding 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": "Show a list of all DApps together with the total number of unique assets linked to each via the metadata table." }, { "role": "assistant", "content": "SELECT d.dapp_id, d.name, d.url, COUNT(DISTINCT m.asset_id) AS unique_asset_count\nFROM trading_platform.dapps d\nL...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_...
[ { "role": "user", "content": "For each type of entity a notification can be related to, how many notifications have been successfully sent?" }, { "role": "assistant", "content": "SELECT related_entity_type, COUNT(*) AS sent_notification_count FROM government_services.notifications WHERE status =...
You are an expert in writing database language. You can write a corresponding 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": "What is the total and average amount of unspent UTXOs per address?" }, { "role": "assistant", "content": "SELECT\n address,\n COUNT(*) AS utxo_count,\n SUM(amount) AS total_unspent_amount,\n AVG(amount) AS average_unspent_amount\nFROM trading_platform.utxos\nWHE...
You are an expert in writing database language. You can write a corresponding 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 address and the count of successful transactions sent to that contract." }, { "role": "assistant", "content": "SELECT c.address, COUNT(t.transaction_id) AS success_tx_count FROM web3.contracts c JOIN web3.transactions t ON t.to_address = c.address...
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 speed of train number T9876 during its last journey?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the average speed of train number T9876 during its last journey. The data in the trains table does not inclu...
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 ticket price for a journey on train number T4321?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about ticket prices for specific trains. The data I have is limited to train details such as model, manufacturer, c...
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 performance review score for employee with ID 'EMP456' for the last quarter?" }, { "role": "assistant", "content": "I'm sorry, but I can't assist with information about performance review scores as this data is not included in the employees table." } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "How many documents of each type exist in the system? Show the document type and the count." }, { "role": "assistant", "content": "SELECT document_type, COUNT(*) AS document_count\nFROM legal_services.documents\ngroup BY 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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci...
[ { "role": "user", "content": "List all unique claim handler IDs present in the claims table." }, { "role": "assistant", "content": "SELECT DISTINCT claim_handler_id FROM insurance.claims WHERE claim_handler_id IS NOT NULL" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media...
[ { "role": "user", "content": "How many posts have been updated after they were created?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS updated_post_count\nFROM social_media.posts\nWHERE updated_at IS NOT NULL AND updated_at > created_at;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c...
[ { "role": "user", "content": "Can you help me fetch the inventory records for components stored in a specific warehouse, along with their expiry dates?" }, { "role": "assistant", "content": "HGETALL inv:<inventory_record_id>\nZRANGE component_expiry:<component_id> 0 -1 WITHSCORES" }, { "...
You are an expert in writing database language. You can write a corresponding 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.smart_contracts ( contract_id.text, creator_address.text, code.text, time...
[ { "role": "user", "content": "Find all smart contracts where the contract code contains the keyword 'proxy'." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE code LIKE '%proxy%';" }, { "role": "user", "content...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir...
[ { "role": "user", "content": "What is the average commission rate for agents whose status is 'Terminated'?" }, { "role": "assistant", "content": "SELECT AVG(commission_rate) FROM insurance.agents WHERE status = 'Terminated' AND commission_rate IS NOT NULL;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp...
[ { "role": "user", "content": "List tokens with trend rank 5 or better and a price below $1. Show symbol, price, and trend rank." }, { "role": "assistant", "content": "SELECT token_symbol, price, trend_rank FROM token_dexpool_info WHERE trend_rank IS NOT NULL AND trend_rank <= 5 AND price < 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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "Show all users who have no wallets yet." }, { "role": "assistant", "content": "SELECT DISTINCT k.user_id\nFROM trading_platform.kyc_audit k\nLEFT JOIN trading_platform.wallets w ON k.user_id = w.user_id\nWHERE w.wallet_id IS 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.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text...
[ { "role": "user", "content": "List all chronic diagnoses made by Cardiology specialists in the last year, including the patient ID, diagnosis description, and doctor's full name." }, { "role": "assistant", "content": "SELECT dg.patient_id, dg.description, d.first_name || ' ' || d.last_name AS 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "List all clients along with their case_number and case_type for cases that are currently 'Open'." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, c.email, cs.case_number, cs.case_type\nFROM legal_services.clients AS c\nJOIN legal_services.cas...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c...
[ { "role": "user", "content": "Which rooms on the 4th floor are non-smoking, along with their property IDs and type IDs?" }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number, room_type_id FROM hospitality_technology.rooms WHERE floor = 4 AND is_smoking = FALSE;" } ]
You are an expert in writing database language. You can write a corresponding 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 usernames and the length of their 'bio' field for users whose 'is_verified' status is true." }, { "role": "assistant", "content": "SELECT username, LENGTH(bio) AS bio_length FROM social_media.users WHERE is_verified IS TRUE;" } ]
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 are the ticket prices for trains departing from the station with ID 'ST456'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on ticket prices as this data is not included in the station management database. For ticket pricing, ...
You are an expert in writing database language. You can write a corresponding 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": "Find all smart contracts deployed in 2022 that have never received any transactions." }, { "role": "assistant", "content": "SELECT sc.contract_id, sc.creator_address, sc.timestamp AS deployment_time\nFROM blockchain.smart_contracts sc\nLEFT JOIN blockchain.transacti...
You are an expert in writing database language. You can write a corresponding 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": "List each transaction ID that includes token transfers, along with the distinct symbols of the tokens transferred in that transaction." }, { "role": "assistant", "content": "SELECT T1.transaction_id, STRING_AGG(DISTINCT T3.token_symbol, ', ') FROM web3.transactions ...
You are an expert in writing database language. You can write a corresponding 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, first_nam...
[ { "role": "user", "content": "For each security, show the average daily volume from market data and the total quantity traded across all trades." }, { "role": "assistant", "content": "WITH MarketDataAgg AS ( SELECT security_id, AVG(volume) AS avg_daily_volume FROM financial_services.market_data ...
You are an expert in writing database language. You can write a corresponding 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": "For each player, show the player_id and the count of inventory items they acquired with a quantity greater than 1." }, { "role": "assistant", "content": "SELECT player_id, COUNT(inventory_id) AS items_qty_gt_1_count FROM gaming_technology.player_inventory WHERE quan...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "Retrieve each vehicle's make and model along with the date and description of its latest maintenance service." }, { "role": "assistant", "content": "SELECT v.vehicle_id,\n v.make,\n v.model,\n m.service_date,\n m.description\nFROM transportat...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character...
[ { "role": "user", "content": "What are the top 5 tokens by 7-day price change percentage? Show token_symbol, token_name, narrative, and chain, ordered by price_change_percentage_7d descending." }, { "role": "assistant", "content": "```sql\nSELECT\n token_symbol,\n token_name,\n narrative,\n ...
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 job satisfaction level or feedback from staff members working at a specific train station?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on job satisfaction levels or feedback from staff members as this data is...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "For each depot, show the depot name, city, number of active vehicles, and average capacity." }, { "role": "assistant", "content": "SELECT loc.name AS depot_name, loc.city, COUNT(v.vehicle_id) AS active_vehicle_count, ROUND(AVG(v.capacity),2) AS avg_capacity FROM tra...
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 reason behind the cost variation for maintenance of asset_id 'ASSET456' over the past year?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the reasons behind cost variations for maintenance. The data in the maintenan...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Show me a list of all agencies and the number of distinct citizens who have submitted documents to each agency." }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(DISTINCT d.citizen_id) AS citizen_count\nFROM government_services.documents d\nJOIN gov...
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 schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not included in the platfo...
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 market price of a Boeing 737 MAX aircraft?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and general information ab...
You are an expert in writing database language. You can write a corresponding 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 pairs of users who registered on the same weekday but in different years. List the user ID and registration date for both users, and the weekday name." }, { "role": "assistant", "content": "SELECT u1.user_id, u1.created_at AS user1_created_at, u2.user_id, u2.cr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name...
[ { "role": "user", "content": "List the name of each agency and the number of appointments associated with services from that agency." }, { "role": "assistant", "content": "SELECT T1.agency_name, COUNT(T2.appointment_id) FROM agencies AS T1 JOIN appointments AS T2 ON T1.agency_id = T2.agency_id 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 // Use Hashes for platform details. Key format: platform:<platform_id> // HSET platform:plat_123 ...
[ { "role": "user", "content": "Can you provide the total number of cars associated with a specific train with train_id 'train_789'?" }, { "role": "assistant", "content": "SCARD train:train_789:cars" } ]
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?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on train delay times as this data is not stored in the platforms table. The tab...
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 number of passengers waiting at platform 2B at station ABC?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the current number of passengers at a specific platform. The data in the platforms table only include...
You are an expert in writing database language. You can write a corresponding 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, -- unique...
[ { "role": "user", "content": "List the names of manufacturers that produce at least one medication with a description and at least one medication without a description." }, { "role": "assistant", "content": "SELECT DISTINCT manufacturer FROM healthcare.medications m1 WHERE manufacturer IS NOT NU...
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 salary of employee with ID 'EMP123'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about an employee's salary as it is not included in the data available in the 'employees' table." } ]
You are an expert in writing database language. You can write a corresponding 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, agency_name text, jurisdiction_level ...
[ { "role": "user", "content": "Which citizens have received notifications for applications processed by employees from the 'Legal' department? List the citizen ID, full name, and notification ID." }, { "role": "assistant", "content": "SELECT n.citizen_id, CONCAT(e.first_name, ' ', e.last_name) 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan." }, { "role": "assistant", "content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) AS enrolled_patie...
You are an expert in writing database language. You can write a corresponding 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 all users who have set their bio to a non-empty value, showing their username and email." }, { "role": "assistant", "content": "SELECT username, email\nFROM social_media.users\nWHERE bio IS NOT NULL AND TRIM(bio) != '';" } ]
You are an expert in writing database language. You can write a corresponding 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": "For each block that contains more than 5 transactions, list the block number, the total sum of values transferred within that block, and the average gas used per transaction in that block." }, { "role": "assistant", "content": "SELECT block_number, SUM(value) AS tot...
You are an expert in writing database language. You can write a corresponding 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.notifications ( notification_id.text, user_id.text, message.text, s...
[ { "role": "user", "content": "Provide a count of notifications, separated by whether they have been read or not." }, { "role": "assistant", "content": "SELECT CASE WHEN T1.read_at IS NULL THEN 'Unread' ELSE 'Read' END, count(T1.notification_id) FROM trading_platform.notifications AS T1 GROUP BY ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "List all users who signed up in 2024 and have not set a bio. Show their usernames, emails, and account creation dates." }, { "role": "assistant", "content": "SELECT username, email, created_at FROM social_media.users WHERE bio IS NULL AND EXTRACT(YEAR FROM created_a...
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 total number of vacation days taken by employee with ID 'EMP101' in the past year?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the vacation days taken by an employee as this data is not stored in the current table...
You are an expert in writing database language. You can write a corresponding 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." }, { "role": "assistant", "content": "SELECT u1.user_id AS user1_id, u1.username AS user1_name, 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "List the names of agencies and their established dates, but only for agencies that offer at least one service." }, { "role": "assistant", "content": "SELECT DISTINCT T1.agency_name , T1.established_date FROM government_services.agencies AS T1 JOIN government_servic...