conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List all beneficiaries who have a percentage share greater than 50% on a policy. Please include the beneficiary's first name, last name, relationship, the policy ID, and the policy's start date." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_na...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id character varying(64) NOT NULL, -- unique identifier for the benefi...
[ { "role": "user", "content": "List all maintenance logs for vehicles that are currently active, showing the vehicle ID and service type." }, { "role": "assistant", "content": "SELECT m.vehicle_id, m.service_type FROM transportation.maintenance_logs m JOIN transportation.vehicles v ON m.vehicle_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "Which locations have received fuel logs greater than 300 liters in total? Please include the location name and city." }, { "role": "assistant", "content": "SELECT l.name AS location_name, l.city, SUM(f.quantity) AS total_quantity\nFROM transportation.fuel_logs f\nJO...
You are an SQL statement expert. Given the table 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": "For each property, list the property name and the count of payments processed." }, { "role": "assistant", "content": "SELECT\n prop.property_name,\n COUNT(p.payment_id) AS payment_count\nFROM hospitality_technology.properties AS prop\nJOIN hospitality_technology.r...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show me the number of players registered in each country, along with the number of different games available for each country." }, { "role": "assistant", "content": "SELECT p.country_code, COUNT(DISTINCT p.player_id) AS player_count, COUNT(DISTINCT g.game_id) AS gam...
You are an SQL statement expert. Given the table 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": "Which chain has the highest average ROI among all tokens in smart_money_token_performance? Show the chain and the average ROI." }, { "role": "assistant", "content": "SELECT chain, AVG(roi) AS avg_roi\nFROM smart_money_token_performance\nGROUP BY chain\nORDER BY 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 project_fundraising_record ( id text, project_id text, project_name text, rounds_name text, investment_value numeric, i...
[ { "role": "user", "content": "Show me all transfer activities for the token tick 'PEPE', including the sender, receiver, and amount." }, { "role": "assistant", "content": "SELECT from_address, to_address, amt FROM token_activities WHERE tick = 'PEPE' AND type = 'transfer'" }, { "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 erc20_balances ( block_number bigint, contract_address text, wallet_address text, amount text, pk text ) CREATE TABLE n...
[ { "role": "user", "content": "Which room types have a base rate above 250 USD, and what are their maximum occupancies?" }, { "role": "assistant", "content": "SELECT room_type_id, type_name, base_rate, max_occupancy\nFROM hospitality_technology.room_types\nWHERE base_rate > 250;" }, { "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 hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, -- unique identifier for the room ...
[ { "role": "user", "content": "Find employees who were hired after their managers. Display the employee's full name, their hire date, the manager's full name, and the manager's hire date." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_name, e.hire_dat...
You are an SQL statement expert. Given the table 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": "Show me the list of all employees along with the name and city of the service location where their agency operates." }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name, e.last_name, sl.location_name, sl.city FROM government_services.employees e...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.employees ( employee_id text, agency_id text, first_name text, last_name text, job_title text, depa...
[ { "role": "user", "content": "Give me the website for the insurance plan named 'Family Advantage'." }, { "role": "assistant", "content": "SELECT website FROM healthcare.insurance_plans WHERE plan_name = 'Family Advantage';" } ]
You are an SQL statement expert. Given the table 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 PRIMARY KEY, plan_name text, insurance_provider text, plan_type text, contact...
[ { "role": "user", "content": "Can you show me each doctor and the number of prescriptions they wrote for each patient they treated? Include the doctor's full name, the patient's full name, and the total count of prescriptions." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_na...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List all loans that share the same collateral_description with another loan from a different account. For each pair, display collateral_description, loan_id as loan_a, account_id as account_a, loan_id as loan_b, and account_id as account_b." }, { "role": "assistant", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.loans ( loan_id text PRIMARY KEY, account_id text, loan_type text, principal_amount numeric, current...
[ { "role": "user", "content": "Find all pairs of drivers who were hired on the same date. For each pair, show the first_name and last_name of both drivers as driver1_first, driver1_last, driver2_first, driver2_last, and their shared hire_date." }, { "role": "assistant", "content": "SELECT d1.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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "Find the top 3 transactions by total transfer value (sum of all transfers in the transaction), showing the transaction_id and total value." }, { "role": "assistant", "content": "SELECT transaction_id, SUM(value) as total_value FROM web3.token_transfers GROUP BY tran...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.token_transfers ( transfer_id.text, token_id.text, from_address.text, to_address.text, value.numeric, transaction_...
[ { "role": "user", "content": "Can you show me the number of lawyers grouped by specialization?" }, { "role": "assistant", "content": "SELECT specialization, COUNT(*) AS lawyer_count FROM lawyers GROUP BY specialization;" }, { "role": "user", "content": "Include only specializations t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "For each Avalanche token tick, show me the creator from the `token_info_avalanche` table and the total number of activities recorded for that tick in the `token_activities` table." }, { "role": "assistant", "content": "SELECT ti.tick, ti.creator, COUNT(ta.tx_hash) 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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "Show me all SUI coins with status 'exists' and their symbol, name, and the number of decimals." }, { "role": "assistant", "content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nWHERE status = 'exists';" }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Show the name and city of all maintenance facility locations and include the total number of maintenance logs performed at each location." }, { "role": "assistant", "content": "SELECT l.name, l.city, COUNT(m.log_id) AS maintenance_count\nFROM transportation.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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "List the names of all clients that are associated with cases led by lawyers specializing in 'Intellectual Property'." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name, c.last_name\nFROM legal_services.cases cs\nJOIN legal_services.clients c ON cs.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 legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "List all unique service categories and the count of services in each category." }, { "role": "assistant", "content": "SELECT category, COUNT(service_id) FROM hospitality_technology.services GROUP BY category;" }, { "role": "user", "content": "Only includ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "I want to find each user’s total count of completed orders and the last action they logged." }, { "role": "assistant", "content": "SELECT\n o.user_id,\n COUNT(*) AS completed_order_count,\n MAX(l.logged_at) AS last_log_time,\n (SELECT action\n FROM trading_pla...
You are an SQL statement expert. Given the table 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.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan...
[ { "role": "user", "content": "List all chronic diagnoses made by Cardiology specialists in the last year, including the patient ID, diagnosis description, and doctor's full name." }, { "role": "assistant", "content": "SELECT dg.patient_id, dg.description, d.first_name || ' ' || d.last_name AS do...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "Show the payment_id and amount_paid for all premium payments where the status is 'pending'." }, { "role": "assistant", "content": "SELECT payment_id, amount_paid\nFROM insurance.premium_payments\nWHERE status = 'pending';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_name character varying(150) NOT NULL,...
[ { "role": "user", "content": "How many appointments have a status of 'Cancelled'?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM legal_services.appointments WHERE status = 'Cancelled';" } ]
You are an SQL statement expert. Given the table 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": "I want to list all pairs of customers living in the same city with different risk profiles." }, { "role": "assistant", "content": "SELECT a.customer_id AS customer_a,\n b.customer_id AS customer_b,\n a.city,\n a.risk_profile AS risk_a,\n b.ri...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "Give me each server's name, the region, and the maximum number of players that have been connected at once." }, { "role": "assistant", "content": "SELECT s.server_id, s.server_name, s.region, MAX(s.current_players) AS max_players_seen\nFROM gaming_technology.servers...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "Show me all active customers created in the last 30 days." }, { "role": "assistant", "content": "SELECT *\nFROM financial_services.customers\nWHERE status = 'Active'\n AND created_at >= CURRENT_DATE - INTERVAL '30 days';" }, { "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 financial_services.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer ...
[ { "role": "user", "content": "Could you list all pairs of developers in the same country but different companies? Return developer1, developer2, and country." }, { "role": "assistant", "content": "SELECT d1.name AS developer1,\n d2.name AS developer2,\n d1.country\nFROM gaming_techno...
You are an SQL statement expert. Given the table 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": "For each player, count how many unique games they have played." }, { "role": "assistant", "content": "SELECT player_id, COUNT(DISTINCT game_id) AS unique_games_played FROM gaming_technology.game_sessions GROUP BY player_id;" }, { "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.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date...
[ { "role": "user", "content": "Can you list all group conversations and the number of participants in each?" }, { "role": "assistant", "content": "SELECT c.conversation_id, c.group_name, COUNT(cp.user_id) AS participant_count\nFROM social_media.conversations c\nJOIN social_media.conversation_part...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "List the user IDs, theme, and updated_at for users who have disabled email notifications, enabled push notifications, and have a private profile." }, { "role": "assistant", "content": "SELECT user_id, theme, updated_at FROM social_media.user_settings WHERE email_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 social_media.user_settings ( setting_id.text, user_id.text, theme.text, email_notifications_enabled.boolean, push_notif...
[ { "role": "user", "content": "Count the number of orders in each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS order_count\nFROM trading_platform.orders\nGROUP 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 trading_platform.orders ( order_id.text, user_id.text, wallet_id.text, asset_id.text, order_type.text, quantity.numeric...
[ { "role": "user", "content": "Show all room types that offer 'WiFi' in their amenities." }, { "role": "assistant", "content": "SELECT room_type_id, property_id, type_name, amenities FROM hospitality_technology.room_types WHERE amenities LIKE '%WiFi%';" }, { "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 hospitality_technology.room_types ( room_type_id.text, property_id.text, type_name.text, description.text, base_rate.nu...
[ { "role": "user", "content": "Which exchanges have a total token USD value greater than 3,000,000 on the Polygon chain? Show the exchange name and their total USD value." }, { "role": "assistant", "content": "SELECT exchange, SUM(usd_value) AS total_usd_value\nFROM cex_token_balance\nWHERE chain...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show me the top 5 hashtags by number of distinct public posts they're used in. Return tag_name and post_count." }, { "role": "assistant", "content": "SELECT h.tag_name,\n COUNT(DISTINCT ph.post_id) AS post_count\nFROM social_media.hashtags AS h\nJOIN social_me...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "List all review IDs, comments, and overall ratings for reviews submitted for property 'P123'." }, { "role": "assistant", "content": "SELECT review_id, comment, rating_overall FROM hospitality_technology.reviews WHERE property_id = 'P123';" }, { "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 hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.text, guest_id.text, rating_overall.i...
[ { "role": "user", "content": "List all properties with their property ID, property name, and the total number of active staff currently assigned to them." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, COUNT(s.staff_id) AS active_staff_count\nFROM hospitality_techno...
You are an SQL statement expert. Given the table 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": "List all doctors who have made more than 10 diagnoses with status 'Active', including their full names and specialties." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, d.specialty, COUNT(di.diagnosis_id) AS active_diagnoses_count FROM health...
You are an SQL statement expert. Given the table 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 total and average amount of unspent UTXOs per address?" }, { "role": "assistant", "content": "SELECT\n address,\n COUNT(*) AS utxo_count,\n SUM(amount) AS total_unspent_amount,\n AVG(amount) AS average_unspent_amount\nFROM trading_platform.utxos\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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan...
[ { "role": "user", "content": "I want to retrieve a list of all doctors along with every insurance plan name, showing doctor ID, first and last names, and insurance plan name." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, p.plan_name\nFROM healthcare.doctor...
You are an SQL statement expert. Given the table 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, -- unique identifier for the doctor first_name ...
[ { "role": "user", "content": "What is the total number of drivers hired each year? Provide the hire_year and driver_count." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM hire_date) AS hire_year,\n COUNT(*) AS driver_count\nFROM transportation.drivers\nGROU...
You are an SQL statement expert. Given the table 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": "Find all prescriptions for patients who have at least one appointment scheduled in the future. Show the prescription ID, patient ID, medication name, and the earliest future appointment time for that patient." }, { "role": "assistant", "content": "SELECT pr.prescrip...
You are an SQL statement expert. Given the table 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 each contract along with the deployer address, and status for contracts deployed on network_id 'mainnet'." }, { "role": "assistant", "content": "SELECT contract_id, address, deployer_address, status FROM web3.contracts WHERE network_id = 'mainnet';" } ]
You are an SQL statement expert. Given the table 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": "For each user, list their user_id along with their first and last notification messages and the sent_at timestamps." }, { "role": "assistant", "content": "WITH firsts AS (\n SELECT user_id, notification_id AS first_id, message AS first_message, sent_at AS first_sen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, message text, sent_at timestamp, read_...
[ { "role": "user", "content": "Show the name and type of all locations. Also include the country." }, { "role": "assistant", "content": "SELECT name, type, country FROM transportation.locations;" }, { "role": "user", "content": "Now, only show locations located in France and order the...
You are an SQL statement expert. Given the table 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": "能否帮我查询特定路线(route_id 为 'route_ne_corr')上的所有车站信息,并包含每个车站的平台数量?" }, { "role": "assistant", "content": "ZRANGE route:route_ne_corr:stops 0 -1\nHGETALL route_station:<route_station_id> for each route_station_id in result\nHGETALL station:<station_id> for each station_id ...
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 // Use Hashes to store station details. Key format: station:<station_id> // Example: // HSET stat...
[ { "role": "user", "content": "Show me all staff members along with their positions and the names of the properties they work at." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name\nFROM hospitality_technology.staff s\nJOIN 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.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show me all premium payments made by customer with ID 'CUST789'." }, { "role": "assistant", "content": "SELECT * FROM insurance.premium_payments WHERE customer_id = 'CUST789';" }, { "role": "user", "content": "From those payments, only include the ones 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 insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, custo...
[ { "role": "user", "content": "Can you list the names of achievements and the length of their descriptions? Show the ones with the longest descriptions first." }, { "role": "assistant", "content": "SELECT name, LENGTH(description) AS description_length FROM achievements ORDER BY description_lengt...
You are an SQL statement expert. Given the table 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 NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for a...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name) from California (state = 'CA') who have taken out a home loan (loan_type = 'Home'), along with their loan details (loan_id, principal_amount, interest_rate)." }, { "role": "assistant", "content": "SELECT c.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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "Summarize trade activity by account and execution venue, showing the total quantity of shares traded and the average commission paid." }, { "role": "assistant", "content": "SELECT account_id, execution_venue, SUM(quantity) AS total_quantity, AVG(commission) AS avera...
You are an SQL statement expert. Given the table 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.trades ( trade_id text, account_id text, security_id text, order_id text, trade_type text, quantity ...
[ { "role": "user", "content": "Show the total number of reservations for each booking source." }, { "role": "assistant", "content": "SELECT booking_source, COUNT(*) FROM hospitality_technology.reservations GROUP BY booking_source" }, { "role": "user", "content": "Also include the tota...
You are an SQL statement expert. Given the table 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": "Find pairs of token transfers within the same transaction and for the same token, where the value of one transfer is exactly twice the value of the other. Show the transaction ID, token ID, and both transfer IDs and their values." }, { "role": "assistant", "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 character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "List all employees and their managers, showing the full name for both the employee and their manager." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_name, m.first_name || ' ' || m.last_name AS manager_name FROM financial...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id character varying(64) NOT NULL, account_id character varying(64) NOT N...
[ { "role": "user", "content": "Give me the number of active customers grouped by city." }, { "role": "assistant", "content": "SELECT city, COUNT(*) AS customer_count FROM financial_services.customers WHERE status = 'Active' GROUP BY city;" }, { "role": "user", "content": "Actually, 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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "For each chain, find the token with the highest price and the token with the lowest price. List chain, high_price_token, max_price, low_price_token, and min_price." }, { "role": "assistant", "content": "WITH max_prices AS (\n SELECT chain,\n token_symbol 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 token_dexpool_info (", "pair_address character varying(512) NOT NULL, -- the id of dexpool", "token_name cha...
[ { "role": "user", "content": "Provide a count of notifications, separated by whether they have been read or not." }, { "role": "assistant", "content": "SELECT CASE WHEN T1.read_at IS NULL THEN 'Unread' ELSE 'Read' END, count(T1.notification_id) FROM trading_platform.notifications AS T1 GROUP BY ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id.text, user_id.text, message.text, sent_at.timestamp, read_at.timestamp...
[ { "role": "user", "content": "List all distinct job titles present in the organization." }, { "role": "assistant", "content": "SELECT DISTINCT job_title FROM government_services.employees;" } ]
You are an SQL statement expert. Given the table 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": "List each transaction along with its status and the names of any events that were emitted during that transaction." }, { "role": "assistant", "content": "SELECT tr.transaction_id, tr.status, e.event_name\nFROM web3.transactions tr\nLEFT JOIN web3.events e ON tr.tran...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "For token transfers, list total transfer volume and number of transfers per token tick in the last 7 days." }, { "role": "assistant", "content": "WITH agg AS (\n SELECT tick,\n SUM(amt) AS total_volume,\n COUNT(*) AS transfer_count\n FROM token_act...
You are an SQL statement expert. Given the table 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 each user and their total number of followers, including username, ordered by follower count descending." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(f.follower_user_id) AS follower_count FROM social_media.users u LEFT JOIN social_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "List all employees (employee_id, first_name, last_name) who have processed trades with a commission greater than $500." }, { "role": "assistant", "content": "SELECT DISTINCT e.employee_id, e.first_name, e.last_name FROM financial_services.employees e JOIN financial_...
You are an SQL statement expert. Given the table 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.trades ( trade_id.text, account_id.text, security_id.text, order_id.text, trade_type.text, quantity....
[ { "role": "user", "content": "Show the ticker_symbol, security_name, and the number of loans that have that ticker_symbol as their collateral_description." }, { "role": "assistant", "content": "SELECT s.ticker_symbol, s.security_name, COUNT(l.loan_id) AS collateral_loan_count\nFROM financial_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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "Could you provide a count of services available within each department?" }, { "role": "assistant", "content": "SELECT department, COUNT(*) FROM hospitality_technology.services GROUP BY department;" }, { "role": "user", "content": "Now, only list the depa...
You are an SQL statement expert. Given the table 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.services ( service_id.text, property_id.text, service_name.text, description.text, category.text...
[ { "role": "user", "content": "How many unique hashtags has each post been associated with? Please return post_id and unique_hashtag_count." }, { "role": "assistant", "content": "SELECT post_id, COUNT(DISTINCT hashtag_id) AS unique_hashtag_count\nFROM social_media.post_hashtags\nGROUP BY post_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 social_media.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text ) CREATE TABLE social_media.conversati...
[ { "role": "user", "content": "List all reservations where the number of adults is greater than 2, showing reservation_id, guest_id, and the total_amount." }, { "role": "assistant", "content": "SELECT reservation_id, guest_id, total_amount\nFROM hospitality_technology.reservations\nWHERE num_adul...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id character varying(64) NOT NULL, property_id character varying(64) ...
[ { "role": "user", "content": "Find all pairs of wallets that share the same address_id but belong to different users." }, { "role": "assistant", "content": "SELECT\n w1.wallet_id AS wallet1,\n w1.user_id AS user1,\n w2.wallet_id AS wallet2,\n w2.user_id AS user2,\n w1.address_id\nFROM 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 blockchain.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address_id chara...
[ { "role": "user", "content": "我想查询所有来自美国供应商的组件信息,包括组件名称、供应商名称和供应商的质量评分。" }, { "role": "assistant", "content": "SELECT c.component_name, s.supplier_name, s.quality_rating\nFROM manufacturing.components c\nJOIN manufacturing.suppliers s ON c.supplier_id = s.supplier_id\nWHERE s.country = 'USA';" ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE manufacturing.components ( component_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show me all properties in California along with the count of staff members at each property, ordered by staff count in descending order." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, COUNT(s.staff_id) AS staff_count FROM hospitality_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "List all active SUI coins with their symbol, name, and total balance across all owners." }, { "role": "assistant", "content": "SELECT scm.coin_type, scm.symbol, scm.name, SUM(CAST(sc.balance AS DECIMAL)) AS total_balance\nFROM sui_coins_metadata scm\nJOIN sui_coins ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Show me all spa service orders in the last month with their guest names and total prices, ordered by total price in descending order." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, so.total_price FROM hospitality_technology.service_orders 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 hospitality_technology.properties ( property_id.text, property_name.text, address_line1.text, address_line2.text, city....
[ { "role": "user", "content": "Retrieve each completed booking's booking_id, passenger full name, trip_id, scheduled_departure, and fare for bookings where the trip's passenger_count is at least 10." }, { "role": "assistant", "content": "SELECT b.booking_id, p.first_name || ' ' || p.last_name AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Get a list of users who have both read and unread notifications. For each user, show their user_id, the count of unread notifications as unread_count, and the count of read notifications as read_count." }, { "role": "assistant", "content": "SELECT unread.user_id, un...
You are an SQL statement expert. Given the table 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": "Show me all policies and the base premium of the insurance product they are based on. Include policy number, premium amount, and product base premium." }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.premium_amount, T2.base_premium FROM insurance.p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "List all beneficiaries who have a percentage share greater than 75%. Show their first name, last name, and percentage share." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T1.percentage_share FROM insurance.policy_beneficiaries AS T1 WHER...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, -- unique identifier for the claim policy_id charac...
[ { "role": "user", "content": "Show me the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their narrative and 7-day price change percentage." }, { "role": "assistant", "content": "SELECT t.token_symbol, t.narrative, t.price_change_percentage_7d FROM token_basic_info t 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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO...
[ { "role": "user", "content": "Show all service orders with the service_id, guest's full name, and the status of each order." }, { "role": "assistant", "content": "SELECT so.order_id, so.service_id, g.first_name, g.last_name, so.status\nFROM hospitality_technology.service_orders so\nJOIN hospital...
You are an SQL statement expert. Given the table 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, -- unique identifier for the room ...
[ { "role": "user", "content": "Show me all active policies with coverage limits above $500,000, along with the customer names and agent names." }, { "role": "assistant", "content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.coverage_limit, c.first_name || ' ' || c.last_name AS customer_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.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d...
[ { "role": "user", "content": "Show me all electric vehicles that have completed trips in the last month, along with the count of trips each vehicle has completed." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, COUNT(t.trip_id) AS trip_count FROM transportation.vehic...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "Show all diagnoses recorded by doctor with ID 'doc789'. Include the diagnosis ID, patient ID, description, and diagnosis date." }, { "role": "assistant", "content": "SELECT diagnosis_id, patient_id, description, diagnosis_date FROM healthcare.diagnoses WHERE doctor_...
You are an SQL statement expert. Given the table 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 wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and amount, from the nft_holders table." }, { "role": "assistant", "content": "SELECT wallet_address, token_id, amount FROM nft_holders WHERE contract_type = 'ERC1155' AN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "How many secondary insurance policies are there in the system?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS secondary_policy_count\nFROM healthcare.patient_insurance\nWHERE is_primary = FALSE;" } ]
You are an SQL statement expert. Given the table 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": "How many wallets were created in each distinct month?" }, { "role": "assistant", "content": "SELECT DATE_TRUNC('month', created_at) AS creation_month, COUNT(*) AS wallet_count FROM web3.wallets GROUP BY DATE_TRUNC('month', created_at) ORDER BY creation_month;" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
[ { "role": "user", "content": "List the top 3 lawyers who have logged the highest total billable hours in June 2023. Provide their first_name, last_name, and the summed hours." }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, SUM(te.hours_spent) AS total_hours\nFROM legal_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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "List all games along with the count of in-game items they have. Only include games with more than 10 items and sort by the item count in descending order." }, { "role": "assistant", "content": "SELECT g.game_id, g.title, COUNT(i.item_id) AS item_count\nFROM gaming_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title character varying(200) NOT NULL, devel...
[ { "role": "user", "content": "Show each review's comment, the property name, and the review date for all public reviews submitted in 2023." }, { "role": "assistant", "content": "SELECT rv.comment, p.property_name, rv.review_date\nFROM hospitality_technology.reviews rv\nJOIN 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.text, property_name.text, address_line1.text, address_line2.text, city....
[ { "role": "user", "content": "Find all primary insurance plans that became effective in the last 30 days, showing the patient IDs, policy numbers, and subscriber names, ordered by effective date." }, { "role": "assistant", "content": "SELECT patient_id, policy_number, subscriber_name, effective_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, -- unique identifier for this p...
[ { "role": "user", "content": "For each order, show the username of the user who placed it, the name of the asset ordered, and the order quantity." }, { "role": "assistant", "content": "SELECT o.order_id, u.username, a.name AS asset_name, o.quantity\nFROM trading_platform.orders o\nJOIN trading_p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp ) CREATE TAB...
[ { "role": "user", "content": "Show me all vehicles that are due for their next service before the end of this month, along with their last service date and type." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, s.service_date, s.service_type FROM transportation.vehicl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "List the names and prices of all services available in the 'Food & Beverage' department." }, { "role": "assistant", "content": "SELECT service_name, price\nFROM hospitality_technology.services\nWHERE department = 'Food & Beverage' AND is_available = 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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, room...
[ { "role": "user", "content": "List all trips along with the assigned vehicle's license plate, driver full name, and the scheduled departure time." }, { "role": "assistant", "content": "SELECT t.trip_id, t.scheduled_departure, v.license_plate, d.first_name || ' ' || d.last_name AS driver_name\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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "I need to find all group chats created after 2024-01-01, showing group_name and the total number of participants in each." }, { "role": "assistant", "content": "SELECT c.group_name, COUNT(cp.participant_id) AS participant_count\nFROM social_media.conversations c\nJO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "For each game, can you show the total number of players who have unlocked at least one achievement in that game, as well as the game's genre?" }, { "role": "assistant", "content": "SELECT g.game_id, g.title, g.genre, COUNT(DISTINCT pa.player_id) AS player_count\nFRO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "How many service orders were placed by each staff member (staff_id_ordered)? Show the staff ID and the count." }, { "role": "assistant", "content": "SELECT staff_id_ordered, COUNT(*) FROM hospitality_technology.service_orders GROUP BY staff_id_ordered;" }, { ...
You are an SQL statement expert. Given the table 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, reservation_id text, guest_id text, service_id text, staff_id_or...
[ { "role": "user", "content": "Provide the total count of addresses and the minimum balance recorded in the system." }, { "role": "assistant", "content": "SELECT COUNT(*), MIN(balance) FROM blockchain.addresses;" }, { "role": "user", "content": "Now, show me the address ID and public ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.addresses ( address_id text, public_key text, balance numeric )
[ { "role": "user", "content": "List all passengers who have never made a booking, showing their passenger_id, first_name, last_name, and email." }, { "role": "assistant", "content": "SELECT\n p.passenger_id,\n p.first_name,\n p.last_name,\n p.email\nFROM transportation.passengers p\nL...
You are an SQL statement expert. Given the table 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 premium payments along with the payment date, amount, and the status of the related policy." }, { "role": "assistant", "content": "SELECT pp.payment_id, pp.payment_date, pp.amount_paid, p.status AS policy_status\nFROM insurance.premium_payments pp\nJOIN ins...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "role": "user", "content": "List all beneficiaries who do not have any contact information provided. Show beneficiary_id, first_name, and last_name." }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name, last_name FROM insurance.policy_beneficiaries WHERE contact_info IS NUL...
You are an SQL statement expert. Given the table 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 patients who have both an email address and an emergency contact listed, and show their names, email, and emergency contact phone numbers." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, emergency_contact_phone FROM healthcare.pa...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...