conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "Which day had the highest number of service orders? Show the date and order count."
},
{
"role": "assistant",
"content": "SELECT DATE(order_timestamp) AS order_date,\n COUNT(*) AS order_count\nFROM hospitality_technology.service_orders\nGROUP BY DATE(order_tim... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.service_orders ( order_id text, reservation_id text, guest_id text, service_id text, staff_id_or... |
[
{
"role": "user",
"content": "List all reservations with their guest IDs and room IDs where the total amount is greater than $300, ordered by check-in date."
},
{
"role": "assistant",
"content": "SELECT reservation_id, guest_id, room_id, check_in_date FROM hospitality_technology.reservations WHE... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r... |
[
{
"role": "user",
"content": "List all users who have created wallets in the last 30 days, showing their usernames and wallet addresses."
},
{
"role": "assistant",
"content": "SELECT u.username, w.address FROM web3.users u JOIN web3.wallets w ON u.user_id = w.user_id WHERE w.created_at >= NOW() ... | You are an SQL statement expert. Given the table 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": "List all public reviews from the past 30 days with the property name and overall rating."
},
{
"role": "assistant",
"content": "SELECT r.review_id, p.property_name, r.rating_overall, r.review_date\nFROM hospitality_technology.reviews AS r\nJOIN hospitality_technolog... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... |
[
{
"role": "user",
"content": "List all developers founded before the year 2000, showing their name, country, and the year they were founded."
},
{
"role": "assistant",
"content": "SELECT name, country, founded_year FROM gaming_technology.developers WHERE founded_year < 2000;"
},
{
"role"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ... |
[
{
"role": "user",
"content": "Show me the top 5 NFT collections on Sui blockchain with the highest number of unique owners, along with their names and collection types."
},
{
"role": "assistant",
"content": "SELECT name, collection_type, COUNT(DISTINCT owner) AS unique_owners FROM sui_nfts GROUP... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "Show all trades that occurred after '2024-06-01', including the trade ID, quantity, price, and the name and symbol of the asset traded."
},
{
"role": "assistant",
"content": "SELECT t.trade_id, t.quantity, t.price, a.name AS asset_name, a.symbol AS asset_symbol FROM... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ... |
[
{
"role": "user",
"content": "Show all cities in the USA that have more than one distinct location type represented. List the city, country, and number of distinct location types."
},
{
"role": "assistant",
"content": "SELECT city, country, COUNT(DISTINCT type) AS distinct_location_types\nFROM 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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro... |
[
{
"role": "user",
"content": "For each player, list their username together with the titles of games they have any items from in their inventory."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.username, g.title\nFROM gaming_technology.players p\nJOIN gaming_technology.player_inventory ... | You are an SQL statement expert. Given the table 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 case name, case number, date opened, and the first and last name of the lead lawyer for all cases."
},
{
"role": "assistant",
"content": "SELECT T1.case_name , T1.case_number , T1.date_opened , T2.first_name , T2.last_name FROM legal_services.cases 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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "Show me the list of hashtags that have been used, along with the time they were first used."
},
{
"role": "assistant",
"content": "SELECT tag_name, created_at \nFROM social_media.hashtags;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"role": "user",
"content": "Show me a list of all insurance policies along with the subscriber's name and the effective and expiration dates for each policy, including the associated plan ID."
},
{
"role": "assistant",
"content": "SELECT policy_number, subscriber_name, effective_date, expirati... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.text, policy_number.text, group_numb... |
[
{
"role": "user",
"content": "List each user’s user_id and username along with their total trading value (sum of quantity * price from trades) as a buyer for trades executed in June 2024. Show the top 5 users by total value descending."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "Find guests who have made at least one payment using a 'CreditCard'. List their full name (first and last name) and email address."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.email FROM hospitality_technology.guests AS T1 J... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.guests (
guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil... |
[
{
"role": "user",
"content": "Show the invoice_id and total hours logged for each invoice."
},
{
"role": "assistant",
"content": "SELECT invoice_id, SUM(hours_spent) AS total_hours FROM legal_services.time_entries WHERE invoice_id IS NOT NULL GROUP BY invoice_id;"
},
{
"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 legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu... |
[
{
"role": "user",
"content": "Can you list all assets along with their names and types, but only show assets whose symbol contains the letter 'A'?"
},
{
"role": "assistant",
"content": "SELECT asset_id, name, symbol, type FROM trading_platform.assets WHERE symbol LIKE '%A%';"
},
{
"role"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type text )
|
[
{
"role": "user",
"content": "How many patients have at least one medical record associated with them?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT patient_id) FROM healthcare.medical_records;"
},
{
"role": "user",
"content": "Now, can you show me the count of patient... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "Show me all bookings with a status of 'confirmed' that were made in the last 7 days, including passenger_id and fare."
},
{
"role": "assistant",
"content": "SELECT booking_id, passenger_id, fare FROM transportation.bookings WHERE status = 'confirmed' AND booking_tim... | You are an SQL statement expert. Given the table 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.bookings ( booking_id text PRIMARY KEY, passenger_id text, trip_id text, seat_number text, booking_time ... |
[
{
"role": "user",
"content": "Find pairs of citizens who share the same gender but registered in different years. Show each citizen's first and last name along with their registration year."
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first_name_1,\n c1.last_name AS last... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth... |
[
{
"role": "user",
"content": "Find all users along with another user who shares their email domain."
},
{
"role": "assistant",
"content": "SELECT u1.user_id, u1.username, u2.user_id AS other_user_id, u2.username AS other_username\nFROM web3.users u1\nJOIN web3.users u2 ON split_part(u1.email, '@... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the user
username character vary... |
[
{
"role": "user",
"content": "Show me the top 5 tokens by market cap on the Ethereum chain, along with their 24-hour trading volume and 7-day price change percentage."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, market_cap, total_volume, price_change_percentage_7d FROM... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character varying(100) NOT NULL, token_symbol ch... |
[
{
"role": "user",
"content": "Which developers founded after 2010 have published games using the 'Unreal Engine'? List the developer's name, country, game title, and the release year."
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name, d.country, g.title AS game_title, EXTRAC... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date... |
[
{
"role": "user",
"content": "Provide a list of all future appointments showing appointment_id, scheduled_start_time, location_name, city, and state."
},
{
"role": "assistant",
"content": "SELECT\n a.appointment_id,\n a.scheduled_start_time,\n sl.location_name,\n sl.city,\n sl.state\nFROM 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.service_locations ( location_id character varying(64) NOT NULL, agency_id character varying(64) NOT... |
[
{
"role": "user",
"content": "Return the customer_id, full name, policy_id, and start date of all policies sold by agents whose commission_rate is less than 0.08. Please also include the product_name of the related insurance product."
},
{
"role": "assistant",
"content": "SELECT p.customer_id, c... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... |
[
{
"role": "user",
"content": "How many policy beneficiaries in the system have no contact information recorded?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM insurance.policy_beneficiaries WHERE contact_info 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 insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la... |
[
{
"role": "user",
"content": "What is the total USD value of tokens held by 'Binance' on the 'BSC' chain according to the latest snapshot?"
},
{
"role": "assistant",
"content": "SELECT SUM(usd_value) FROM cex_token_balance WHERE exchange = 'Binance' AND chain = 'BSC' AND snapshot_time = (SELECT ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO... |
[
{
"role": "user",
"content": "Show me the security_id, ticker_symbol, and issuer_name for all securities where the currency is 'EUR' and the last_updated date is within the last 30 days."
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, issuer_name FROM financial_services... | You are an SQL statement expert. Given the table 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 review, show me the review comment and the associated service names that the guest has ordered during the same reservation."
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.comment, s.service_name \nFROM hospitality_technology.reviews r\nJOIN ho... | You are an SQL statement expert. Given the table 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 cases that are associated with the court jurisdiction 'Federal Court'."
},
{
"role": "assistant",
"content": "SELECT * FROM legal_services.cases WHERE court_jurisdiction = 'Federal Court';"
},
{
"role": "user",
"content": "From these cases, 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 legal_services.cases ( case_id text, case_number text, case_name text, client_id text, lead_lawyer_id text, case_type t... |
[
{
"role": "user",
"content": "Count the number of appointments that have a status of 'Cancelled'."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM government_services.appointments WHERE status = 'Cancelled';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id text, location_id text, service_id... |
[
{
"role": "user",
"content": "Count the number of completed premium payments grouped by payment_method."
},
{
"role": "assistant",
"content": "SELECT payment_method,\n COUNT(*) AS payment_count\nFROM insurance.premium_payments\nWHERE status = 'Completed'\nGROUP BY payment_method;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_id text, payment_date timestamp, amo... |
[
{
"role": "user",
"content": "Find the address that has the highest total amount across all its UTXOs."
},
{
"role": "assistant",
"content": "SELECT address FROM utxos GROUP BY address ORDER BY SUM(amount) DESC LIMIT 1;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp )
CREATE TAB... |
[
{
"role": "user",
"content": "Show recipient_user_id and the number of unread notifications (where read_at is NULL) for each recipient."
},
{
"role": "assistant",
"content": "SELECT recipient_user_id, COUNT(*) AS unread_count\nFROM social_media.notifications\nWHERE read_at IS NULL\nGROUP BY reci... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, user_id character varying(64) NOT NULL, content text, medi... |
[
{
"role": "user",
"content": "List all reservations where the number of adults is greater than 2, showing reservation_id, guest_id, and the total_amount."
},
{
"role": "assistant",
"content": "SELECT reservation_id, guest_id, total_amount\nFROM hospitality_technology.reservations\nWHERE num_adul... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id character varying(64) NOT NULL, property_id character varying(64) ... |
[
{
"role": "user",
"content": "List each agent along with their manager's contact_email. Include agent_id, first_name, last_name, manager_id, and manager's contact_email."
},
{
"role": "assistant",
"content": "SELECT a.agent_id,\n a.first_name,\n a.last_name,\n a.manager_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 insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state... |
[
{
"role": "user",
"content": "List the plan_name, contact_phone, and website for all insurance plans offered by 'Optima Health'."
},
{
"role": "assistant",
"content": "SELECT plan_name,\n contact_phone,\n website\nFROM healthcare.insurance_plans\nWHERE insurance_provider = 'Optima He... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_provider text, plan_type text, contact... |
[
{
"role": "user",
"content": "List all claim IDs, policy IDs, and incident dates for claims reported after February 1st, 2024."
},
{
"role": "assistant",
"content": "SELECT claim_id, policy_id, incident_date\nFROM insurance.claims\nWHERE reported_date > '2024-02-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 insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara... |
[
{
"role": "user",
"content": "Show me, for each wallet address, the total sum of amounts for all unspent UTXOs, along with the user ID who owns the wallet."
},
{
"role": "assistant",
"content": "SELECT w.address, w.user_id, COALESCE(SUM(u.amount), 0) AS total_unspent_amount\nFROM trading_platfor... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch... |
[
{
"role": "user",
"content": "Show me all failed transactions where the gas_used is greater than 100,000, including the transaction_id and timestamp."
},
{
"role": "assistant",
"content": "SELECT transaction_id, timestamp FROM web3.transactions WHERE status = 'failed' AND gas_used > 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.transactions (
transaction_id character varying(64) NOT NULL, -- unique identifier for the transaction
fr... |
[
{
"role": "user",
"content": "List all trips where the passenger_count exceeds the vehicle's capacity. For each trip include trip_id, vehicle license_plate, driver full name, and scheduled_departure."
},
{
"role": "assistant",
"content": "SELECT t.trip_id,\n v.license_plate,\n d.firs... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
[
{
"role": "user",
"content": "Can you retrieve a list of all case numbers, their names, the client's full name, and the date_opened, sorted by date_opened descending?"
},
{
"role": "assistant",
"content": "SELECT c.case_number,\n c.case_name,\n CONCAT(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": "How many users were registered in each month of 2024?"
},
{
"role": "assistant",
"content": "SELECT date_trunc('month', created_at) AS month, COUNT(*) AS user_count\nFROM social_media.users\nWHERE created_at >= '2024-01-01'\n AND created_at < '2025-01-01'\nGROUP BY... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, full_name.text, profile_picture_url.t... |
[
{
"role": "user",
"content": "List each user along with the number of wallets they own and the number of unique addresses found in their UTXOs."
},
{
"role": "assistant",
"content": "SELECT u.user_id, COUNT(DISTINCT w.wallet_id) as wallet_count, COUNT(DISTINCT ut.address) as unique_utxo_addresse... | You are an SQL statement expert. Given the table 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": "For each vehicle, count how many maintenance logs exist."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.make, v.model, COUNT(ml.log_id) AS maintenance_log_count FROM transportation.vehicles v JOIN transportation.maintenance_logs ml ON v.vehicle_id = 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU... |
[
{
"role": "user",
"content": "Retrieve pairs of law firms that share the same managing_partner_id, showing the firm names and the managing_partner_id."
},
{
"role": "assistant",
"content": "SELECT lf1.firm_name AS firm1, lf2.firm_name AS firm2, lf1.managing_partner_id FROM legal_services.law_fir... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the law firm
firm_... |
[
{
"role": "user",
"content": "Find pairs of distinct nodes that share the same 'last_seen' timestamp but have different port numbers. Show the node IDs, ports, and the shared timestamp for each pair."
},
{
"role": "assistant",
"content": "SELECT T1.node_id AS node1_id , T1.port AS node1_port , ... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the node
ip_address charac... |
[
{
"role": "user",
"content": "Find tokens on the 'Polygon' chain with a market cap greater than $1,000,000,000 and a positive price change in the last 24 hours. List their symbol, name, market cap, and 24h price change."
},
{
"role": "assistant",
"content": "SELECT token_symbol, token_name, mark... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri... |
[
{
"role": "user",
"content": "Count the number of contracts per network and status."
},
{
"role": "assistant",
"content": "SELECT\n network_id,\n status,\n COUNT(*) AS contract_count\nFROM web3.contracts\nGROUP BY network_id, status;"
},
{
"role": "user",
"content": "Actually, ple... | You are an SQL statement expert. Given the table 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 unique policies that have claim documents of type 'Claim Form'. For each, return the policy_number, start_date, end_date, and the document file_name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.policy_number, p.start_date, p.end_date, cd.file_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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d... |
[
{
"role": "user",
"content": "Show the usernames of all users who were created in 2024."
},
{
"role": "assistant",
"content": "SELECT username\nFROM social_media.users\nWHERE EXTRACT(YEAR FROM created_at) = 2024;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "List all pairs of wallet addresses that were created by the same user but on different dates. Show both wallet IDs, their addresses, the user ID, and their creation dates."
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet_id_1, w1.address AS addre... | You are an SQL statement expert. Given the table 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": "Show pairs of fundraising records for the same project, including the round names and their investment values."
},
{
"role": "assistant",
"content": "SELECT T1.project_name, T1.rounds_name AS round1, T1.investment_value AS value1, T2.rounds_name AS round2, T2.invest... | 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 project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... |
[
{
"role": "user",
"content": "Which customers have more than one beneficiary listed under the same policy? I want to see the policy_id, customer_id, and the count of beneficiaries for each such group."
},
{
"role": "assistant",
"content": "SELECT policy_id, customer_id, COUNT(beneficiary_id) 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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text... |
[
{
"role": "user",
"content": "Show the full names and emails of staff members who have delivered at least one service order."
},
{
"role": "assistant",
"content": "SELECT DISTINCT s.first_name, s.last_name, s.work_email\nFROM hospitality_technology.staff s\nJOIN hospitality_technology.service_or... | You are an SQL statement expert. Given the table 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": "I need to check the inventory status of components, including their batch details and warehouse location."
},
{
"role": "assistant",
"content": "MATCH (i:InventoryBatch)-[:IS_INSTANCE_OF]->(c:Component)\nRETURN c.component_id, c.component_name, i.inventory_record_id... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Node Label ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St... |
[
{
"role": "user",
"content": "What is the average market cap and average 24-hour trading volume for tokens on each chain?"
},
{
"role": "assistant",
"content": "SELECT chain, AVG(market_cap) AS average_market_cap, AVG(volume_24h) AS average_volume_24h FROM token_dexpool_info GROUP BY chain"
},... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, token_name character varying(100) NOT NULL, token_sy... |
[
{
"role": "user",
"content": "Find the average commission rate among all agents whose hire date is after '2020-01-01'."
},
{
"role": "assistant",
"content": "SELECT AVG(commission_rate) FROM insurance.agents WHERE hire_date > '2020-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 insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state... |
[
{
"role": "user",
"content": "I want to find each user’s total count of completed orders and the last action they logged."
},
{
"role": "assistant",
"content": "SELECT\n o.user_id,\n COUNT(*) AS completed_order_count,\n MAX(l.logged_at) AS last_log_time,\n (SELECT action\n FROM trading_pla... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan... |
[
{
"role": "user",
"content": "How many tokens had a net positive flow according to smart_money_token_performance, and what is their average ROI?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS token_count, AVG(roi) AS avg_roi\nFROM smart_money_token_performance\nWHERE net_flow > 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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name... |
[
{
"role": "user",
"content": "Can you count how many times each user has commented on posts created by users they are following?"
},
{
"role": "assistant",
"content": "SELECT c.user_id AS commenter_user_id, f.following_user_id, COUNT(*) AS comment_count FROM social_media.comments c JOIN social_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.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ... |
[
{
"role": "user",
"content": "List all agents who have sold policies with a coverage limit above 500000. Show agent_id, first_name, last_name, and the count of such policies as policy_count."
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name, a.last_name, COUNT(p.policy_id) 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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
first_... |
[
{
"role": "user",
"content": "How many conversations are group chats?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = TRUE;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique identifier for the comment
post_id... |
[
{
"role": "user",
"content": "For each ERC1155 NFT contract on Ethereum, show the `contract_address`, `token_id`, total amount held across all wallets, and number of unique holders."
},
{
"role": "assistant",
"content": "SELECT nh.contract_address,\n nh.token_id,\n SUM(CAST(nh.amount... | You are an SQL statement expert. Given the table 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": "Count the number of assets for each asset type."
},
{
"role": "assistant",
"content": "SELECT type, COUNT(*) FROM trading_platform.assets GROUP BY type;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "Show me wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address."
},
{
"role": "assistant",
"content": "SELECT nh.wallet_address, nh.token_id, nh.contract_address FROM nft_holders nh JOIN token_metas tm ON nh.cont... | You are an SQL statement expert. Given the table 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": "I need a list of users who have commented on their own posts. For each, return user_id, username, and the total number of such comments, ordered by comment count descending."
},
{
"role": "assistant",
"content": "SELECT u.user_id,\n u.username,\n COUNT(c... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "Show all room types that offer 'WiFi' in their amenities."
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, type_name, amenities FROM hospitality_technology.room_types WHERE amenities LIKE '%WiFi%';"
},
{
"role": "user",
"content":... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.room_types ( room_type_id.text, property_id.text, type_name.text, description.text, base_rate.nu... |
[
{
"role": "user",
"content": "Show me all service orders with their reservation IDs and total prices where the quantity is more than 1."
},
{
"role": "assistant",
"content": "SELECT order_id, reservation_id, total_price FROM hospitality_technology.service_orders WHERE quantity > 1;"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_id.text, room_id.text, room_type_id.... |
[
{
"role": "user",
"content": "Which active insurance products contain the word 'comprehensive' or 'premium' in their description? List their product IDs, product names, types, and base premiums."
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, product_type, base_premium\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.insurance_products ( product_id text PRIMARY KEY, product_name text, product_type text, description text, bas... |
[
{
"role": "user",
"content": "For each patient, find the next appointment after each one. Return patient_id, appointment_id, next_appointment_id, and the waiting time in minutes between them."
},
{
"role": "assistant",
"content": "SELECT A.patient_id,\n A.appointment_id AS current_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 healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,... |
[
{
"role": "user",
"content": "Which users have registered but never created a wallet? Show their user_id, username, and email."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, u.email\nFROM trading_platform.users u\nLEFT JOIN trading_platform.wallets w ON u.user_id = w.user_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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "List the names of group conversations and the usernames of participants who joined after '2023-01-01'."
},
{
"role": "assistant",
"content": "SELECT T1.group_name, T3.username FROM social_media.conversations AS T1 JOIN social_media.participants AS T2 ON T1.conversat... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp, last_message_at timestamp, is_grou... |
[
{
"role": "user",
"content": "I need a list of all SUI coins with their object ID, coin type, and balance."
},
{
"role": "assistant",
"content": "SELECT object_id, coin_type, balance FROM sui_coins;"
},
{
"role": "user",
"content": "Only include coins where status is 'exists'."
},
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ... |
[
{
"role": "user",
"content": "For all maintenance records, can you show the vehicle's make, model, the odometer reading, and the mechanic's name?"
},
{
"role": "assistant",
"content": "SELECT v.make, v.model, m.odometer_reading, m.mechanic_name FROM transportation.maintenance_logs m JOIN transpo... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
[
{
"role": "user",
"content": "List all insurance products that have no active policies currently."
},
{
"role": "assistant",
"content": "SELECT ip.product_id, ip.product_name, ip.product_type FROM insurance.insurance_products ip LEFT JOIN insurance.policies p ON ip.product_id = p.product_id AND ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name... |
[
{
"role": "user",
"content": "Show me the usernames of users who have followed someone, but have not been followed by anyone. Include the time they started following others."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, f.created_at AS follow_created_at\nFROM social_media.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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "Show me the total number of trades and the total traded value for each customer, including their first and last names."
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name, c.last_name, COUNT(t.trade_id) AS trade_count, SUM(t.total_amount) AS 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.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... |
[
{
"role": "user",
"content": "Show me a list of cases, including the case number, case name, and the full name of the client associated with each case that has at least one appointment."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.case_number, T1.case_name, T2.first_name, T2.last_na... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad... |
[
{
"role": "user",
"content": "List the top 5 Avalanche tokens by total transfer volume in token_activities_avalanche."
},
{
"role": "assistant",
"content": "SELECT tick, SUM(amt) AS total_volume\nFROM token_activities_avalanche\nGROUP BY tick\nORDER BY total_volume DESC\nLIMIT 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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_... |
[
{
"role": "user",
"content": "List all securities (security_id, ticker_symbol, security_name) that belong to the 'Technology' sector and have a currency of 'USD'."
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, security_name FROM financial_services.securities WHERE sect... | You are an SQL statement expert. Given the table 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": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 3 months, along with their narrative information if available."
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.valuation, pfr.rounds_name, pfr.investment_date, ... | You are an SQL statement expert. Given the table 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 employees (employee_id, first_name, last_name) in the 'Wealth Management' department who have processed trades for securities with a currency of 'EUR', along with the count of such trades for each employee."
},
{
"role": "assistant",
"content": "SELECT 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 financial_services.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
... |
[
{
"role": "user",
"content": "Show me all users who have wallets but have never placed any orders, along with their wallet addresses."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, u.email, w.address FROM trading_platform.users u JOIN trading_platform.wallets w ON u.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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "Find all bookings for which the special_requests field is not null. Show the booking ID, passenger ID, and the special request."
},
{
"role": "assistant",
"content": "SELECT booking_id, passenger_id, special_requests\nFROM transportation.bookings\nWHERE special_requ... | You are an SQL statement expert. Given the table 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": "List all guests who have communication consent enabled along with their email addresses."
},
{
"role": "assistant",
"content": "SELECT guest_id,\n first_name || ' ' || last_name AS full_name,\n email\nFROM guests\nWHERE communication_consent = TRUE;"
}... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la... |
[
{
"role": "user",
"content": "List maintenance logs including vehicle make, model, service_date, cost, and next_service_due_date for vehicles that are currently 'Active'."
},
{
"role": "assistant",
"content": "SELECT ml.log_id,\n v.make,\n v.model,\n ml.service_date,\n ml... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"role": "user",
"content": "List all time entries that do not have a description, including the entry ID, date worked, hours spent, and the first and last name of the lawyer who recorded the entry."
},
{
"role": "assistant",
"content": "SELECT te.entry_id, te.date_worked, te.hours_spent, l.fir... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu... |
[
{
"role": "user",
"content": "Show me all completed trips with their driver's full name and the route description, ordered by actual arrival time in descending order."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, CONCAT(d.first_name, ' ', d.last_name) AS driver_name, r.description AS ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ... |
[
{
"role": "user",
"content": "Show the names of all agencies and the names of their associated service locations."
},
{
"role": "assistant",
"content": "SELECT T1.agency_name , T2.location_name FROM government_services.agencies AS T1 JOIN government_services.service_locations AS T2 ON T1.agency... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text, agency_name text, jurisdiction_level text, primary_contact_email text, m... |
[
{
"role": "user",
"content": "Which claims have an estimated_loss greater than 20000 and also have any premium payment that is not completed? Return claim_id, policy_id, estimated_loss, due_date, and amount_paid."
},
{
"role": "assistant",
"content": "SELECT c.claim_id,\n c.policy_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 insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d... |
[
{
"role": "user",
"content": "Show me all claims that were settled for more than $50,000, along with the policy details and agent information."
},
{
"role": "assistant",
"content": "SELECT c.*, p.*, a.first_name || ' ' || a.last_name AS agent_name FROM insurance.claims c JOIN insurance.policies ... | You are an SQL statement expert. Given the table 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": "For each user, calculate the total value of 'buy' and 'sell' orders (quantity * price)."
},
{
"role": "assistant",
"content": "SELECT b.user_id,\n b.total_buy_value,\n s.total_sell_value\nFROM (\n SELECT user_id,\n SUM(quantity * price) AS total... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.orders ( order_id.text, user_id.text, wallet_id.text, asset_id.text, order_type.text, quantity.numeric... |
[
{
"role": "user",
"content": "Show me all claims and the file names of documents uploaded for each claim."
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T2.file_name FROM insurance.claims AS T1 JOIN insurance.claim_documents AS T2 ON T1.claim_id = T2.claim_id;"
},
{
"role": "... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... |
[
{
"role": "user",
"content": "List all doctors who have made more than 10 diagnoses with status 'Active', including their full names and specialties."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, d.specialty, COUNT(di.diagnosis_id) AS active_diagnoses_count FROM health... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "Show me all rooms with their room number, the type name, and the maximum occupancy for each room."
},
{
"role": "assistant",
"content": "SELECT r.room_id, r.room_number, rt.type_name, rt.max_occupancy\nFROM hospitality_technology.rooms r\nJOIN 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.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... |
[
{
"role": "user",
"content": "Show me a list of all policy numbers that have a deductible exactly equal to 0."
},
{
"role": "assistant",
"content": "SELECT policy_number\nFROM insurance.policies\nWHERE deductible = 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 insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identifier for the policy
customer_id ... |
[
{
"role": "user",
"content": "Which fundraising project in 2022 had the highest valuation, and which token (by symbol) from smart_money_token_performance matches the project name? Please display project_name, valuation, rounds_name, and the matched token_symbol."
},
{
"role": "assistant",
"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, project_id character varying(32) NOT NULL, project_name... |
[
{
"role": "user",
"content": "For each vehicle, show the vehicle_id, license_plate, date of its most recent trip (actual_arrival), and the odometer_reading at its latest maintenance service."
},
{
"role": "assistant",
"content": "SELECT\n v.vehicle_id,\n v.license_plate,\n (\n 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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"role": "user",
"content": "List the diagnosis_id, patient_id, and doctor_id for all diagnoses with status 'Pending' and is_chronic set to TRUE."
},
{
"role": "assistant",
"content": "SELECT diagnosis_id, patient_id, doctor_id FROM healthcare.diagnoses WHERE status = 'Pending' AND is_chronic =... | You are an SQL statement expert. Given the table 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.text, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty... |
[
{
"role": "user",
"content": "List all policies that have been cancelled, showing the policy number, cancelled date, and cancellation reason."
},
{
"role": "assistant",
"content": "SELECT policy_number, cancellation_date, cancellation_reason FROM insurance.policies WHERE cancellation_date IS NOT... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.