conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "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": "List all service orders with quantity greater than 3, showing the order ID, total price, and the staff member who placed the order." }, { "role": "assistant", "content": "SELECT order_id, total_price, staff_id_ordered\nFROM hospitality_technology.service_orders\nWHE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id text, guest_id text, service_id text,...
[ { "role": "user", "content": "Show me all trades (trade_id, security_id, total_amount) executed by employees in the 'Investment' department, along with their employee_id and first_name." }, { "role": "assistant", "content": "SELECT t.trade_id, t.security_id, t.total_amount, e.employee_id, e.firs...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "How many active insurance policies does each patient have? Return patient_id and active_policy_count." }, { "role": "assistant", "content": "SELECT patient_id,\n COUNT(*) AS active_policy_count\nFROM healthcare.patient_insurance\nWHERE expiration_date IS 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, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "Find pairs of cases that belong to the same client, listing the case number, case name, and the shared client ID for each pair." }, { "role": "assistant", "content": "SELECT c1.case_number AS case_number_1, c1.case_name AS case_name_1, c2.case_number AS case_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 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 the scheduled start times and service names for all appointments, along with the description of those services." }, { "role": "assistant", "content": "SELECT a.scheduled_start_time, s.service_name, s.description\nFROM government_services.appointments a\nJOIN go...
You are an SQL statement expert. Given the table 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": "List fuel log entries where the cost per unit is greater than 5.00, showing the log ID, vehicle ID, timestamp, quantity, unit, and cost per unit." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, log_timestamp, quantity, unit, cost_per_unit FROM...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List all group conversations that have at least one unread notification, include the conversation ID, group name, and the count of unread notifications as unread_count." }, { "role": "assistant", "content": "SELECT c.conversation_id, c.group_name, COUNT(n.notificati...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ...
[ { "role": "user", "content": "Show me the subject and start times of all appointments along with the corresponding lawyer IDs for each client." }, { "role": "assistant", "content": "SELECT client_id, lawyer_id, subject, start_time FROM legal_services.appointments;" } ]
You are an SQL statement expert. Given the table 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 each room's number and the total amount of payments processed for that room." }, { "role": "assistant", "content": "SELECT r.room_number, SUM(p.amount) AS total_payments\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.payments p ON r.room_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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "Give me a list of the usernames and email addresses of users who have participated in at least one conversation." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email\nFROM social_media.users u\nJOIN social_media.conversation_participants cp ON ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Show all DApps that have metadata linked to an asset with a key of 'category', including the DApp name, URL, and the associated asset_id." }, { "role": "assistant", "content": "SELECT d.name, d.url, m.asset_id\nFROM trading_platform.dapps d\nJOIN trading_platform.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 trading_platform.utxos ( utxo_id character varying(64) NOT NULL, -- unique identifier for the UTXO transaction...
[ { "role": "user", "content": "How many service locations are marked as accessible?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.service_locations WHERE is_accessible = TRUE;" } ]
You are an SQL statement expert. Given the table 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 PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "How many players are there for each status in the players table?" }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS player_count\nFROM gaming_technology.players\nGROUP BY status;" }, { "role": "user", "content": "Exclude any rows where 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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "List all accounts having both a loan and at least one transaction in the last 7 days. Show account_id, account_type, and the total number of transactions in that period." }, { "role": "assistant", "content": "SELECT a.account_id, a.account_type, COUNT(t.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.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "Show me all cancelled policies with their cancellation reasons and premium amounts, sorted by cancellation date in descending order." }, { "role": "assistant", "content": "SELECT policy_id, cancellation_reason, premium_amount, cancellation_date FROM insurance.polici...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address, from the nft_holders table." }, { "role": "assistant", "content": "SELECT wallet_address, token_id, contract_address FROM nft_holders WHERE contract...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded ...
[ { "role": "user", "content": "List all developer names and their founded years, ordered from newest to oldest." }, { "role": "assistant", "content": "SELECT name, founded_year FROM gaming_technology.developers ORDER BY founded_year DESC;" }, { "role": "user", "content": "Show only de...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "List all pairs of tokens (show token_id for both) that share the same contract address, excluding pairs where the token_id is the same." }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id1, t2.token_id AS token_id2, t1.contract_address FROM web3.to...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha...
[ { "role": "user", "content": "List the name, city, state, and country for all locations with a latitude greater than 40 and a longitude less than -70." }, { "role": "assistant", "content": "SELECT name, city, state_province, country FROM transportation.locations WHERE latitude > 40 AND longitude...
You are an SQL statement expert. Given the table 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": "List all pairs of lawyers who share the same last name but have different first names. Show the first name, last name, and lawyer ID for both lawyers in each pair." }, { "role": "assistant", "content": "SELECT l1.first_name AS lawyer1_first_name, l1.last_name AS law...
You are an SQL statement expert. Given the table 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 documents uploaded for cases handled in the 'District Court' jurisdiction, showing the document name, case number, and upload timestamp." }, { "role": "assistant", "content": "SELECT d.document_name, cs.case_number, d.upload_timestamp\nFROM legal_services.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 legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "List the full name of citizens who have uploaded documents that were verified by an employee from the agency named 'City Hall Services'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 INNER ...
You are an SQL statement expert. Given the table 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": "Count the number of agents for each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.agents GROUP BY status;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Show me all bookings along with the full name and email of the passenger, the trip's scheduled departure time, and the assigned driver's full name." }, { "role": "assistant", "content": "SELECT b.booking_id, p.first_name || ' ' || p.last_name AS passenger_full_name,...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "List all properties with a star rating of 5.0, showing their name and city." }, { "role": "assistant", "content": "SELECT property_name, city FROM hospitality_technology.properties WHERE star_rating = 5.0;" }, { "role": "user", "content": "Now, also incl...
You are an SQL statement expert. Given the table 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": "Show me all properties in California with a star rating above 4.0, along with their room types and base rates, ordered by star rating in descending order." }, { "role": "assistant", "content": "SELECT p.property_name, p.star_rating, rt.type_name, rt.base_rate FROM h...
You are an SQL statement expert. Given the table 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": "Can you help me retrieve the details of all bookings for a specific route with route_id 'RT789', including the passenger names and the scheduled departure times?" }, { "role": "assistant", "content": "SELECT b.booking_id, p.first_name, p.last_name, s.departure_datet...
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 train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "I need a breakdown showing, for each game, how many in-game items exist per rarity category." }, { "role": "assistant", "content": "SELECT i.game_id,\n i.rarity,\n COUNT(*) AS item_count\nFROM gaming_technology.in_game_items i\nGROUP BY i.game_id, i.rari...
You are an SQL statement expert. Given the table 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": "Find all patients along with the number of unique diagnoses each has received. Only include patients who have at least two diagnoses." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, COUNT(DISTINCT d.diagnosis_id) AS num_diagnos...
You are an SQL statement expert. Given the table 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": "Which centralized exchange holds the highest total USD value of tokens in the 'AI' narrative, and what is that amount?" }, { "role": "assistant", "content": "SELECT cb.exchange, SUM(cb.usd_value) AS total_usd_value\nFROM cex_token_balance cb\nJOIN smart_money_token_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE narrative_info (", "narrative character varying(512) NOT NULL, -- the id of narrative", "top_3_coins text, --...
[ { "role": "user", "content": "Retrieve each game_id alongside the achievement with the highest points, showing its name and points." }, { "role": "assistant", "content": "SELECT a.game_id,\n a.name,\n a.points\nFROM achievements a\nJOIN (\n SELECT game_id,\n MAX(points) 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 gaming_technology.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name text, description text, icon_url t...
[ { "role": "user", "content": "Show the total payment amount and the count of payments for each payment method with status 'Completed'." }, { "role": "assistant", "content": "SELECT payment_method, SUM(amount), COUNT(*) FROM government_services.payments WHERE status = 'Completed' GROUP BY payment...
You are an SQL statement expert. Given the table 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.payments ( payment_id.text, application_id.text, citizen_id.text, service_id.text, amount.numeric, ...
[ { "role": "user", "content": "Can you help me retrieve the details of passengers who are part of a specific loyalty program with ID 'LOYALTY123'?" }, { "role": "assistant", "content": "db.passengers.find({ loyalty_program_id: 'LOYALTY123' }, { first_name: 1, last_name: 1, email: 1, phone_number:...
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 // db.createCollection('passengers') // Optional: db.passengers.createIndex({ passenger_id: 1 }, ...
[ { "role": "user", "content": "For each vehicle that has both maintenance and fuel log records, show the vehicle_id, make, model, count of maintenance_logs as maintenance_count, and count of fuel_logs as fuel_count." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Retrieve the most recent log entry for each user, including action and logged_at." }, { "role": "assistant", "content": "SELECT l1.user_id,\n l1.action,\n l1.logged_at\nFROM trading_platform.logs l1\nWHERE l1.logged_at = (\n SELECT MAX(l2.logged_at)\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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "I want to retrieve the product_name, base_premium, and created_at from insurance_products where the description contains the word 'comprehensive'." }, { "role": "assistant", "content": "SELECT product_name,\n base_premium,\n created_at\nFROM insurance.in...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Get all non-smoking rooms with status 'Available'." }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number, floor\nFROM hospitality_technology.rooms\nWHERE is_smoking = FALSE\n AND status = 'Available';" }, { "role": "user", "con...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Can you list the names of agencies that do not have a parent agency assigned, ordered by their established date?" }, { "role": "assistant", "content": "SELECT agency_id, agency_name, established_date\nFROM government_services.agencies\nWHERE parent_agency_id IS 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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.text, primary_contact_email.text, m...
[ { "role": "user", "content": "List all NFT collections where the floor price is greater than 0.5 ETH, including their names and contract addresses." }, { "role": "assistant", "content": "SELECT name, contract_address FROM nft_collections WHERE CAST(floor_price AS decimal) > 0.5 AND floor_price_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "List all beneficiaries who have a contact_info field containing an email address, showing their full names and relationship to the policyholder." }, { "role": "assistant", "content": "SELECT first_name, last_name, relationship FROM insurance.policy_beneficiaries WHE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text...
[ { "role": "user", "content": "List the first name and last name of each employee, along with the first and last name of their manager." }, { "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.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.employees ( employee_id character varying(64) NOT NULL, -- unique identifier for the government...
[ { "role": "user", "content": "Which SUI coins are owned by the address '0xSuperOwner'? Please list the object_id, coin_type, and balance." }, { "role": "assistant", "content": "SELECT object_id, coin_type, balance\nFROM sui_coins\nWHERE owner = '0xSuperOwner';" }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "List the names and prices of all services ordered by guests from 'Texas', along with the guest's full name." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, s.service_name, s.price\nFROM hospitality_technology.guests g\nJOIN hospitality_techn...
You are an SQL statement expert. Given the table 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": "Retrieve the name and description of services offered by agencies in the 'Federal' jurisdiction." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.description FROM government_services.services AS T1 JOIN government_services.agencies AS T2 ON T1.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": "What is the total count of game sessions recorded?" }, { "role": "assistant", "content": "SELECT count(*) FROM gaming_technology.game_sessions;" }, { "role": "user", "content": "Now, only count sessions that lasted longer than 1 hour." }, { "role...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "How many unique projects are there in the project_fundraising_record table, and what's their average investment value?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT project_id) AS unique_project_count, AVG(investment_value) AS avg_investment_value\nFR...
You are an SQL statement expert. Given the table 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 time entries for case ID 'case_abc', including the entry ID, date worked, hours spent, and the first and last name of the lawyer." }, { "role": "assistant", "content": "SELECT te.entry_id, te.date_worked, te.hours_spent, l.first_name, l.last_name FROM le...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu...
[ { "role": "user", "content": "How many appointments were created in the last 24 hours?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.appointments WHERE created_at >= NOW() - INTERVAL '24 hours';" } ]
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, patient_id character varying(64) NOT NULL, doc...
[ { "role": "user", "content": "How many unread notifications are there with the type 'mention'?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.notifications WHERE read_at IS NULL AND notification_type = 'mention';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp, last_message_at timestamp, is_grou...
[ { "role": "user", "content": "Retrieve all beneficiaries with their policy numbers, including beneficiary first and last name, relationship, and the policy end date." }, { "role": "assistant", "content": "SELECT pb.beneficiary_id, pb.first_name, pb.last_name, pb.relationship, p.policy_number, 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.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "Find the names of service locations where services categorized as 'Licensing' have had appointments scheduled." }, { "role": "assistant", "content": "SELECT DISTINCT T1.location_name FROM service_locations AS T1 JOIN appointments AS T2 ON T1.location_id = T2.locatio...
You are an SQL statement expert. Given the table 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": "Find the contract address and name for all NFT collections listed on the 'Ethereum' blockchain." }, { "role": "assistant", "content": "SELECT contract_address, name FROM nft_collections WHERE blockchain = 'Ethereum'" }, { "role": "user", "content": "For ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "List all beneficiaries added to any policy in March 2024, including their beneficiary_id, policy_id, first and last name." }, { "role": "assistant", "content": "SELECT beneficiary_id, policy_id, first_name, last_name\nFROM insurance.policy_beneficiaries\nWHERE added...
You are an SQL statement expert. Given the table 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": "Can you show me the count of items and the average cost_amount for each item_type and rarity?" }, { "role": "assistant", "content": "SELECT item_type, rarity, COUNT(*) AS item_count, AVG(cost_amount) AS avg_cost_amount\nFROM gaming_technology.in_game_items\nGROUP BY...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), game_id uuid NOT NULL, item_name cha...
[ { "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": "I want to know how many vehicles are assigned to each depot_id." }, { "role": "assistant", "content": "SELECT depot_id, COUNT(*) AS vehicle_count FROM transportation.vehicles GROUP BY depot_id;" }, { "role": "user", "content": "Please only include depots...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Show me a list of all patients and the doctors who have made diagnoses for them. For each, include patient ID, patient full name, doctor ID, and doctor full name." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name AS patient_first_name, p.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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Provide a count of appointments grouped by their current status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM government_services.appointments 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show the latest time each player acquired any item." }, { "role": "assistant", "content": "SELECT player_id, MAX(acquired_at) AS last_acquired_at FROM gaming_technology.player_inventory GROUP BY player_id;" }, { "role": "user", "content": "Actually, can ...
You are an SQL statement expert. Given the table 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 the total count of active insurance products." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM insurance.insurance_products WHERE is_active = TRUE;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, -- unique identifier for the insurance pr...
[ { "role": "user", "content": "List the total number of items acquired by each player, grouped by rarity, for items that have been acquired at least twice." }, { "role": "assistant", "content": "SELECT pi.player_id, igi.rarity, SUM(pi.quantity) AS total_acquired\nFROM gaming_technology.player_inv...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "Show all likes made by user 'U555' on comments, including the comment_id and like creation time." }, { "role": "assistant", "content": "SELECT like_id, comment_id, created_at\nFROM social_media.likes\nWHERE user_id = 'U555' AND comment_id 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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u...
[ { "role": "user", "content": "I want to know how many hashtags have been used for posts whose IDs correspond to conversation IDs. Return conversation_id and hashtag_count." }, { "role": "assistant", "content": "SELECT cp.conversation_id, COUNT(ph.hashtag_id) AS hashtag_count\nFROM social_media.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 social_media.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, -- unique identifier for the post-hash...
[ { "role": "user", "content": "Show me the usernames and the group names of group chats where each user has posted at least one post containing a hashtag." }, { "role": "assistant", "content": "SELECT u.username, c.group_name\nFROM social_media.users u\nJOIN social_media.posts p ON u.user_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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, full_name.text, profile_picture_url.t...
[ { "role": "user", "content": "List all premium payments made via credit card in the last 30 days, showing their policy IDs and payment amounts." }, { "role": "assistant", "content": "SELECT policy_id, amount_paid FROM insurance.premium_payments WHERE payment_method = 'credit card' AND payment_da...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "How many employees are currently not terminated?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.employees WHERE termination_date IS 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Show all pairs of patients and doctors who are linked by a prescription, listing the patient's full name and the doctor's full name." }, { "role": "assistant", "content": "SELECT DISTINCT\n p.first_name AS patient_first_name,\n p.last_name AS patient_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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "What is the average balance of all addresses in the database?" }, { "role": "assistant", "content": "SELECT AVG(balance) AS average_balance FROM blockchain.addresses;" }, { "role": "user", "content": "Can you break this down by the first 3 characters of ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.addresses ( address_id text PRIMARY KEY, public_key text, balance numeric )
[ { "role": "user", "content": "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": "List all pairs of accounts belonging to the same customer but with different currencies. Show both account numbers, currencies, and balances." }, { "role": "assistant", "content": "SELECT a.account_number AS account_a, a.currency AS currency_a, a.balance AS balance_...
You are an SQL statement expert. Given the table 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": "Can you write a query that retrieves each server's name, its region, and the highest current player count observed in that region?" }, { "role": "assistant", "content": "SELECT s.server_name, s.region, m.max_current_players\nFROM gaming_technology.servers s\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 gaming_technology.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_id uuid NOT NULL, server_name chara...
[ { "role": "user", "content": "Show me all users who have unread notifications sent in the last 7 days, along with the notification message and when it was sent." }, { "role": "assistant", "content": "SELECT user_id, message, sent_at FROM trading_platform.notifications WHERE read_at IS NULL AND 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 trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, message text, sent_at timestamp, read_...
[ { "role": "user", "content": "List all claim documents where the file name contains 'invoice' (case insensitive), showing the document ID, claim ID, file name, and uploaded_at." }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_name, uploaded_at\nFROM insurance.claim_docum...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "Which service locations are not accessible and belong to agencies with a jurisdiction level of 'Local'? Show the location name and city." }, { "role": "assistant", "content": "SELECT sl.location_name, sl.city\nFROM government_services.service_locations sl\nINNER JOI...
You are an SQL statement expert. Given the table 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": "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 full name of each citizen who has an appointment scheduled at the 'Downtown DMV Office', along with the appointment ID, the scheduled start time, and the full name of the assigned employee." }, { "role": "assistant", "content": "SELECT c.first_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 character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "能否帮我统计数据库中每个城市的车站数量?" }, { "role": "assistant", "content": "SELECT city, COUNT(*) AS station_count\nFROM stations\nGROUP BY city\nORDER BY station_count DESC;" } ]
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 // PUT /stations { "mappings": { "properties": { "station_id": { "type": "keyword" },...
[ { "role": "user", "content": "Which invoices have the exact same total_amount as another invoice? List the invoice_id and total_amount for each one." }, { "role": "assistant", "content": "SELECT invoice_id, total_amount\nFROM legal_services.invoices\nWHERE total_amount IN (\n SELECT total_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 legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, client_id text, case_id text, issue_...
[ { "role": "user", "content": "List all pairs of beneficiaries on the same policy, showing policy_id, beneficiary1_id, beneficiary1 first_name, beneficiary1 last_name, beneficiary2_id, beneficiary2 first_name, and beneficiary2 last_name." }, { "role": "assistant", "content": "SELECT b1.policy_id,...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text...
[ { "role": "user", "content": "List all pairs of law firms founded in the same year, showing both firm names and their shared founding year." }, { "role": "assistant", "content": "SELECT lf1.firm_name AS firm1, lf2.firm_name AS firm2, EXTRACT(YEAR FROM lf1.founded_date) AS founded_year\nFROM lega...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, phone text, website text, founded_da...
[ { "role": "user", "content": "List all appointments scheduled for the service named 'Passport Renewal', showing the appointment ID, citizen ID, and scheduled start time." }, { "role": "assistant", "content": "SELECT T1.appointment_id, T1.citizen_id, T1.scheduled_start_time FROM government_servic...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id text, location_id text, service_id...
[ { "role": "user", "content": "Show me all users who have wallets but have never placed any orders, along with their wallet creation dates." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, w.wallet_id, w.created_at FROM trading_platform.users u JOIN trading_platform.wallets w ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "Show me all reviews with ratings of 5 stars, including the guest name, property ID, and review date, ordered by review date from newest to oldest." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, r.property_id, rv.review_date FROM hospitality...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, property_id character varying(64) NOT ...
[ { "role": "user", "content": "For each patient, find the next appointment after each one. Return patient_id, appointment_id AS current_appointment, next_appointment_id, and waiting_time in minutes." }, { "role": "assistant", "content": "SELECT a.patient_id,\n a.appointment_id AS current_ap...
You are an SQL statement expert. Given the table 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": "List all bookings with the passenger's full name, booking status, and fare amount, but only for bookings where the fare is greater than 50." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, b.status, b.fare FROM transportation.bookings b 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Show me the number of rooms by current_condition." }, { "role": "assistant", "content": "SELECT current_condition, COUNT(*) AS room_count FROM hospitality_technology.rooms GROUP BY current_condition;" }, { "role": "user", "content": "Actually, only inclu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, room...
[ { "role": "user", "content": "I want to find pairs of service locations within the same city but with different postal codes. Show both location IDs and the city." }, { "role": "assistant", "content": "SELECT a.location_id AS location_id1, b.location_id AS location_id2, a.city\nFROM service_loca...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.service_locations ( location_id text PRIMARY KEY, agency_id text, location_name text, address text,...
[ { "role": "user", "content": "Find all users who have placed buy orders but never sell orders, along with their email addresses." }, { "role": "assistant", "content": "SELECT DISTINCT u.user_id, u.email FROM trading_platform.users u JOIN trading_platform.orders o ON u.user_id = o.user_id WHERE o...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "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": "Show me the latest price and symbol for all tokens listed in the token_prices_latest table." }, { "role": "assistant", "content": "SELECT symbol, price FROM token_prices_latest;" }, { "role": "user", "content": "Filter that to only show tokens on the 'bi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "List the top 5 smart money addresses by their total Profit (PNL). Show the address, chain, and total PNL." }, { "role": "assistant", "content": "SELECT token_address, chain, SUM(pnl) AS total_pnl FROM smart_money_token_performance GROUP BY token_address, chain ORDER...
You are an SQL statement expert. Given the table 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 top-level comments (comments without a parent_comment_id), showing the comment ID and content." }, { "role": "assistant", "content": "SELECT comment_id, content FROM social_media.comments WHERE parent_comment_id IS 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 social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_id.text, content.text, created_at.t...
[ { "role": "user", "content": "For each player, show how many achievements they have unlocked in games with items of type 'Consumable'." }, { "role": "assistant", "content": "SELECT pa.player_id, COUNT(DISTINCT pa.achievement_id) AS achievements_unlocked\nFROM gaming_technology.player_achievement...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "Show me the top 5 NFT collections with the highest floor price on Ethereum, along with their names and symbols, but only include collections with more than 10,000 tokens." }, { "role": "assistant", "content": "SELECT name, symbol, floor_price FROM nft_collections WH...
You are an SQL statement expert. Given the table 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": "What is the average ROI for tokens with a realized ratio above 50% across all chains?" }, { "role": "assistant", "content": "SELECT AVG(roi) AS average_roi FROM smart_money_token_performance WHERE realized_ratio > 50;" } ]
You are an SQL statement expert. Given the table 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 character varying(100) NOT NULL, -- the token's address token_symbol char...
[ { "role": "user", "content": "List all active reservations with their guest names and room numbers, ordered by check-in date." }, { "role": "assistant", "content": "SELECT r.reservation_id, g.first_name, g.last_name, ro.room_number, r.check_in_date FROM hospitality_technology.reservations r 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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show me all appointments scheduled to last exactly 60 minutes." }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, doctor_id, appointment_time, duration_minutes, status\nFROM healthcare.appointments\nWHERE duration_minutes = 60;" } ]
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the appointment ...
[ { "role": "user", "content": "How many unique wallets hold each NFT (by contract_address and token_id) currently?" }, { "role": "assistant", "content": "SELECT contract_address, token_id, COUNT(DISTINCT wallet_address) AS holder_count\nFROM nft_holders\nGROUP BY contract_address, token_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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Which SUI coins have 'exists' status and what is the total balance across all owners for each coin_type? Please include coin_type, symbol, name, and total_balance." }, { "role": "assistant", "content": "SELECT sc.coin_type,\n sm.symbol,\n sm.name,\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_...