conversations listlengths 2 8 | system stringlengths 276 8.03k |
|---|---|
[
{
"role": "user",
"content": "List all trades with their order_id, trade_type, and commission for trades with commission higher than 100."
},
{
"role": "assistant",
"content": "SELECT trade_id, order_id, trade_type, commission FROM financial_services.trades WHERE commission > 100;"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h... |
[
{
"role": "user",
"content": "Show me all room types with a base rate over $200 and max occupancy of at least 4, along with their property IDs and amenities."
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, amenities FROM hospitality_technology.room_types WHERE base_rate ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text, type_name text, description text, ... |
[
{
"role": "user",
"content": "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": "For each address, show the total amount contained in UTXOs that have been spent."
},
{
"role": "assistant",
"content": "SELECT address, SUM(amount) FROM utxos WHERE spent = TRUE GROUP BY address;"
},
{
"role": "user",
"content": "Only include addresses w... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.utxos (
utxo_id character varying(64) NOT NULL, -- unique identifier for the UTXO
transaction... |
[
{
"role": "user",
"content": "How many addresses on the Polygon chain have an ROI above 5?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS address_count FROM smart_money_profit WHERE chain = 'Polygon' AND roi > 5;"
},
{
"role": "user",
"content": "Also show the average prof... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token... |
[
{
"role": "user",
"content": "Find all wallets that were created on the same day and list their wallet IDs, addresses, and the creation date."
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id, w1.address, w1.created_at::date AS creation_date FROM web3.wallets w1 JOIN (SELECT created_at:... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the wallet
user_id character... |
[
{
"role": "user",
"content": "For each vehicle, show the first and last fueling events including their timestamps and the quantities refueled."
},
{
"role": "assistant",
"content": "WITH first_last AS (\n SELECT\n vehicle_id,\n MIN(log_timestamp) AS first_time,\n MAX(log_timestamp) 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.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry... |
[
{
"role": "user",
"content": "Show the names and types of all assets whose symbol is exactly 3 characters long."
},
{
"role": "assistant",
"content": "SELECT name, type, symbol FROM trading_platform.assets WHERE LENGTH(symbol) = 3;"
},
{
"role": "user",
"content": "Also, I want to 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 trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type text )
|
[
{
"role": "user",
"content": "List all tokens with a positive 1-hour price change percentage in the 'DeFi' narrative."
},
{
"role": "assistant",
"content": "SELECT token_symbol FROM smart_money_token_inflow WHERE narrative = 'DeFi' AND type = 1 AND token_amount > 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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative top_3_coins text, -- the top 3 token... |
[
{
"role": "user",
"content": "Count the number of law firms founded in each decade. Show the decade (e.g., 1990s, 2000s) and the count."
},
{
"role": "assistant",
"content": "SELECT CONCAT(FLOOR(EXTRACT(YEAR FROM founded_date) / 10) * 10, 's') AS decade, COUNT(*) AS firm_count FROM law_firms 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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "List all tokens with a liquidity over $1 million and a positive 1-hour price change percentage on the Ethereum chain."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, price_change_percentage_1h FROM token_dexpool_info WHERE chain = 'Eth... | You are an SQL statement expert. Given the table 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": "List the first name, last name, and firm name for all lawyers who are partners."
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , T2.firm_name FROM legal_services.lawyers AS T1 JOIN law_firms AS T2 ON T1.firm_id = T2.firm_id WHERE T1.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 legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer
first_n... |
[
{
"role": "user",
"content": "List pairs of distinct routes that originate from the same location but go to different destinations. Show the route ID and route number for both routes and the common origin location ID."
},
{
"role": "assistant",
"content": "SELECT\n r1.route_id AS route1_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 transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati... |
[
{
"role": "user",
"content": "List all medical record IDs and the record date for records created by doctors specializing in 'Gastroenterology'."
},
{
"role": "assistant",
"content": "SELECT mr.record_id, mr.record_date FROM healthcare.medical_records mr JOIN healthcare.doctors d ON mr.doctor_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "List all wallet addresses that hold any NFT currently. Show the wallet address and the count of distinct token IDs they hold."
},
{
"role": "assistant",
"content": "SELECT wallet_address, COUNT(DISTINCT token_id) FROM nft_holders GROUP BY wallet_address;"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t... |
[
{
"role": "user",
"content": "For each service location, find the nearest accessible service location. Show the location_id, location_name, nearest_location_id, and the distance."
},
{
"role": "assistant",
"content": "SELECT l.location_id,\n l.location_name,\n nearest.location_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 government_services.service_locations ( location_id text PRIMARY KEY, agency_id text, location_name text, address text,... |
[
{
"role": "user",
"content": "For each transaction, find its immediate next transaction by the same sender, listing the original transaction_id, the next transaction_id, and the time difference in minutes between them."
},
{
"role": "assistant",
"content": "SELECT t1.transaction_id AS current_tx... | You are an SQL statement expert. Given the table 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 text PRIMARY KEY, from_address text, to_address text, value numeric, gas_used int, g... |
[
{
"role": "user",
"content": "Count the total number of distinct specialties listed in the doctors table."
},
{
"role": "assistant",
"content": "SELECT count(DISTINCT specialty) FROM healthcare.doctors;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number... |
[
{
"role": "user",
"content": "List all achievements with points greater than 100, showing achievement_id, name, and points."
},
{
"role": "assistant",
"content": "SELECT achievement_id, name, points\nFROM gaming_technology.achievements\nWHERE points > 100;"
},
{
"role": "user",
"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 gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, description.text, icon_url.text, points.... |
[
{
"role": "user",
"content": "I need a report of patients who have received prescriptions for medications manufactured by 'Pfizer'. Include patient ID, first name, last name, medication_name, and prescription_date."
},
{
"role": "assistant",
"content": "SELECT p.patient_id,\n p.first_name,... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "Show the full names and job titles of employees who work in the same department as at least one other employee."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, job_title\nFROM government_services.employees\nWHERE department IN (\n SELECT 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 government_services.employees ( employee_id text, agency_id text, first_name text, last_name text, job_title text, depa... |
[
{
"role": "user",
"content": "Retrieve the names of all properties that have listed room types, along with the name of each room type available at that property."
},
{
"role": "assistant",
"content": "SELECT t1.property_name, t2.type_name FROM hospitality_technology.properties AS t1 INNER JOIN h... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "List the medical record ID and record date for all medical records that are linked to an appointment whose duration was longer than the average duration of all appointments."
},
{
"role": "assistant",
"content": "SELECT T1.record_id, T1.record_date FROM healthcare.m... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number... |
[
{
"role": "user",
"content": "List all smart money addresses that have a negative PNL but a positive Realized Ratio. Show the address, chain, PNL, and Realized Ratio."
},
{
"role": "assistant",
"content": "SELECT token_address, chain, pnl, realized_ratio FROM smart_money_token_performance WHERE ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, net_flow.numeric, avg_cost.numeric,... |
[
{
"role": "user",
"content": "For each medical record, display the record date, doctor full name, and medication name for any prescription linked to that record."
},
{
"role": "assistant",
"content": "SELECT mr.record_date, d.first_name || ' ' || d.last_name AS doctor_full_name, m.medication_nam... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "Show me each guest's full name and the number of unique properties they have made reservations for."
},
{
"role": "assistant",
"content": "SELECT g.first_name || ' ' || g.last_name AS full_name,\n COUNT(DISTINCT r.property_id) AS property_count\nFROM 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, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "Find the average percentage share among all beneficiaries for each distinct relationship type."
},
{
"role": "assistant",
"content": "SELECT relationship, AVG(percentage_share) FROM insurance.policy_beneficiaries GROUP BY relationship ORDER BY relationship;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu... |
[
{
"role": "user",
"content": "Provide a count of how many peers were last seen on each distinct day recorded in the system."
},
{
"role": "assistant",
"content": "SELECT DATE(last_seen), COUNT(*) FROM trading_platform.peers GROUP BY DATE(last_seen) ORDER BY DATE(last_seen);"
}
] | You are an SQL statement expert. Given the table 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": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count."
},
{
"role": "assistant",
"content": "SELECT g.genre, COUNT(gs.session_id) AS session_count, COUNT(DISTIN... | You are an SQL statement expert. Given the table 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": "List the usernames of users that are being followed by user 'U123'."
},
{
"role": "assistant",
"content": "SELECT T2.username FROM social_media.follows AS T1 JOIN social_media.users AS T2 ON T1.following_user_id = T2.user_id WHERE T1.follower_user_id = 'U123'"
},
... | You are an SQL statement expert. Given the table 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": "I need to compare consecutive daily close_prices for each security to find when the close_price increased compared to the previous day."
},
{
"role": "assistant",
"content": "SELECT a.security_id, b.data_timestamp AS prev_date, b.close_price AS prev_close, a.data_ti... | You are an SQL statement expert. Given the table 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.market_data ( data_point_id bigint, security_id text, data_timestamp timestamp, open_price numeric, ... |
[
{
"role": "user",
"content": "List pairs of citizens who share the same email domain."
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first1,\n c1.last_name AS last1,\n c2.first_name AS first2,\n c2.last_name AS last2,\n SPLIT_PART(c1.contact_email, '@', 2)... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Show the guest's full name, reservation ID, check-in date, and status for all reservations made via 'Phone'."
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, r.reservation_id, r.check_in_date, r.status FROM hospitality_technology.reservations... | You are an SQL statement expert. Given the table 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": "For each trip, calculate the total fuel quantity consumed and the total fuel cost. Show trip_id, total_quantity, total_cost."
},
{
"role": "assistant",
"content": "SELECT trip_id, SUM(quantity) AS total_quantity, SUM(total_cost) AS total_cost FROM transportation.fue... | You are an SQL statement expert. Given the table 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 first and last name of each citizen along with the city and state of the service location for their agency."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, sl.city, sl.state\nFROM government_services.citizens c\nJOIN government_serv... | You are an SQL statement expert. Given the table 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": "List the first and last names of employees and the number of services offered by their agency."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS service_count\nFROM government_services.employees e\nLEFT JOIN government_s... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "How many documents are there for each document_type? Show document_type and count ordered by the count in descending order."
},
{
"role": "assistant",
"content": "SELECT document_type,\n COUNT(*) AS count\nFROM legal_services.documents\nGROUP BY document_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 legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u... |
[
{
"role": "user",
"content": "Show me all insurance products along with the number of distinct agents whose handled claims are for policies using that product. Include product_id, product_name, and agent_count."
},
{
"role": "assistant",
"content": "SELECT ip.product_id, ip.product_name, COUNT(D... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... |
[
{
"role": "user",
"content": "Show me the total deposit and withdrawal amounts for each account in February 2024."
},
{
"role": "assistant",
"content": "SELECT account_id, SUM(CASE WHEN transaction_type = 'Deposit' THEN amount ELSE 0 END) AS total_deposit, SUM(CASE WHEN transaction_type = 'Withd... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h... |
[
{
"role": "user",
"content": "What is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the detailed repair history of equipment used by staff memb... | 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.m... |
[
{
"role": "user",
"content": "Show me the top 5 NFT collections with the highest floor price on Ethereum, along with their names and contract addresses."
},
{
"role": "assistant",
"content": "SELECT name, contract_address, floor_price FROM nft_collections WHERE blockchain = 'ethereum' ORDER BY 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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "Show me all notifications that are related to posts created by users who have a verified profile. Include the notification type, the recipient username, and the post ID."
},
{
"role": "assistant",
"content": "SELECT\n n.notification_type,\n u_recipient.username 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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"role": "user",
"content": "Which route numbers connect locations with a distance less than 80 km and more than 5 words in their description? Include the route type in the results."
},
{
"role": "assistant",
"content": "SELECT route_number, type FROM transportation.routes WHERE distance_km < 8... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati... |
[
{
"role": "user",
"content": "List all invoices that were paid within 7 days of their issue date. Show invoice number, issue date, payment date, and total amount."
},
{
"role": "assistant",
"content": "SELECT invoice_number, issue_date, payment_date, total_amount FROM legal_services.invoices 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph... |
[
{
"role": "user",
"content": "Show me the average number of current players per server for each region."
},
{
"role": "assistant",
"content": "SELECT region, AVG(current_players) AS avg_current_players\nFROM gaming_technology.servers\nGROUP BY region;"
},
{
"role": "user",
"content":... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "List all appointment IDs and their corresponding location IDs for appointments that have status 'cancelled'."
},
{
"role": "assistant",
"content": "SELECT appointment_id, location_id FROM healthcare.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 healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id character varying(64) NOT NULL, doc... |
[
{
"role": "user",
"content": "특정 품질 등급 이상의 공급업체를 조회하고 싶습니다. 품질 등급, 공급업체 이름, 국가를 포함해 주세요."
},
{
"role": "assistant",
"content": "GET suppliers/_search\n{\n \"query\": {\n \"range\": {\n \"quality_rating\": {\n \"gte\": 4.0\n }\n }\n },\n \"_source\": [\"supplier_name\", ... | 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
Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty... |
[
{
"role": "user",
"content": "What are the maintenance costs for a specific aircraft model like the Airbus A320?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to data regarding maintenance costs for specific aircraft models such as the Airbus A320. The information in ... | 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.aircraft_mod... |
[
{
"role": "user",
"content": "List the number of cases for each case type that are currently marked as 'Open'."
},
{
"role": "assistant",
"content": "SELECT case_type, COUNT(*) FROM legal_services.cases WHERE status = 'Open' GROUP BY case_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 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": "Find the average score for each player who has participated in game sessions."
},
{
"role": "assistant",
"content": "SELECT player_id, AVG(score) AS avg_score\nFROM gaming_technology.game_sessions\nGROUP BY player_id;"
},
{
"role": "user",
"content": "No... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, server_id uuid, start_time timestamp w... |
[
{
"role": "user",
"content": "Retrieve the total number of agents managed by each manager, showing the manager_id and the count."
},
{
"role": "assistant",
"content": "SELECT manager_id, COUNT(*) FROM insurance.agents GROUP BY manager_id;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state... |
[
{
"role": "user",
"content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table."
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.valuation, tbi.token_symbol,... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundraising record id",
"project_id ch... |
[
{
"role": "user",
"content": "Show me all policy beneficiaries who were added in the last 6 months, along with their policy details and percentage shares."
},
{
"role": "assistant",
"content": "SELECT pb.*, pp.policy_id, pp.customer_id, pp.payment_date FROM insurance.policy_beneficiaries pb JOIN... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_id text, payment_date timestamp, amo... |
[
{
"role": "user",
"content": "Provide the count of diagnoses by status."
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS count\nFROM healthcare.diagnoses\nGROUP BY status;"
},
{
"role": "user",
"content": "Now only include statuses with more than 10 diagnoses... | You are an SQL statement expert. Given the table 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": "List each unique plan_id and the total number of patients enrolled in that plan."
},
{
"role": "assistant",
"content": "SELECT plan_id, COUNT(DISTINCT patient_id) AS patient_count FROM healthcare.patient_insurance GROUP BY plan_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 healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id text, policy_number text, group_numb... |
[
{
"role": "user",
"content": "Show all SUI coins with status 'exists', listing their object ID, owner address, coin type, and balance from the sui_coins table."
},
{
"role": "assistant",
"content": "SELECT object_id, owner, coin_type, balance FROM sui_coins WHERE status = '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 erc20_balances_historical ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wallet_address varchar NOT... |
[
{
"role": "user",
"content": "For each employee, find their first and last name along with the number of applications they've been assigned. Only include employees with at least 5 assigned applications."
},
{
"role": "assistant",
"content": "SELECT e.first_name,\n e.last_name,\n COUN... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth... |
[
{
"role": "user",
"content": "Show me all diesel fuel logs from the last month with their vehicle details, including make, model and license plate."
},
{
"role": "assistant",
"content": "SELECT f.fuel_log_id, f.log_timestamp, f.quantity, f.total_cost, v.make, v.model, v.license_plate FROM transp... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU... |
[
{
"role": "user",
"content": "Show me all claims with police reports that were filed in the last 3 months, along with their policy details and estimated loss amounts."
},
{
"role": "assistant",
"content": "SELECT cl.claim_id, cl.policy_id, cl.estimated_loss, cl.incident_date, cl.reported_date, p... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d... |
[
{
"role": "user",
"content": "Can you show me all prescriptions along with each patient's policy number and insurance plan ID?"
},
{
"role": "assistant",
"content": "SELECT p.prescription_id, p.patient_id, p.medication_id, pi.policy_number, pi.plan_id\nFROM healthcare.prescriptions p\nJOIN healt... | You are an SQL statement expert. Given the table 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.prescriptions ( prescription_id text, record_id text, patient_id text, doctor_id text, medication_id text, d... |
[
{
"role": "user",
"content": "Show the number of employees in each department."
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS employee_count\nFROM financial_services.employees\ngroup BY department;"
},
{
"role": "user",
"content": "Exclude departments that have... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba... |
[
{
"role": "user",
"content": "Show me all insurance plans that have more than 5 patients enrolled, along with the provider name and count of patients, sorted by patient count in descending order."
},
{
"role": "assistant",
"content": "SELECT i.plan_name, i.insurance_provider, COUNT(p.patient_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "Show all SUI coins that are marked as 'exists' in both sui_coins and sui_coins_metadata, displaying their coin_type, symbol, name, and balance."
},
{
"role": "assistant",
"content": "SELECT sc.coin_type, scm.symbol, scm.name, sc.balance FROM sui_coins sc JOIN sui_co... | You are an SQL statement expert. Given the table 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": "Provide a report of each user with their username and the count of all log entries from the last 30 days."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COUNT(l.log_id) AS log_count\nFROM trading_platform.users u\nLEFT JOIN trading_platform.log... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username ch... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 3