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 gaming_technology.achievements ( achievement_id uuid NOT NULL DEFAULT gen_random...
[ { "role": "user", "content": "Can you list the names of achievements and the length of their descriptions? Show the ones with the longest descriptions first.", "sql": null }, { "role": "assistant", "content": "SELECT name, LENGTH(description) AS description_length FROM achievements ORDER 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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var...
[ { "role": "user", "content": "List all agents who have been terminated, showing their full name, agency name, and termination date.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, agency_name, termination_date\nFROM insurance.agents\nWHERE status <> 'Active'...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.documents ( document_id character varying(64) NOT NULL, applicat...
[ { "role": "user", "content": "For each employee who has verified more than one document, list their employee ID, the first document they verified, and the next document they verified, along with both verification timestamps.", "sql": null }, { "role": "assistant", "content": "SELECT\n d1.ve...
You are an expert in writing database language. You can write a corresponding 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": "How many customers have a non-null phone number in your system?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM insurance.customers WHERE phone_number 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 social_media.conversation_participants ( participant_id character varying(64) NO...
[ { "role": "user", "content": "List each participant_id along with the total number of participants in their conversation, and include user_id and conversation_id.", "sql": null }, { "role": "assistant", "content": "SELECT cp.participant_id, cp.user_id, cp.conversation_id, counts.participant_...
You are an expert in writing database language. You can write a corresponding 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": "List all pairs of locations within the same state_province where the two locations are of different types. For each pair, show the first location's name, type, city, and the second location's name, type, city, and their shared state_province.", "sql": null }, { "rol...
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?", "sql": null }, { "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 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 financial_services.transactions ( transaction_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "List employees whose transaction effective_date matches their hire_date anniversary. Show full name and count of such transactions.", "sql": null }, { "role": "assistant", "content": "SELECT e.employee_id,\n e.first_name || ' ' || e.last_name AS employee_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 financial_services.market_data ( data_point_id bigint, security_id text, data_timest...
[ { "role": "user", "content": "Get the total trading volume and average close_price for each data source over the last quarter.", "sql": null }, { "role": "assistant", "content": "SELECT source,\n SUM(volume) AS total_volume,\n AVG(close_price) AS avg_close_price\nFROM financial_s...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "Find pairs of drivers where the first driver was hired after the second driver, but the first driver's license expires before the second driver's. Show driver IDs, hire dates, and license expiry dates for both drivers in each pair.", "sql": null }, { "role": "assist...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri...
[ { "role": "user", "content": "Show narratives with a 24-hour trading volume greater than $10,000,000 and a positive 24-hour price change percentage. List the narrative name, volume_24h, and price_change_percentage_24h.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, vol...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Show the full names and registration dates of citizens who have submitted applications with the status 'Processing'.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name, c.last_name, c.registration_date\nFROM 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 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 legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "List all active clients with their client_id, first_name, last_name, and the website of their law firm, matching on company_name = firm_name.", "sql": null }, { "role": "assistant", "content": "SELECT cl.client_id,\n cl.first_name,\n cl.last_name,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_y...
[ { "role": "user", "content": "Find all pairs of developers in the same country but founded in different years. Show each developer's name, their founded_year, and the shared country.", "sql": null }, { "role": "assistant", "content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti...
[ { "role": "user", "content": "For Sui coins, can you show the coin_type and owner address for each coin where the balance is greater than 100000?", "sql": null }, { "role": "assistant", "content": "SELECT coin_type, owner FROM sui_coins WHERE CAST(balance AS NUMERIC) > 100000;", "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": "Retrieve the first and last names and email addresses of all customers who registered after '2024-01-01'.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM insurance.customers WHERE created_at > '2024-01-01';", "sql...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.tokens ( token_id text PRIMARY KEY, contract_address text, token_name text, tok...
[ { "role": "user", "content": "Find all pairs of tokens that have the same contract_address but different token_symbols. Show both token_ids, each token's symbol, and the shared contract_address.", "sql": null }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id_1, t2.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 social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Show the usernames and email addresses of all users who have never created a post.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, u.email\nFROM social_media.users u\nLEFT JOIN social_media.posts p ON u.user_id = p.user_id\nWHERE p.post_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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "Show me claim IDs and the file names of any documents associated with claims filed before January 1, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT cd.claim_id, cd.file_name\nFROM insurance.claims c\nJOIN insurance.claim_documents cd ON c.claim...
You are an expert in writing database language. You can write a corresponding 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 DEFAULT ...
[ { "role": "user", "content": "For each player who has unlocked at least two achievements, find the time difference in minutes between their first and last achievement unlock. Show player_id and the difference labeled last_minus_first_minutes.", "sql": null }, { "role": "assistant", "content"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_dexpool_info ( pair_address text, token_name text, token_symbol text, chain te...
[ { "role": "user", "content": "What is the total USD value of tokens held by Binance exchange on the Ethereum chain according to the cex_token_balance table?", "sql": null }, { "role": "assistant", "content": "SELECT SUM(usd_value) AS total_usd_value FROM cex_token_balance WHERE exchange = '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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "List each user with the date of their most recent trade (as a buyer or seller). Include all users even if they have not traded.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id,\n u.username,\n MAX(t.traded_at) AS last_trade_date\...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uu...
[ { "role": "user", "content": "I want to see, for each player, the total score they have accumulated on each server, along with the server_id and player_id. Only include sessions where the server_id is not null.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, server_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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "Show me the policy number, premium amount, and payment status for every premium payment made, along with the customer's full name for each one.", "sql": null }, { "role": "assistant", "content": "SELECT p.policy_number, pp.amount_paid, pp.status, c.first_name, 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 // db.createCollection('stations') // Optional: Add unique index: db.stations.createIndex({ stati...
[ { "role": "user", "content": "Can you assist me in finding all staff members assigned to a specific station with station_id 'station_xyz', including the station details and their roles?", "sql": null }, { "role": "assistant", "content": "db.staff.aggregate([\n {\n $lookup: {\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 government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "Show me the first and last names of citizens, the appointment id, and the department of the employee who scheduled their appointment.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.appointment_id, e.department\nFROM gover...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agenc...
[ { "role": "user", "content": "Show the number of active agents in each license state.", "sql": null }, { "role": "assistant", "content": "SELECT license_state,\n COUNT(*) AS active_agent_count\nFROM insurance.agents\nWHERE status = 'active'\nGROUP BY license_state;", "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.notifications ( notification_id text PRIMARY KEY, citizen_id tex...
[ { "role": "user", "content": "List the IDs of citizens who have received notifications related to more than one distinct type of entity.", "sql": null }, { "role": "assistant", "content": "SELECT citizen_id FROM government_services.notifications WHERE related_entity_type IS NOT NULL AND rela...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "Show a list of clients whose status is 'inactive', including their first and last name, email, phone, and date registered.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email, phone, date_registered\nFROM legal_services.client...
You are an expert in writing database language. You can write a corresponding 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 all ERC20 tokens from token_metas that are marked as a proxy (is_proxy = 1). Show their contract address, symbol, and name.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, symbol, name FROM token_metas WHERE is_erc20 = 1 AND 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 hospitality_technology.reviews ( review_id character varying(64) NOT NULL, property_...
[ { "role": "user", "content": "Show me the property_id and property_name along with the average overall rating for public reviews.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.review...
You are an expert in writing database language. You can write a corresponding 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": "Show me the incident date, estimated loss, and the associated product name for all claims with an estimated loss greater than 20000.", "sql": null }, { "role": "assistant", "content": "SELECT c.incident_date, c.estimated_loss, p.product_name\nFROM insurance.clai...
You are an expert in writing database language. You can write a corresponding 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": "Can you list all route numbers and their corresponding distance in km for routes that start in 'San Francisco'?", "sql": null }, { "role": "assistant", "content": "SELECT r.route_number, r.distance_km\nFROM transportation.routes r\nJOIN transportation.locations ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id charact...
[ { "role": "user", "content": "List all peers with their IP addresses who have not been seen in the last 7 days.", "sql": null }, { "role": "assistant", "content": "SELECT peer_id, ip_address, port, last_seen\nFROM trading_platform.peers\nWHERE last_seen < NOW() - INTERVAL '7 days';", "sq...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp...
[ { "role": "user", "content": "List distinct patient IDs who have received a diagnosis from a doctor with 'Cardiology' specialty.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.patient_id FROM healthcare.diagnoses AS T1 JOIN healthcare.doctors AS T2 ON T1.doctor_id = 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 cex_token_balance ( snapshot_time character varying(32) NOT NULL, chain character va...
[ { "role": "user", "content": "Show me the top 5 tokens by USD value held on the Binance Smart Chain, along with their average price and total balance.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, AVG(price) as average_price, SUM(balance) as total_balance, SUM(usd_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.passengers ( passenger_id text PRIMARY KEY, first_name text, last_nam...
[ { "role": "user", "content": "List each passenger's first_name, last_name along with another passenger's first_name and last_name who share the same loyalty_program_id. Label them as member and peer.", "sql": null }, { "role": "assistant", "content": "SELECT p1.first_name AS member_first, p1...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Show the content of all comments made on posts that are tagged with hashtag 'H456'.", "sql": null }, { "role": "assistant", "content": "SELECT T1.content FROM social_media.comments AS T1 JOIN social_media.post_hashtags AS T2 ON T1.post_id = T2.post_id WHERE T2.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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "How many unique patient records are there for each gender?", "sql": null }, { "role": "assistant", "content": "SELECT gender, COUNT(DISTINCT patient_id) AS patient_count FROM healthcare.patients GROUP BY gender;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agenc...
[ { "role": "user", "content": "List all agents and their managers' full names.", "sql": null }, { "role": "assistant", "content": "SELECT a.first_name, a.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name FROM insurance.agents a LEFT JOIN insurance.agents m ON a.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 legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "Which lawyers have uploaded at least two different types of documents? Show their first name, last name, and the count of unique document types.", "sql": null }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, COUNT(DISTINCT d.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 legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id tex...
[ { "role": "user", "content": "List each case_id along with the total hours worked and total billed amount for that case.", "sql": null }, { "role": "assistant", "content": "SELECT case_id, SUM(hours_spent) AS total_hours, SUM(hours_spent * billing_rate) AS total_billed_amount FROM legal_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 legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w...
[ { "role": "user", "content": "List the case number and name for all cases that do not have any linked invoices.", "sql": null }, { "role": "assistant", "content": "SELECT T1.case_number, T1.case_name FROM cases AS T1 LEFT JOIN invoices AS T2 ON T1.case_id = T2.case_id WHERE T2.invoice_id 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 web3.wallets ( wallet_id text, user_id text, address text, private_key text, created...
[ { "role": "user", "content": "List all pairs of wallets that were created within 10 minutes of each other, showing both wallet IDs, the user_id, and both creation timestamps.", "sql": null }, { "role": "assistant", "content": "SELECT\n w1.wallet_id AS wallet1_id,\n w2.wallet_id AS wallet2_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "Provide a summary of transactions by transaction_type, showing the count and the total amount for each type.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_type, COUNT(transaction_id) AS transaction_count, SUM(amount) AS total_amount 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 gaming_technology.player_inventory ( inventory_id uuid, player_id uuid, item_id uuid...
[ { "role": "user", "content": "List each unique item ID and the total number of inventory entries for that item.", "sql": null }, { "role": "assistant", "content": "SELECT item_id, COUNT(*) AS entry_count FROM gaming_technology.player_inventory GROUP BY item_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 web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a...
[ { "role": "user", "content": "List all transactions together with any event emitted in the same transaction, showing transaction ID, event name, and event emitted timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT tx.transaction_id, ev.event_name, ev.emitted_at\nFROM web3....
You are an expert in writing database language. You can write a corresponding 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, token_id.text, from_address.text, to_addres...
[ { "role": "user", "content": "List all token transfers where the value is an even number, showing transfer ID, token ID, value, and transaction ID.", "sql": null }, { "role": "assistant", "content": "SELECT transfer_id, token_id, value, transaction_id\nFROM web3.token_transfers\nWHERE MOD(va...
You are an expert in writing database language. You can write a corresponding 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.", "sql": null }, { "role": "assistant", "content": "SELECT city, COUNT(guest_id) AS guest_count FROM guests GROUP BY city ORDER BY city;", "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 manufacturing.materials ( material_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "特定の材料を使用しているコンポーネントの組み立て手順を確認したいです。材料IDと材料名、組み立て手順のステップ名と説明を含めてください。", "sql": null }, { "role": "assistant", "content": "SELECT m.material_id, m.material_name, s.step_name, s.description\nFROM manufacturing.materials m\nJOIN manufacturing.assembly_steps s ON m.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 legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "How many lawyers who are partners were hired in each year? Show the hire year and the count.", "sql": null }, { "role": "assistant", "content": "SELECT strftime('%Y', hire_date) AS hire_year , count(lawyer_id) FROM legal_services.lawyers WHERE is_partner = 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 legal_services.invoices ( invoice_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "Which invoices have a status of 'Partially Paid' and have not reached their due date yet? Show the invoice number, client ID, due date, and amount paid.", "sql": null }, { "role": "assistant", "content": "SELECT invoice_number, client_id, due_date, amount_paid\n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.trades ( trade_id text, order_id text, buyer_id text, seller_id tex...
[ { "role": "user", "content": "Show each user's total count of notifications and, for each, how many of them have been read.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) AS total_notifications, COUNT(read_at) AS notifications_read \nFROM trading_platform.notifi...
You are an expert in writing database language. You can write a corresponding 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.components ( component_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "我想查询所有使用特定材料ID的组件信息,包括组件名称、零件编号和供应商ID,同时还需要获取该材料的名称和规格。", "sql": null }, { "role": "assistant", "content": "SELECT c.component_id, c.component_name, c.part_number, c.supplier_id, m.material_name, m.specification\nFROM manufacturing.components c\nJOIN manufacturi...
You are an expert in writing database language. You can write a corresponding 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.maintenance_logs ( log_id text, vehicle_id text, service_date date, o...
[ { "role": "user", "content": "For each maintenance log, find the upcoming scheduled service by joining on next_service_due_date matching another log's service_date. Show l1.log_id, l1.vehicle_id, l1.service_date, l2.log_id AS upcoming_log_id, and l2.service_date AS upcoming_service_date.", "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.documents ( document_id character varying(64) NOT NULL, applicat...
[ { "role": "user", "content": "Which service locations do not have a contact phone specified? Show the location_id and location_name.", "sql": null }, { "role": "assistant", "content": "SELECT location_id, location_name\nFROM government_services.service_locations\nWHERE contact_phone 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.patient_insurance ( patient_insurance_id text, patient_id text, plan_id t...
[ { "role": "user", "content": "How many primary insurance policies are currently active for each plan_id? Show plan_id and active_count.", "sql": null }, { "role": "assistant", "content": "SELECT plan_id,\n COUNT(*) AS active_count\nFROM healthcare.patient_insurance\nWHERE is_primary = ...
You are an expert in writing database language. You can write a corresponding 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": "List the case name, case number, and date opened for all cases with a status of 'Pending'.", "sql": null }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE status = 'Pending';", "sql": null }, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "List each vehicle along with the city of the station where it had its most recent fueling and the timestamp of that fueling.", "sql": null }, { "role": "assistant", "content": "SELECT v.vehicle_id,\n v.license_plate,\n l.city AS last_fuel_city,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3...
[ { "role": "user", "content": "Show me the top 5 token balances by amount for wallet '0xabc123abcdef' in the erc20_balances table.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, amount\nFROM erc20_balances\nWHERE wallet_address = '0xabc123abcdef'\nORDER BY CAST(a...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Give me the list of DApp names and URLs whose description contains any asset symbol from the assets table.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT d.name, d.url\nFROM trading_platform.dapps d\nJOIN trading_platform.assets a ON d.descr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,...
[ { "role": "user", "content": "I want to retrieve the agent ID, first and last name, along with their manager's contact email and phone number.", "sql": null }, { "role": "assistant", "content": "SELECT a.agent_id,\n a.first_name || ' ' || a.last_name AS agent_name,\n m.contact_em...
You are an expert in writing database language. You can write a corresponding 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": "Show a list of all routes including their route number, type, distance in km, and estimated duration in minutes.", "sql": null }, { "role": "assistant", "content": "SELECT\n route_number,\n type,\n distance_km,\n estimated_duration_minutes\nFROM transportati...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "How many hashtags have been used in all posts linked to private conversations? Please show the conversation_id and hashtag_count for conversations where is_group_chat is false.", "sql": null }, { "role": "assistant", "content": "SELECT c.conversation_id, 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 blockchain.wallets ( wallet_id text, user_id text, address_id text, private_key text...
[ { "role": "user", "content": "Show me the top 5 users with the most wallet addresses, along with the count of their wallets.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, COUNT(wallet_id) AS wallet_count FROM blockchain.wallets WHERE user_id IS NOT NULL GROUP BY user_id...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "List players who have completed at least one game session with a score greater than 100, showing their player_id and username.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.player_id, T1.username FROM gaming_technology.players 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 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 narrative_info ( narrative text, top_3_coins text, price_change_percentage_1h numeri...
[ { "role": "user", "content": "List narratives with a market cap over $1,000,000,000, ordered by market cap descending.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, market_cap FROM narrative_info WHERE market_cap > 1000000000 ORDER BY market_cap DESC;", "sql": nul...
You are an expert in writing database language. You can write a corresponding 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 the average number of current players for each server region.", "sql": null }, { "role": "assistant", "content": "SELECT region, AVG(current_players) AS average_players FROM gaming_technology.servers GROUP BY region;", "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 transportation.locations ( location_id.text, name.text, type.text, address_line1.tex...
[ { "role": "user", "content": "List pairs of distinct locations in the same city that share the same location type. Show both location IDs, names, city, and the shared type.", "sql": null }, { "role": "assistant", "content": "SELECT L1.location_id AS location1_id, L1.name AS location1_name, L...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.market_data ( data_point_id bigserial NOT NULL, -- auto-incre...
[ { "role": "user", "content": "List the ticker symbol and security name for all securities that had a volume greater than 100000 on '2023-10-27'.", "sql": null }, { "role": "assistant", "content": "SELECT T2.ticker_symbol, T2.security_name FROM financial_services.market_data AS T1 JOIN financ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List all law firms that share the same address with another firm, showing both firm names and the address.", "sql": null }, { "role": "assistant", "content": "SELECT f1.firm_name AS firm_a, f2.firm_name AS firm_b, f1.address\nFROM law_firms f1\nJOIN law_firms f2...
You are an expert in writing database language. You can write a corresponding 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 project_fundraising_record (", "id character varying(32) NOT NULL, -- fundrai...
[ { "role": "user", "content": "For each project, list the earliest and latest fundraising rounds they completed, along with the investment values for those rounds.", "sql": null }, { "role": "assistant", "content": "SELECT project_name, MIN(investment_date) AS earliest_round_date, MAX(investm...
You are an expert in writing database language. You can write 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 to store station details. Key format: station:<station_id> // Example: // HSET stat...
[ { "role": "user", "content": "能否帮我查询特定列车(train_id 为 'train_789')上的所有车辆信息,并关联到该列车所在的路线信息?", "sql": null }, { "role": "assistant", "content": "SMEMBERS train:train_789:cars\nHGETALL car:<car_id> for each car_id in result\nHGETALL train:train_789\nSMEMBERS schedule:sched_1122:bookings\nHGETALL ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco...
[ { "role": "user", "content": "Find projects that completed a fundraising round in 2023 and have a corresponding token listed in the smart money performance data. Show the project name, fundraising amount, token symbol, and the token's smart money ROI.", "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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "List each patient along with the number of active diagnoses they have. Return patient_id, first_name, last_name, and active_diagnoses_count.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, COUNT(d.diagnosis_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 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.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, price, trend_rank FROM token_dexpool_info WHERE trend_rank IS NOT NULL AND trend_rank <= 5 ...
You are an expert in writing database language. You can write a corresponding 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 blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character vary...
[ { "role": "user", "content": "Show me all nodes that haven't been seen in the last 24 hours.", "sql": null }, { "role": "assistant", "content": "SELECT node_id,\n ip_address,\n port,\n last_seen\nFROM blockchain.nodes\nWHERE last_seen < NOW() - INTERVAL '24 hours';", "s...
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 personal contact details of the staff member associated with staff_id 'STAFF789' who worked on a specific maintenance record?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide personal contact details of staff member...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id....
[ { "role": "user", "content": "I need a count of games per platform and the earliest release date on each platform.", "sql": null }, { "role": "assistant", "content": "SELECT platform, COUNT(*) AS game_count, MIN(release_date) AS first_release\nFROM gaming_technology.games\nGROUP BY platform;...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ...
[ { "role": "user", "content": "List all insurance products with a base premium less than 800, displaying product name, product type, and base premium.", "sql": null }, { "role": "assistant", "content": "SELECT product_name, product_type, base_premium\nFROM insurance.insurance_products\nWHERE ...
You are an expert in writing database language. You can write a corresponding 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": "Show all contracts that share the same deployment date, along with their contract IDs and the corresponding deployment date.", "sql": null }, { "role": "assistant", "content": "SELECT a.contract_id AS contract_id_1, b.contract_id AS contract_id_2, a.deployed_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 CREATE TABLE government_services.documents ( document_id text, application_id text, citizen_id te...
[ { "role": "user", "content": "How many documents have a file reference assigned?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.documents WHERE file_reference IS NOT NULL AND file_reference <> '';", "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.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List the names and email addresses of guests who have made a reservation in the last 60 days.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT g.first_name, g.last_name, g.email\nFROM hospitality_technology.guests g\nJOIN hospitality_technolog...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Show the first name, last name, and email for all guests created in 2023.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM guests WHERE created_at >= '2023-01-01' AND created_at < '2024-01-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 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 social_media.comments ( comment_id character varying(64) NOT NULL, post_id character...
[ { "role": "user", "content": "Show me the usernames and group names for all users who received a 'mention' notification related to group conversations, and when those notifications were created.", "sql": null }, { "role": "assistant", "content": "SELECT us.user_id, us.theme AS username, c.gr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure "CREATE TABLE smart_money_token_inflow (", "token_address character varying(100) NOT NULL, ...
[ { "role": "user", "content": "What are the top 3 narratives with the highest total USD buy value?", "sql": null }, { "role": "assistant", "content": "SELECT narrative,\n SUM(usd_value) AS total_buy_usd\nFROM smart_money_token_inflow\nWHERE type = 1\nGROUP BY narrative\nORDER BY total_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 financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account...
[ { "role": "user", "content": "Show the average current_principal_balance for each loan_type, and include the number of active loans per type.", "sql": null }, { "role": "assistant", "content": "SELECT loan_type,\n COUNT(*) AS active_loan_count,\n AVG(current_principal_balance) 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 social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url...
[ { "role": "user", "content": "For each group conversation, get the latest message's sender_user_id and sent_at, including conversation_id and group_name.", "sql": null }, { "role": "assistant", "content": "SELECT c.conversation_id, c.group_name, m.sender_user_id, m.sent_at\nFROM social_media...
You are an expert in writing database language. You can write a corresponding 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.employees ( employee_id character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "Report the number of employees for each department, broken down by their employment status.", "sql": null }, { "role": "assistant", "content": "SELECT department, status, COUNT(*) AS employee_count FROM financial_services.employees GROUP BY department, 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 blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp tim...
[ { "role": "user", "content": "Show me all smart contracts created by addresses with a balance greater than 1000, along with the contract creation timestamp and the creator's public key.", "sql": null }, { "role": "assistant", "content": "SELECT sc.contract_id, sc.timestamp, a.public_key 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 government_services.services ( service_id character varying(64) NOT NULL, agency_id ...
[ { "role": "user", "content": "List all services with an average processing time greater than the overall average processing time for all services. Show the service name, average processing time, and the overall average processing time.", "sql": null }, { "role": "assistant", "content": "SELE...
You are an expert in writing database language. You can write a corresponding 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 the full name (first name and last name) and position of all staff members working at properties located in 'California'. Include the name of the property they work at.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "Show me a list of all clients and their invoices, including the client's full name, email, invoice number, total amount, and invoice status.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, c.email, i.invoice_number, i.total_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "List the post_id and the count of distinct hashtags associated with each post that has at least 3 hashtags.", "sql": null }, { "role": "assistant", "content": "SELECT ph.post_id, COUNT(DISTINCT ph.hashtag_id) AS hashtag_count FROM social_media.post_hashtags ph 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 social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte...
[ { "role": "user", "content": "Count the total number of hashtags.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.hashtags;", "sql": null } ]