Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
282
8.08k
[ { "role": "user", "content": "Show each user's username and the total number of notifications they have received." }, { "role": "assistant", "content": "SELECT T1.username, count(T2.notification_id) FROM users AS T1 LEFT JOIN notifications AS T2 ON T1.user_id = T2.user_id GROUP BY T1.user_id, T1...
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...
[ { "role": "user", "content": "What is the schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not included in the platfo...
You are an 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...
[ { "role": "user", "content": "List all pairs of tokens (show token_id for both) that share the same contract address, excluding pairs where the token_id is the same." }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id1, t2.token_id AS token_id2, t1.contract_address FROM web3.to...
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.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha...
[ { "role": "user", "content": "For the 'DeFi' narrative, what is the average ROI and the total net inflow (usd_value where type=1) from smart money token inflow?" }, { "role": "assistant", "content": "SELECT AVG(sm.roi) AS avg_roi, SUM(smt.usd_value) AS total_net_inflow\nFROM smart_money_token_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 token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "Find the average time it takes for users to read notifications after they are sent." }, { "role": "assistant", "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;" ...
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_...
[ { "role": "user", "content": "List all inactive insurance products that were created more than 5 years ago." }, { "role": "assistant", "content": "SELECT * FROM insurance.insurance_products WHERE is_active = false AND created_at < CURRENT_DATE - INTERVAL '5 years';" }, { "role": "user", ...
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.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "How many insurance policies have 'Group' in their group_number?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.patient_insurance WHERE group_number ILIKE '%Group%';" } ]
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.patient_insurance ( patient_insurance_id text, patient_id text, plan_id text, policy_number text, group_numb...
[ { "role": "user", "content": "I need to get the most recent message each verified user has sent in any group chat, showing username, group_name, message_id, and sent_at." }, { "role": "assistant", "content": "WITH user_recent AS (\n SELECT m.sender_user_id, m.message_id, m.conversation_id, m.se...
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...
[ { "role": "user", "content": "Which wallets hold at least 100 units of any ERC1155 NFT, and what is the token ID and contract address of the NFT for each such holding?" }, { "role": "assistant", "content": "SELECT wallet_address, contract_address, token_id, amount\nFROM nft_holders\nWHERE contra...
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...
[ { "role": "user", "content": "Provide a list of all vehicles and the total quantity of fuel refueled for each vehicle." }, { "role": "assistant", "content": "SELECT T1.license_plate, sum(T2.quantity) FROM transportation.vehicles AS T1 JOIN transportation.fuel_logs AS T2 ON T1.vehicle_id = T2.veh...
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 PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount." }, { "role": "assistant", "content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas tm ON eb.contract_address = tm...
You are an 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_...
[ { "role": "user", "content": "List the username and email of users whose first wallet creation date is the same day as their user registration date." }, { "role": "assistant", "content": "SELECT u.username, u.email FROM web3.users u JOIN (SELECT user_id, MIN(created_at) as first_wallet_created_a...
You are an 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...
[ { "role": "user", "content": "Show me the top 5 buyers by total trade volume (quantity * price) in the last 30 days, along with their trade count." }, { "role": "assistant", "content": "SELECT buyer_id, COUNT(trade_id) AS trade_count, SUM(quantity * price) AS total_volume FROM trading_platform.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 trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "role": "user", "content": "Generate a report that lists each manager’s full name and the count of direct reports they have." }, { "role": "assistant", "content": "SELECT m.employee_id,\n m.first_name || ' ' || m.last_name AS manager_name,\n COUNT(e.employee_id) AS direct_repo...
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.transactions ( transaction_id character varying(64) NOT NULL, -- unique identifier for the trans...
[ { "role": "user", "content": "List all invoices that were paid within 7 days of their issue date. Show invoice number, issue date, payment date, and total amount." }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, payment_date, total_amount FROM legal_services.invoices WHE...
You are an 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, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "What is the current market cap and 7-day price change percentage for the top 3 narratives by trend rank?" }, { "role": "assistant", "content": "SELECT narrative, market_cap, price_change_percentage_7d FROM narrative_info ORDER BY trend_rank ASC LIMIT 3;" } ]
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...
[ { "role": "user", "content": "List the full name (first name and last name) of all citizens who have uploaded documents whose expiry date is in the past." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 INNER JOIN governme...
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 PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show me all reservations with their guest IDs and room IDs where the total amount is greater than $500 and the status is 'Confirmed', ordered by check-in date." }, { "role": "assistant", "content": "SELECT reservation_id, guest_id, room_id, check_in_date, total_amou...
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...
[ { "role": "user", "content": "For each city and state, show the number of service locations available along with their accessibility status." }, { "role": "assistant", "content": "SELECT city, state, is_accessible, COUNT(*) AS location_count FROM government_services.service_locations GROUP BY ci...
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, ...
[ { "role": "user", "content": "What is the total USD value of all token outflows (type = 2) across all chains?" }, { "role": "assistant", "content": "SELECT SUM(usd_value) AS total_outflow_usd FROM smart_money_token_inflow WHERE type = 2;" } ]
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 smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the token's address token_symbol character...
[ { "role": "user", "content": "What is the average, minimum, and maximum interest_rate for each loan_type among active loans?" }, { "role": "assistant", "content": "SELECT loan_type,\n AVG(interest_rate) AS avg_interest_rate,\n MIN(interest_rate) AS min_interest_rate,\n MAX(inte...
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.loans ( loan_id character varying(64) NOT NULL, -- unique identifier for the loan, could be same...
[ { "role": "user", "content": "Find services that have associated documents with a 'Pending' verification status. Show the service name and the document type name." }, { "role": "assistant", "content": "SELECT DISTINCT s.service_name, dt.document_type_name FROM government_services.services AS s J...
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 ...
[ { "role": "user", "content": "Show each policy number and the total amount paid for it across all premium payments received so far." }, { "role": "assistant", "content": "SELECT T1.policy_number, SUM(T2.amount_paid) FROM insurance.policies AS T1 JOIN insurance.premium_payments AS T2 ON T1.policy...
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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Show me the notification ID, recipient user ID, and notification type for notifications received by users that user 'user123' is following." }, { "role": "assistant", "content": "SELECT n.notification_id, n.recipient_user_id, n.notification_type FROM social_media.no...
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.text, post_id.text, user_id.text, parent_comment_id.text, content.text, created_at.t...
[ { "role": "user", "content": "List all agents who have a commission rate above 0.1, showing their full names and agency names." }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, agency_name, commission_rate FROM insurance.agents WHERE commission_rate > 0.1 AND status ...
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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "How many unique patient records are there for each gender?" }, { "role": "assistant", "content": "SELECT gender, COUNT(DISTINCT patient_id) AS patient_count FROM healthcare.patients GROUP BY gender;" } ]
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, ...
[ { "role": "user", "content": "What is the fuel efficiency of the train car with car_id 'TC456'?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the fuel efficiency of specific train cars. The data available in the train_cars table only includes deta...
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...
[ { "role": "user", "content": "Provide a count of how many peers were last seen on each distinct day recorded in the system." }, { "role": "assistant", "content": "SELECT DATE(last_seen), COUNT(*) FROM trading_platform.peers GROUP BY DATE(last_seen) ORDER BY DATE(last_seen);" } ]
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...
[ { "role": "user", "content": "What is the total investment_value per fundraising round for the year 2023? Order by total investment descending." }, { "role": "assistant", "content": "SELECT\n substr(investment_date,1,7) AS month,\n rounds_name,\n SUM(investment_value) AS total_investment\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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "What are the environmental impact assessments for the production of the Airbus A350 model?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to data regarding the environmental impact assessments for the production of specific aircraft models...
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...
[ { "role": "user", "content": "For each player, count the total number of achievements they've unlocked." }, { "role": "assistant", "content": "SELECT player_id,\n COUNT(*) AS total_achievements\nFROM gaming_technology.player_achievements\nGROUP BY player_id;" }, { "role": "user", ...
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_achievements ( player_achievement_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique id...
[ { "role": "user", "content": "Count the total number of premium payments made in the year 2024." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM premium_payments WHERE EXTRACT(YEAR FROM payment_date) = 2024" } ]
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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "List all the appointments that overlap in time for the same location, showing both appointment IDs, their start and end times, and the location." }, { "role": "assistant", "content": "SELECT a1.appointment_id AS appointment_id_1, a2.appointment_id AS appointment_id_...
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.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "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": "assistant", "content": "SELECT\n d1.driver_id AS driver_id,\n d1.first_name || ' ' || d1.last_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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "How many unique IP addresses are there in the nodes table?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT ip_address) FROM blockchain.nodes;" }, { "role": "user", "content": "Can you break this down by port numbers, showing the count of nod...
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.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
[ { "role": "user", "content": "Count the total number of chronic diagnoses for each code_type." }, { "role": "assistant", "content": "SELECT\n code_type,\n COUNT(*) AS chronic_diagnosis_count\nFROM healthcare.diagnoses\nWHERE is_chronic = TRUE\nGROUP BY code_type;" } ]
You are an 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.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty...
[ { "role": "user", "content": "Show me the count of available rooms for each property." }, { "role": "assistant", "content": "SELECT T1.property_name, count(T2.room_id) FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.rooms AS T2 ON T1.property_id = T2.property_id WHERE T2...
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 text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Which citizens have received notifications for applications processed by employees from the 'Legal' department? List the citizen ID, full name, and notification ID." }, { "role": "assistant", "content": "SELECT n.citizen_id, CONCAT(e.first_name, ' ', e.last_name) AS...
You are an 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.agencies ( agency_id text, agency_name text, jurisdiction_level text, primary_contact_email text, m...
[ { "role": "user", "content": "Can you help me find all bookings made by passengers from a specific city, say 'Boston', including the passenger details and the scheduled trip information?" }, { "role": "assistant", "content": "MATCH (p:Passenger)-[:MADE_BOOKING]->(b:Booking)-[:FOR_TRIP]->(st:Sche...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_...
[ { "role": "user", "content": "How many events were emitted on each date? List the date and the count of events." }, { "role": "assistant", "content": "SELECT DATE(emitted_at) AS emit_date,\n COUNT(*) AS event_count\nFROM web3.events\nGROUP BY DATE(emitted_at);" }, { "role": "user",...
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, contract_id character varying(64) NOT NULL, event_name character...
[ { "role": "user", "content": "Show me each service order along with the next order placed by the same guest, including both order IDs and the time difference in minutes between the two orders." }, { "role": "assistant", "content": "SELECT a.order_id,\n b.order_id AS next_order_id,\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 hospitality_technology.service_orders ( order_id.text, reservation_id.text, guest_id.text, service_id.text, staff_id_or...
[ { "role": "user", "content": "Show the IDs and registration dates of all verified citizens who could be eligible for at least one active service. Display the citizen ID and registration date." }, { "role": "assistant", "content": "SELECT DISTINCT c.citizen_id, c.registration_date\nFROM governmen...
You are an 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, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens where the price is greater than $0.10." }, { "role": "assistant", "content": "SELECT tm.name, tm.contract_address, tm.total_supply FR...
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, -- Timestamp of the block when token metadata was recorded ...
[ { "role": "user", "content": "How many unique customers are there in the system?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT customer_id) AS unique_customer_count\nFROM insurance.customers;" } ]
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...
[ { "role": "user", "content": "I need to find all components associated with a specific supplier. Can you help with that?" }, { "role": "assistant", "content": "HGETALL component:<component_id>\nIF HGET component:<component_id> supplier_id = 'sup:ACME_AERO' THEN INCLUDE" }, { "role": "use...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Use Hashes. Key pattern: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_numbe...
[ { "role": "user", "content": "List all tokens together with the deployment status of the contract that created them, showing token_id, token_symbol, and contract status." }, { "role": "assistant", "content": "SELECT t.token_id, t.token_symbol, c.status AS contract_status\nFROM web3.tokens t\nJOI...
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.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount, sorted by amount in descending order." }, { "role": "assistant", "content": "SELECT b.wallet_address, t.symbol, b.amount FROM erc20_balances b JOIN sui_coin...
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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "Can you show, for each employee, the full name and job title of their direct manager, as well as the employee's department and branch_id?" }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name AS employee_first_name, e.last_name AS employee_last_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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "How many policies were canceled in the previous month, grouped by cancellation reason?" }, { "role": "assistant", "content": "SELECT cancellation_reason,\n COUNT(*) AS canceled_count\nFROM insurance.policies\nWHERE cancellation_date BETWEEN date_trunc('month',...
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.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "Count the number of logs for each action type." }, { "role": "assistant", "content": "SELECT action,\n COUNT(*) AS count\nFROM trading_platform.logs\nGROUP BY action;" } ]
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.logs ( log_id text PRIMARY KEY, user_id text, action text, details text, logged_at timestamp )
[ { "role": "user", "content": "Get the number of agents grouped by status. Return status and agent_count." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS agent_count\n FROM insurance.agents\n GROUP BY status;" } ]
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 PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "Get all non-smoking rooms with status 'Available'." }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number, floor\nFROM hospitality_technology.rooms\nWHERE is_smoking = FALSE\n AND status = 'Available';" }, { "role": "user", "con...
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 text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Find all users who registered with a Yahoo email address, along with their registration dates." }, { "role": "assistant", "content": "SELECT user_id, username, email, password_hash FROM blockchain.users WHERE email LIKE '%@yahoo.com';" }, { "role": "user", ...
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...
[ { "role": "user", "content": "For each address, show the total amount contained in UTXOs that have been spent." }, { "role": "assistant", "content": "SELECT address, SUM(amount) FROM utxos WHERE spent = TRUE GROUP BY address;" }, { "role": "user", "content": "Only include addresses w...
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.utxos ( utxo_id character varying(64) NOT NULL, -- unique identifier for the UTXO transaction...
[ { "role": "user", "content": "List each wallet that has received tokens of more than one distinct token type. Show wallet_id, address, the number of distinct tokens received as distinct_token_count, and the total received value, ordered by total_received_value descending." }, { "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 web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "What is the reason behind the cost variation for maintenance of asset_id 'ASSET456' over the past year?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the reasons behind cost variations for maintenance. The data in the maintenan...
You are an 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...
[ { "role": "user", "content": "Find the contract address and name for all NFT collections listed on the 'Ethereum' blockchain." }, { "role": "assistant", "content": "SELECT contract_address, name FROM nft_collections WHERE blockchain = 'Ethereum'" }, { "role": "user", "content": "For ...
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...
[ { "role": "user", "content": "Find all wallets created by users in the last 7 days along with any tokens that have a total supply greater than 10 million, showing the wallet address and token details." }, { "role": "assistant", "content": "SELECT w.address AS wallet_address, t.token_name, t.toke...
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.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha...
[ { "role": "user", "content": "Find any two claims made by the same customer on the same day. Return customer_id, the two claim IDs, and the incident date." }, { "role": "assistant", "content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_id,\n c2.claim_id AS claim2_id,\n DAT...
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...
[ { "role": "user", "content": "Show me assets along with their associated 'symbol' metadata value. Assume an assets table with asset_id exists." }, { "role": "assistant", "content": "SELECT a.asset_id, m.value FROM assets a JOIN metadata m ON a.asset_id = m.asset_id WHERE m.key = 'symbol'" }, ...
You are an expert in writing database language. You can write a corresponding 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.utxos ( utxo_id text PRIMARY KEY, transaction_id text, output_index...
[ { "role": "user", "content": "List the first and last names of employees and the number of services offered by their agency." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS service_count\nFROM government_services.employees e\nLEFT JOIN government_s...
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.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "For each patient, show the total number of diagnoses they have received, along with their patient ID and the ID of their latest diagnosis. Join with the diagnoses table." }, { "role": "assistant", "content": "SELECT patient_id, COUNT(diagnosis_id) AS diagnosis_count...
You are an 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.appointments ( appointment_id text, patient_id text, doctor_id text, appointment_time timestamp, duration_mi...
[ { "role": "user", "content": "Show me the average, maximum, and minimum points for all achievements." }, { "role": "assistant", "content": "SELECT AVG(points) AS average_points, MAX(points) AS maximum_points, MIN(points) AS minimum_points FROM gaming_technology.achievements;" }, { "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 gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table." }, { "role": "assistant", "content": "SELECT pfr.project_name, pfr.valuation, tbi.token_symbol,...
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 project_fundraising_record (", "id character varying(32) NOT NULL, -- fundraising record id", "project_id ch...
[ { "role": "user", "content": "What is the average investment_value and total number of projects for each rounds_name in project_fundraising_record?" }, { "role": "assistant", "content": "SELECT rounds_name,\n AVG(investment_value) AS avg_investment,\n COUNT(DISTINCT project_id) AS pr...
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 project_fundraising_record ( id text, project_id text, project_name text, rounds_name text, investment_value numeric, i...
[ { "role": "user", "content": "List game titles released on the 'PC' platform along with the count of servers currently hosting each game." }, { "role": "assistant", "content": "SELECT T1.title, count(T2.server_id) FROM games AS T1 JOIN servers AS T2 ON T1.game_id = T2.game_id WHERE T1.platform =...
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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player ...
[ { "role": "user", "content": "Show me all rooms along with their current overall review rating for each room, including the room number and property id." }, { "role": "assistant", "content": "SELECT r.room_number, r.property_id, AVG(rv.rating_overall) AS average_overall_rating\nFROM hospitality_...
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.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat...
[ { "role": "user", "content": "Show me all wallet addresses and their private keys for users who have more than 3 wallets." }, { "role": "assistant", "content": "SELECT w.address_id, w.private_key FROM blockchain.wallets w WHERE w.user_id IN (SELECT user_id FROM blockchain.wallets GROUP BY user_i...
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 character varying(64) NOT NULL, -- unique identifier for the wallet user_id cha...
[ { "role": "user", "content": "Show me the average star rating for each property type in the USA." }, { "role": "assistant", "content": "SELECT property_type, AVG(star_rating) as avg_rating FROM hospitality_technology.properties WHERE country_code = 'US' GROUP BY property_type;" }, { "rol...
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 text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Show me the top 3 smart money addresses by profit across all chains, along with their most profitable token and chain information." }, { "role": "assistant", "content": "SELECT address, profit, most_profit_token, chain\nFROM smart_money_profit\nORDER BY profit 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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
4