conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"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 all services in the 'Concierge' department along with their names, price, and whether they are currently available. Include the property name as well."
},
{
"role": "assistant",
"content": "SELECT s.service_name, s.price, s.is_available, p.property_name\nFROM 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 character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "Show me a list of all achievements with their name, point value, and the title of the game they are part of."
},
{
"role": "assistant",
"content": "SELECT\n T1.name,\n T1.points,\n T2.title\nFROM gaming_technology.achievements AS T1\nJOIN gaming_technology.games ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player
... |
[
{
"role": "user",
"content": "Show me all room types with a base rate over $200 and max occupancy of at least 4, along with their property IDs and amenities."
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, type_name, base_rate, max_occupancy, amenities 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.room_types ( room_type_id character varying(64) NOT NULL, property_id character varying(64) NOT ... |
[
{
"role": "user",
"content": "List all cryptocurrency assets that have been traded more than 50 times but have never been traded in quantities greater than 100."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, a.symbol, COUNT(t.trade_id) AS trade_count\nFROM trading_platform.ass... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"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": "Show the first and last name of each citizen and the count of their scheduled appointments."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, COUNT(a.appointment_id) AS scheduled_appointment_count FROM government_services.citizens AS c JOIN 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.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth... |
[
{
"role": "user",
"content": "Can you list each employee's first and last name along with the first and last name of their manager?"
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name\nFROM government_servi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.employees ( employee_id text, agency_id text, first_name text, last_name text, job_title text, depa... |
[
{
"role": "user",
"content": "Show the usernames and registration dates for all players whose status is 'inactive'."
},
{
"role": "assistant",
"content": "SELECT username, registration_date FROM players WHERE status = 'inactive';"
},
{
"role": "user",
"content": "Refine the list to 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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player
... |
[
{
"role": "user",
"content": "Show me the top 5 transactions by value along with the token names transferred in those transactions."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.value, tok.token_name FROM web3.transactions t JOIN web3.token_transfers tt ON t.transaction_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 web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for the event
contract_id characte... |
[
{
"role": "user",
"content": "Show the claim ID, estimated loss, and the corresponding policy number for claims reported in the year 2023."
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T1.estimated_loss, T2.policy_number FROM insurance.claims AS T1 JOIN insurance.policies AS T2 ON 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 insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d... |
[
{
"role": "user",
"content": "Display the username and the total number of wallets for each user."
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(w.wallet_id) AS wallet_count FROM trading_platform.users u LEFT JOIN trading_platform.wallets w ON u.user_id = w.user_id GROUP BY u.us... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "Which citizens have had both applications and appointments for services in the 'Healthcare' category? List their full name, application ID, and appointment ID."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, a.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth... |
[
{
"role": "user",
"content": "Show me the full names of users and the total number of likes they have given to comments."
},
{
"role": "assistant",
"content": "SELECT u.full_name, COUNT(l.like_id) AS likes_given_to_comments\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.u... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "Show me the total billable hours and total billed amount for each lawyer who worked on 'Civil Litigation' cases in 2023, sorted by billed amount descending."
},
{
"role": "assistant",
"content": "SELECT te.lawyer_id,\n SUM(te.hours_spent) AS total_billable_hou... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad... |
[
{
"role": "user",
"content": "Show me the top 3 narratives by trend rank, along with their top 3 tokens and 7-day price change percentage."
},
{
"role": "assistant",
"content": "SELECT ni.narrative, ni.top_3_coins, ni.price_change_percentage_7d FROM narrative_info ni ORDER BY ni.trend_rank ASC L... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundraising record id",
"project_id ch... |
[
{
"role": "user",
"content": "How many beneficiaries has each unique relationship type? List relationship and the count."
},
{
"role": "assistant",
"content": "SELECT relationship, COUNT(*) AS beneficiary_count\nFROM insurance.policy_beneficiaries\nGROUP BY relationship;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la... |
[
{
"role": "user",
"content": "List each product_type along with the most expensive active product in that type, showing product_type, product_id, product_name, and base_premium."
},
{
"role": "assistant",
"content": "SELECT product_type, product_id, product_name, base_premium\nFROM (\n SELECT 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.insurance_products ( product_id character varying(64) NOT NULL, product_name character varying(150) NOT NULL,... |
[
{
"role": "user",
"content": "Show me all room types with a base rate over $200 and max occupancy of at least 4, along with their property IDs and amenities."
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, type_name, base_rate, max_occupancy, amenities 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.room_types ( room_type_id text PRIMARY KEY, property_id text, type_name text, description text, ... |
[
{
"role": "user",
"content": "List all employees whose manager belongs to a different department, showing the employee's full name, their department, the manager's full name, and the manager's department."
},
{
"role": "assistant",
"content": "SELECT e.employee_id,\n CONCAT(e.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 financial_services.employees (
employee_id character varying(64) NOT NULL, -- unique identifier for the employee
... |
[
{
"role": "user",
"content": "List all pairs of users with different usernames but the same registration timestamp; show both user IDs, their usernames, and the created_at value."
},
{
"role": "assistant",
"content": "SELECT u1.user_id AS user_id_1, u1.username AS username_1, u2.user_id AS user_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
|
[
{
"role": "user",
"content": "List all tokens with a market cap rank under 50 that have negative price changes in both the last 24 hours and last 7 days."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price_change_percentage_24h, price_change_percentage_7d, market_cap_ra... | You are an SQL statement expert. Given the table 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, -- fundraising record id project_id character varying(... |
[
{
"role": "user",
"content": "Show me all contracts deployed on the 'ethereum' network along with their deployer addresses and the count of token transfers associated with each contract, sorted by transfer count in descending order."
},
{
"role": "assistant",
"content": "SELECT c.address, c.depl... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,... |
[
{
"role": "user",
"content": "List each partner’s full name along with the full name of a non-partner lawyer in the same firm."
},
{
"role": "assistant",
"content": "SELECT p.lawyer_id,\n CONCAT(p.first_name, ' ', p.last_name) AS partner_full_name,\n CONCAT(n.first_name, ' ', n.last_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id text, first_name text, last_name text, bar_number text, firm_id text, email text, ph... |
[
{
"role": "user",
"content": "List all policies that expired in the last 30 days, along with their product IDs and premium amounts."
},
{
"role": "assistant",
"content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE end_date BETWEEN DATE_SUB(CURRENT_DATE, INTERVAL 3... | You are an SQL statement expert. Given the table 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": "Can you show me the user IDs and their theme settings for all users who have enabled email notifications and have updated their settings in 2024?"
},
{
"role": "assistant",
"content": "SELECT user_id, theme FROM social_media.user_settings WHERE email_notifications_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 social_media.user_settings ( setting_id text PRIMARY KEY, user_id text, theme text, email_notifications_enabled bool, p... |
[
{
"role": "user",
"content": "List events from contract '0xContractA...' that occurred between '2023-01-01' and '2023-01-31'. Show the event ID, event name, and emitted timestamp."
},
{
"role": "assistant",
"content": "SELECT event_id, event_name, emitted_at FROM web3.events WHERE contract_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 web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for the event
contract_id characte... |
[
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 100 of any ERC1155 token, along with the token ID and amount."
},
{
"role": "assistant",
"content": "SELECT wallet_address, token_id, amount FROM erc20_balances WHERE CAST(amount AS decimal) > 100 AND contract_address... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add... |
[
{
"role": "user",
"content": "Show a list of all documents, along with the case name and the email of the client related to each document."
},
{
"role": "assistant",
"content": "SELECT d.document_name, c.case_name, cl.email\nFROM legal_services.documents d\nJOIN legal_services.cases c ON d.case_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id.text, first_name.text, last_name.text, company_name.text, email.text, phone.text, ad... |
[
{
"role": "user",
"content": "Can you show me the first and last names of employees along with the first and last names of their managers?"
},
{
"role": "assistant",
"content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, m.first_name AS manager_first_name, m.l... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa... |
[
{
"role": "user",
"content": "Show me all rooms along with their current overall review rating for each room, including the room number and property id."
},
{
"role": "assistant",
"content": "SELECT r.room_number, r.property_id, AVG(rv.rating_overall) AS average_overall_rating\nFROM 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.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat... |
[
{
"role": "user",
"content": "List all players who have never added any item to their inventory, showing their player_id and username."
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username\nFROM gaming_technology.players p\nLEFT JOIN gaming_technology.player_inventory pi ON p.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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... |
[
{
"role": "user",
"content": "Show me all room types with their property IDs and amenities where the description includes 'ocean view'."
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, amenities FROM hospitality_technology.room_types WHERE description LIKE '%ocean view%';... | You are an SQL statement expert. Given the table 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": "Show me a list of all players who have rare items in their inventory, and for each, display the player's username and the names of the rare items they possess."
},
{
"role": "assistant",
"content": "SELECT p.username, i.item_name \nFROM gaming_technology.player_inve... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"role": "user",
"content": "Show me all insurance plans that cover more than 10 patients as their primary insurance, along with the provider name and contact information."
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, ip.insurance_provider, ip.contact_phone, ip.website, COUNT(pi.p... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"role": "user",
"content": "Show the top 10 most expensive fuel log entries including fuel_log_id, vehicle make and model, location name and city, and total_cost."
},
{
"role": "assistant",
"content": "SELECT f.fuel_log_id,\n v.make,\n v.model,\n loc.name AS location_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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
[
{
"role": "user",
"content": "Could you provide the total number of notifications sent on each day?"
},
{
"role": "assistant",
"content": "SELECT DATE(sent_at), COUNT(*) FROM notifications GROUP BY DATE(sent_at) ORDER BY DATE(sent_at);"
},
{
"role": "user",
"content": "Now, show only... | You are an SQL statement expert. Given the table 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": "What is the average speed of train number T9876 during its last journey?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the average speed of train number T9876 during its last journey. The data in the trains table does not inclu... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.t... |
[
{
"role": "user",
"content": "List all active employees with their employee_id, full name, and their manager's first and last name."
},
{
"role": "assistant",
"content": "SELECT e.employee_id,\n CONCAT(e.first_name, ' ', e.last_name) AS employee_name,\n CONCAT(m.first_name, ' ', m.la... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, isin_code text, cusip_code text, secu... |
[
{
"role": "user",
"content": "For each trip, provide the trip_id, the total fuel quantity refueled, and the number of refueling events that occurred during the trip."
},
{
"role": "assistant",
"content": "SELECT trip_id, SUM(quantity) AS total_fuel_quantity, COUNT(*) AS refuel_event_count\nFROM ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry... |
[
{
"role": "user",
"content": "Show all policies that were cancelled in 2024, including their policy_number, cancellation_date, and cancellation_reason. Also show the file name of any associated claim documents."
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.cancellation_date, 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": "List all comment IDs and their content for comments made by users who have 'dark' as their theme."
},
{
"role": "assistant",
"content": "SELECT c.comment_id, c.content\nFROM social_media.comments c\nJOIN social_media.user_settings s ON c.user_id = s.user_id\nWHERE 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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "For each game_id, calculate the average points of achievements that have been unlocked at least once."
},
{
"role": "assistant",
"content": "SELECT a.game_id, AVG(a.points) AS average_unlocked_points FROM gaming_technology.achievements a JOIN gaming_technology.playe... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, description.text, icon_url.text, points.... |
[
{
"role": "user",
"content": "Show a list of patients along with their most recent diagnoses, including patient ID, diagnosis description, and the diagnosis date."
},
{
"role": "assistant",
"content": "SELECT d.patient_id, d.description AS diagnosis_description, d.diagnosis_date FROM healthcare.... | You are an SQL statement expert. Given the table 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": "Which narrative in narrative_info has the highest volume_24h, and what are its top_3_coins and token_num?"
},
{
"role": "assistant",
"content": "SELECT narrative,\n top_3_coins,\n token_num\nFROM narrative_info\nORDER BY volume_24h DESC\nLIMIT 1;"
},
{
"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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name... |
[
{
"role": "user",
"content": "List employees and the name of the agency they work for, who were hired in the year 2023."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, a.agency_name FROM government_services.employees AS e JOIN government_services.agencies AS a ON e.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 text, national_id_number text, first_name text, last_name text, date_of_birth... |
[
{
"role": "user",
"content": "Show me all patients who have a primary insurance plan from 'Blue Cross', along with their insurance policy numbers and the plan types."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, pi.policy_number, ip.plan_type FROM healthc... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "How many distinct projects conducted fundraising in April 2023?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT project_id) AS num_projects\nFROM project_fundraising_record\nWHERE investment_date LIKE '2023-04%';"
},
{
"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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(... |
[
{
"role": "user",
"content": "Get the number of direct reports for each manager, showing manager_id and report_count."
},
{
"role": "assistant",
"content": "SELECT manager_id,\n COUNT(*) AS report_count\nFROM hospitality_technology.staff\nWHERE manager_id IS NOT NULL\nGROUP BY manager_id;"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, fir... |
[
{
"role": "user",
"content": "List the citizen_id, first_name, last_name, and registration_date for all citizens who registered during March 2024."
},
{
"role": "assistant",
"content": "SELECT citizen_id, first_name, last_name, registration_date\nFROM government_services.citizens\nWHERE registra... | You are an SQL statement expert. Given the table 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": "For each game, I need a breakdown of how many sessions each server has hosted and what percentage of that game's total sessions each server represents. Display game_id, server_id, server_name, session_count, and session_percentage."
},
{
"role": "assistant",
"conten... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... |
[
{
"role": "user",
"content": "List the content and creation time of all posts made in the last 7 days."
},
{
"role": "assistant",
"content": "SELECT content, created_at FROM social_media.posts WHERE created_at >= NOW() - INTERVAL '7 day';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u... |
[
{
"role": "user",
"content": "List all patients who do not have an email address on file, showing their patient_id, first_name, last_name, and phone_number."
},
{
"role": "assistant",
"content": "SELECT patient_id,\n first_name,\n last_name,\n phone_number\nFROM healthcare.pati... | You are an SQL statement expert. Given the table 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": "Get the number of agents grouped by status. Return status and agent_count."
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS agent_count\n FROM insurance.agents\n 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.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l... |
[
{
"role": "user",
"content": "List all claims, showing the claim ID, incident date, and the associated policy number."
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T1.incident_date, T2.policy_number FROM insurance.claims AS T1 JOIN insurance.policies AS T2 ON T1.policy_id = T2.polic... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,... |
[
{
"role": "user",
"content": "List all node pairs that operate on the same port and were last_seen within 30 minutes of each other, showing both node_ids, the port, and the time difference in minutes."
},
{
"role": "assistant",
"content": "SELECT n1.node_id AS node1_id, n2.node_id AS node2_id, n... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
|
[
{
"role": "user",
"content": "List all rooms with their number, property ID, floor, and status where the room has the feature 'Balcony'."
},
{
"role": "assistant",
"content": "SELECT room_id, room_number, property_id, floor, status FROM hospitality_technology.rooms WHERE features ILIKE '%Balcony... | You are an SQL statement expert. Given the table 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 distinct email domains found in the user email addresses."
},
{
"role": "assistant",
"content": "SELECT DISTINCT SUBSTRING(email, INSTR(email, '@') + 1) AS email_domain FROM web3.users;"
},
{
"role": "user",
"content": "For each domain, show the... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.users ( user_id.text, username.text, email.text, password_hash.text, created_at... |
[
{
"role": "user",
"content": "Show me the invoice number and total amount for each invoice, along with the number and name of the case it belongs to."
},
{
"role": "assistant",
"content": "SELECT T1.invoice_number, T1.total_amount, T2.case_number, T2.case_name FROM invoices AS T1 JOIN cases AS 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.law_firms ( firm_id text, firm_name text, address text, phone text, website text, founded_date date, man... |
[
{
"role": "user",
"content": "Show all transactions where the recipient address matches a wallet address, listing the transaction ID, the recipient address, the user ID who owns the wallet, and the value of the transaction."
},
{
"role": "assistant",
"content": "SELECT tx.transaction_id, tx.to_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 web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the contract
address cha... |
[
{
"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": "Show me the top 5 narratives by market cap, along with their 24-hour trading volume and 7-day price change percentage."
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap, volume_24h, price_change_percentage_7d FROM narrative_info ORDER BY market_cap... | You are an SQL statement expert. Given the table 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": "List all agents who have been terminated, showing their full name, agency name, and termination date."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, agency_name, termination_date\nFROM insurance.agents\nWHERE status <> 'Active';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.agents ( agent_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara... |
[
{
"role": "user",
"content": "Show all users who follow both user 'U100' and user 'U101'."
},
{
"role": "assistant",
"content": "SELECT f1.follower_user_id\nFROM social_media.follows f1\nJOIN social_media.follows f2 ON f1.follower_user_id = f2.follower_user_id\nWHERE f1.following_user_id = 'U100... | You are an SQL statement expert. Given the table 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": "How many unique IP addresses are there in the nodes table?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT ip_address) FROM blockchain.nodes;"
},
{
"role": "user",
"content": "Can you break this down by port numbers, showing the count of nod... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
|
[
{
"role": "user",
"content": "Show all appointments that have 'follow-up' mentioned in the notes field."
},
{
"role": "assistant",
"content": "SELECT * FROM healthcare.appointments WHERE notes LIKE '%follow-up%';"
}
] | You are an SQL statement expert. Given the table 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": "How many premium payments were made using 'Credit Card' as the payment method?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS credit_card_payments\nFROM insurance.premium_payments\nWHERE payment_method = 'Credit Card';"
}
] | You are an SQL statement expert. Given the table 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 pairs of vehicles with the same make and model but different manufacture years. Include each vehicle's ID, make, model, and both years."
},
{
"role": "assistant",
"content": "SELECT v1.vehicle_id AS vehicle1_id, v2.vehicle_id AS vehicle2_id, v1.make, v1.mod... | You are an SQL statement expert. Given the table 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 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": "Show me the list of players who have never logged in since they registered."
},
{
"role": "assistant",
"content": "SELECT player_id, username, registration_date\nFROM gaming_technology.players\nWHERE last_login IS NULL;"
},
{
"role": "user",
"content": "... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"role": "user",
"content": "Show me each patient's full name along with the name of every doctor they've had an appointment with."
},
{
"role": "assistant",
"content": "SELECT p.first_name || ' ' || p.last_name AS patient_full_name, d.first_name || ' ' || d.last_name AS doctor_full_name\nFROM ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad... |
[
{
"role": "user",
"content": "Find all nodes that were last seen in the last 7 days, along with their IP addresses and ports."
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '7 days';"
},
{
"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 blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic... |
[
{
"role": "user",
"content": "Which users have sent messages in multiple different conversations? Show the user ID and the count of unique conversations."
},
{
"role": "assistant",
"content": "SELECT sender_user_id, COUNT(DISTINCT conversation_id) AS unique_conversation_count FROM social_media.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 social_media.messages (
message_id character varying(64) NOT NULL, -- unique identifier for the message
convers... |
[
{
"role": "user",
"content": "Get the total number of guests for each country_code."
},
{
"role": "assistant",
"content": "SELECT country_code, COUNT(*) AS guest_count\nFROM hospitality_technology.guests\nGROUP BY country_code;"
},
{
"role": "user",
"content": "Actually, only include... | You are an SQL statement expert. Given the table 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 transactions along with the user_id of the sender when the sender’s address matches a wallet. Return transaction_id, from_address, and user_id."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.from_address, w.user_id FROM web3.transactions ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the contract
address cha... |
[
{
"role": "user",
"content": "Can you list all pairs of doctors where one mentors another (meaning they share the same specialty and the mentor was created in the system before the mentee)? Include the full names of both the mentor and the mentee, as well as their shared specialty."
},
{
"role": "as... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number... |
[
{
"role": "user",
"content": "Get the total number of logs per user for July 2024."
},
{
"role": "assistant",
"content": "SELECT user_id,\n COUNT(*) AS log_count\nFROM trading_platform.logs\nWHERE logged_at BETWEEN '2024-07-01' AND '2024-07-31'\nGROUP BY user_id;"
},
{
"role": "use... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.logs ( log_id text PRIMARY KEY, user_id text, action text, details text, logged_at timestamp )
|
[
{
"role": "user",
"content": "List each agency's name and primary contact email along with the total number of notifications related to that agency."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, a.primary_contact_email, COUNT(n.notification_id) AS notification_count\nFROM governme... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "Provide a list of all log entries recorded since the start of 2024, including the user ID, action, and the exact time the log occurred."
},
{
"role": "assistant",
"content": "SELECT user_id, action, logged_at FROM logs WHERE logged_at >= '2024-01-01';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
CREATE ... |
[
{
"role": "user",
"content": "List prescription ID, medication ID, and the record ID for all prescriptions linked to medical records where the chief complaint contains 'cough'."
},
{
"role": "assistant",
"content": "SELECT T1.prescription_id, T1.medication_id, T1.record_id FROM healthcare.prescr... | You are an SQL statement expert. Given the table 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": "能否帮我查询特定路线(route_id 为 'RT001')的所有行程信息,并关联到乘客的联系方式?"
},
{
"role": "assistant",
"content": "SELECT s.schedule_id, s.train_id, s.route_id, s.departure_datetime, s.arrival_datetime, s.status, p.passenger_id, p.first_name, p.last_name, p.phone_number, p.email\nFROM sched... | 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 /schedules
{
"mappings": {
"properties": {
"schedule_id": { "type": "keyword" ... |
[
{
"role": "user",
"content": "List all document IDs, file names, and uploaded timestamps for documents that were uploaded on a weekend."
},
{
"role": "assistant",
"content": "SELECT document_id, file_name, uploaded_at FROM insurance.claim_documents WHERE EXTRACT(DOW FROM uploaded_at) IN (0, 6);"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_type text, file_name text, file_path ... |
[
{
"role": "user",
"content": "Show me all trades where the traded quantity is less than 2, including the trade_id, quantity, and the buyer and seller IDs."
},
{
"role": "assistant",
"content": "SELECT trade_id, quantity, buyer_id, seller_id\nFROM trading_platform.trades\nWHERE quantity < 2;"
}... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
CREATE ... |
[
{
"role": "user",
"content": "List all assets that have metadata entries for both 'category' and 'blockchain_network', along with their corresponding values."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, m1.value AS category, m2.value AS blockchain_network FROM trading_platfo... | You are an SQL statement expert. Given the table 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": "Show the top 5 narratives ranked by trend_rank (lowest is better). Include the narrative, trend rank, and number of tokens."
},
{
"role": "assistant",
"content": "SELECT narrative, trend_rank, token_num FROM narrative_info ORDER BY trend_rank ASC LIMIT 5;"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE narrative_info ( narrative text, top_3_coins text, price_change_percentage_1h numeric, price_change_percentage_24h nume... |
[
{
"role": "user",
"content": "Show me all claims with police reports that were settled for more than $50,000, along with the customer and policy details."
},
{
"role": "assistant",
"content": "SELECT cl.claim_id, cl.police_report_number, cl.settlement_amount, c.customer_id, c.first_name, c.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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name... |
[
{
"role": "user",
"content": "List all terminated agents who worked for more than 5 years, showing their full names and termination dates."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, termination_date FROM insurance.agents WHERE termination_date IS NOT NULL AND (terminati... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l... |
[
{
"role": "user",
"content": "List all law firms whose website is missing or not provided."
},
{
"role": "assistant",
"content": "SELECT firm_id, firm_name, address, phone, founded_date, managing_partner_id\nFROM legal_services.law_firms\nWHERE website IS NULL OR website = '';"
}
] | You are an SQL statement expert. Given the table 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": "Show me the top 5 addresses with the highest balances, along with their public keys."
},
{
"role": "assistant",
"content": "SELECT address_id, public_key, balance FROM blockchain.addresses ORDER BY balance DESC LIMIT 5;"
},
{
"role": "user",
"content": "... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.addresses ( address_id text PRIMARY KEY, public_key text, balance numeric )
|
[
{
"role": "user",
"content": "Show all achievements for games developed in Germany, including achievement names and their point values."
},
{
"role": "assistant",
"content": "SELECT a.name AS achievement_name, a.points\nFROM gaming_technology.achievements a\nJOIN gaming_technology.games g ON a.g... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ... |
[
{
"role": "user",
"content": "Show me all users who are participants in conversations that are group chats, including the group name and the date they joined the group."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, c.conversation_id, conv.group_name, cp.joined_at\nFROM soc... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "What is the average interest rate for each account type?"
},
{
"role": "assistant",
"content": "SELECT account_type, AVG(interest_rate) FROM financial_services.accounts GROUP BY account_type;"
},
{
"role": "user",
"content": "Restrict this calculation 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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri... |
[
{
"role": "user",
"content": "Show me all claims handled by agent 'AG123' along with their settlement details and policy IDs."
},
{
"role": "assistant",
"content": "SELECT claim_id, policy_id, settlement_amount, settlement_date FROM insurance.claims WHERE claim_handler_id = 'AG123';"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara... |
[
{
"role": "user",
"content": "Show me all servers, the title of the game they host, and the name of the game's developer."
},
{
"role": "assistant",
"content": "SELECT s.server_name, g.title AS game_title, d.name AS developer_name FROM gaming_technology.servers s JOIN gaming_technology.games g 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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"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 all wallet addresses that don't have an associated user_id."
},
{
"role": "assistant",
"content": "SELECT address_id FROM blockchain.wallets WHERE user_id IS NULL;"
},
{
"role": "user",
"content": "Now show me these addresses along with their privat... | You are an SQL statement expert. Given the table 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, public_key.text, balance.numeric )
CREATE TABLE blockchain.wallets ( wallet_id ... |
[
{
"role": "user",
"content": "List all tokens together with the deployment status of the contract that created them, showing token_id, token_symbol, and contract status."
},
{
"role": "assistant",
"content": "SELECT t.token_id, t.token_symbol, c.status AS contract_status\nFROM web3.tokens t\nJOI... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "I want to find all notifications for messages containing the word 'holiday' in their content; include notification_id, message content, and notification created_at."
},
{
"role": "assistant",
"content": "SELECT n.notification_id, m.content, n.created_at\nFROM 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.messages ( message_id.text, conversation_id.text, sender_user_id.text, content.text, media_url.text, media... |
[
{
"role": "user",
"content": "For each player and game pair, please show the total number of achievements unlocked by the player in that game."
},
{
"role": "assistant",
"content": "SELECT gs.player_id, gs.game_id, COUNT(pa.achievement_id) AS achievements_unlocked\nFROM gaming_technology.game_se... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"role": "user",
"content": "List all trips where the actual origin location is different from the scheduled origin location or the actual destination location is different from the scheduled destination location. Show trip ID, scheduled origin/destination location IDs, and actual origin/destination locati... | You are an SQL statement expert. Given the table 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.