Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
303
8.03k
[ { "content": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own.", "role": "user" }, { "content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.users AS u\nLEFT JOIN\n bloc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonce.integer, merkle_root.text, diffic...
[ { "content": "I want to know, for each conversation participant, how many unread messages they have. Return participant_id, conversation_id, and unread_count.", "role": "user" }, { "content": "SELECT cp.participant_id,\n cp.conversation_id,\n COUNT(m.message_id) AS unread_count\nFROM soc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, -- unique identifier for the post user_id characte...
[ { "content": "Show me the username and email of all users who own at least one wallet.", "role": "user" }, { "content": "SELECT DISTINCT T1.username, T1.email FROM blockchain.users AS T1 JOIN blockchain.wallets AS T2 ON T1.user_id = T2.user_id;", "role": "assistant" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text ) CREATE TABLE blockchain.users ( ...
[ { "content": "Show me the balances held by the 'Coinbase' exchange. For each token, list the token symbol, balance, and the current price from the token basic info table.", "role": "user" }, { "content": "SELECT ctb.token_symbol, ctb.balance, tbi.price FROM cex_token_balance ctb JOIN token_basic_inf...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_basic_info ( coin_id.text, token_name.text, token_symbol.text, token_address.t...
[ { "content": "What is the current market cap and 7-day price change percentage for the top 3 narratives by trend rank?", "role": "user" }, { "content": "SELECT narrative, market_cap, price_change_percentage_7d FROM narrative_info ORDER BY trend_rank ASC LIMIT 3;", "role": "assistant" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE token_basic_info (", "coin_id character varying(100) NOT NULL, -- the id of the token", "token_name character...
[ { "content": "For each developer, can you find the next developer in the same country using a self join, returning developer_ids and names?", "role": "user" }, { "content": "SELECT d1.developer_id AS current_dev,\n d1.name AS current_name,\n d2.developer_id AS next_dev,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "content": "List all service orders for spa services with their guest names and total prices, ordered by total price in descending order.", "role": "user" }, { "content": "SELECT g.first_name, g.last_name, so.order_id, so.total_price FROM hospitality_technology.service_orders so JOIN hospitality_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, property_id character varying(64) NOT ...
[ { "content": "Show the total fuel cost for each month in 2023 based on the log timestamp.", "role": "user" }, { "content": "SELECT\n EXTRACT(MONTH FROM log_timestamp) AS log_month,\n SUM(total_cost) AS monthly_total_cost\nFROM transportation.fuel_logs\nWHERE EXTRACT(YEAR FROM log_timestamp) = ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, vehicle_id character varying(64) NOT NULL, trip_...
[ { "content": "For each user, show their username, email, and the number of posts they've created that contain at least one hashtag. Only include users who have created such posts.", "role": "user" }, { "content": "SELECT u.username, u.email, COUNT(DISTINCT p.post_id) AS posts_with_hashtag_count\nFRO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "content": "List the top 5 Avalanche tokens by activity count in the past 7 days.", "role": "user" }, { "content": "SELECT ta.tick,\n COUNT(*) AS activity_count\nFROM token_activities_avalanche ta\nWHERE ta.block_timestamp >= NOW() - INTERVAL '7 days'\nGROUP BY ta.tick\nORDER BY activity_cou...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "content": "For each event recorded, list its ID, name, and the status and value of the transaction in which it occurred.", "role": "user" }, { "content": "SELECT E.event_id, E.event_name, E.transaction_id, T.status, T.value FROM web3.events AS E JOIN web3.transactions AS T ON E.transaction_id = T...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "content": "Provide a count of citizens registered per calendar year.", "role": "user" }, { "content": "SELECT CAST(EXTRACT(YEAR FROM registration_date) AS INTEGER) AS registration_year, COUNT(*) AS citizen_count FROM government_services.citizens GROUP BY 1 ORDER BY 1;", "role": "assistant" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "content": "What is the history of incidents or accidents that occurred on platform 5 at station GHI?", "role": "user" }, { "content": "I'm sorry, but I can't provide information about the history of incidents or accidents on platform 5 at station GHI. My data is limited to the structural and oper...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.p...
[ { "content": "How many notifications are there where the sender user ID is not recorded?", "role": "user" }, { "content": "SELECT COUNT(*) FROM social_media.notifications WHERE sender_user_id IS NULL", "role": "assistant" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "content": "What is the current operational status of the train car with car_id 'CAR123'?", "role": "user" }, { "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 does not include real-tim...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "content": "List all applications that have at least one document with a verification status of 'Verified'. Show the application reference number and the name of the service associated with the application.", "role": "user" }, { "content": "SELECT\n T1.reference_number,\n T2.service_name\nFROM g...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "content": "Show me all documents uploaded by lawyers from the 'Smith Legal Group' firm, including document_name, upload_timestamp, and the lawyer's first and last name.", "role": "user" }, { "content": "SELECT d.document_name, d.upload_timestamp, l.first_name, l.last_name\nFROM legal_services.doc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "content": "Show me all users who have both bought and sold the same cryptocurrency asset, along with the asset details and their total buy/sell volumes.", "role": "user" }, { "content": "SELECT u.user_id, u.email, a.asset_id, a.name AS asset_name, a.symbol, SUM(CASE WHEN t.buyer_id = u.user_id TH...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text, username text, email text, password_hash text, created_at timestamp ) CREATE TAB...
[ { "content": "Show me the total number of invoices issued.", "role": "user" }, { "content": "SELECT COUNT(*) FROM invoices;", "role": "assistant" }, { "content": "How many invoices were issued in each status?", "role": "user" }, { "content": "SELECT status, COUNT(*) FROM invo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case_id.text, issue_date.date, due_date...
[ { "content": "For Sui coins owned by address '0xabc...xyz', list the balance and their symbol by joining the coins and metadata tables.", "role": "user" }, { "content": "SELECT T1.balance, T2.symbol FROM sui_coins AS T1 JOIN sui_coins_metadata AS T2 ON T1.coin_type = T2.coin_type WHERE T1.owner = '0...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "content": "How many users are being followed by at least 100 different followers?", "role": "user" }, { "content": "SELECT COUNT(*)\nFROM (\n SELECT following_user_id\n FROM social_media.follows\n GROUP BY following_user_id\n HAVING COUNT(DISTINCT follower_user_id) >= 100\n) AS user_followers...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "content": "Show me all documents that have a version greater than 2 and include the document name, upload timestamp, and description.", "role": "user" }, { "content": "SELECT document_id, document_name, upload_timestamp, description FROM legal_services.documents WHERE version > 2;", "role": "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u...
[ { "content": "What is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?", "role": "user" }, { "content": "I'm sorry, but I can't provide information on the detailed repair history of equipment used by staff members. The data in the main...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.m...
[ { "content": "List patients who have appointments scheduled, their appointment time, the name of their primary insurance plan, and the provider name.", "role": "user" }, { "content": "SELECT p.first_name AS patient_first_name, p.last_name AS patient_last_name, a.appointment_time, ip.plan_name, ip.in...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "content": "Get a count of available rooms per room type across all properties.", "role": "user" }, { "content": "SELECT T2.type_name, COUNT(T1.room_id) AS available_room_count FROM hospitality_technology.rooms AS T1 INNER JOIN hospitality_technology.room_types AS T2 ON T1.room_type_id = T2.room_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "content": "Show me the top 5 users by the total number of trades they participated in as sellers, along with their wallet addresses.", "role": "user" }, { "content": "SELECT t.seller_id, w.address, COUNT(t.trade_id) AS total_trades FROM trading_platform.trades t JOIN trading_platform.wallets w ON...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch...
[ { "content": "List all Sui NFT collections where the owner is not null, including their name and collection_type.", "role": "user" }, { "content": "SELECT name, collection_type FROM sui_nfts WHERE owner IS NOT NULL;", "role": "assistant" }, { "content": "Can you also include the display ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "content": "Find the average time it takes for users to read notifications after they are sent.", "role": "user" }, { "content": "SELECT AVG(EXTRACT(EPOCH FROM (read_at - sent_at))/3600) as avg_hours_to_read FROM trading_platform.notifications WHERE read_at IS NOT NULL;", "role": "assistant" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, message text, sent_at timestamp, read_...
[ { "content": "How many unique tokens are recorded for each chain in the latest snapshot in cex_token_balance?", "role": "user" }, { "content": "WITH latest_snapshot AS (\n SELECT MAX(snapshot_time) AS max_time FROM cex_token_balance\n)\nSELECT \n chain, \n COUNT(DISTINCT token_symbol) AS unique_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE cex_token_balance ( snapshot_time.text, chain.text, address.text, exchange.text, token_address.text, token_symbol.text,...
[ { "content": "Find the service locations that are not accessible and located in the state of 'California'. List their name, address, and city.", "role": "user" }, { "content": "SELECT location_name , address , city FROM government_services.service_locations WHERE is_accessible = false AND state = ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.service_locations ( location_id text, agency_id text, location_name text, address text, city text, ...
[ { "content": "Show me all active managers along with their property IDs and the number of staff members they supervise, ordered by the number of supervised staff in descending order.", "role": "user" }, { "content": "SELECT s.staff_id, s.property_id, s.first_name, s.last_name, COUNT(s2.staff_id) AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.staff ( staff_id character varying(64) NOT NULL, -- unique identifier for the staff member ...
[ { "content": "能否帮我查询特定路线(route_id 为 'RT001')的所有行程信息,并关联到乘客的联系方式?", "role": "user" }, { "content": "SELECT s.schedule_id, s.train_id, s.route_id, s.departure_datetime, s.arrival_datetime, s.status, p.passenger_id, p.first_name, p.last_name, p.phone_number, p.email\nFROM schedules s\nLEFT JOIN passeng...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // PUT /schedules { "mappings": { "properties": { "schedule_id": { "type": "keyword" ...
[ { "content": "特定のプラットフォームID 'plat_123' に関連するメンテナンス記録を取得するのを手伝っていただけますか?また、記録のステータスも含めてください。", "role": "user" }, { "content": "SMEMBERS platform:plat_123:maintenance\nHGETALL maintenance_record:<record_id>", "role": "assistant" }, { "content": "ステータスが 'Completed' の記録だけを表示するようにフィルタリングしていただ...
You are an expert in writing database language. You can write 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...
[ { "content": "Show me all properties in California with their star ratings and the total number of rooms they have, ordered by the room count in descending order.", "role": "user" }, { "content": "SELECT p.property_id, p.property_name, p.star_rating, COUNT(r.room_id) AS room_count FROM hospitality_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "content": "List users who have received notifications triggered by another user (non-system notifications). Show the recipient username, notification type, and the sender username.", "role": "user" }, { "content": "SELECT T1.username AS recipient_username, T2.notification_type, T3.username AS sen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "content": "Provide the total number of vehicles for each fuel_type.", "role": "user" }, { "content": "SELECT fuel_type, COUNT(*) AS vehicle_count\nFROM transportation.vehicles\nGROUP BY fuel_type;", "role": "assistant" }, { "content": "Only include fuel types with more than 5 vehicles...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "content": "What are the maintenance costs for a specific aircraft model like the Airbus A320?", "role": "user" }, { "content": "I'm sorry, but I don't have access to data regarding maintenance costs for specific aircraft models such as the Airbus A320. The information in the database is limited t...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE manufacturing.aircraft_mod...
[ { "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": "user" }, { "content": "SELECT s.service_name, COUNT(a.application_id) AS appointment_count, COUNT(DISTINCT ap.location_id) A...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "content": "Show the contract address, symbol, and current total supply for all Avalanche tokens from token_balances_avalanche.", "role": "user" }, { "content": "SELECT tick AS contract_address, tick AS symbol, SUM(total_supply) AS current_total_supply\nFROM token_balances_avalanche\nGROUP BY tick...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "content": "List each agent along with their manager's contact_email. Include agent_id, first_name, last_name, manager_id, and manager's contact_email.", "role": "user" }, { "content": "SELECT a.agent_id,\n a.first_name,\n a.last_name,\n a.manager_id,\n m.contact_email AS m...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state...
[ { "content": "What is the total number of employees for each status that is not 'Active'?", "role": "user" }, { "content": "SELECT status, COUNT(employee_id) AS employee_count FROM financial_services.employees WHERE status != 'Active' GROUP BY status;", "role": "assistant" }, { "content"...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "content": "How many prescriptions have been issued for each medication?", "role": "user" }, { "content": "SELECT medication_id, COUNT(*) AS prescription_count FROM healthcare.prescriptions GROUP BY medication_id;", "role": "assistant" }, { "content": "Exclude null or empty medication_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "content": "How many documents are there for each document_type? Show document_type and count ordered by the count in descending order.", "role": "user" }, { "content": "SELECT document_type,\n COUNT(*) AS count\nFROM legal_services.documents\nGROUP BY document_type\nORDER BY count DESC;", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "content": "Show me all customers (customer_id, first_name, last_name) from California (state = 'CA') who have taken out a home loan (loan_type = 'Home'), along with their loan details (loan_id, principal_amount, interest_rate).", "role": "user" }, { "content": "SELECT c.customer_id, c.first_name,...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "content": "Find all patients who have been prescribed medications with dosage greater than 50mg, along with their medication details and prescribing doctor's name.", "role": "user" }, { "content": "SELECT p.patient_id, p.first_name, p.last_name, pr.dosage, pr.medication_id, pr.start_date, doc.fir...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "content": "Show me all users who have commented on a post and have also liked any comment on that same post. I want their user IDs and the corresponding post IDs.", "role": "user" }, { "content": "SELECT DISTINCT c.user_id, c.post_id\nFROM social_media.comments c\nJOIN social_media.likes l ON l.c...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "content": "List the names of employees and the agency they work for who have scheduled at least one appointment. Show the employee's first name, last name, and agency_id.", "role": "user" }, { "content": "SELECT DISTINCT e.first_name, e.last_name, e.agency_id\nFROM government_services.employees e...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli...
[ { "content": "List all claims that were reported more than 30 days after the incident date.", "role": "user" }, { "content": "SELECT claim_id, policy_id, customer_id, incident_date, reported_date FROM insurance.claims WHERE DATEDIFF(reported_date, incident_date) > 30;", "role": "assistant" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d...
[ { "content": "How many notifications have been sent per channel?", "role": "user" }, { "content": "SELECT channel,\n COUNT(*) AS notification_count\nFROM government_services.notifications\nGROUP BY channel;", "role": "assistant" }, { "content": "Exclude any notifications with statu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.notifications ( notification_id text PRIMARY KEY, citizen_id text, application_id text, message_sub...
[ { "content": "Count the total number of employees who have a direct manager assigned.", "role": "user" }, { "content": "SELECT COUNT(employee_id) FROM government_services.employees WHERE manager_employee_id IS NOT NULL;", "role": "assistant" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "content": "For each driver, find the other driver whose license_expiry_date is the next one after theirs. Show both IDs, names and their expiry dates.", "role": "user" }, { "content": "SELECT\n d1.driver_id AS driver_id,\n d1.first_name || ' ' || d1.last_name AS driver_name,\n d...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "content": "List each citizen's full name and the number of documents they have uploaded per service category.", "role": "user" }, { "content": "SELECT c.first_name || ' ' || c.last_name AS full_name,\n s.category,\n COUNT(d.document_id) AS document_count\nFROM government_services.citi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "content": "Count the number of policies issued in each calendar year, and show the year and the count.", "role": "user" }, { "content": "SELECT EXTRACT(YEAR FROM issued_at), COUNT(*) FROM insurance.policies WHERE issued_at IS NOT NULL GROUP BY 1 ORDER BY 1;", "role": "assistant" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin...
[ { "content": "What is the schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?", "role": "user" }, { "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 platform management table. For ...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.p...
[ { "content": "I want a summary of each asset showing the total number of trades executed and the average trade price, including asset name and symbol.", "role": "user" }, { "content": "SELECT a.asset_id,\n a.name,\n a.symbol,\n COUNT(t.trade_id) AS trades_count,\n AVG(t.price...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp ) CREATE ...
[ { "content": "Find acquisition event pairs for each player where they acquired two distinct items. Show player_id, the first inventory_id as inv1, the second inventory_id as inv2, and their corresponding item_ids.", "role": "user" }, { "content": "SELECT p1.player_id,\n p1.inventory_id AS inv1...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, item_id uuid, quantity int, acquire...
[ { "content": "Find law firms where the managing partner is also listed as a lawyer within that firm. Show the firm name and the managing partner's first and last name.", "role": "user" }, { "content": "SELECT T1.firm_name, T2.first_name, T2.last_name FROM law_firms AS T1 JOIN lawyers AS T2 ON T1.fir...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text, bar_number text UNIQUE, firm_id t...
[ { "content": "For each Sui coin type with status 'exists' in both sui_coins and sui_coins_metadata, calculate the average balance per owner. Include coin_type, symbol, name, description, and avg_balance. Sort by avg_balance descending.", "role": "user" }, { "content": "SELECT\n sc.coin_type,\n met...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "content": "List tokens with trend rank 5 or better and a price below $1. Show symbol, price, and trend rank.", "role": "user" }, { "content": "SELECT token_symbol, price, trend_rank FROM token_dexpool_info WHERE trend_rank IS NOT NULL AND trend_rank <= 5 AND price < 1;", "role": "assistant" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
7