conversations
listlengths
2
8
system
stringlengths
288
8.03k
[ { "role": "user", "content": "Count the number of registered citizens by gender." }, { "role": "assistant", "content": "SELECT\n gender,\n COUNT(*) AS citizen_count\nFROM government_services.citizens\nGROUP BY gender;" } ]
You are an 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": "How many likes were given to comments in June 2024?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS comment_likes_count\nFROM social_media.likes\nWHERE comment_id IS NOT NULL \n AND DATE_TRUNC('month', created_at) = '2024-06-01';" } ]
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, post_id character varying(64) NOT NULL, user_id char...
[ { "role": "user", "content": "Which route numbers connect locations with a distance less than 80 km and more than 5 words in their description? Include the route type in the results." }, { "role": "assistant", "content": "SELECT route_number, type FROM transportation.routes WHERE distance_km < 8...
You are an 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.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "Which users have commented on posts that include hashtags? Show their user IDs and the hashtag IDs." }, { "role": "assistant", "content": "SELECT DISTINCT c.user_id, ph.hashtag_id\nFROM social_media.comments c\nJOIN social_media.post_hashtags ph ON c.post_id = ph.po...
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 clients along with their case_number and case_type for cases that are currently 'Open'." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, c.email, cs.case_number, cs.case_type\nFROM legal_services.clients AS c\nJOIN legal_services.cas...
You are an 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, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "Find all nodes that were last seen in the last 30 days and have port numbers between 8000 and 9000." }, { "role": "assistant", "content": "SELECT node_id, ip_address, port FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '30 days' AND port BETWEEN 8000 AND ...
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.transactions ( transaction_id text, block_id text, sender_address text, receiver_address text, amount numeri...
[ { "role": "user", "content": "For each player, show the timestamp of their first achievement unlock. Include player_id and the timestamp." }, { "role": "assistant", "content": "SELECT player_id, MIN(unlocked_at) as first_unlock_at FROM gaming_technology.player_achievements GROUP BY player_id ORD...
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(), player_id uuid N...
[ { "role": "user", "content": "Show all SUI coins with 'exists' status and more than 8 decimal places. Display coin_type, symbol, name, and decimals." }, { "role": "assistant", "content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nWHERE status = 'exists' AND decimals > 8;...
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 nft_holders ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wallet_address varchar NOT NULL, token_i...
[ { "role": "user", "content": "Show all appointments with subject containing 'Review' and their corresponding case_id." }, { "role": "assistant", "content": "SELECT appointment_id, subject, case_id\nFROM legal_services.appointments\nWHERE subject ILIKE '%Review%';" } ]
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...
[ { "role": "user", "content": "Count the number of policies issued in each calendar year, and show the year and the count." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM issued_at), COUNT(*) FROM insurance.policies WHERE issued_at IS NOT NULL GROUP BY 1 ORDER BY 1;" } ]
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": "List all medical record entries where the treatment_plan mentions a medication name. Return patient_id, record_id, and the matching medication_name." }, { "role": "assistant", "content": "SELECT mr.patient_id,\n mr.record_id,\n m.medication_name\nFROM he...
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, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "For each achievement, show its name, the game_id it belongs to, and the number of distinct players who have played a session for that game." }, { "role": "assistant", "content": "SELECT a.name, a.game_id, COUNT(DISTINCT gs.player_id) AS players_with_sessions\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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt...
[ { "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": "How many policies are there for each status, and what is the average premium amount for policies in each status?" }, { "role": "assistant", "content": "SELECT status, COUNT(policy_id), AVG(premium_amount) FROM insurance.policies GROUP BY status ORDER BY COUNT(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.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "Find all pairs of overlapping payment periods for the same customer. Return customer_id, first payment_id as payment1_id, second payment_id as payment2_id, and both periods' start and end dates." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p...
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.premium_payments ( payment_id character varying(64) NOT NULL, -- unique identifier for the payment po...
[ { "role": "user", "content": "Can you show me how many distinct players played on each server and the average session score for those players?" }, { "role": "assistant", "content": "SELECT server_id, COUNT(DISTINCT player_id) AS num_players, AVG(score) AS average_score\nFROM gaming_technology.ga...
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.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time...
[ { "role": "user", "content": "How many hashtags have been created in March 2024?" }, { "role": "assistant", "content": "```sql\nSELECT COUNT(*) AS march_2024_hashtag_count\nFROM social_media.hashtags\nWHERE created_at >= '2024-03-01'\n AND created_at < '2024-04-01';\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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "For each trip, show the trip_id, vehicle's license plate, total fuel quantity, and number of fueling events." }, { "role": "assistant", "content": "SELECT t.trip_id, v.license_plate, SUM(f.quantity) AS total_fuel, COUNT(f.fuel_log_id) AS fueling_events FROM transpor...
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 character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "What is the history of incidents or accidents that occurred on platform 5 at station GHI?" }, { "role": "assistant", "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 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 train_station_management.p...
[ { "role": "user", "content": "Show me all vehicles that are currently out of service (status = 'out_of_service'), including their make, model, and the reason (type field)." }, { "role": "assistant", "content": "SELECT vehicle_id, make, model, type FROM transportation.vehicles WHERE status = 'out...
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 character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "Show me all wallet addresses that belong to user_id 'U1001', along with their private keys." }, { "role": "assistant", "content": "SELECT address_id, private_key FROM blockchain.wallets WHERE user_id = 'U1001';" }, { "role": "user", "content": "Now join ...
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 )
[ { "role": "user", "content": "Find the average percentage share among all beneficiaries for each distinct relationship type." }, { "role": "assistant", "content": "SELECT relationship, AVG(percentage_share) FROM insurance.policy_beneficiaries GROUP BY relationship ORDER BY relationship;" } ]
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": "List all pairs of token transfers where the sender is the same but the recipients differ. Show both transfer IDs and the common sender address." }, { "role": "assistant", "content": "SELECT t1.transfer_id AS transfer_id_1, t2.transfer_id AS transfer_id_2, t1.from_ad...
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.token_transfers ( transfer_id character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "How many appointments are scheduled to start tomorrow?" }, { "role": "assistant", "content": "SELECT count(*) FROM government_services.appointments WHERE DATE(scheduled_start_time) = CURRENT_DATE + INTERVAL '1 day'" } ]
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.appointments ( appointment_id text PRIMARY KEY, citizen_id text, employee_id text, location_id text...
[ { "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": "How many messages in total have been sent that do not contain any media attachment?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS non_media_message_count\nFROM social_media.messages\nWHERE media_url IS NULL OR media_url = '';" } ]
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.messages ( message_id text PRIMARY KEY, conversation_id text, sender_user_id text, content text, media_url...
[ { "role": "user", "content": "Show me the appointment_id alongside plan_id and plan_name for all appointments exceeding 30 minutes with plan_type 'PPO'." }, { "role": "assistant", "content": "SELECT a.appointment_id, p.plan_id, p.plan_name FROM healthcare.appointments a CROSS JOIN healthcare.ins...
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 PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,...
[ { "role": "user", "content": "What is the detailed repair history for train number T5678?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the detailed repair history for train number T5678 as this information is not available in the current database table. The table only in...
You are an 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": "What are the personal contact details of the staff member associated with staff_id 'STAFF789' who worked on a specific maintenance record?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide personal contact details of staff members as this informa...
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": "List the name and symbol for all assets that do not have a corresponding entry with the key 'website' in the metadata table." }, { "role": "assistant", "content": "SELECT T1.name , T1.symbol FROM trading_platform.assets AS T1 LEFT JOIN trading_platform.metadata AS T...
You are an 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 character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 6 months, along with their narrative information if available." }, { "role": "assistant", "content": "SELECT pfr.project_name, pfr.rounds_name, pfr.valuation, pfr.investment_date, ...
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(...
[ { "role": "user", "content": "How many claims were reported in the last 90 days?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM claims WHERE reported_date >= CURRENT_DATE - INTERVAL '90 days'" } ]
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 character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "Show the full name of each manager and the average commission rate of the agents who report directly to them. Only include managers who have at least one reporting agent." }, { "role": "assistant", "content": "SELECT T2.first_name AS manager_first_name, T2.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 insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state...
[ { "role": "user", "content": "Find all wallets that were created on the same day and list their wallet IDs, addresses, and the creation date." }, { "role": "assistant", "content": "SELECT w1.wallet_id, w1.address, w1.created_at::date AS creation_date FROM web3.wallets w1 JOIN (SELECT created_at:...
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.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_id character...
[ { "role": "user", "content": "For each ERC20 token, how many unique wallets currently hold them? Show the contract address and unique wallet count." }, { "role": "assistant", "content": "SELECT contract_address, COUNT(DISTINCT wallet_address) AS unique_wallet_count FROM erc20_balances GROUP BY 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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "List all guests from California who are loyalty members and have provided their email addresses, ordered by last name." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, loyalty_member_id FROM hospitality_technology.guests WHERE state_provin...
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": "List employees whose transaction effective_date matches their hire_date anniversary. Show full name and count of such transactions." }, { "role": "assistant", "content": "SELECT e.employee_id,\n e.first_name || ' ' || e.last_name AS employee_name,\n COUN...
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": "Find all peers that haven't been active for more than 30 days, along with their IP addresses." }, { "role": "assistant", "content": "SELECT peer_id, ip_address FROM trading_platform.peers WHERE last_seen < NOW() - INTERVAL '30 days'" }, { "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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "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": "List the usernames and user IDs of all users whose bio contains the word 'developer'." }, { "role": "assistant", "content": "SELECT user_id, username\nFROM social_media.users\nWHERE bio ILIKE '%developer%';" } ]
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": "What is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the detailed repair history of equipment used by staff memb...
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": "List tokens with trend rank 5 or better and a price below $1. Show symbol, price, and trend rank." }, { "role": "assistant", "content": "SELECT token_symbol, price, trend_rank FROM token_dexpool_info WHERE trend_rank IS NOT NULL AND trend_rank <= 5 AND price < 1;" ...
You are an 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...
[ { "role": "user", "content": "Count the number of law firms founded in each decade. Show the decade (e.g., 1990s, 2000s) and the count." }, { "role": "assistant", "content": "SELECT CONCAT(FLOOR(EXTRACT(YEAR FROM founded_date) / 10) * 10, 's') AS decade, COUNT(*) AS firm_count FROM law_firms 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.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "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": "assistant", "content": "SELECT DISTINCT c.user_id, c.post_id\nFROM social_media.comments c\nJOIN so...
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...
[ { "role": "user", "content": "For each ERC20 token contract, show the contract address and the total number of approval events recorded." }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS approval_count\nFROM erc20_approval\nGROUP BY contract_address;" }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "What is the total revenue generated by ticket sales at the station with ID 'ST101' for the past month?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the revenue generated by ticket sales as this data is not available in the cur...
You are an 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.s...
[ { "role": "user", "content": "Show a list of all game developers with their name and founded year." }, { "role": "assistant", "content": "SELECT\n name,\n founded_year\nFROM gaming_technology.developers;" }, { "role": "user", "content": "Please filter the list to only include devel...
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": "List all active staff members who are managers, along with their hire dates and email addresses." }, { "role": "assistant", "content": "SELECT staff_id, first_name, last_name, position, work_email, hire_date FROM hospitality_technology.staff WHERE is_active = true 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "List all premium payments along with the full name of the agent who sold each policy and the name of the related insurance product." }, { "role": "assistant", "content": "SELECT pp.payment_id, pp.amount_paid, pp.payment_date, a.first_name AS agent_first_name, a.last...
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": "For each reservation in the last three months, show the reservation ID, check-in date, number of adults, and the corresponding room type name." }, { "role": "assistant", "content": "SELECT r.reservation_id, r.check_in_date, r.num_adults, rt.type_name\nFROM hospitali...
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 5 games by number of online servers in European regions. I want the game title and the server count." }, { "role": "assistant", "content": "SELECT g.title, COUNT(s.server_id) AS server_count\nFROM gaming_technology.games g\nJOIN gaming_technology.ser...
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 PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "Show me the total fuel quantity and cost for each route, grouped by route number, only for trips that have associated fuel logs." }, { "role": "assistant", "content": "SELECT r.route_number, SUM(f.quantity) AS total_quantity, SUM(f.total_cost) AS total_cost\nFROM tr...
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.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "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": "For each user, list their user_id along with their first and last notification messages and the sent_at timestamps." }, { "role": "assistant", "content": "WITH firsts AS (\n SELECT user_id, notification_id AS first_id, message AS first_message, sent_at AS first_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 trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, message text, sent_at timestamp, read_...
[ { "role": "user", "content": "How many pairs of distinct locations are there that share the same state or province but are in different cities?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM transportation.locations AS l1 JOIN transportation.locations AS l2 ON l1.state_province = l2...
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.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ...
[ { "role": "user", "content": "List all SUI coins, showing object ID, owner address, and balance." }, { "role": "assistant", "content": "SELECT object_id, owner, balance FROM sui_coins;" }, { "role": "user", "content": "Include the coin symbol and name by joining with the metadata tab...
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": "List all service orders for spa services with their guest names and total prices, ordered by total price in descending order." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, so.order_id, so.total_price FROM hospitality_technology.service_ord...
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 ...
[ { "role": "user", "content": "Show me the total amount held and number of unique wallets for each ERC20 token with a symbol ending in 'X'." }, { "role": "assistant", "content": "SELECT tm.symbol, SUM(CAST(ebh.amount AS DECIMAL)) AS total_amount, COUNT(DISTINCT ebh.wallet_address) AS unique_walle...
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": "List the user ID, KYC status, and the number of UTXOs they have, including spent and unspent." }, { "role": "assistant", "content": "SELECT T1.user_id, T1.status, COUNT(T2.utxo_id) FROM trading_platform.kyc_audit AS T1 JOIN trading_platform.utxos AS T2 ON T1.user_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 trading_platform.utxos ( utxo_id text, transaction_id text, output_index integer, address text, amount numeric, spent b...
[ { "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": "How many lawyers who are partners were hired in each year? Show the hire year and the count." }, { "role": "assistant", "content": "SELECT strftime('%Y', hire_date) AS hire_year , count(lawyer_id) FROM legal_services.lawyers WHERE is_partner = true GROUP BY hire_...
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 character varying(64) NOT NULL, -- unique identifier for the lawyer first_n...
[ { "role": "user", "content": "Show me all beneficiaries who have a percentage share greater than 30%, along with their policy details and customer information." }, { "role": "assistant", "content": "SELECT b.*, p.policy_id, p.customer_id FROM insurance.policy_beneficiaries b JOIN insurance.polic...
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.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text...
[ { "role": "user", "content": "What proportion of posts have received at least one like? Return the ratio as a decimal between 0 and 1." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT CASE WHEN l.post_id IS NOT NULL THEN p.post_id END)::float / COUNT(DISTINCT p.post_id) AS like_ratio...
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, user_id character varying(64) NOT NULL, content text, medi...
[ { "role": "user", "content": "List the service names, agency names, and standard fees for all services that are active and have a standard fee between 50 and 100 inclusive." }, { "role": "assistant", "content": "SELECT s.service_name, ag.agency_name, s.standard_fee\nFROM government_services.serv...
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...
[ { "role": "user", "content": "Which cities have more than 10 active customers in the state of Texas? Provide the city name and the customer count." }, { "role": "assistant", "content": "SELECT city, COUNT(*) AS customer_count\nFROM insurance.customers\nWHERE state = 'TX' AND status = 'Active'\nG...
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": "For each chain, which token had the highest number of smart money addresses buying it this week? Show the token symbol and narrative too." }, { "role": "assistant", "content": "SELECT chain, token_symbol, narrative, MAX(address_amount) AS max_buyers FROM smart_money...
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": "List each guest’s full name and the total number of service orders they have placed, ordered by order count descending." }, { "role": "assistant", "content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n COUNT(so.order_id) AS o...
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.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te...
[ { "role": "user", "content": "Show the total payment amount per currency for payments that are either 'Pending' or 'Failed', grouped by currency_code." }, { "role": "assistant", "content": "SELECT currency_code, SUM(amount) AS total_payment_amount\nFROM hospitality_technology.payments\nWHERE sta...
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.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r...
[ { "role": "user", "content": "What is the maintenance schedule for platform 3 at station DEF for the next month?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the maintenance schedule for platforms. The data I have only includes static information about platform de...
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 users whose email contains the word 'block', along with their username and registration timestamp." }, { "role": "assistant", "content": "SELECT user_id, username, email, created_at\nFROM web3.users\nWHERE email ILIKE '%block%';" }, { "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.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
[ { "role": "user", "content": "For wallet address '0xWalletA', list the ERC20 tokens held, showing contract address and amount." }, { "role": "assistant", "content": "SELECT contract_address, amount FROM erc20_balances WHERE wallet_address = '0xWalletA';" }, { "role": "user", "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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ...
[ { "role": "user", "content": "Retrieve the vehicle_id, make, model, and the next_service_due_date for each vehicle based on the most recent maintenance log." }, { "role": "assistant", "content": "SELECT DISTINCT ON (ml.vehicle_id) v.vehicle_id, v.make, v.model, ml.next_service_due_date FROM tran...
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": "List all unspent UTXOs with an amount greater than 10." }, { "role": "assistant", "content": "SELECT utxo_id, transaction_id, address, amount FROM utxos WHERE spent = FALSE AND amount > 10;" } ]
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 ...
[ { "role": "user", "content": "For each event recorded, list its ID, name, and the status and value of the transaction in which it occurred." }, { "role": "assistant", "content": "SELECT E.event_id, E.event_name, E.transaction_id, T.status, T.value FROM web3.events AS E JOIN web3.transactions 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 web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "List each payment method, the total amount paid, and the number of payments for each method for services in the 'Education' category." }, { "role": "assistant", "content": "SELECT p.payment_method, SUM(p.amount) AS total_amount, COUNT(p.payment_id) AS payment_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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.text, primary_contact_email.text, m...
[ { "role": "user", "content": "What is the average speed of train number T9876 during its last journey?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the average speed of train number T9876 during its last journey. The data in the trains table does not inclu...
You are an 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": "Identify all instances where a vehicle's odometer_reading increased by more than 500 miles between two consecutive fuel log entries." }, { "role": "assistant", "content": "SELECT a.vehicle_id,\n a.fuel_log_id AS previous_log_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 transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_timestamp.timestamp, fuel_type.text, qu...
[ { "role": "user", "content": "Show me the object ID, coin type, and balance for all SUI coins where the status is 'active'." }, { "role": "assistant", "content": "SELECT object_id, coin_type, balance FROM sui_coins WHERE status = 'active'" }, { "role": "user", "content": "Also, inclu...
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": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan." }, { "role": "assistant", "content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) AS enrolled_patie...
You are an 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": "Provide the total number of reservations made for each property, including the property name and reservation count." }, { "role": "assistant", "content": "SELECT p.property_name, COUNT(r.reservation_id) AS reservation_count\nFROM hospitality_technology.properties p\...
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": "Which citizens have made successful payments and also have had at least one appointment scheduled? I want to see their first name, last name, total payment amount, and number of appointments." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, 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.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Find pairs of customers who share the same last name and live in the same city. List the two customer IDs as customer1_id, customer2_id, their first names as first_name1, first_name2, and city." }, { "role": "assistant", "content": "SELECT c1.customer_id AS customer...
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": "Find all medical records where the vitals field indicates a heart rate over 100 bpm, along with the associated appointment details and diagnosis description if available." }, { "role": "assistant", "content": "SELECT mr.record_id, mr.patient_id, a.appointment_time, ...
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 top 5 NFT collections with the highest floor price on Ethereum, along with their names and contract addresses." }, { "role": "assistant", "content": "SELECT name, contract_address, floor_price FROM nft_collections WHERE blockchain = 'ethereum' ORDER BY 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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "Find all medical records where the vitals JSON field contains a blood pressure reading with systolic higher than 140, and show the patient_id, record_date, and vitals." }, { "role": "assistant", "content": "SELECT patient_id, record_date, vitals FROM healthcare.medi...
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.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "role": "user", "content": "Which Avalanche token has the largest total supply currently held by wallets, and who is its creator?" }, { "role": "assistant", "content": "SELECT tb.tick, SUM(tb.amount) AS total_amount, ti.creator\nFROM token_balances_avalanche tb\nJOIN token_info_avalanche ti 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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Provide a summary that shows, for each property, the total number of distinct amenities listed across all its room types." }, { "role": "assistant", "content": "SELECT property_id, COUNT(DISTINCT TRIM(UNNEST(string_to_array(amenities, ',')))) AS total_amenities FROM...
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 text PRIMARY KEY, property_id text, type_name text, description text, ...
[ { "role": "user", "content": "I want to see, for each guest, the total number of payments they have made and the timestamp of their latest payment." }, { "role": "assistant", "content": "SELECT p.guest_id,\n COUNT(p.payment_id) AS payment_count,\n t.last_ts\nFROM hospitality_technolo...
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.payments ( payment_id character varying(64) NOT NULL, reservation_id character varying(64), gues...
[ { "role": "user", "content": "List all tokens with a positive 1-hour price change percentage in the 'DeFi' narrative." }, { "role": "assistant", "content": "SELECT token_symbol FROM smart_money_token_inflow WHERE narrative = 'DeFi' AND type = 1 AND token_amount > 0;" } ]
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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative top_3_coins text, -- the top 3 token...
[ { "role": "user", "content": "For each group chat, list its ID, name, creation time, and the creation time of the next group chat created after it, ordered by creation time." }, { "role": "assistant", "content": "SELECT conversation_id, group_name, created_at, LEAD(created_at) OVER (ORDER BY cre...
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.conversations ( conversation_id character varying(64) NOT NULL, created_at timestamp NOT NULL DEFAULT CURR...
[ { "role": "user", "content": "Show me all patients who have scheduled appointments with doctors specializing in Pediatrics, along with their appointment times and the doctors' full names." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, a.appointment_time, d.first_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 healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "For each vehicle, list its vehicle_id, license_plate, and any older vehicle of the same type (showing older_vehicle_id and older year)." }, { "role": "assistant", "content": "SELECT cur.vehicle_id,\n cur.license_plate,\n old.vehicle_id AS older_vehicle_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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "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": "assistant", "content": "SELEC...
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": "Show me all insurance plans that have more than 5 patients enrolled, along with the provider name and count of patients, sorted by patient count in descending order." }, { "role": "assistant", "content": "SELECT i.plan_name, i.insurance_provider, COUNT(p.patient_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me the number of game servers in each region and the average maximum number of players they can accommodate. Exclude any servers that are currently offline." }, { "role": "assistant", "content": "SELECT region, COUNT(server_id) AS server_count, AVG(max_players)...
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": "List each group conversation with its group name and the number of verified users who have posted in it." }, { "role": "assistant", "content": "SELECT c.conversation_id, c.group_name, COUNT(DISTINCT u.user_id) AS verified_posters\nFROM social_media.conversations c\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 social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Provide a count of notifications, separated by whether they have been read or not." }, { "role": "assistant", "content": "SELECT CASE WHEN T1.read_at IS NULL THEN 'Unread' ELSE 'Read' END, count(T1.notification_id) FROM trading_platform.notifications AS T1 GROUP BY ...
You are an 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, user_id.text, message.text, sent_at.timestamp, read_at.timestamp...
[ { "role": "user", "content": "Show the total number of policies in each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.policies 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.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "What are the specific tools or equipment used during the maintenance with record_id 'REC456'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about the specific tools or equipment used during a maintenance record. The data in the ma...
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": "For block '0xbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeef', what is its timestamp and difficulty, and what is the timestamp and difficulty of its previous block?" }, { "role": "assistant", "content": "SELECT t1.timestamp AS current_block_timestam...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonc...