conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "For each ERC20 token, find the count of distinct historical holders and the sum of balances using erc20_balances_historical." }, { "role": "assistant", "content": "SELECT contract_address,\n COUNT(DISTINCT wallet_address) AS holder_count,\n SUM(CAST(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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "List all active employees with their employee_id, full name, and their manager's first and last name." }, { "role": "assistant", "content": "SELECT e.employee_id,\n CONCAT(e.first_name, ' ', e.last_name) AS employee_name,\n CONCAT(m.first_name, ' ', m.la...
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.securities ( security_id text PRIMARY KEY, ticker_symbol text, isin_code text, cusip_code text, secu...
[ { "role": "user", "content": "Retrieve each gender and the count of verified citizens born before 1990." }, { "role": "assistant", "content": "SELECT gender,\n COUNT(*) AS citizen_count\nFROM government_services.citizens\nWHERE is_verified = TRUE\n AND date_of_birth < '1990-01-01'\nGROUP ...
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": "I want to see a list of followers and the usernames of the users they are following, along with when they followed." }, { "role": "assistant", "content": "SELECT u_f.username AS follower_username,\n u_t.username AS following_username,\n f.created_at\nFRO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "List each driver along with the driver_id of the driver who was hired immediately after them." }, { "role": "assistant", "content": "SELECT d1.driver_id AS current_driver_id, d2.driver_id AS next_driver_id FROM transportation.drivers d1 LEFT JOIN transportation.driv...
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": "Show me all claims handled by agents who were hired in the last 3 years, along with the agent's full name and agency." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, c.incident_date, c.status, CONCAT(a.first_name, ' ', a.last_name) AS agent_na...
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 PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "Find all addresses with a balance greater than 1000, ordered by balance in descending order." }, { "role": "assistant", "content": "SELECT address_id, public_key, balance FROM blockchain.addresses WHERE balance > 1000 ORDER BY balance DESC;" }, { "role": "us...
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.addresses ( address_id text PRIMARY KEY, public_key text, balance numeric )
[ { "role": "user", "content": "Show me the total value of assets purchased by each user (sum of quantity * price for trades where they were the buyer). Include user ID and username." }, { "role": "assistant", "content": "SELECT T1.user_id , T1.username , sum(T2.quantity * T2.price) FROM trading_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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "Provide the contract ID, creator address, and timestamp for all smart contracts created between January 1st, 2022, and December 31st, 2024." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE ti...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, time...
[ { "role": "user", "content": "What is the total number of unique manufacturers listed in the medications table?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT manufacturer) FROM healthcare.medications;" }, { "role": "user", "content": "Could you also show the count of m...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, generic_name text, manufacturer text, nd...
[ { "role": "user", "content": "List tokens on the 'Arbitrum' chain with a 24-hour trading volume greater than 1,000,000 USD. Show symbol, volume, and price." }, { "role": "assistant", "content": "SELECT token_symbol, volume_24h, price FROM token_dexpool_info WHERE chain = 'Arbitrum' AND volume_24...
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, token_name character varying(100) NOT NULL, token_sy...
[ { "role": "user", "content": "Show me the list of all room numbers and their corresponding guest full names for current reservations (status is 'Occupied' or 'CheckedIn')." }, { "role": "assistant", "content": "SELECT r.room_number, g.first_name || ' ' || g.last_name AS guest_full_name\nFROM hos...
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 properties that have more than 10 service orders delivered in the last month. Include the property_name and the number of delivered orders." }, { "role": "assistant", "content": "SELECT p.property_name,\n COUNT(o.order_id) AS delivered_orders\nFROM hos...
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, -- unique identifier for the prope...
[ { "role": "user", "content": "List users and their latest wallet address if they have one, ordered by username." }, { "role": "assistant", "content": "SELECT u.username, w.address FROM users u JOIN wallets w ON u.user_id = w.user_id WHERE w.created_at = (SELECT MAX(w2.created_at) FROM wallets w2...
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 PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "List all comments made by user with ID 'user456', including their content and creation time." }, { "role": "assistant", "content": "SELECT content, created_at FROM social_media.comments WHERE user_id = 'user456';" }, { "role": "user", "content": "From th...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ...
[ { "role": "user", "content": "Show me each achievement name and the number of players who have unlocked it." }, { "role": "assistant", "content": "SELECT a.name,\n COUNT(pa.player_id) AS unlock_count\nFROM gaming_technology.achievements a\nLEFT JOIN gaming_technology.player_achievements pa...
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": "Which users have sent messages containing media in group chats? List their usernames and the names of the group chats." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, c.group_name\nFROM social_media.messages m\nJOIN social_media.users u ON m.sende...
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": "How many distinct users have ever participated in a conversation?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT user_id) AS distinct_participant_count\nFROM social_media.conversation_participants;" } ]
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.follows ( follow_id.text, follower_user_id.text, following_user_id.text, created_at.timestamp ) CREATE TAB...
[ { "role": "user", "content": "List all insurance products and the total number of premium payments that have been made for each of them. Show product_id, product_name, and payments_count." }, { "role": "assistant", "content": "SELECT ip.product_id, ip.product_name, COUNT(pp.payment_id) AS paymen...
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 character varying(64) NOT NULL, product_name character varying(150) NOT NULL,...
[ { "role": "user", "content": "List all claim IDs that have both an 'Accident Report' and a 'Damage Assessment' document type." }, { "role": "assistant", "content": "SELECT claim_id\nFROM insurance.claim_documents\nWHERE document_type IN ('Accident Report', 'Damage Assessment')\nGROUP BY claim_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 insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id character varying(64) NOT NULL, docume...
[ { "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": "For each achievement, list the achievement name and the total number of unique players who have unlocked it." }, { "role": "assistant", "content": "SELECT a.name AS achievement_name, COUNT(DISTINCT pa.player_id) AS unique_players\nFROM gaming_technology.achievements...
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": "List all reservations that have at least one service order, showing the reservation ID, the check-in date, and the total number of service orders placed for that reservation." }, { "role": "assistant", "content": "SELECT T1.reservation_id, T1.check_in_date, COUNT(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.reservations ( reservation_id character varying(64) NOT NULL, property_id character varying(64) ...
[ { "role": "user", "content": "Show me all contracts deployed on the 'ethereum' network along with their deployer wallet addresses and creation dates, sorted by the most recent deployments first." }, { "role": "assistant", "content": "SELECT c.contract_id, c.address, c.deployer_address, w.address...
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 text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "Show me all claims that were settled for more than $50,000, along with the policy details and agent information." }, { "role": "assistant", "content": "SELECT c.*, p.*, a.first_name || ' ' || a.last_name AS agent_name FROM insurance.claims c JOIN insurance.policies ...
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": "Show me the top 3 narratives by trend rank, along with their top 3 tokens and 7-day price change percentage." }, { "role": "assistant", "content": "SELECT n.narrative, n.top_3_coins, n.price_change_percentage_7d FROM narrative_info n ORDER BY n.trend_rank ASC LIMIT ...
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 varying(100) NO...
[ { "role": "user", "content": "For each sender address, count how many distinct tokens they have transferred. Show from_address and token_count." }, { "role": "assistant", "content": "SELECT from_address, COUNT(DISTINCT token_id) AS token_count\nFROM web3.token_transfers\nGROUP BY from_address;" ...
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": "List the location name and city for all service locations that belong to agencies which offer services with a standard fee greater than 500. Include the service name and fee." }, { "role": "assistant", "content": "SELECT DISTINCT T2.location_name, T2.city, T1.servic...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id character varying(64) NOT NULL, -- unique identifier for the service ...
[ { "role": "user", "content": "For each patient, find the next appointment after each one. Return patient_id, appointment_id, next_appointment_id, and the waiting time in minutes between them." }, { "role": "assistant", "content": "SELECT A.patient_id,\n A.appointment_id AS current_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 healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,...
[ { "role": "user", "content": "For each trip that has associated bookings, show the trip ID, the total number of passengers recorded for the trip, and the total fare collected from all bookings for that trip." }, { "role": "assistant", "content": "SELECT T1.trip_id, T1.passenger_count, SUM(T2.far...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "List the full names and email addresses of citizens who have submitted an application but have not uploaded any documents for that application. Display the citizen's full name, application_id, and submitted_at." }, { "role": "assistant", "content": "SELECT c.first_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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Which users have received both a comment notification and a like notification? List the recipient_user_id and the total number of such users." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT recipient_user_id) AS user_count\nFROM (\n SELECT recipient_us...
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.likes ( like_id character varying(64) NOT NULL, -- unique identifier for the like user_id characte...
[ { "role": "user", "content": "Show me all insurance plans that cover more than 10 patients as their primary insurance, along with the provider name and contact information." }, { "role": "assistant", "content": "SELECT ip.plan_name, ip.insurance_provider, ip.contact_phone, ip.website, COUNT(pi.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 healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "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": "Show me all agents and their managers' full names. For each agent, include agent_id, agent's first and last name, and their manager's first and last name." }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agen...
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": "Show me all events emitted by contracts where the event name contains 'Approval', along with the contract ID and transaction ID, sorted by emitted timestamp in descending order." }, { "role": "assistant", "content": "SELECT event_id, contract_id, event_name, transac...
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 all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT t.name, t.symbol, t.address FROM token_prices_latest t WHERE t.price BETWEEN 1 AND 10;" }, { "r...
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, block_timestamp.timestamp, transaction_index.integer, transaction_hash....
[ { "role": "user", "content": "How many diagnoses does each status have grouped by is_chronic flag?" }, { "role": "assistant", "content": "SELECT is_chronic, status, COUNT(*) AS count FROM healthcare.diagnoses GROUP BY is_chronic, 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 healthcare.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id text, diagnosis_code text, code_ty...
[ { "role": "user", "content": "For each passenger, compute the count of bookings and average fare for bookings made in February 2024." }, { "role": "assistant", "content": "SELECT p.passenger_id, COUNT(b.booking_id) AS booking_count, AVG(b.fare) AS avg_fare\nFROM transportation.passengers p\nJOIN...
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": "List the IDs of citizens who have received notifications related to more than one distinct type of entity." }, { "role": "assistant", "content": "SELECT citizen_id FROM government_services.notifications WHERE related_entity_type IS NOT NULL AND related_entity_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 government_services.notifications ( notification_id text PRIMARY KEY, citizen_id text, application_id text, message_sub...
[ { "role": "user", "content": "How many agents were hired in the current year and what is their average commission rate?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS hired_this_year, AVG(commission_rate) AS average_commission_rate FROM insurance.agents WHERE EXTRACT(YEAR FROM hire_da...
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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara...
[ { "role": "user", "content": "Show me pairs of developers from the same country, listing both names, country, and founded years." }, { "role": "assistant", "content": "SELECT\n d1.name AS developer1_name,\n d2.name AS developer2_name,\n d1.country,\n d1.founded_year AS developer1_founded_yea...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d...
[ { "role": "user", "content": "Show me the wallet addresses that have both sent and received tokens in the same transaction." }, { "role": "assistant", "content": "SELECT DISTINCT w.address FROM web3.wallets w JOIN web3.token_transfers tt1 ON w.address = tt1.from_address JOIN web3.token_transfers...
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 all items with rarity = 'Legendary', showing item_id, item_name, and cost_amount." }, { "role": "assistant", "content": "SELECT item_id,\n item_name,\n cost_amount\nFROM gaming_technology.in_game_items\nWHERE rarity = 'Legendary';" }, { "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 gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_type.text, description.text, rarity....
[ { "role": "user", "content": "Show me all guests from California (state_province = 'California') who are loyalty members and have provided both email and phone number, ordered by their last name in alphabetical order." }, { "role": "assistant", "content": "SELECT guest_id, first_name, 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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "List tokens associated with the 'AI' narrative. For each token, show its symbol and current price. Also include the 24-hour volume for the 'AI' narrative itself." }, { "role": "assistant", "content": "SELECT T1.token_symbol, T1.price, T2.volume_24h FROM token_basic_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character...
[ { "role": "user", "content": "Show me the name of all NFTs and their collection names for collections named 'CryptoPunks'." }, { "role": "assistant", "content": "SELECT t1.name AS nft_name, t2.name AS collection_name FROM nft_metadata AS t1 JOIN nft_collections AS t2 ON t1.contract_address = t2....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,...
[ { "role": "user", "content": "List scheduled appointments, including the patient's full name, the doctor's full name, and the appointment time." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, d.first_name, d.last_name, a.appointment_time FROM healthcare.appointments AS 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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "For each fundraising round in 2022 and 2023, list the round name, the year, the total investment_value, and the count of distinct projects. Also include the average market_cap of associated tokens by matching project_name to token_symbol in token_basic_info." }, { "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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show me the average market cap and average 24-hour price change percentage for tokens on each chain." }, { "role": "assistant", "content": "SELECT chain, AVG(market_cap) AS average_market_cap, AVG(price_change_percentage_24h) AS average_price_change_24h FROM token_b...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var...
[ { "role": "user", "content": "Show me the total hours spent by each lawyer on a specific case, say with case_id = 'CASE001'." }, { "role": "assistant", "content": "SELECT lawyer_id, SUM(hours_spent) AS total_hours FROM legal_services.time_entries WHERE case_id = 'CASE001' GROUP BY lawyer_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.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu...
[ { "role": "user", "content": "What is the total estimated_loss and average settlement_amount for all claims with status 'Approved'?" }, { "role": "assistant", "content": "SELECT SUM(estimated_loss) AS total_estimated_loss,\n AVG(settlement_amount) AS average_settlement\nFROM insurance.clai...
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": "How many prescriptions have been issued for each medication?" }, { "role": "assistant", "content": "SELECT medication_id, COUNT(*) AS prescription_count FROM healthcare.prescriptions GROUP BY medication_id;" }, { "role": "user", "content": "Exclude 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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Show me all open cases along with the case number, the client's full name, and the name and email of the lead lawyer." }, { "role": "assistant", "content": "SELECT c.case_number, cl.first_name || ' ' || cl.last_name AS client_full_name, l.first_name || ' ' || l.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 legal_services.clients ( client_id.text, first_name.text, last_name.text, company_name.text, email.text, phone.text, ad...
[ { "role": "user", "content": "Show me all employees (employee_id, first_name, last_name) in the 'Investment' department who have processed trades for securities in the 'Technology' sector, along with the count of such trades for each employee." }, { "role": "assistant", "content": "SELECT e.empl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "What is the total sum of amounts paid for all invoices?" }, { "role": "assistant", "content": "SELECT SUM(amount_paid) FROM invoices;" }, { "role": "user", "content": "Group this total by the status of the invoice." }, { "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 legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, website text, founded_date date, man...
[ { "role": "user", "content": "How many customers have a non-null phone number in your system?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM insurance.customers WHERE phone_number 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "特定の材料を使用しているコンポーネントの組み立て手順を確認したいです。材料IDと材料名、組み立て手順のステップ名と説明を含めてください。" }, { "role": "assistant", "content": "SELECT m.material_id, m.material_name, s.step_name, s.description\nFROM manufacturing.materials m\nJOIN manufacturing.assembly_steps s ON m.material_id = s.st...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE manufacturing.materials ( material_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "I need a report showing each passenger's total number of bookings and the date of their most recent booking." }, { "role": "assistant", "content": "SELECT b.passenger_id,\n COUNT(*) AS total_bookings,\n MAX(b.booking_time) AS last_booking_date\nFROM 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.routes ( route_id character varying(64) NOT NULL, route_number character varying(32) NOT NULL UNIQUE, de...
[ { "role": "user", "content": "Which players have not logged in in the last 30 days but have unlocked any achievements? Show player_id, username, and total unlocked achievements." }, { "role": "assistant", "content": "SELECT p.player_id, p.username, COUNT(pa.achievement_id) AS total_unlocked\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 gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "List the usernames and email addresses of users who have participated in group chats, along with the names of those group chats." }, { "role": "assistant", "content": "SELECT u.username, u.email, c.group_name\nFROM social_media.users u\nJOIN social_media.conversatio...
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": "List all tokens with a 24-hour trading volume over $1 million and a positive price change percentage in the last 24 hours." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, volume_24h, price_change_percentage_24h FROM token_dexpool_info WHERE v...
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, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show me all pairs of overlapping reservations at the same property, including both reservation IDs." }, { "role": "assistant", "content": "SELECT r1.reservation_id AS res1, r2.reservation_id AS res2\nFROM hospitality_technology.reservations r1\nJOIN hospitality_tech...
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, property_id text, guest_id text, room_id text, room_type_id ...
[ { "role": "user", "content": "I need a count of games per platform and the earliest release date on each platform." }, { "role": "assistant", "content": "SELECT platform, COUNT(*) AS game_count, MIN(release_date) AS first_release\nFROM gaming_technology.games\nGROUP BY platform;" }, { "r...
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": "List all rooms along with their room number, room type name, and the base rate for that room type." }, { "role": "assistant", "content": "SELECT T1.room_number, T2.type_name, T2.base_rate FROM rooms AS T1 JOIN room_types AS T2 ON T1.room_type_id = T2.room_type_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "Which projects had two or more fundraising rounds and what are the latest and earliest rounds with their investment values and dates? Also show the associated token symbol and its chain." }, { "role": "assistant", "content": "WITH rounds AS (\n SELECT\n project_...
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, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Which claims have an estimated_loss greater than 20000 and also have any premium payment that is not completed? Return claim_id, policy_id, estimated_loss, due_date, and amount_paid." }, { "role": "assistant", "content": "SELECT c.claim_id,\n c.policy_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 insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d...
[ { "role": "user", "content": "How many games are there per platform, and what is the earliest release_date for each platform?" }, { "role": "assistant", "content": "SELECT platform,\n COUNT(*) AS game_count,\n MIN(release_date) AS earliest_release\nFROM gaming_technology.games\nGROUP...
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 route ID, route number, and route type for all transportation routes." }, { "role": "assistant", "content": "SELECT route_id, route_number, type FROM transportation.routes;" }, { "role": "user", "content": "Filter this list to only include ro...
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": "Show me the user ID, wallet ID, address ID, and the transaction ID for transactions where the sender address is linked to an address associated with a wallet." }, { "role": "assistant", "content": "SELECT DISTINCT w.user_id, w.wallet_id, w.address_id, t.transaction_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp tim...
[ { "role": "user", "content": "List patient_id, first_name, last_name, and date_of_birth for all patients older than 65 years." }, { "role": "assistant", "content": "SELECT patient_id, first_name, last_name, date_of_birth\nFROM healthcare.patients\nWHERE date_of_birth < CURRENT_DATE - INTERVAL '6...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "For each distinct deployer address, how many contracts have they deployed and what is the most recent deployment time? Please show deployer_address, contract_count, and latest_deployed_at." }, { "role": "assistant", "content": "SELECT deployer_address, COUNT(*) AS 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 web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifier for the contract address cha...
[ { "role": "user", "content": "List all ERC20 tokens along with their contract addresses and the wallet address holding the largest balance for each token." }, { "role": "assistant", "content": "SELECT eb.contract_address, eb.wallet_address, eb.amount FROM erc20_balances eb WHERE (eb.contract_add...
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 erc20_balances ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar ) CR...
[ { "role": "user", "content": "List all customers along with any employees who have the same last name. For each pair, display customer_id, customer full name, employee_id, employee full name, and their respective emails." }, { "role": "assistant", "content": "SELECT c.customer_id,\n c.firs...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "List the case number, case name, and the full name of the client for cases that have uploaded documents." }, { "role": "assistant", "content": "SELECT T1.case_number , T1.case_name , T2.full_name FROM legal_services.cases AS T1 JOIN legal_services.clients AS T2 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 legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "For each city that has a fueling location, show the city name and the total quantity of fuel refueled." }, { "role": "assistant", "content": "SELECT T2.city , SUM(T1.quantity) FROM transportation.fuel_logs AS T1 JOIN transportation.locations AS T2 ON T1.location_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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "Show me all users who are participants in conversations that are group chats, including the group name and the date they joined the group." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, c.conversation_id, conv.group_name, cp.joined_at\nFROM soc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "List the name and city of locations where fuel logs have been recorded, along with the total fuel quantity logged at each location." }, { "role": "assistant", "content": "SELECT l.name, l.city, SUM(f.quantity) AS total_fuel_quantity FROM transportation.locations l 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 transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ...
[ { "role": "user", "content": "Could you please list the first and last names of all clients?" }, { "role": "assistant", "content": "SELECT first_name, last_name FROM clients;" }, { "role": "user", "content": "Now, only show clients whose status is 'active'." }, { "role": "ass...
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, first_name text, last_name text, company_name text, email text, phone text, ad...
[ { "role": "user", "content": "Provide for each security its ticker_symbol, the most recent close_price and corresponding timestamp." }, { "role": "assistant", "content": "SELECT s.ticker_symbol, md.close_price, md.data_timestamp\nFROM financial_services.market_data md\nJOIN financial_services.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 financial_services.market_data ( data_point_id bigserial NOT NULL, security_id character varying(64) NOT NULL, data_tim...
[ { "role": "user", "content": "List all claims with police reports that were filed in the last 3 months, showing the claim ID, policy ID, and estimated loss amount." }, { "role": "assistant", "content": "SELECT claim_id, policy_id, estimated_loss FROM insurance.claims WHERE police_report_number 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 insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "List the appointment ID, subject, and duration in minutes for all completed appointments." }, { "role": "assistant", "content": "SELECT appointment_id, subject, EXTRACT(EPOCH FROM (end_time - start_time))/60 AS duration_minutes FROM legal_services.appointments WHERE...
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": "What is the total revenue generated for each department from delivered service orders? Return department and total_revenue." }, { "role": "assistant", "content": "SELECT s.department,\n SUM(so.total_price) AS total_revenue\nFROM hospitality_technology.service_...
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": "Can you show me the total number of diagnosis records for each doctor, along with the doctor's ID? Please include only those diagnoses marked as 'chronic'." }, { "role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS total_chronic_diagnoses FROM healthcare.d...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty...
[ { "role": "user", "content": "Find all pairs of tokens that share the same token_name but have different token_symbols. Show both token IDs, the shared token_name, and each token’s symbol." }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id_1,\n t2.token_id AS token_id_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 web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "How many insurance products were created before 2022?" }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM insurance.insurance_products\nWHERE created_at < '2022-01-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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, product_type text, description text, bas...
[ { "role": "user", "content": "For each document, show its document id, the verification status, and the purpose of the related appointment (if any)." }, { "role": "assistant", "content": "SELECT d.document_id, d.verification_status, a.purpose\nFROM government_services.documents d\nLEFT JOIN gove...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id character varying(64) NOT NULL, -- unique identifier for the service ...
[ { "role": "user", "content": "Show each agency along with its parent agency’s name and jurisdiction level." }, { "role": "assistant", "content": "SELECT child.agency_id, child.agency_name, child.jurisdiction_level, parent.agency_name AS parent_agency_name, parent.jurisdiction_level AS parent_jur...
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": "I want to find pairs of developers that share the same website domain. For each pair, show both developer names and the domain." }, { "role": "assistant", "content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.domain AS domain\nFROM (\n SELECT develope...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "List the names of law firms whose managing partner has uploaded at least one document, and show the managing partner ID along with the firm's phone number." }, { "role": "assistant", "content": "SELECT DISTINCT T1.firm_name, T1.managing_partner_id, T1.phone FROM leg...
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.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, phone text, website text, founded_da...
[ { "role": "user", "content": "List the total value and count of transactions for each status, ordered by total value descending." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS transaction_count, SUM(value) AS total_value\nFROM web3.transactions\nGROUP BY status\nORDER BY total...
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.transactions ( transaction_id.text, from_address.text, to_address.text, value.numeric, gas_used.integer, gas_price...
[ { "role": "user", "content": "For each case type, calculate the average time to close cases in days, only including cases that have been closed." }, { "role": "assistant", "content": "SELECT case_type,\n AVG(EXTRACT(EPOCH FROM (date_closed - date_opened)) / 86400) AS avg_close_days\nFROM l...
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.cases ( case_id text, case_number text, case_name text, client_id text, lead_lawyer_id text, case_type t...
[ { "role": "user", "content": "For each player, show their player_id and the number of different games they have played sessions on." }, { "role": "assistant", "content": "SELECT player_id, COUNT(DISTINCT game_id) AS games_played\nFROM gaming_technology.game_sessions\nGROUP BY player_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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "List the wallet IDs and creation timestamps for all wallets created after '2023-01-01'." }, { "role": "assistant", "content": "SELECT wallet_id, created_at FROM web3.wallets WHERE created_at > '2023-01-01';" }, { "role": "user", "content": "Can you modif...
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.text, user_id.text, address.text, private_key.text, created_at.timestamp )
[ { "role": "user", "content": "For each chain, list the address with the highest ROI, showing the address, ROI, profit, and most profitable token." }, { "role": "assistant", "content": "SELECT t1.chain, t1.address, t1.roi, t1.profit, t1.most_profit_token FROM smart_money_profit t1 INNER JOIN (SEL...
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_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token...
[ { "role": "user", "content": "Show me document_id, application_id, and verification_status for all documents submitted by citizen 'cit123'." }, { "role": "assistant", "content": "SELECT document_id,\n application_id,\n verification_status\nFROM documents\nWHERE citizen_id = 'cit123';...
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": "How many players are there in each country?" }, { "role": "assistant", "content": "SELECT country_code, COUNT(*) AS player_count\nFROM gaming_technology.players\nGROUP BY country_code;" }, { "role": "user", "content": "Only include countries with more th...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player ...
[ { "role": "user", "content": "List for each fuel type the number of unique vehicle models available. Show the fuel_type and the model count." }, { "role": "assistant", "content": "SELECT fuel_type, COUNT(DISTINCT model) AS model_count FROM transportation.vehicles GROUP BY fuel_type ORDER BY fuel...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Show me a list of all unique user IDs present in the wallet database." }, { "role": "assistant", "content": "SELECT DISTINCT user_id FROM web3.wallets;" }, { "role": "user", "content": "For each of those user IDs, how many wallets do they have? Show both...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(6...
[ { "role": "user", "content": "For each vehicle, show the fuel_log_id and log_timestamp for its earliest and latest fuel log entries by comparing timestamps." }, { "role": "assistant", "content": "SELECT fl_min.vehicle_id,\n fl_min.fuel_log_id AS earliest_log_id,\n fl_min.log_timestam...
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...