conversations listlengths 2 8 | system stringlengths 295 8.03k |
|---|---|
[
{
"role": "user",
"content": "Could you list each game_id along with the count of hidden achievements and the count of visible achievements?"
},
{
"role": "assistant",
"content": "SELECT game_id,\n SUM(CASE WHEN hidden THEN 1 ELSE 0 END) AS hidden_count,\n SUM(CASE WHEN NOT hidden TH... | You are an SQL statement expert. Given the table 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": "List the content and sent time for messages sent by user 'U101'."
},
{
"role": "assistant",
"content": "SELECT content, sent_at FROM social_media.messages WHERE sender_user_id = 'U101';"
},
{
"role": "user",
"content": "Could you also include the group 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 social_media.messages (
message_id character varying(64) NOT NULL, -- unique identifier for the message
convers... |
[
{
"role": "user",
"content": "What is the schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not included in the platfo... | 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.p... |
[
{
"role": "user",
"content": "Count the number of posts that have a media URL but no textual content."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.posts AS T1 WHERE T1.media_url IS NOT NULL AND (T1.content IS NULL OR T1.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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username charac... |
[
{
"role": "user",
"content": "特定の予約ID 'book_zyx' に関連するすべてのチケットの詳細を取得するのを手伝っていただけますか?また、関連する車両情報も含めてください。"
},
{
"role": "assistant",
"content": "SMEMBERS booking:book_zyx:tickets\nHGETALL ticket:<ticket_id>\nHGETALL car:<car_id>"
},
{
"role": "user",
"content": "チェックイン済みのチケットだけを表示するよう... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// Use Hashes for ticket details. Key format: ticket:<ticket_id>
// HSET ticket:tkt_1a2b ticket_i... |
[
{
"role": "user",
"content": "Can you help me fetch the inventory details for components associated with a specific aircraft build, including the batch number, quantity, and warehouse location?"
},
{
"role": "assistant",
"content": "MATCH (ab:AircraftBuild {build_id: 'specific_build_id'})-[:IS_M... | 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 ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str... |
[
{
"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": "For each application that has at least one failed notification, provide the application ID, the total number of notifications received for that application, and the count of failed notifications."
},
{
"role": "assistant",
"content": "SELECT application_id, COUNT(*)... | You are an SQL statement expert. Given the table 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.notifications ( notification_id.text, citizen_id.text, application_id.text, message_subject.text, m... |
[
{
"role": "user",
"content": "List all unique claim handler IDs present in the claims table."
},
{
"role": "assistant",
"content": "SELECT DISTINCT claim_handler_id FROM insurance.claims WHERE claim_handler_id IS NOT 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.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... |
[
{
"role": "user",
"content": "Show me the object ID, coin type, and balance for all SUI coins where the status is 'active'."
},
{
"role": "assistant",
"content": "SELECT object_id, coin_type, balance FROM sui_coins WHERE status = 'active'"
},
{
"role": "user",
"content": "Also, inclu... | You are an SQL statement expert. Given the table 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": "I need to identify pairs of verified documents submitted by the same citizen. For each pair, display the citizen_id, the earlier document_id with its verification timestamp, and the later document_id with its verification timestamp."
},
{
"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 government_services.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz... |
[
{
"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": "Find all contracts where the deployer address is the same as the contract address, indicating self-deployed contracts, and show their network IDs and deployment timestamps."
},
{
"role": "assistant",
"content": "SELECT address, network_id, deployed_at FROM web3.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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "For each group chat, can you show me each participant's username and the date they joined the chat?"
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name, cp.joined_at\nFROM social_media.conversation_participants cp\nJOIN social_media.users u ON cp.... | You are an SQL statement expert. Given the table 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": "Which developers have created games that include at least one item of rarity 'Legendary'? Show the developer_id and the item_name."
},
{
"role": "assistant",
"content": "SELECT d.developer_id, igi.item_name\nFROM gaming_technology.developers d\nJOIN gaming_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 gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ... |
[
{
"role": "user",
"content": "List usernames and the length of their 'bio' field for users whose 'is_verified' status is true."
},
{
"role": "assistant",
"content": "SELECT username, LENGTH(bio) AS bio_length FROM social_media.users WHERE is_verified IS 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.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "For each player, list the total number of 'Legendary' rarity items they have in their inventory, along with the titles of the respective games those items belong to."
},
{
"role": "assistant",
"content": "SELECT pi.player_id, g.game_id, g.title, COUNT(*) AS legendar... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time... |
[
{
"role": "user",
"content": "For each chain, which centralized exchange holds the largest total USD value in their token balance as of the most recent snapshot?"
},
{
"role": "assistant",
"content": "WITH latest_snapshot AS (\n SELECT MAX(snapshot_time) AS max_time FROM cex_token_balance\n)\nS... | You are an SQL statement expert. Given the table 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": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses."
},
{
"role": "assistant",
"content": "SELECT t.name, t.symbol, t.address FROM token_prices_latest t WHERE t.price BETWEEN 1 AND 10;"
},
{
"r... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transaction_index.integer, transaction_hash.... |
[
{
"role": "user",
"content": "Show me all insurance plans that have more than 3 patients enrolled as their primary insurance, along with the provider name and count of patients, sorted by patient count in descending order."
},
{
"role": "assistant",
"content": "SELECT ip.insurance_provider, 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 healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad... |
[
{
"role": "user",
"content": "Show me the top 5 narratives by market cap, along with their 24-hour trading volume and 7-day price change percentage."
},
{
"role": "assistant",
"content": "SELECT narrative.text, volume_24h.numeric, price_change_percentage_7d.numeric FROM narrative_info ORDER BY 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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume... |
[
{
"role": "user",
"content": "Find the total transfer volume for each Avalanche token over the past 7 days and include the token's creator."
},
{
"role": "assistant",
"content": "SELECT a.tick,\n i.creator,\n SUM(a.amt) AS total_volume\nFROM token_activities_avalanche a\nJOIN token_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_... |
[
{
"role": "user",
"content": "What is the number of guests per country, grouped by country_code?"
},
{
"role": "assistant",
"content": "SELECT country_code,\n COUNT(*) AS guest_count\nFROM hospitality_technology.guests\nGROUP BY country_code;"
},
{
"role": "user",
"content": "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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la... |
[
{
"role": "user",
"content": "Show me the service name, category, and price for all services that are currently not available."
},
{
"role": "assistant",
"content": "SELECT service_name, category, price FROM hospitality_technology.services WHERE is_available = FALSE;"
},
{
"role": "user"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.text, description.text, category.text... |
[
{
"role": "user",
"content": "Find all documents that are larger than 5MB. Show the document ID, claim ID, file name, and file size in bytes."
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, file_name, file_size_bytes\nFROM insurance.claim_documents\nWHERE file_size_bytes > 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 insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara... |
[
{
"role": "user",
"content": "List lawyers who have any unbilled time entries. Show their first name, last name, and the count of their unbilled entries."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, COUNT(T2.entry_id) FROM lawyers AS T1 JOIN time_entries AS T2 ON T1... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, bar_number text UNIQUE, firm_id t... |
[
{
"role": "user",
"content": "Find the names of service locations where services categorized as 'Licensing' have had appointments scheduled."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.location_name FROM service_locations AS T1 JOIN appointments AS T2 ON T1.location_id = T2.locatio... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services (
service_id character varying(64) NOT NULL, -- unique identifier for the service
... |
[
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and amount, from the nft_holders table."
},
{
"role": "assistant",
"content": "SELECT wallet_address, token_id, amount FROM nft_holders WHERE contract_type = 'ERC1155... | You are an SQL statement expert. Given the table 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": "Show all medical records with the record_id, record_date, the patient's insurance policy_number, and the doctor's ID, for records linked to a currently active insurance policy."
},
{
"role": "assistant",
"content": "SELECT mr.record_id, mr.record_date, pi.policy_num... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appointment_time.timestamp, duration_mi... |
[
{
"role": "user",
"content": "Find, for each case, pairs of documents where one document_type is 'Contract' and the other is 'Evidence'. Return the case_id, the name of the contract document as contract_name, and the name of the evidence document as evidence_name."
},
{
"role": "assistant",
"con... | You are an SQL statement expert. Given the table 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": "List the plan_id, plan_name, and plan_type for all insurance plans where the insurance_provider is 'Humana'."
},
{
"role": "assistant",
"content": "SELECT\n plan_id,\n plan_name,\n plan_type\nFROM healthcare.insurance_plans\nWHERE\n insurance_provider = 'Humana'... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "What is the detailed repair history for train number T5678?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the detailed repair history for train number T5678 as this information is not available in the current database table. The table only 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 train_station_management.t... |
[
{
"role": "user",
"content": "Show the IDs and registration dates of all verified citizens who could be eligible for at least one active service. Display the citizen ID and registration date."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.citizen_id, c.registration_date\nFROM governmen... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "Which exchanges hold the highest total USD value of tokens on the Ethereum chain, and what are their top 3 tokens by USD value?"
},
{
"role": "assistant",
"content": "SELECT exchange, token_symbol, usd_value FROM (SELECT exchange, token_symbol, usd_value, ROW_NUMBER... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE cex_token_balance ( snapshot_time text, chain text, address text, exchange text, token_address text, token_symbol text,... |
[
{
"role": "user",
"content": "Could you list all pairs of developers that are based in the same country and share the same website domain?"
},
{
"role": "assistant",
"content": "SELECT\n d1.name AS developer1_name,\n d2.name AS developer2_name,\n d1.country,\n d1.website\nFROM\n gaming_tech... | You are an SQL statement expert. Given the table 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 NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d... |
[
{
"role": "user",
"content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount, sorted by amount in descending order."
},
{
"role": "assistant",
"content": "SELECT b.wallet_address, t.symbol, b.amount FROM erc20_balances b JOIN sui_coin... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "List all appointments scheduled for '2024-07-25' with a status of 'Scheduled'."
},
{
"role": "assistant",
"content": "SELECT * FROM legal_services.appointments WHERE DATE(start_time) = '2024-07-25' AND status = 'Scheduled'"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ... |
[
{
"role": "user",
"content": "Which smart money address on the Ethereum chain has the lowest ROI, and what are their profit and rank?"
},
{
"role": "assistant",
"content": "SELECT address, roi, profit, rank FROM smart_money_profit WHERE chain = 'Ethereum' ORDER BY roi ASC 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 smart_money_profit ( address.text, rank.numeric, profit.numeric, roi.numeric, realized_ratio.numeric, most_profit_token... |
[
{
"role": "user",
"content": "For each recipient address, count how many token transfers they have received."
},
{
"role": "assistant",
"content": "SELECT to_address, COUNT(*) AS received_transfer_count FROM web3.token_transfers GROUP BY to_address;"
},
{
"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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ... |
[
{
"role": "user",
"content": "For each doctor, show their full name along with all plan names of insurance plans that have a 'contact_phone' beginning with '+44'."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, ip.plan_name\nFROM healthcare.doctors d\nCROSS JOIN healthca... | You are an SQL statement expert. Given the table 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": "Can you list all SUI coins with 'active' status and their owner addresses and balances?"
},
{
"role": "assistant",
"content": "SELECT object_id, coin_type, owner, balance\nFROM sui_coins\nWHERE status = 'active';"
},
{
"role": "user",
"content": "Add the... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ... |
[
{
"role": "user",
"content": "List the booking ID, the first name, and the last name of the passenger for all bookings."
},
{
"role": "assistant",
"content": "SELECT T1.booking_id , T2.first_name , T2.last_name FROM transportation.bookings AS T1 JOIN transportation.passengers AS T2 ON T1.passeng... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text... |
[
{
"role": "user",
"content": "Show me document_id, application_id, and verification_status for all documents submitted by citizen 'cit123'."
},
{
"role": "assistant",
"content": "SELECT document_id,\n application_id,\n verification_status\nFROM documents\nWHERE citizen_id = 'cit123';... | You are an SQL statement expert. Given the table 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": "Get a list of room types along with their property name and the count of rooms currently Available for each type."
},
{
"role": "assistant",
"content": "SELECT rt.type_name, p.property_name, COUNT(r.room_id) AS available_rooms_count\nFROM hospitality_technology.room... | You are an SQL statement expert. Given the table 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 all rooms that have a 'Jacuzzi' feature, including the room_number, property_id, type_name, and base_rate."
},
{
"role": "assistant",
"content": "SELECT r.room_number,\n r.property_id,\n rt.type_name,\n rt.base_rate\nFROM 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.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat... |
[
{
"role": "user",
"content": "List each guest’s full name and the total number of service orders they have placed, ordered by order count descending."
},
{
"role": "assistant",
"content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n COUNT(so.order_id) AS 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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te... |
[
{
"role": "user",
"content": "Show me all lawyers' full names, their bar number, and if they are partners, the full name of another partner from their firm."
},
{
"role": "assistant",
"content": "SELECT l1.first_name || ' ' || l1.last_name AS lawyer_full_name, l1.bar_number,\n CASE WHEN l1... | You are an SQL statement expert. Given the table 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 number of game servers in each region and the average maximum number of players they can accommodate. Exclude any servers that are currently offline."
},
{
"role": "assistant",
"content": "SELECT region, COUNT(server_id) AS server_count, AVG(max_players)... | You are an SQL statement expert. Given the table 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 each employee's first and last name along with their manager's first and last name."
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS employee_name,\n m.first_name || ' ' || m.last_name AS manager_name\nFROM financial_ser... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba... |
[
{
"role": "user",
"content": "Can you show, for each employee, the full name and job title of their direct manager, as well as the employee's department and branch_id?"
},
{
"role": "assistant",
"content": "SELECT e.employee_id, e.first_name AS employee_first_name, e.last_name AS employee_last_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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri... |
[
{
"role": "user",
"content": "Can you give me the total number of appointments grouped by status?"
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS total_appointments\nFROM healthcare.appointments\nGROUP BY status;"
},
{
"role": "user",
"content": "Filter the ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,... |
[
{
"role": "user",
"content": "Find pairs of claims filed by the same customer where the incident dates are within 7 days of each other. Return customer_id, both claim IDs, and their incident dates."
},
{
"role": "assistant",
"content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_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.claims (
claim_id character varying(64) NOT NULL, -- unique identifier for the claim
policy_id charac... |
[
{
"role": "user",
"content": "Find all nodes that were last seen in the last 7 days, along with their IP addresses and ports."
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '7 days';"
},
{
"role": "user",
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic... |
[
{
"role": "user",
"content": "For projects that have completed more than one fundraising round, calculate the average investment value across all their recorded rounds. Display the project name and this average value."
},
{
"role": "assistant",
"content": "SELECT project_name, AVG(investment_val... | You are an SQL statement expert. Given the table 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": "List all users who have bought assets, along with their wallet addresses."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.user_id, T1.address FROM wallets AS T1 JOIN trades AS T2 ON T1.user_id = T2.buyer_id;"
},
{
"role": "user",
"content": "Fi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
CREATE ... |
[
{
"role": "user",
"content": "List each employee's first and last name along with the count of active services offered by their agency."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS active_service_count\nFROM government_services.employees e\nJOIN... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "Show me the top 5 narratives by market cap, along with their 24-hour trading volume and 7-day price change percentage."
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap, volume_24h, price_change_percentage_7d FROM narrative_info ORDER BY market_cap... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE narrative_info (",
"narrative character varying(512) NOT NULL, -- the id of narrative",
"top_3_coins text, --... |
[
{
"role": "user",
"content": "List all node pairs that operate on the same port and were last_seen within 30 minutes of each other, showing both node_ids, the port, and the time difference in minutes."
},
{
"role": "assistant",
"content": "SELECT n1.node_id AS node1_id, n2.node_id AS node2_id, n... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
|
[
{
"role": "user",
"content": "How many unique patient records are there for each gender?"
},
{
"role": "assistant",
"content": "SELECT gender, COUNT(DISTINCT patient_id) AS patient_count FROM healthcare.patients GROUP BY gender;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ... |
[
{
"role": "user",
"content": "List all loans (loan_id, loan_type, principal_amount) that have a current principal balance less than 25% of the original principal amount, along with their account_id and the difference between principal_amount and current_principal_balance."
},
{
"role": "assistant",
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.loans ( loan_id text, account_id text, loan_type text, principal_amount numeric, current_principal_b... |
[
{
"role": "user",
"content": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan."
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) AS enrolled_patie... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "What is the total revenue generated by ticket sales at the station with ID 'ST101' for the past month?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the revenue generated by ticket sales as this data is not available in the cur... | 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": "What is the ticket price for a journey on train number T4321?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about ticket prices for specific trains. The data I have is limited to train details such as model, manufacturer, c... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.t... |
[
{
"role": "user",
"content": "How many reviews does each staff member respond to, along with their full name and the average response time in hours?"
},
{
"role": "assistant",
"content": "SELECT st.staff_id,\n st.first_name || ' ' || st.last_name AS staff_full_name,\n COUNT(*) AS res... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "List all spa services (category = 'Wellness') with their names, prices, and units, ordered by price in descending order."
},
{
"role": "assistant",
"content": "SELECT service_name, price, unit FROM hospitality_technology.services WHERE category = 'Wellness' ORDER 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 hospitality_technology.guests (
guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil... |
[
{
"role": "user",
"content": "Which employees have been assigned to applications for services with a standard fee greater than 200? Show the employee's full name, job title, application ID, and the service name."
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "For each category, list all pairs of services where one is active and the other is inactive. Show the category, active service name, and inactive service name."
},
{
"role": "assistant",
"content": "SELECT a.category,\n a.service_name AS active_service,\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 government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli... |
[
{
"role": "user",
"content": "List the document ID, document type, and verification status for all documents verified by employees working for the agency with ID 'AG101'. Also include the verifying employee's full name."
},
{
"role": "assistant",
"content": "SELECT T1.document_id , T1.document_... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs."
},
{
"role": "assistant",
"content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS case_id_2 FROM lega... | You are an SQL statement expert. Given the table 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": "Count the number of policies issued in each calendar year, and show the year and the count."
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM issued_at), COUNT(*) FROM insurance.policies WHERE issued_at IS NOT NULL GROUP BY 1 ORDER BY 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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... |
[
{
"role": "user",
"content": "Find all contracts where the deployer address is the same as the contract address, indicating self-deployed contracts."
},
{
"role": "assistant",
"content": "SELECT address, deployer_address FROM web3.contracts WHERE address = deployer_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 web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,... |
[
{
"role": "user",
"content": "List each wallet with its wallet_id, user_id, and the total amount of unspent UTXOs associated with that wallet."
},
{
"role": "assistant",
"content": "SELECT\n w.wallet_id,\n w.user_id,\n COALESCE(SUM(u.amount), 0) AS unspent_total\nFROM trading_platform.wallets... | You are an SQL statement expert. Given the table 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": "For each Bitcoin token tick, show me the creator address from the token_info_bitcoin table and the number of unique wallets currently holding that token."
},
{
"role": "assistant",
"content": "SELECT ti.tick, ti.creator, COUNT(DISTINCT tb.wallet_address) AS unique_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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "What are the safety ratings or crash statistics for the Boeing 787 Dreamliner?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to safety ratings or crash statistics for specific aircraft models like the Boeing 787 Dreamliner. My data is lim... | 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": "Find all pairs of different insurance records that share the same group_number, and show group_number, the patient_insurance_id of both records, and their corresponding patient_ids."
},
{
"role": "assistant",
"content": "SELECT a.group_number,\n a.patient_insu... | You are an SQL statement expert. Given the table 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": "Count the total number of premium payments made in the year 2024."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM premium_payments WHERE EXTRACT(YEAR FROM payment_date) = 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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,... |
[
{
"role": "user",
"content": "Show me all reservations with their guest IDs and room IDs where the total amount is greater than $500 and the status is 'Confirmed', ordered by check-in date."
},
{
"role": "assistant",
"content": "SELECT reservation_id, guest_id, room_id, check_in_date, total_amou... | You are an SQL statement expert. Given the table 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 all rooms that are on floor 3."
},
{
"role": "assistant",
"content": "SELECT room_id, property_id, room_number FROM hospitality_technology.rooms WHERE floor = 3;"
},
{
"role": "user",
"content": "For these rooms, include the property name and room n... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... |
[
{
"role": "user",
"content": "Find employees who are managers and list the number of employees they directly manage. Show the manager's full name and the count of their direct reports."
},
{
"role": "assistant",
"content": "SELECT m.first_name || ' ' || m.last_name AS manager_full_name, COUNT(e.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.employees (
employee_id character varying(64) NOT NULL, -- unique identifier for the government... |
[
{
"role": "user",
"content": "Calculate the total and average cost per service_type in maintenance_logs."
},
{
"role": "assistant",
"content": "SELECT\n service_type,\n SUM(cost) AS total_cost,\n AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nGROUP BY service_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 transportation.maintenance_logs ( log_id text, vehicle_id text, service_date date, odometer_reading integer, service_ty... |
[
{
"role": "user",
"content": "Show me the document name and the date worked for time entries logged by the same lawyer."
},
{
"role": "assistant",
"content": "SELECT T1.document_name , T2.date_worked FROM documents AS T1 JOIN time_entries AS T2 ON T1.uploaded_by_lawyer_id = T2.lawyer_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 legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u... |
[
{
"role": "user",
"content": "List the usernames of players who own at least one item from the game with title 'Game Title X'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username FROM players AS T1 INNER JOIN player_inventory AS T2 ON T1.player_id = T2.player_id INNER JOIN items 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 gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, ite... |
[
{
"role": "user",
"content": "List pairs of wallet IDs owned by the same user where the creation dates are more than one year apart. Show the user ID and the wallet IDs of both wallets."
},
{
"role": "assistant",
"content": "SELECT w1.user_id, w1.wallet_id AS wallet_id_1, w2.wallet_id AS wallet_... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"role": "user",
"content": "List all appointments scheduled in the next 30 days with appointment_id, client_id, case_id, and any invoice_id linked to that case."
},
{
"role": "assistant",
"content": "SELECT\n a.appointment_id,\n a.client_id,\n a.case_id,\n i.invoice_id\nFROM legal_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 legal_services.law_firms (
firm_id character varying(64) NOT NULL, -- unique identifier for the law firm
firm_... |
[
{
"role": "user",
"content": "List all users whose email contains the word 'block', along with their username and registration timestamp."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, created_at\nFROM web3.users\nWHERE email ILIKE '%block%';"
},
{
"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 web3.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
|
[
{
"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": "List all users who have never followed anyone, showing their username, full name, email, and account creation date."
},
{
"role": "assistant",
"content": "SELECT u.username,\n u.full_name,\n u.email,\n u.created_at\nFROM social_media.users AS u\nLE... | You are an SQL statement expert. Given the table 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": "For each guest, calculate their total spending on delivered service orders and the total number of those orders."
},
{
"role": "assistant",
"content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n SUM(so.total_price) AS total_s... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te... |
[
{
"role": "user",
"content": "What are the fuel consumption rates per hour for the Boeing 747-8 model?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the fuel consumption rates for the Boeing 747-8 model as this data is not included in the aircraft_models ta... | 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": "Show me assets along with their associated 'symbol' metadata value. Assume an assets table with asset_id exists."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, m.value FROM assets a JOIN metadata m ON a.asset_id = m.asset_id WHERE m.key = 'symbol'"
},
... | 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 trading_platform.utxos ( utxo_id text PRIMARY KEY, transaction_id text, output_index... |
[
{
"role": "user",
"content": "Find all smart contracts where the code length is greater than 1000 characters."
},
{
"role": "assistant",
"content": "SELECT contract_id, creator_address, LENGTH(code) AS code_length FROM blockchain.smart_contracts WHERE LENGTH(code) > 1000;"
},
{
"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 blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
|
[
{
"role": "user",
"content": "List all patients who do not have an email address on file, showing their patient_id, first_name, last_name, and phone_number."
},
{
"role": "assistant",
"content": "SELECT patient_id,\n first_name,\n last_name,\n phone_number\nFROM healthcare.pati... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "Can you list the number of citizens registered each month in 2024? Please show the month and the citizen count."
},
{
"role": "assistant",
"content": "SELECT TO_CHAR(registration_date, 'YYYY-MM') AS registration_month, COUNT(*) AS citizen_count FROM government_servi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "List all properties and the room types they offer, including the base rate for each room type."
},
{
"role": "assistant",
"content": "SELECT T1.property_name, T2.type_name, T2.base_rate FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_ty... | You are an SQL statement expert. Given the table 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 all time entries, including the case name they are associated with."
},
{
"role": "assistant",
"content": "SELECT T1.*, T2.case_name FROM time_entries AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id"
},
{
"role": "user",
"content": "Only show 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 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": "What are the specific tools or equipment used during the maintenance with record_id 'REC456'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the specific tools or equipment used during a maintenance record. The data in the ma... | 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": "Count how many appointments have been canceled at each location. Return the location and cancelled_count."
},
{
"role": "assistant",
"content": "SELECT location, COUNT(*) AS cancelled_count\nFROM legal_services.appointments\nWHERE status = 'Canceled'\nGROUP BY locat... | You are an SQL statement expert. Given the table 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": "Which citizens have received notifications for applications processed by employees from the 'Legal' department? List the citizen ID, full name, and notification ID."
},
{
"role": "assistant",
"content": "SELECT n.citizen_id, CONCAT(e.first_name, ' ', e.last_name) AS... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text, agency_name text, jurisdiction_level text, primary_contact_email text, m... |
[
{
"role": "user",
"content": "For each route that originates from a location of type 'Port', list the route number, the name of the origin location, and the total distance accumulated from all completed trips on this route."
},
{
"role": "assistant",
"content": "SELECT\n r.route_number,\n l_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.