conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Find the top 3 tokens by total supply that have a token symbol starting with 'T', showing their token names, contract addresses, and total supply." }, { "role": "assistant", "content": "SELECT token_name, contract_address, total_supply FROM web3.tokens WHERE token_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 web3.tokens ( token_id.text, contract_address.text, token_name.text, token_symbol.text, decimals.integer, total_supply....
[ { "role": "user", "content": "Show me the token names and their contract addresses where the total supply is greater than 1 million, sorted by total supply in descending order." }, { "role": "assistant", "content": "SELECT token_name, contract_address FROM web3.tokens WHERE total_supply > 100000...
You are an SQL statement expert. Given the table 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 text, contract_address text, token_name text, token_symbol text, decimals integer, total_supply ...
[ { "role": "user", "content": "List all guests who have a loyalty member ID, showing their full name (first and last name), email, and loyalty ID." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, loyalty_member_id FROM hospitality_technology.guests WHERE loyalty_member_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "Show me all SUI coins with a balance greater than 1000, including their symbol and name." }, { "role": "assistant", "content": "SELECT sc.object_id, sc.coin_type, sc.balance, scm.symbol, scm.name FROM sui_coins sc JOIN sui_coins_metadata scm ON sc.coin_type = scm.co...
You are an SQL statement expert. Given the table 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": "Show me all trips that were completed with a passenger count greater than 15, including their route and vehicle details." }, { "role": "assistant", "content": "SELECT t.trip_id, t.route_id, t.vehicle_id, t.driver_id, t.scheduled_departure, t.actual_departure, t.sche...
You are an SQL statement expert. Given the table 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.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti...
[ { "role": "user", "content": "Show me all properties in California along with the count of staff members at each property, ordered by staff count in descending order." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, COUNT(s.staff_id) AS staff_count FROM hospitality_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "Show all bookings for trips that are on routes of type 'Shuttle', including the booking ID, passenger's full name, and the route number." }, { "role": "assistant", "content": "SELECT b.booking_id, p.first_name || ' ' || p.last_name AS passenger_name, r.route_number\...
You are an SQL statement expert. Given the table 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": "Find all patients who have both an email address and an emergency contact listed, and show their names, email, and emergency contact phone numbers." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, emergency_contact_phone FROM healthcare.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 healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "List each patient along with the patient record whose phone_number matches that patient's emergency_contact_phone. Show patient_id, first_name, and matched contact patient_id." }, { "role": "assistant", "content": "SELECT p.patient_id AS patient_id, p.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": "Show the license numbers and full names of all doctors who were registered before January 1, 2020 and work at 'hospital_789'." }, { "role": "assistant", "content": "SELECT license_number, first_name, last_name FROM healthcare.doctors WHERE created_at < '2020-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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "role": "user", "content": "Show me the usernames of buyers along with the names of assets they have traded." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, a.name AS asset_name\nFROM trading_platform.trades t\nJOIN trading_platform.users u ON t.buyer_id = u.user_id\nJOIN 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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "For each vehicle, show the vehicle_id, license_plate, the date of its most recent actual_arrival, and the total number of bookings across all its trips. Only include vehicles that have made at least one trip." }, { "role": "assistant", "content": "SELECT v.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": "Show me the top 5 addresses with the highest balances, along with their public keys." }, { "role": "assistant", "content": "SELECT address_id, public_key, balance FROM blockchain.addresses ORDER BY balance DESC LIMIT 5;" }, { "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 blockchain.addresses ( address_id character varying(128) NOT NULL, -- unique identifier for the address public...
[ { "role": "user", "content": "Show the number of staff members for each property, along with the property name." }, { "role": "assistant", "content": "SELECT p.property_name, COUNT(s.staff_id) AS staff_count\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.staff s ON p.prop...
You are an SQL statement expert. Given the table 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": "Show me all users who have wallets but have never placed any orders, along with their wallet addresses and creation dates." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, w.address AS wallet_address, w.created_at FROM trading_platform.users u 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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "List all insurance plans where the plan_type is 'EPO', showing plan_id, plan_name, and insurance_provider." }, { "role": "assistant", "content": "SELECT plan_id, plan_name, insurance_provider\nFROM healthcare.insurance_plans\nWHERE plan_type = 'EPO';" } ]
You are an SQL statement expert. Given the table 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": "Show me the total number of token transfers for each token symbol on the network." }, { "role": "assistant", "content": "SELECT tk.token_symbol, COUNT(tt.transfer_id) AS total_transfers FROM web3.tokens tk JOIN web3.token_transfers tt ON tk.token_id = tt.token_id GR...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Show all fuel logs for vehicle_id 'VH123', including the timestamp, fuel type, quantity, and the location_id. Sort the list by timestamp descending." }, { "role": "assistant", "content": "SELECT fuel_log_id, log_timestamp, fuel_type, quantity, location_id\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.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry...
[ { "role": "user", "content": "Provide a count of loans grouped by their status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM financial_services.loans GROUP BY status" }, { "role": "user", "content": "Additionally, show the total current principal balance for ea...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.loans ( loan_id.text, account_id.text, loan_type.text, principal_amount.numeric, current_principal_b...
[ { "role": "user", "content": "For each transaction_id in the utxos table, show the transaction_id and the total number of UTXOs associated with it, sorted by the count descending." }, { "role": "assistant", "content": "SELECT transaction_id,\n COUNT(*) AS utxo_count\nFROM trading_platform....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, -- unique identifier for the asset name cha...
[ { "role": "user", "content": "Show me all players who have unlocked any achievements in games released after 2020, and include the player's ID, achievement ID, the game's title, and the unlock date." }, { "role": "assistant", "content": "SELECT pa.player_id, pa.achievement_id, g.title, pa.unlock...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea...
[ { "role": "user", "content": "List appointments for patients who have an insurance policy with a group number assigned. Show the appointment ID, patient ID, and appointment time." }, { "role": "assistant", "content": "SELECT T1.appointment_id , T1.patient_id , T1.appointment_time FROM healthca...
You are an SQL statement expert. Given the table 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": "Find users who have never followed anyone but have created at least 5 posts. Return user_id and post_count." }, { "role": "assistant", "content": "SELECT u.user_id, COUNT(p.post_id) AS post_count\nFROM social_media.users u\nLEFT JOIN social_media.posts p ON u.user_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "List projects that raised funds in 2023 and have an associated token in token_basic_info. Show project_name, rounds_name, investment_value, token_symbol, and chain." }, { "role": "assistant", "content": "SELECT p.project_name, p.rounds_name, p.investment_value, t.to...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Count the number of customers grouped by their status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.customers 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 character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "Find customers who have at least two policies with overlapping coverage periods. Show customer_id, policy1_id, policy2_id, overlap_start and overlap_end." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_id AS policy1_id,\n p2.pol...
You are an SQL statement expert. Given the table 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": "Show me the top 3 tokens by USD value inflow where smart money was buying (type = 1), along with their token symbol and narrative from the smart_money_token_inflow table." }, { "role": "assistant", "content": "SELECT token_symbol, narrative, usd_value FROM smart_mon...
You are an SQL statement expert. Given the table 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, token_name character varying(100) NOT NULL, token_symbol ch...
[ { "role": "user", "content": "Find all smart contracts created by addresses that have a balance greater than 1000." }, { "role": "assistant", "content": "SELECT sc.* FROM blockchain.smart_contracts sc JOIN blockchain.addresses a ON sc.creator_address = a.address_id WHERE a.balance > 1000;" }, ...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, previous_block_id character varying(64), timestamp timesta...
[ { "role": "user", "content": "For each ERC20 token, I need the total historical balance and number of unique holders from erc20_balances_historical. Include contract_address, total_balance, holder_count, symbol, and decimals." }, { "role": "assistant", "content": "SELECT bh.contract_address,\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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "Show item_id, item_name, and the damage attribute extracted from attributes JSON for items of type 'Weapon'." }, { "role": "assistant", "content": "SELECT item_id,\n item_name,\n (attributes->>'damage')::numeric AS damage\nFROM gaming_technology.in_game_...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea...
[ { "role": "user", "content": "List all projects that have completed a Series A funding round, including their investment value and valuation." }, { "role": "assistant", "content": "SELECT project_name, investment_value, valuation FROM project_fundraising_record WHERE rounds_name = 'Series 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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "Show me all trips that were completed with vehicles manufactured after 2020, including the vehicle make and model." }, { "role": "assistant", "content": "SELECT t.trip_id, v.make, v.model FROM transportation.trips t JOIN transportation.vehicles v ON t.vehicle_id = 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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "Find all appointments where the employee ID is not null and show the appointment ID, employee ID, and the scheduled start time." }, { "role": "assistant", "content": "SELECT appointment_id, employee_id, scheduled_start_time FROM government_services.appointments WHER...
You are an SQL statement expert. Given the table 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, citizen_id text, employee_id text, location_id text, service_id...
[ { "role": "user", "content": "List law firm names and the full name and specialization of all lawyers hired after 2020." }, { "role": "assistant", "content": "SELECT T1.firm_name, T2.first_name || ' ' || T2.last_name AS lawyer_full_name, T2.specialization FROM law_firms AS T1 JOIN lawyers AS 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "List all servers that are currently online. Show their name, region, current player count, and maximum player capacity." }, { "role": "assistant", "content": "SELECT server_name, region, current_players, max_players FROM gaming_technology.servers WHERE status = 'onl...
You are an SQL statement expert. Given the table 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.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_id uuid NOT NULL, server_name chara...
[ { "role": "user", "content": "For each notification sent through the 'SMS' channel, list the notification ID, message subject, and the full name of the citizen who received it." }, { "role": "assistant", "content": "SELECT n.notification_id, n.message_subject, c.first_name || ' ' || c.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 government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "For each loan, show the loan_id, the account_id, the principal_amount, and the ticker_symbol and security_name of any associated collateral, if the collateral_description matches a security's ticker_symbol." }, { "role": "assistant", "content": "SELECT l.loan_id, 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 financial_services.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,...
[ { "role": "user", "content": "Can you list each developer's name along with the number of games they have published by joining developers and games?" }, { "role": "assistant", "content": "SELECT d.name AS developer_name,\n COUNT(g.game_id) AS games_published\nFROM gaming_technology.develop...
You are an SQL statement expert. Given the table 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": "I need to find pairs of servers that host the same game but are deployed in different regions. Can you write a SQL statement for that?" }, { "role": "assistant", "content": "SELECT s1.game_id, s1.region AS region1, s2.region AS region2, s1.server_name AS server1, s2...
You are an SQL statement expert. Given the table 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.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game se...
[ { "role": "user", "content": "Get the total fuel cost per route, showing route_number and the sum of total_cost for all fuel logs associated with trips on that route." }, { "role": "assistant", "content": "SELECT r.route_number,\n SUM(fl.total_cost) AS total_fuel_cost\nFROM transportation....
You are an SQL statement expert. Given the table 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": "What is the average difficulty of blocks mined after January 1, 2023?" }, { "role": "assistant", "content": "SELECT AVG(difficulty) FROM blockchain.blocks WHERE timestamp > '2023-01-01 00:00:00';" }, { "role": "user", "content": "Can you also show the co...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the block previous_block...
[ { "role": "user", "content": "Show me the total transaction amount sent by each user (based on user_id) in the last 30 days, along with their username." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, SUM(t.amount) AS total_amount FROM blockchain.users u JOIN blockchain.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 blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "role": "user", "content": "List all trips along with their trip ID and the number of passengers if the trip is currently in progress." }, { "role": "assistant", "content": "SELECT trip_id, passenger_count FROM transportation.trips WHERE status = 'In Progress';" }, { "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 transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti...
[ { "role": "user", "content": "Show me all appointment IDs and their scheduled start times along with the employee ID and service ID for appointments that have been booked using the 'Kiosk' booking method." }, { "role": "assistant", "content": "SELECT appointment_id, scheduled_start_time, employe...
You are an SQL statement expert. Given the table 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, citizen_id text, employee_id text, location_id text, service_id...
[ { "role": "user", "content": "Show me each product_type along with the count of products for that type, but only include types where the average base_premium exceeds 500. Order the results by the product count in descending order." }, { "role": "assistant", "content": "SELECT product_type,\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.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Calculate the average duration of appointments in minutes for each doctor. Return doctor_id and avg_duration." }, { "role": "assistant", "content": "SELECT doctor_id, AVG(duration_minutes) AS avg_duration\nFROM healthcare.appointments\nGROUP BY doctor_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": "Can you show me, for each player, the total number of different in-game items they have acquired, along with the names and types of these items?" }, { "role": "assistant", "content": "SELECT pi.player_id, COUNT(DISTINCT pi.item_id) AS unique_items_acquired, STRING_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 gaming_technology.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ...
[ { "role": "user", "content": "I'd like a report showing for each sector the average close_price and maximum volume from market_data for the previous quarter." }, { "role": "assistant", "content": "SELECT s.sector, AVG(md.close_price) AS avg_close_price, MAX(md.volume) AS max_volume\nFROM financi...
You are an SQL statement expert. Given the table 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 non-primary insurance plans for patients, including their policy numbers and effective dates, sorted by expiration date." }, { "role": "assistant", "content": "SELECT patient_id, policy_number, effective_date FROM healthcare.patient_insurance WHERE is_prima...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, patient_id character varying(64) NO...
[ { "role": "user", "content": "List every offline server alongside an online server in the same region. Show offline_server and online_server names." }, { "role": "assistant", "content": "SELECT o.server_name AS online_server, f.server_name AS offline_server\nFROM gaming_technology.servers f\nJOI...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,...
[ { "role": "user", "content": "How many appointments have a status of 'Cancelled' for each service?" }, { "role": "assistant", "content": "SELECT service_id, COUNT(*) AS cancelled_appointments FROM government_services.appointments WHERE status = 'Cancelled' GROUP BY service_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 government_services.appointments ( appointment_id text, citizen_id text, employee_id text, location_id text, service_id...
[ { "role": "user", "content": "List all insurance plans that will expire within the next 30 days, showing the patient IDs and subscriber names." }, { "role": "assistant", "content": "SELECT patient_id, subscriber_name, policy_number, expiration_date\nFROM healthcare.patient_insurance\nWHERE expir...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, -- unique identifier for this p...
[ { "role": "user", "content": "Find all pairs of lawyers who were hired on the exact same date but have different specializations. Return each lawyer's name, hire_date, and both specializations." }, { "role": "assistant", "content": "SELECT a.lawyer_id AS lawyer1_id,\n a.first_name AS 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "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": "For each customer with at least one open claim, list the customer_id, first_name, last_name, policy_number, claim_id, and incident_date." }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_number, cl.claim_id, cl.incident...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "Find all pairs of vehicles that have the same make and model but different fuel types. For each pair, display the first vehicle_id, the second vehicle_id, make, model, fuel_type of the first as fuel_type1 and of the second as fuel_type2." }, { "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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "List all trips with their ID, vehicle ID, and driver ID." }, { "role": "assistant", "content": "SELECT trip_id, vehicle_id, driver_id FROM transportation.trips;" }, { "role": "user", "content": "Can you also include the scheduled departure and actual arr...
You are an SQL statement expert. Given the table 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": "List the names and types of all properties, along with the full names and positions of their managers." }, { "role": "assistant", "content": "SELECT p.property_name, p.property_type, s.first_name || ' ' || s.last_name AS manager_full_name, s.position AS manager_posi...
You are an SQL statement expert. Given the table 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": "Show me the total transaction amount and count for each account type. Please include the account type and the total amount and count from the transactions table." }, { "role": "assistant", "content": "SELECT\n a.account_type,\n SUM(t.amount) AS total_transaction_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 financial_services.accounts ( account_id character varying(64) NOT NULL, -- unique identifier for the account c...
[ { "role": "user", "content": "List all reservations that have a total_amount greater than the amount_paid. Include the reservation_id, guest_id, total_amount, and amount_paid." }, { "role": "assistant", "content": "SELECT reservation_id, guest_id, total_amount, amount_paid\nFROM 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 PRIMARY KEY, property_id text, guest_id text, room_id text, r...
[ { "role": "user", "content": "Could you provide the sum of Deposit and Withdrawal amounts for each customer, showing their first and last names?" }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name,\n SUM(CASE WHEN t.transaction_type = 'Deposit' THEN t.amo...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ...
[ { "role": "user", "content": "Find all smart contracts where the code length is greater than 1000 characters." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE LENGTH(code) > 1000;" }, { "role": "user", "conten...
You are an SQL statement expert. Given the table 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.smart_contracts ( contract_id text PRIMARY KEY, creator_address text, code text, timestamp timestamp )
[ { "role": "user", "content": "Give me the average cleanliness rating from reviews for each property." }, { "role": "assistant", "content": "SELECT property_id, AVG(rating_cleanliness) AS avg_cleanliness_rating\nFROM hospitality_technology.reviews\nGROUP BY property_id;" }, { "role": "use...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat...
[ { "role": "user", "content": "For each state, show the total number of service locations and the number of employees working at agencies within those states." }, { "role": "assistant", "content": "SELECT sl.state, COUNT(DISTINCT sl.location_id) AS location_count, COUNT(DISTINCT e.employee_id) AS...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "Find all pairs of fuel log entries for the same vehicle that occurred on the same calendar day. Show vehicle ID, the two log IDs, and their timestamps." }, { "role": "assistant", "content": "SELECT\n f1.vehicle_id,\n f1.fuel_log_id AS log_id_1,\n f2.fuel_lo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, vehicle_id character varying(64) NOT NULL, trip_...
[ { "role": "user", "content": "List pairs of documents uploaded by the same user for the same claim. Return uploaded_by, claim_id, document_id AS doc1_id, and the paired document_id AS doc2_id." }, { "role": "assistant", "content": "SELECT cd1.uploaded_by,\n cd1.claim_id,\n cd1.docume...
You are an SQL statement expert. Given the table 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 text PRIMARY KEY, claim_id text, document_type text, file_name text, file_path ...
[ { "role": "user", "content": "How many users registered on each weekday? Return the weekday name and registration count." }, { "role": "assistant", "content": "SELECT\n to_char(created_at, 'FMDay') AS weekday,\n COUNT(*) AS registration_count\nFROM web3.users\nGROUP BY 1\nORDER BY registration...
You are an SQL statement expert. Given the table 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": "What is the total number of billable hours worked by each lawyer?" }, { "role": "assistant", "content": "SELECT lawyer_id,\n SUM(hours_spent) AS total_billable_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\nGROUP 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, case_id.text, lawyer_id.text, date_worked.date, hours_spent.numeric, billi...
[ { "role": "user", "content": "List the file name and file size for all claim documents uploaded by agents whose license state is 'CA' and status is 'Active'." }, { "role": "assistant", "content": "SELECT T1.file_name, T1.file_size_bytes FROM insurance.claim_documents AS T1 JOIN insurance.agents ...
You are an SQL statement expert. Given the table 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 the total file size in bytes for all documents uploaded with a MIME type of 'application/pdf'." }, { "role": "assistant", "content": "SELECT SUM(file_size_bytes) FROM insurance.claim_documents WHERE mime_type = 'application/pdf'" } ]
You are an SQL statement expert. Given the table 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": "Find pairs of distinct nodes that share the same 'last_seen' timestamp but have different port numbers. Show the node IDs, ports, and the shared timestamp for each pair." }, { "role": "assistant", "content": "SELECT T1.node_id AS node1_id , T1.port AS node1_port , ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, -- unique identifier for the node ip_address charac...
[ { "role": "user", "content": "List all vehicles along with their make, model, and license plate, that have not had any maintenance service since '2023-01-01'." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, v.license_plate FROM transportation.vehicles AS v WHERE NOT ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Show 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": "Show me the usernames of users who have commented on posts that were created in group chat conversations, along with the names of those group chats." }, { "role": "assistant", "content": "SELECT u.username, c.group_name\nFROM social_media.comments cm\nJOIN social_me...
You are an SQL statement expert. Given the table 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": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own." }, { "role": "assistant", "content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.users ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonce.integer, merkle_root.text, diffic...
[ { "role": "user", "content": "For each employee, retrieve their first and last name along with the number of appointments they've scheduled." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, COUNT(a.appointment_id) AS appointment_count\nFROM government_services.employees e...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "List the agency name, location name, address, and contact phone for all accessible service locations in the city of 'Seattle'." }, { "role": "assistant", "content": "SELECT t1.agency_name, t2.location_name, t2.address, t2.contact_phone FROM government_services.agenc...
You are an SQL statement expert. Given the table 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": "Which citizens have received notifications for applications processed by employees from the 'Legal' department? List the citizen ID, full name, and notification ID." }, { "role": "assistant", "content": "SELECT n.citizen_id, CONCAT(e.first_name, ' ', e.last_name) AS...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text, agency_name text, jurisdiction_level text, primary_contact_email text, m...
[ { "role": "user", "content": "I want to list all pairs of customers living in the same city with different risk profiles." }, { "role": "assistant", "content": "SELECT a.customer_id AS customer_a,\n b.customer_id AS customer_b,\n a.city,\n a.risk_profile AS risk_a,\n b.ri...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "Show me all properties in California with their star ratings and the total number of reservations they have, ordered by the reservation count in descending order." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, p.star_rating, COUNT(r.re...
You are an SQL statement expert. Given the table 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, property_name.text, address_line1.text, address_line2.text, city....
[ { "role": "user", "content": "For each exchange, compute the percentage change in total USD value of its holdings between snapshots '2023-01-01 00:00:00' and '2023-02-01 00:00:00'. Show exchange, chain, value_jan, value_feb, and pct_change." }, { "role": "assistant", "content": "SELECT t1.exchan...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "Show me all nodes that were last seen in the past 30 days, along with their IP addresses and ports." }, { "role": "assistant", "content": "SELECT node_id, ip_address, port, last_seen FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '30 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 blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
[ { "role": "user", "content": "List each vehicle and the date of its most recent maintenance, including the service type and cost." }, { "role": "assistant", "content": "SELECT vehicle_id, service_type, cost, service_date FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY vehicle_id ORDER BY 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 transportation.maintenance_logs ( log_id text, vehicle_id text, service_date date, odometer_reading integer, service_ty...
[ { "role": "user", "content": "List the content and creation time of all posts made in the last 7 days." }, { "role": "assistant", "content": "SELECT content, created_at FROM social_media.posts WHERE created_at >= NOW() - INTERVAL '7 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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u...
[ { "role": "user", "content": "For each review, show me the review comment and the associated service names that the guest has ordered during the same reservation." }, { "role": "assistant", "content": "SELECT r.review_id, r.comment, s.service_name \nFROM hospitality_technology.reviews r\nJOIN ho...
You are an SQL statement expert. Given the table 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": "List all rooms that are currently in 'Maintenance' status, including their room numbers and current conditions." }, { "role": "assistant", "content": "SELECT room_number, current_condition FROM hospitality_technology.rooms WHERE status = 'Maintenance';" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "List all pairs of cases that share the same court jurisdiction, including both case names and their common jurisdiction." }, { "role": "assistant", "content": "SELECT c1.case_name AS case_name_1, c2.case_name AS case_name_2, c1.court_jurisdiction\nFROM legal_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 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 the latest snapshot time, list the total `usd_value` held by CEXes for each distinct `token_symbol` across all chains. Order the results by total value descending." }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT max(snapshot_time) as m...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "List all messages sent in group chats, including the sender's username, the group name, and the message content." }, { "role": "assistant", "content": "SELECT T1.username , T3.group_name , T2.content FROM users AS T1 JOIN messages AS T2 ON T1.user_id = T2.sender...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the message convers...
[ { "role": "user", "content": "Show me the full names and email addresses of users who have received notifications of type 'mention', and the notification creation time." }, { "role": "assistant", "content": "SELECT u.full_name, u.email, n.created_at\nFROM social_media.notifications n\nJOIN socia...
You are an SQL statement expert. Given the table 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": "Please list the contact phone number and website for each insurance plan." }, { "role": "assistant", "content": "SELECT plan_id, plan_name, contact_phone, website FROM healthcare.insurance_plans;" }, { "role": "user", "content": "Show only the plans wher...
You are an SQL statement expert. Given the table 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.insurance_plans ( plan_id text, plan_name text, insurance_provider text, plan_type text, contact_phone text,...
[ { "role": "user", "content": "Show me the top 5 token balances by amount for wallet '0xabc123abcdef' in the erc20_balances table." }, { "role": "assistant", "content": "SELECT contract_address, amount\nFROM erc20_balances\nWHERE wallet_address = '0xabc123abcdef'\nORDER BY CAST(amount AS numeric)...
You are an SQL statement expert. Given the table 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": "List all employees with the job title 'Analyst'. Show their first name, last name, and department." }, { "role": "assistant", "content": "SELECT first_name, last_name, department\nFROM government_services.employees\nWHERE job_title = 'Analyst';" } ]
You are an SQL statement expert. Given the table 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": "Show all cities in the USA that have more than one distinct location type represented. List the city, country, and number of distinct location types." }, { "role": "assistant", "content": "SELECT city, country, COUNT(DISTINCT type) AS distinct_location_types\nFROM 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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "For each achievement, list how many unique players have unlocked it." }, { "role": "assistant", "content": "SELECT achievement_id, COUNT(DISTINCT player_id) AS unique_players FROM gaming_technology.player_achievements GROUP BY achievement_id;" }, { "role": "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, achievement_id.uuid, unlocked_at.ti...
[ { "role": "user", "content": "List the make, model, year, and the depot_id for all vehicles acquired before 2020." }, { "role": "assistant", "content": "SELECT make, model, year, depot_id FROM transportation.vehicles WHERE acquisition_date < '2020-01-01';" }, { "role": "user", "conte...
You are an SQL statement expert. Given the table 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": "Get the number of documents for each case, showing case_id and document count, ordered by count descending." }, { "role": "assistant", "content": "SELECT case_id,\n COUNT(*) AS document_count\nFROM legal_services.documents\nGROUP BY case_id\nORDER BY document_...
You are an SQL statement expert. Given the table 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": "List all prescriptions with medication details. Return prescription_id, patient full name, medication_name, and prescription_date." }, { "role": "assistant", "content": "SELECT pr.prescription_id,\n p.first_name || ' ' || p.last_name AS patient_name,\n 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.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "List the token_id, token_symbol, and token_name for all tokens where the symbol has more than 4 characters." }, { "role": "assistant", "content": "SELECT token_id, token_symbol, token_name FROM web3.tokens WHERE LENGTH(token_symbol) > 4;" }, { "role": "user"...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "Show me all premium payments where the actual payment date was after the due date. Include the payment ID, amount paid, payment date, and due date." }, { "role": "assistant", "content": "SELECT payment_id, amount_paid, payment_date, due_date FROM insurance.premium_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.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...