conversations listlengths 2 8 | system stringlengths 284 7.86k |
|---|---|
[
{
"role": "user",
"content": "Find tokens that have a positive price change percentage over the last 1 hour, 6 hours, and 24 hours. Display their symbol and chain."
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain FROM token_dexpool_info WHERE price_change_percentage_1h > 0 AND p... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10... |
[
{
"role": "user",
"content": "How many players are registered for each country? Return the country_code and the player count."
},
{
"role": "assistant",
"content": "SELECT country_code, COUNT(*) AS player_count FROM gaming_technology.players GROUP BY country_code;"
},
{
"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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"role": "user",
"content": "Show me the top 5 narratives by market cap, along with their top 3 coins and 24-hour trading volume."
},
{
"role": "assistant",
"content": "SELECT narrative, top_3_coins, volume_24h FROM narrative_info ORDER BY market_cap DESC LIMIT 5;"
},
{
"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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative top_3_coins text, -- the top 3 token... |
[
{
"role": "user",
"content": "How many rooms are there on each floor?"
},
{
"role": "assistant",
"content": "SELECT floor, COUNT(*) FROM hospitality_technology.rooms GROUP BY floor"
},
{
"role": "user",
"content": "Only show floors with more than 10 rooms."
},
{
"role": "assi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... |
[
{
"role": "user",
"content": "List all guests who have never left a review, including their full name and email."
},
{
"role": "assistant",
"content": "SELECT g.guest_id, g.first_name, g.last_name, g.email \nFROM hospitality_technology.guests g \nLEFT JOIN hospitality_technology.reviews r ON g.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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "Show me all invoices where the total_amount is more than 2000, including the invoice number, the associated case name, and the full name of the client."
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, c.case_name, cl.first_name || ' ' || cl.last_name ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam... |
[
{
"role": "user",
"content": "Show policy numbers, start dates, and the type of the insurance product for policies with a deductible greater than 500."
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T1.start_date, T2.product_type FROM insurance.policies AS T1 JOIN insurance.insur... | You are an SQL statement expert. Given the table 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 replacement policies where a customer received a new policy starting the day after their previous policy was cancelled. Return customer_id, original_policy_id, original_cancellation_date, new_policy_id, new_start_date."
},
{
"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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c... |
[
{
"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 each case ID with its latest uploaded document. I want to see the case ID, document name, version, and upload timestamp for the most recently uploaded document in each case."
},
{
"role": "assistant",
"content": "SELECT d.case_id, d.document_name, d.version,... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u... |
[
{
"role": "user",
"content": "Find pairs of reservations at the same property where the second check-in is within 7 days after the first check-out. Return first_reservation, second_reservation, and gap_days."
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id AS first_reservation,\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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ... |
[
{
"role": "user",
"content": "Show me all invoice numbers and due dates where the amount paid is exactly zero."
},
{
"role": "assistant",
"content": "SELECT invoice_number, due_date FROM legal_services.invoices WHERE amount_paid = 0;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, client_id text, case_id text, issue_... |
[
{
"role": "user",
"content": "How many distinct relationships are listed for policy beneficiaries?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT relationship) FROM insurance.policy_beneficiaries;"
}
] | You are an SQL statement expert. Given the table 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": "For each KYC-approved user, list their wallet address and the date it was created."
},
{
"role": "assistant",
"content": "SELECT w.address, w.created_at\nFROM trading_platform.wallets w\nJOIN trading_platform.kyc_audit k ON w.user_id = k.user_id\nWHERE k.status = '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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
CREATE ... |
[
{
"role": "user",
"content": "List all pairs of wallets that were created within 10 minutes of each other, showing both wallet IDs, the user_id, and both creation timestamps."
},
{
"role": "assistant",
"content": "SELECT\n w1.wallet_id AS wallet1_id,\n w2.wallet_id AS wallet2_id,\n w1.user_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.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"role": "user",
"content": "Count the number of appointments for each status."
},
{
"role": "assistant",
"content": "SELECT status, count(*) FROM government_services.appointments GROUP BY status;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.appointments ( appointment_id character varying(64) NOT NULL, citizen_id character varying(64) NOT ... |
[
{
"role": "user",
"content": "Show me the total number of trades and total volume for each buyer-seller pair where the same two users traded multiple assets."
},
{
"role": "assistant",
"content": "SELECT buyer_id, seller_id, COUNT(DISTINCT asset_id) AS asset_count, COUNT(*) AS trade_count, SUM(q... | You are an SQL statement expert. Given the table 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.trades ( trade_id text, order_id text, buyer_id text, seller_id text, asset_id text, quantity numeric,... |
[
{
"role": "user",
"content": "I need the average capacity of vehicles for each fuel_type."
},
{
"role": "assistant",
"content": "SELECT fuel_type,\n AVG(capacity) AS avg_capacity\nFROM transportation.vehicles\nGROUP BY fuel_type;"
},
{
"role": "user",
"content": "Only include f... | You are an SQL statement expert. Given the table 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": "Show me all in-progress trips with their vehicle IDs and the difference between scheduled and actual departure time in minutes."
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, EXTRACT(EPOCH FROM (actual_departure - scheduled_departure))/60 AS 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 transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti... |
[
{
"role": "user",
"content": "Show me the number of distinct room types offered by each property, including the property name and the count."
},
{
"role": "assistant",
"content": "SELECT T1.property_name, COUNT(DISTINCT T2.room_type_id) FROM hospitality_technology.properties AS T1 JOIN hospitali... | You are an SQL statement expert. Given the table 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": "Find reviews that contain the word 'dirty' in the comment section, showing the review ID, comment, and rating."
},
{
"role": "assistant",
"content": "SELECT review_id, comment, rating_overall FROM hospitality_technology.reviews WHERE LOWER(comment) LIKE '%dirty%';"
... | You are an SQL statement expert. Given the table 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": "How many distinct posts does each hashtag appear in?"
},
{
"role": "assistant",
"content": "SELECT hashtag_id, COUNT(DISTINCT post_id) AS post_count FROM social_media.post_hashtags GROUP BY hashtag_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 )
|
[
{
"role": "user",
"content": "Find the diagnosis code and description for all non-chronic diagnoses for patient 'patient_789' made by doctor 'doctor_abc'."
},
{
"role": "assistant",
"content": "SELECT diagnosis_code, description FROM healthcare.diagnoses WHERE patient_id = 'patient_789' AND doct... | You are an SQL statement expert. Given the table 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.diagnoses (
diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry
... |
[
{
"role": "user",
"content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts."
},
{
"role": "assistant",
"content": "SELECT policy_id, product_id, premium_amount, end_date FROM insurance.policies WHERE status = 'expired' AND end_date >= CU... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ... |
[
{
"role": "user",
"content": "How many time entries does each client have? Provide the client's first and last name along with the count, sorted by count descending."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, COUNT(te.entry_id) AS entry_count FROM legal_services.cli... | You are an SQL statement expert. Given the table 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": "For each developer, show their name and the total number of in-game items in all games they've developed."
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name,\n COUNT(i.item_id) AS total_items\nFROM gaming_technology.developers d\nJOIN gamin... | You are an SQL statement expert. Given the table 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 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": "What is the current address of the employee with ID 'EMP234'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the current address of an employee as this information is not stored in the database table."
}
] | 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 manufacturing.employees ( ... |
[
{
"role": "user",
"content": "Show me all properties in California with a star rating above 4.0, along with their room types and base rates."
},
{
"role": "assistant",
"content": "SELECT p.property_name, p.star_rating, rt.type_name, rt.base_rate FROM hospitality_technology.properties p JOIN hosp... | You are an SQL statement expert. Given the table 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": "What is the average number of appointments assigned per employee for each job title?"
},
{
"role": "assistant",
"content": "SELECT e.job_title, CAST(COUNT(a.appointment_id) AS REAL) / COUNT(DISTINCT e.employee_id) AS average_appointments_per_employee FROM government... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego... |
[
{
"role": "user",
"content": "Which insurance products have had a policy issued in 2024, and what is the name and type of those products? Show the product_id, product_name, and product_type."
},
{
"role": "assistant",
"content": "SELECT DISTINCT ip.product_id, ip.product_name, ip.product_type\nF... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c... |
[
{
"role": "user",
"content": "Could you list the name, type, and rarity for all in-game items that belong to games released on or after January 1st, 2022?"
},
{
"role": "assistant",
"content": "SELECT ii.item_name, ii.item_type, ii.rarity FROM gaming_technology.in_game_items AS ii JOIN gaming_te... | You are an SQL statement expert. Given the table 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 the list of developer names and their corresponding website domains (the domain part of the website URL)."
},
{
"role": "assistant",
"content": "SELECT name, \n CASE \n WHEN website LIKE 'http%' THEN SUBSTRING(website FROM '://([^/]+)')\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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_... |
[
{
"role": "user",
"content": "List pairs of routes where the destination of one route matches the origin of another route."
},
{
"role": "assistant",
"content": "SELECT r1.route_number AS route_1, r2.route_number AS route_2 FROM transportation.routes r1 JOIN transportation.routes r2 ON r1.destin... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, route_number text, description text, origin_location_id text, destin... |
[
{
"role": "user",
"content": "Find all customers who have made a premium payment and list their first name, last name, email, and the total amount they have paid across all their payments."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.email, SUM(T2.amount_paid) FR... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin... |
[
{
"role": "user",
"content": "List all pairs of beneficiaries on the same policy, showing policy_id, beneficiary1_id, beneficiary1 first_name, beneficiary1 last_name, beneficiary2_id, beneficiary2 first_name, and beneficiary2 last_name."
},
{
"role": "assistant",
"content": "SELECT b1.policy_id,... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text... |
[
{
"role": "user",
"content": "List all depot locations in the United States with their city and state information."
},
{
"role": "assistant",
"content": "SELECT name, city, state_province FROM transportation.locations WHERE type = 'depot' AND country = 'United States';"
},
{
"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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro... |
[
{
"role": "user",
"content": "How many agencies exist for each jurisdiction level?"
},
{
"role": "assistant",
"content": "SELECT jurisdiction_level, COUNT(*) AS agency_count FROM government_services.agencies GROUP BY jurisdiction_level;"
},
{
"role": "user",
"content": "Only show 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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "Show me the token names and their contract addresses where the total supply is greater than 1 million, sorted by total supply in descending order."
},
{
"role": "assistant",
"content": "SELECT token_name, contract_address FROM web3.tokens WHERE total_supply > 100000... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.tokens ( token_id text, contract_address text, token_name text, token_symbol text, decimals integer, total_supply ... |
[
{
"role": "user",
"content": "What is the maintenance schedule for the platforms at the station with ID 'ST234' for the next month?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the maintenance schedule for the platforms at any station. The data I have only include... | 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.s... |
[
{
"role": "user",
"content": "Which customers have policies that expired in the last month? Please show the customer ID, policy number, and expiration date."
},
{
"role": "assistant",
"content": "SELECT c.customer_id, p.policy_number, p.end_date\nFROM insurance.customers c\nJOIN insurance.polici... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... |
[
{
"role": "user",
"content": "List all room types that have at least one service in the 'Spa' category, including the room type name, property name, and service name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT rt.type_name, p.property_name, s.service_name\nFROM hospitality_technology... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... |
[
{
"role": "user",
"content": "How many 'ApprovalForAll' events are recorded for each ERC1155 contract address in the `erc1155_approval_for_all` table?"
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_for_all GROUP BY contract_addres... | You are an SQL statement expert. Given the table 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 the first name, last name, and email address for all passengers who are part of the loyalty program with ID 'Gold'."
},
{
"role": "assistant",
"content": "SELECT first_name , last_name , email FROM transportation.passengers WHERE loyalty_program_id = '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 transportation.routes ( route_id text PRIMARY KEY, route_number text, description text, origin_location_id text, destin... |
[
{
"role": "user",
"content": "Could you list each developer along with the next developer founded after them in the same country? Return columns current_developer, next_developer, and years_difference."
},
{
"role": "assistant",
"content": "SELECT d1.name AS current_developer,\n d2.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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_... |
[
{
"role": "user",
"content": "Who are the top 3 agents with the highest commission rate? Show their full names and commission rates."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, commission_rate\nFROM insurance.agents\nORDER BY commission_rate DESC\nLIMIT 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.agents ( agent_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara... |
[
{
"role": "user",
"content": "What is the count of customers for each state where the status is 'Active' and the created_at date is within the last 3 months?"
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) as customer_count FROM financial_services.customers WHERE 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 financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad... |
[
{
"role": "user",
"content": "What are the training programs or certifications completed by a staff member with the role of Platform Supervisor?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about the training programs or certifications completed by sta... | 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.s... |
[
{
"role": "user",
"content": "How many services are defined for each service category?"
},
{
"role": "assistant",
"content": "SELECT category, COUNT(*) AS service_count FROM government_services.services GROUP BY category;"
},
{
"role": "user",
"content": "Only show categories that ha... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Show the first name, last name, and email for guests residing in California."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM hospitality_technology.guests WHERE state_province = 'CA'"
},
{
"role": "user",
"content": "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 hospitality_technology.properties ( property_id.text, property_name.text, address_line1.text, address_line2.text, city.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.