conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Show each service's name along with the total number of appointments scheduled and the number of unique locations these appointments are scheduled at." }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(a.application_id) AS appointment_count, COUNT(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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "For all scheduled appointments in the next 14 days, list the appointment ID, scheduled start time, the name of the service, and the standard fee." }, { "role": "assistant", "content": "SELECT a.appointment_id, a.scheduled_start_time, s.service_name, s.standard_fee\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.services ( service_id character varying(64) NOT NULL, -- unique identifier for the service ...
[ { "role": "user", "content": "For each customer, show the number of open accounts and their combined balance, joining the accounts table with itself on customer_id for demonstration." }, { "role": "assistant", "content": "SELECT a.customer_id, COUNT(a.account_id) AS open_accounts_count, SUM(a.ba...
You are an SQL statement expert. Given the table 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": "Find all currently employed staff whose managers are no longer employed. Show the employee's full name, hire date, the manager's full name, and the manager's termination_date." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employ...
You are an SQL statement expert. Given the table 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.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa...
[ { "role": "user", "content": "List all contracts along with their deployer address and status for contracts deployed on the same network as '0xabc123...'. Also, include the deployment timestamp." }, { "role": "assistant", "content": "SELECT c1.contract_id, c1.address, c1.deployer_address, c1.sta...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Which bed types are offered in each property and how many different room types are associated with each bed type?" }, { "role": "assistant", "content": "SELECT property_id, bed_type, COUNT(DISTINCT room_type_id) AS room_type_count FROM hospitality_technology.room_ty...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text, type_name text, description text, ...
[ { "role": "user", "content": "List all assets that have 'category' metadata. Show the asset ID and the value of the 'category'." }, { "role": "assistant", "content": "SELECT asset_id, value AS category FROM trading_platform.metadata WHERE key = 'category';" }, { "role": "user", "cont...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "Can you list each game alongside another game in the same genre but by a different developer?" }, { "role": "assistant", "content": "SELECT g1.genre, g1.title AS game1, g2.title AS game2\nFROM gaming_technology.games g1\nJOIN gaming_technology.games g2\n ON g1.genr...
You are an SQL statement expert. Given the table 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": "Which five license states have the highest count of active agents? Return the license_state and agent_count." }, { "role": "assistant", "content": "SELECT license_state,\n COUNT(*) AS agent_count\nFROM insurance.agents\nWHERE status = 'Active'\nGROUP BY licens...
You are an SQL statement expert. Given the table 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": "特定のコンポーネントの在庫情報を取得したいです。コンポーネントIDと在庫数量、倉庫の場所を含めてください。" }, { "role": "assistant", "content": "SELECT component_id, quantity, location_warehouse FROM component_inventory WHERE component_id = 'specific_component_id';" }, { "role": "user", "content": "さらに、受け...
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 Index 'component_inventory'. Mapping: { properties: { inventory_record_id: { type: 'keyword' }, c...
[ { "role": "user", "content": "Show me all diesel fuel logs where the quantity is more than 100 liters, including the vehicle ID and total cost." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, quantity, total_cost FROM transportation.fuel_logs WHERE fuel_type = 'diesel' AND...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "List all trades, showing the trade ID, account ID, and the ticker symbol and security name of the traded security." }, { "role": "assistant", "content": "SELECT t.trade_id, t.account_id, s.ticker_symbol, s.security_name FROM financial_services.trades AS t JOIN finan...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "List all diesel vehicles with a capacity greater than 20, showing their make, model, and year." }, { "role": "assistant", "content": "SELECT make, model, year FROM transportation.vehicles WHERE fuel_type = 'diesel' AND capacity > 20;" }, { "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.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "List all agents along with their manager's first and last name for agents whose status is 'active'." }, { "role": "assistant", "content": "SELECT a.agent_id,\n a.first_name AS agent_first_name,\n a.last_name AS agent_last_name,\n m.agent_id AS mana...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "Find the date (calendar day) with the highest total number of game sessions. Show the date and the total session count." }, { "role": "assistant", "content": "SELECT CAST(start_time AS DATE) AS session_date, COUNT(*) AS total_sessions\nFROM gaming_technology.game_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 gaming_technology.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ...
[ { "role": "user", "content": "Show the names and phone numbers of all law firms whose website ends with '.org'." }, { "role": "assistant", "content": "SELECT firm_name, phone\nFROM legal_services.law_firms\nWHERE website LIKE '%.org';" } ]
You are an SQL statement expert. Given the table 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": "Find tokens that have a positive price change percentage over the last 1 hour, 6 hours, and 24 hours. Display their symbol and chain." }, { "role": "assistant", "content": "SELECT token_symbol, chain FROM token_dexpool_info WHERE price_change_percentage_1h > 0 AND 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 token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "role": "user", "content": "List all unique actions that have been logged in the system." }, { "role": "assistant", "content": "SELECT DISTINCT action FROM trading_platform.logs;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp ) CREATE TAB...
[ { "role": "user", "content": "For each recipient address, count how many token transfers they have received." }, { "role": "assistant", "content": "SELECT to_address, COUNT(*) AS received_transfer_count FROM web3.token_transfers GROUP BY to_address;" }, { "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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ...
[ { "role": "user", "content": "Show me all fuel logs where the fuel type is diesel and the quantity is more than 100 liters, including the vehicle ID and location details." }, { "role": "assistant", "content": "SELECT fl.fuel_log_id, fl.vehicle_id, fl.quantity, l.name AS location_name, l.city FRO...
You are an SQL statement expert. Given the table 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": "Could you get the total spend on rare items for each player along with the player's username?" }, { "role": "assistant", "content": "SELECT p.player_id,\n p.username,\n SUM(pi.quantity * i.cost_amount) AS total_spend\nFROM gaming_technology.player_invent...
You are an SQL statement expert. Given the table 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": "Retrieve all billable but not yet billed time entries, showing entry_id, lawyer_id, case_id, hours_spent, and billing_rate." }, { "role": "assistant", "content": "SELECT entry_id, lawyer_id, case_id, hours_spent, billing_rate\nFROM legal_services.time_entries\nWHERE...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, case_number text UNIQUE, case_name text, client_id text, lead_lawyer_i...
[ { "role": "user", "content": "How many achievements has each player unlocked and what's the earliest unlocked timestamp for each?" }, { "role": "assistant", "content": "SELECT player_id,\n COUNT(*) AS total_unlocked,\n MIN(unlocked_at) AS first_unlocked\nFROM gaming_technology.player...
You are an SQL statement expert. Given the table 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": "Show me all drivers and the vehicles they are assigned for trips that have status 'Delayed'. Include driver first_name, driver last_name, vehicle license_plate, trip_id, and actual_departure." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, 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 character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Show all documents uploaded in 2024 along with the citizen's full name and the reference number of the associated application." }, { "role": "assistant", "content": "SELECT d.document_id, d.upload_timestamp, c.first_name || ' ' || c.last_name AS citizen_full_name, a...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "Show me all invoices for cases with status 'Closed'." }, { "role": "assistant", "content": "SELECT T1.* FROM legal_services.invoices AS T1 JOIN legal_services.cases AS T2 ON T1.case_id = T2.case_id WHERE T2.status = 'Closed';" }, { "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 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": "Show me the number of approval-for-all events for each ERC1155 contract in the erc1155_approval_for_all table." }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_for_all GROUP BY contract_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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "List all service appointments showing the appointment ID, the name of the service, and the city where the appointment is scheduled." }, { "role": "assistant", "content": "SELECT a.appointment_id, s.service_name, l.city\nFROM government_services.appointments a\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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show each player's ID along with the name and quantity of every item they have in their inventory. Join the player inventory with item details." }, { "role": "assistant", "content": "SELECT pi.player_id, igi.item_name, pi.quantity FROM gaming_technology.player_inven...
You are an SQL statement expert. Given the table 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": "Show me all insurance products with coverage details mentioning 'liability', along with their product names and base premiums." }, { "role": "assistant", "content": "SELECT product_name, base_premium, coverage_details FROM insurance.insurance_products WHERE coverage...
You are an SQL statement expert. Given the table 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": "Find all document types uploaded by citizens whose documents have an expiry date in 2024 and were uploaded at locations located in the state of 'Nevada'. List the document_id, document_type, and location_name." }, { "role": "assistant", "content": "SELECT d.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 government_services.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "Can you show me all insurance plans along with their provider and the type of plan? Please include the plan ID, plan name, insurance provider, and plan type." }, { "role": "assistant", "content": "SELECT plan_id, plan_name, insurance_provider, plan_type FROM healthc...
You are an SQL statement expert. Given the table 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 all cases that were opened and subsequently closed in the same calendar year. List the case name, case number, date opened, and date closed." }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened, date_closed FROM legal_services.cases...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "Show all SUI coin types with more than 6 decimals and status 'exists' in the metadata table." }, { "role": "assistant", "content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nWHERE status = 'exists' AND decimals > 6;" }, { "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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "List all appointments that have a location specified and their status is not 'Cancelled'. Show the appointment ID, subject, and location." }, { "role": "assistant", "content": "SELECT appointment_id, subject, location FROM legal_services.appointments WHERE location ...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, client_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Show me all insurance plans where the website includes 'secure'." }, { "role": "assistant", "content": "SELECT * FROM healthcare.insurance_plans WHERE website ILIKE '%secure%';" } ]
You are an SQL statement expert. Given the table 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": "List all employees who have a termination_date set, including their full name, department, and termination_date." }, { "role": "assistant", "content": "SELECT employee_id, first_name || ' ' || last_name AS full_name, department, termination_date FROM financial_servi...
You are an SQL statement expert. Given the table 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.employees ( employee_id character varying(64) NOT NULL, -- unique identifier for the employee ...
[ { "role": "user", "content": "How many posts has user 'U150' made so far?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS post_count\nFROM social_media.posts\nWHERE user_id = 'U150';" } ]
You are an SQL statement expert. Given the table 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": "Can you show me the first and last names of employees along with the first and last names of their managers?" }, { "role": "assistant", "content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, m.first_name AS manager_first_name, m.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 government_services.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa...
[ { "role": "user", "content": "Show smart money addresses with an ROI greater than 3 and a realized ratio greater than 0.7. Display the address, chain, ROI, realized ratio, and most profitable token." }, { "role": "assistant", "content": "SELECT address, chain, roi, realized_ratio, most_profit_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 cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "List the user IDs of users who are following user 'U300' and have also created a public post, showing their follower_user_id and the post_id." }, { "role": "assistant", "content": "SELECT T1.follower_user_id, T2.post_id FROM social_media.follows AS T1 JOIN 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.posts ( post_id text, user_id text, content text, media_url text, media_type text, created_at timestamp, u...
[ { "role": "user", "content": "Show the IDs and registration dates of all verified citizens who could be eligible for at least one active service. Display the citizen ID and registration date." }, { "role": "assistant", "content": "SELECT DISTINCT c.citizen_id, c.registration_date\nFROM governmen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "List all achievements (name and ID) that have not been unlocked by any player." }, { "role": "assistant", "content": "SELECT a.achievement_id, a.name FROM gaming_technology.achievements a LEFT JOIN gaming_technology.player_achievements pa ON a.achievement_id = pa.ac...
You are an SQL statement expert. Given the table 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.achievements ( achievement_id.uuid, game_id.uuid, name.text, description.text, icon_url.text, points....
[ { "role": "user", "content": "For each claim, retrieve the document_id, file_name, and uploaded_at of the earliest and the latest uploaded document." }, { "role": "assistant", "content": "SELECT\n c1.claim_id,\n c1.document_id AS earliest_document_id,\n c1.file_name AS earliest_file_nam...
You are an SQL statement expert. Given the table 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, claim_id text, document_type text, file_name text, file_path text, file_s...
[ { "role": "user", "content": "For each sender address that has sent at least 10 transactions, show the address and the total gas used by their transactions." }, { "role": "assistant", "content": "SELECT from_address, SUM(gas_used) AS total_gas_used\nFROM web3.transactions\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.transactions ( transaction_id.text, from_address.text, to_address.text, value.numeric, gas_used.integer, gas_price...
[ { "role": "user", "content": "For narratives listed in `narrative_info`, find the total USD value held by CEXes for tokens that are among their top 3 listed coins. Show the narrative and the total CEX USD value." }, { "role": "assistant", "content": "SELECT T2.narrative, SUM(T1.usd_value) AS Tot...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume...
[ { "role": "user", "content": "Show me each wallet address along with the number of unread notifications for the user who owns that wallet." }, { "role": "assistant", "content": "SELECT w.address, COUNT(n.notification_id) AS unread_count\nFROM trading_platform.wallets w\nJOIN trading_platform.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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Get each review with the next review date for the same guest." }, { "role": "assistant", "content": "SELECT guest_id, review_id, review_date,\n LEAD(review_date) OVER (PARTITION BY guest_id ORDER BY review_date) AS next_review_date\nFROM hospitality_technology...
You are an SQL statement expert. Given the table 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.reviews ( review_id.text, property_id.text, reservation_id.text, guest_id.text, rating_overall.i...
[ { "role": "user", "content": "For citizens who registered before January 1, 2023, show the total number of notifications sent to them for each channel. List the citizen's first name, last name, the channel, and the count of notifications." }, { "role": "assistant", "content": "SELECT\n T1.first...
You are an SQL statement expert. Given the table 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": "List the top 5 most used services across all properties. Show service_name and total quantity ordered, ordered by quantity descending." }, { "role": "assistant", "content": "SELECT s.service_name,\n SUM(o.quantity) AS total_quantity\nFROM hospitality_technolog...
You are an SQL statement expert. Given the table 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": "How many beneficiaries has each unique relationship type? List relationship and the count." }, { "role": "assistant", "content": "SELECT relationship, COUNT(*) AS beneficiary_count\nFROM insurance.policy_beneficiaries\nGROUP BY relationship;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la...
[ { "role": "user", "content": "Give me a list of all specializations available at each law firm." }, { "role": "assistant", "content": "SELECT DISTINCT firm_id, specialization\nFROM legal_services.lawyers;" }, { "role": "user", "content": "For each specialization, show the number of 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.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "List the names of service locations and categories of active services offered by the same agency." }, { "role": "assistant", "content": "SELECT sl.location_name, s.category\nFROM government_services.service_locations AS sl\nJOIN government_services.services AS s\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 text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "I want to know for each player, what's the average time interval in days between their achievement unlocks? Only show player_ids with at least 2 unlocks." }, { "role": "assistant", "content": "SELECT player_id, AVG(unlocked_at - LAG(unlocked_at) OVER (PARTITION BY 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 gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, achievement_id.uuid, unlocked_at.ti...
[ { "role": "user", "content": "Which players have played sessions on more than one distinct game? Show their player_id, username, and the number of unique games they've played." }, { "role": "assistant", "content": "SELECT p.player_id, p.username, COUNT(DISTINCT gs.game_id) AS unique_games_played...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt...
[ { "role": "user", "content": "List all claim documents along with the beneficiary first and last names and their relationship for policies where a document of type 'MEDICAL_REPORT' exists." }, { "role": "assistant", "content": "SELECT cd.document_id, cd.claim_id, cd.file_name, cd.document_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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "List all pairs of citizens who registered on the same date. Include each citizen's full name and the shared registration date." }, { "role": "assistant", "content": "SELECT c1.first_name || ' ' || c1.last_name AS full_name_1,\n c2.first_name || ' ' || c2.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 government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "Retrieve document names and the uploader's full name for all documents with version greater than 1." }, { "role": "assistant", "content": "SELECT d.document_name,\n l.first_name || ' ' || l.last_name AS uploader\nFROM legal_services.documents d\nJOIN legal_ser...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE 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 patients who have scheduled appointments with doctors specializing in Cardiology, along with their appointment times and the doctors' full names." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, a.appointment_time, d.first_name AS...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Which drivers have missing contact numbers or email addresses? Show their IDs and names." }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name FROM transportation.drivers WHERE contact_number IS NULL OR email IS NULL;" }, { "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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Which users have commented on posts created by the users they follow? Please show the commenter user_ids and the followed user_ids." }, { "role": "assistant", "content": "SELECT DISTINCT c.user_id AS commenter_user_id, f.following_user_id AS followed_user_id FROM so...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ...
[ { "role": "user", "content": "For each citizen, retrieve the count of notifications sent by each channel." }, { "role": "assistant", "content": "SELECT citizen_id,\n channel,\n COUNT(*) AS notification_count\nFROM government_services.notifications\nGROUP BY citizen_id, channel;" },...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "List all group conversation names along with the number of different users who have sent a message in each group." }, { "role": "assistant", "content": "SELECT c.group_name, COUNT(DISTINCT m.sender_user_id) AS unique_senders\nFROM social_media.conversations c\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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List all payments processed in the last 90 days, showing payment ID, amount, currency, method, and status." }, { "role": "assistant", "content": "SELECT payment_id, amount, currency_code, payment_method, status FROM hospitality_technology.payments WHERE payment_time...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "For each vehicle, show the first and last fueling events including their timestamps and the quantities refueled." }, { "role": "assistant", "content": "WITH first_last AS (\n SELECT\n vehicle_id,\n MIN(log_timestamp) AS first_time,\n MAX(log_timestamp) 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 transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry...
[ { "role": "user", "content": "Find pairs of insurance plans that are offered by the same insurance provider. Show the provider name, and the names of the two plans." }, { "role": "assistant", "content": "SELECT p1.insurance_provider, p1.plan_name, p2.plan_name FROM healthcare.insurance_plans p1 ...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, plan_name character varying(200) NOT NULL, insuran...
[ { "role": "user", "content": "I want to retrieve all claims with an estimated loss greater than 10000, including the claim ID, incident date, beneficiary first and last name, and relationship." }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, b.first_name, b.last_name, b...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara...
[ { "role": "user", "content": "Show me all electric vehicles that have had an oil change in the last 6 months, including the service date and cost." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, m.service_date, m.cost FROM transportation.vehicles v JOIN transportatio...
You are an SQL statement expert. Given the table 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": "Which lawyers have scheduled appointments at each location? Please list the lawyer_id, location, and the number of scheduled appointments per lawyer per location." }, { "role": "assistant", "content": "SELECT lawyer_id, location, COUNT(*) AS scheduled_appointments\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 legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "content": "Show me all active contracts on the 'ethereum' network along with their deployer addresses and the token names associated with those contracts if they exist." }, { "role": "assistant", "content": "SELECT c.contract_id, c.address, c.deployer_address, t.token_name FRO...
You are an SQL statement expert. Given the table 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": "List all transactions where the receiver is a smart contract address, along with the contract creation timestamp." }, { "role": "assistant", "content": "SELECT t.transaction_id, t.sender_address, t.receiver_address, t.amount, t.timestamp, c.creation_timestamp AS con...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id.text, block_id.text, sender_address.text, receiver_address.text, amount.numeri...
[ { "role": "user", "content": "How many patients have provided both a phone_number and emergency_contact_phone?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.patients WHERE phone_number IS NOT NULL AND emergency_contact_phone 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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Show me all claims with police reports that were filed in the last 3 months, along with the policy details and customer information." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, c.customer_id, c.incident_date, c.reported_date, c.description...
You are an SQL statement expert. Given the table 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": "List the usernames of players who own at least one item from the game with title 'Game Title X'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username FROM players AS T1 INNER JOIN player_inventory AS T2 ON T1.player_id = T2.player_id INNER JOIN items 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.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, ite...
[ { "role": "user", "content": "Provide each trip's ID, vehicle license plate, driver's full name, origin city, and destination city." }, { "role": "assistant", "content": "SELECT t.trip_id,\n v.license_plate,\n CONCAT(d.first_name, ' ', d.last_name) AS driver_name,\n lo.city 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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "List properties that have at least one room type with 'Queen' beds and at least one service in the 'Wellness' category." }, { "role": "assistant", "content": "SELECT DISTINCT T1.property_id FROM hospitality_technology.room_types AS T1 JOIN hospitality_technology.ser...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu...
[ { "role": "user", "content": "Show me all lawyers' full names, their bar number, and if they are partners, the full name of another partner from their firm." }, { "role": "assistant", "content": "SELECT l1.first_name || ' ' || l1.last_name AS lawyer_full_name, l1.bar_number,\n CASE WHEN l1...
You are an SQL statement expert. Given the table 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": "List all transactions where the receiver is a smart contract address, along with the contract creation timestamp." }, { "role": "assistant", "content": "SELECT t.*, sc.timestamp AS contract_creation_time FROM blockchain.transactions t JOIN blockchain.smart_contracts...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id character varying(64) NOT NULL, block_id character varying(64) NOT NULL, sende...
[ { "role": "user", "content": "Show me all documents that have a version greater than 2 and include the document name, upload timestamp, and description." }, { "role": "assistant", "content": "SELECT document_id, document_name, upload_timestamp, description FROM legal_services.documents WHERE ver...
You are an SQL statement expert. Given the table 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": "How many patients are there for each gender?" }, { "role": "assistant", "content": "SELECT gender, COUNT(*) AS patient_count\nFROM healthcare.patients\nGROUP BY gender;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me all transactions (transaction_id, amount, transaction_type) where the status is 'Completed' and the transaction_date is within the last 30 days, along with the security details (ticker_symbol, security_name) for securities traded on the same day as the transaction." }...
You are an SQL statement expert. Given the table 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": "Show the first 5 games released before 2015, displaying game_id and title." }, { "role": "assistant", "content": "SELECT game_id, title\nFROM gaming_technology.games\nWHERE release_date < '2015-01-01'\nLIMIT 5;" }, { "role": "user", "content": "Actually ...
You are an SQL statement expert. Given the table 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(), title character varying(200) NOT NULL, devel...
[ { "role": "user", "content": "Show a list of all wallet addresses along with the user_id who owns them, sorted by the wallet creation time." }, { "role": "assistant", "content": "SELECT user_id, address FROM web3.wallets ORDER BY created_at;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_id character...
[ { "role": "user", "content": "List all invoices with status 'Sent', including invoice_number and the associated case_name." }, { "role": "assistant", "content": "SELECT i.invoice_number, c.case_name\nFROM legal_services.invoices i\nJOIN legal_services.cases c\n ON i.case_id = c.case_id\nWHERE 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 legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer first_n...
[ { "role": "user", "content": "List all smart money addresses that have a negative PNL but a positive Realized Ratio. Show the address, chain, PNL, and Realized Ratio." }, { "role": "assistant", "content": "SELECT token_address, chain, pnl, realized_ratio FROM smart_money_token_performance 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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, net_flow.numeric, avg_cost.numeric,...
[ { "role": "user", "content": "List all posts where the content mentions 'meeting'." }, { "role": "assistant", "content": "SELECT post_id, user_id, content, created_at FROM social_media.posts WHERE content LIKE '%meeting%'" }, { "role": "user", "content": "Also, only include those pos...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ...
[ { "role": "user", "content": "What is the average number of wallets each user owns?" }, { "role": "assistant", "content": "SELECT\n AVG(wallet_count) AS avg_wallets_per_user\nFROM (\n SELECT user_id, COUNT(*) AS wallet_count\n FROM web3.wallets\n GROUP BY user_id\n) AS sub;" }, { "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 web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "Show me all room types with a base rate over $200 and max occupancy of at least 4, along with their property IDs and amenities." }, { "role": "assistant", "content": "SELECT room_type_id, property_id, amenities FROM hospitality_technology.room_types WHERE base_rate ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text, type_name text, description text, ...
[ { "role": "user", "content": "Show me the list of players who have never logged in since they registered." }, { "role": "assistant", "content": "SELECT player_id, username, registration_date\nFROM gaming_technology.players\nWHERE last_login IS NULL;" }, { "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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "For each relationship type among policy beneficiaries, show the average percentage_share and the count of unique beneficiaries. Please order the results with the highest average percentage_share first." }, { "role": "assistant", "content": "SELECT relationship, AVG(...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id.text, policy_id.text, customer_id.text, first_name.text, last_name.text...
[ { "role": "user", "content": "Find all pairs of distinct medications manufactured by the same company, showing med1.medication_id, med1.medication_name, med2.medication_id, med2.medication_name, and the manufacturer." }, { "role": "assistant", "content": "SELECT m1.medication_id AS med1_id, m1.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, medication_name.text, generic_name.text, manufacturer.text, ndc_code.text,...
[ { "role": "user", "content": "Show me the total fuel cost for each trip along with the trip's route number and the type of the route." }, { "role": "assistant", "content": "SELECT t.trip_id, r.route_number, r.type, SUM(f.total_cost) AS total_fuel_cost\nFROM transportation.trips t\nJOIN transport...
You are an SQL statement expert. Given the table 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": "Count the number of policies issued in each calendar year, and show the year and the count." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM issued_at), COUNT(*) FROM insurance.policies WHERE issued_at IS NOT NULL GROUP BY 1 ORDER BY 1;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin...
[ { "role": "user", "content": "List all pairs of token transfers occurring within the same transaction where one transferred value is greater than the other, showing both transfer IDs, the transaction ID, and both values." }, { "role": "assistant", "content": "SELECT t1.transaction_id,\n t1...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ...
[ { "role": "user", "content": "Show me each player's username and the total quantity of all items they possess." }, { "role": "assistant", "content": "SELECT p.username, SUM(pi.quantity) AS total_items FROM gaming_technology.player_inventory pi JOIN gaming_technology.players p ON pi.player_id = 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 gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for...
[ { "role": "user", "content": "Find guests born before 1990 who have 'Pet Friendly' in their preferences. List their full name (first and last) and date of birth." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM hospitality_technology.guests WHERE date_of_bi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, email.text, phone_number.text, date_of_...
[ { "role": "user", "content": "For each ERC20 token, how many unique wallets currently hold them? Show the contract address and unique wallet count." }, { "role": "assistant", "content": "SELECT contract_address, COUNT(DISTINCT wallet_address) AS unique_wallet_count FROM erc20_balances GROUP BY c...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "List the doctor ID, last name, and the date they were updated, for all doctors updated in the year 2024." }, { "role": "assistant", "content": "SELECT doctor_id, last_name, updated_at FROM healthcare.doctors WHERE updated_at >= '2024-01-01' AND updated_at < '2025-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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ch...
[ { "role": "user", "content": "Get all active SUI coins with their owner and balance." }, { "role": "assistant", "content": "SELECT coin_type, owner, balance\nFROM sui_coins\nWHERE status = 'active';" }, { "role": "user", "content": "Join metadata to include the coin symbol and decima...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Identify all sender addresses that have transferred tokens in more than 3 distinct transactions. Return from_address and transfer_count, ordered by transfer_count descending." }, { "role": "assistant", "content": "SELECT\n from_address,\n COUNT(DISTINCT transactio...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add...