conversations
listlengths
2
8
system
stringlengths
288
8.03k
[ { "role": "user", "content": "List all unique wallet addresses present in the system." }, { "role": "assistant", "content": "SELECT DISTINCT address FROM 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.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "I need to find all components associated with a specific supplier. Can you help with that?" }, { "role": "assistant", "content": "HGETALL component:<component_id>\nIF HGET component:<component_id> supplier_id = 'sup:ACME_AERO' THEN INCLUDE" }, { "role": "use...
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. Key pattern: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_numbe...
[ { "role": "user", "content": "List all services belonging to the 'Spa' category, showing their name and price." }, { "role": "assistant", "content": "SELECT service_name, price FROM hospitality_technology.services WHERE category = 'Spa';" }, { "role": "user", "content": "Now, also in...
You are an SQL statement expert. Given the table 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": "How many active insurance policies are there for each plan_id? Show plan_id and active_count." }, { "role": "assistant", "content": "SELECT plan_id,\n COUNT(*) AS active_count\nFROM healthcare.patient_insurance\nWHERE expiration_date IS NULL OR expiration_date...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.text, policy_number.text, group_numb...
[ { "role": "user", "content": "List all guests from California (state_province = 'California') who are loyalty members, along with their email and phone number." }, { "role": "assistant", "content": "SELECT guest_id, first_name, last_name, email, phone_number FROM hospitality_technology.guests WH...
You are an SQL statement expert. Given the table 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, first_name.text, last_name.text, email.text, phone_number.text, date_of_...
[ { "role": "user", "content": "How many documents were uploaded in the year 2023?" }, { "role": "assistant", "content": "SELECT count(*) FROM government_services.documents WHERE date_part('year', upload_timestamp) = 2023;" } ]
You are an SQL statement expert. Given the table 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": "Show each wallet address, the user who owns it, and the number of UTXOs associated with that address." }, { "role": "assistant", "content": "SELECT w.address, w.user_id, COUNT(u.utxo_id) AS utxo_count\nFROM trading_platform.wallets w\nLEFT JOIN trading_platform.utxo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp ) CREATE TAB...
[ { "role": "user", "content": "Show me the email addresses and usernames of users who have sent messages in group chats." }, { "role": "assistant", "content": "SELECT DISTINCT u.email, u.username\nFROM social_media.messages m\nJOIN social_media.conversations c ON m.conversation_id = c.conversatio...
You are an SQL statement expert. Given the table 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 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": "List all pairs of achievements in the same game where the difference in their points is greater than 50." }, { "role": "assistant", "content": "SELECT a1.game_id,\n a1.name AS achv1,\n a2.name AS achv2,\n ABS(a1.points - a2.points) AS point_dif...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "List all patients with active diagnoses of chronic conditions, including their diagnosis details and the diagnosing doctor's specialty." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, dg.diagnosis_code, dg.description, dg.diagnosis_date, d.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 healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "Retrieve the product_id, product_name, base_premium, and created_at for all active insurance products with a base_premium greater than 1000, ordered by base_premium descending." }, { "role": "assistant", "content": "SELECT\n product_id,\n product_name,\n base_pre...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, -- unique identifier for the insurance pr...
[ { "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": "Calculate the average market cap and average 24-hour trading volume for tokens belonging to each narrative category." }, { "role": "assistant", "content": "SELECT narrative, AVG(market_cap) AS average_market_cap, AVG(CAST(REPLACE(total_volume, ',', '') AS NUMERIC)) ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "List smart money addresses, their chain, and profit for those who have incurred a loss. Order the results by the magnitude of the loss (smallest profit value first)." }, { "role": "assistant", "content": "SELECT address, chain, profit FROM smart_money_profit WHERE p...
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 smart_money_profit ( address character varying(100) NOT NULL, rank INT, profit numer...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address." }, { "role": "assistant", "content": "SELECT wallet_address, token_id, contract_address FROM erc20_balances WHERE CAST(amount AS decimal) > 1000;" ...
You are an SQL statement expert. Given the table 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 insurance products that have a base premium greater than 1000 and are currently active, showing product name, type, and base premium." }, { "role": "assistant", "content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WH...
You are an SQL statement expert. Given the table 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": "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": "Retrieve all transactions where the total value of token transfers in that transaction exceeds the Ether value of the transaction itself. Include transaction_id, ether_value, and total_token_value." }, { "role": "assistant", "content": "SELECT\n t.transaction_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 web3.transactions ( transaction_id character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add...
[ { "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": "Show me the name and type for all the locations." }, { "role": "assistant", "content": "SELECT name, type FROM transportation.locations" }, { "role": "user", "content": "Now, filter this list to only include locations whose type is either 'Distribution 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 transportation.locations ( location_id.text, name.text, type.text, address_line1.text, city.text, state_province.text, ...
[ { "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": "Show the symbol, name, and total supply for all SUI coins with status 'active'." }, { "role": "assistant", "content": "SELECT scm.symbol, scm.name, scm.coin_type, scm.total_supply\nFROM sui_coins_metadata scm\nWHERE scm.status = 'active';" }, { "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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Show the names of agencies along with their website URLs which were established before the year 2000." }, { "role": "assistant", "content": "SELECT agency_name, website_url\nFROM government_services.agencies\nWHERE established_date < '2000-01-01';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show the total number of customers in each state." }, { "role": "assistant", "content": "SELECT\n state,\n COUNT(customer_id)\nFROM insurance.customers\nGROUP BY\n state;" } ]
You are an SQL statement expert. Given the table 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": "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": "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": "Get the total balance of each SUI coin per coin_type, including symbol and name from metadata." }, { "role": "assistant", "content": "SELECT sc.coin_type,\n scm.symbol,\n scm.name,\n SUM(CAST(sc.balance AS NUMERIC)) AS total_balance\nFROM sui_coins...
You are an SQL statement expert. Given the table 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": "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": "Please show me all locations that do not have a state or province recorded. Include the location name, city, and country." }, { "role": "assistant", "content": "SELECT name, city, country\nFROM transportation.locations\nWHERE state_province IS NULL OR state_province...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description text, origin_location_id text, destin...
[ { "role": "user", "content": "List all accounts for customers who have at least one account with a balance over 10000 and another account with a balance under 1000. Show customer_id, account_id, account_type, balance, and currency." }, { "role": "assistant", "content": "SELECT account_id , cust...
You are an SQL statement expert. Given the table 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": "How many 'ApprovalForAll' events are recorded for each ERC1155 contract address in the `erc1155_approval_for_all` table?" }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_for_all GROUP BY contract_addres...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "Show me all customers who have missing contact information (either phone number or email is null), along with their state and city." }, { "role": "assistant", "content": "SELECT first_name, last_name, state, city FROM insurance.customers WHERE phone_number IS NULL 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 insurance.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "How many likes were given to comments in June 2024?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS comment_likes_count\nFROM social_media.likes\nWHERE comment_id IS NOT NULL \n AND DATE_TRUNC('month', created_at) = '2024-06-01';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, post_id character varying(64) NOT NULL, user_id char...
[ { "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": "Retrieve each agency’s name along with the count of accessible service locations it has in California." }, { "role": "assistant", "content": "SELECT\n a.agency_name,\n COUNT(l.location_id) AS accessible_location_count\nFROM government_services.agencies a\nJOIN gov...
You are an SQL statement expert. Given the table 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": "Show me all trips that were delayed by more than 1 hour, including their vehicle and driver IDs, along with the origin and destination location IDs." }, { "role": "assistant", "content": "SELECT trip_id, vehicle_id, driver_id, origin_location_id, destination_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 transportation.trips ( trip_id character varying(64) NOT NULL, -- unique identifier for a specific trip instance ...
[ { "role": "user", "content": "Find cases where an address received tokens in one transfer and then sent tokens in another. List the receive transfer_id, the send transfer_id, the address, and both transfer values." }, { "role": "assistant", "content": "SELECT recv.transfer_id AS receive_transfer...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "Show each policy number and the total amount paid for it across all premium payments received so far." }, { "role": "assistant", "content": "SELECT T1.policy_number, SUM(T2.amount_paid) FROM insurance.policies AS T1 JOIN insurance.premium_payments AS T2 ON T1.policy...
You are an SQL statement expert. Given the table 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": "Which vehicles have a total maintenance cost exceeding 10000 across all their maintenance logs?" }, { "role": "assistant", "content": "SELECT vehicle_id, SUM(cost) AS total_maintenance_cost FROM transportation.maintenance_logs GROUP BY vehicle_id HAVING SUM(cost) > ...
You are an SQL statement expert. Given the table 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": "Find all patients who have been prescribed medications with dosage greater than 50mg, along with their medication details and prescribing doctor's name." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pr.dosage, pr.medication_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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "List all wallets holding the NFT with contract_address '0xabc123' and token_id '100' and the amount held." }, { "role": "assistant", "content": "SELECT wallet_address, amount\nFROM nft_holders\nWHERE contract_address = '0xabc123'\n AND token_id = '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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ...
[ { "role": "user", "content": "Show me all users who have commented on a post and have also liked any comment on that same post. I want their user IDs and the corresponding post IDs." }, { "role": "assistant", "content": "SELECT DISTINCT c.user_id, c.post_id\nFROM social_media.comments c\nJOIN so...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "For each 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": "List all service orders for spa services with their guest names and total prices, ordered by total price in descending order." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, so.order_id, so.total_price FROM hospitality_technology.service_ord...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, property_id character varying(64) NOT ...
[ { "role": "user", "content": "For each premium payment, list all previous payments made by the same customer. Show customer_id, previous_payment_id, previous_payment_date, current_payment_id, current_payment_date, and amount difference." }, { "role": "assistant", "content": "SELECT p1.customer_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 insurance.premium_payments ( payment_id text, policy_id text, customer_id text, payment_date timestamp, amount_paid num...
[ { "role": "user", "content": "Get the number of agents grouped by status. Return status and agent_count." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS agent_count\n FROM insurance.agents\n GROUP BY status;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "List the medication_name and manufacturer for all medications where the description is null or an empty string." }, { "role": "assistant", "content": "SELECT medication_name, manufacturer FROM healthcare.medications WHERE description IS NULL OR description = '';" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "What is the fuel efficiency of the train car with car_id 'TC456'?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the fuel efficiency of specific train cars. The data available in the train_cars table only includes deta...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "role": "user", "content": "List the notification message and sent timestamp for all notifications that were sent before '2024-07-01'." }, { "role": "assistant", "content": "SELECT message, sent_at FROM trading_platform.notifications WHERE sent_at < '2024-07-01';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id text, user_id text, message text, sent_at timestamp, read_at timestamp...
[ { "role": "user", "content": "What is the history of incidents or accidents that occurred on platform 5 at station GHI?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about the history of incidents or accidents on platform 5 at station GHI. My data is limited t...
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": "What is the fuel consumption rate of train number T1234?" }, { "role": "assistant", "content": "I'm sorry, but I don't have information on the fuel consumption rate of train number T1234. The data available in the system only includes details such as train ID, model...
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 full names and contact emails of all citizens who have applied for services with a standard fee greater than 100." }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM government_services.citize...
You are an SQL statement expert. Given the table 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 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": "Show me all users who have wallets but have never placed any orders, along with their wallet creation dates." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, w.wallet_id, w.created_at FROM trading_platform.users u JOIN trading_platform.wallets 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.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "Find all smart contracts where the code length is greater than 1000 characters." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE LENGTH(code) > 1000;" }, { "role": "user", "conten...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id text PRIMARY KEY, creator_address text, code text, timestamp timestamp )
[ { "role": "user", "content": "Find the contract address and name for all NFT collections listed on the 'Ethereum' blockchain." }, { "role": "assistant", "content": "SELECT contract_address, name FROM nft_collections WHERE blockchain = 'Ethereum'" }, { "role": "user", "content": "For ...
You are an SQL statement expert. Given the table 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": "What is the current job satisfaction level or feedback from staff members working at a specific train station?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on job satisfaction levels or feedback from staff members as this data is...
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": "Find the most recent verified document for each application, showing application_id, document_id, and verification_timestamp." }, { "role": "assistant", "content": "SELECT d.document_id, d.application_id, d.verification_timestamp\nFROM government_services.documents ...
You are an SQL statement expert. Given the table 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 text PRIMARY KEY, application_id text, citizen_id text, document_type text,...
[ { "role": "user", "content": "Find any two claims made by the same customer on the same day. Return customer_id, the two claim IDs, and the incident date." }, { "role": "assistant", "content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_id,\n c2.claim_id AS claim2_id,\n DAT...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "Show me all claims with police reports that were handled by agents hired in the last 2 years, along with the agent's full name and agency." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, c.incident_date, c.police_report_number, CONCAT(a.first_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "List the citizen IDs for individuals who have both uploaded documents and made payments." }, { "role": "assistant", "content": "SELECT DISTINCT T1.citizen_id FROM documents AS T1 JOIN payments AS T2 ON T1.citizen_id = T2.citizen_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 government_services.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "Show the top 5 properties by average overall review rating." }, { "role": "assistant", "content": "SELECT p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.reviews r\n ON p.property_id = r.pr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "Find services that have associated documents with a 'Pending' verification status. Show the service name and the document type name." }, { "role": "assistant", "content": "SELECT DISTINCT s.service_name, dt.document_type_name FROM government_services.services AS s J...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show a list of all DApps together with the total number of unique assets linked to each via the metadata table." }, { "role": "assistant", "content": "SELECT d.dapp_id, d.name, d.url, COUNT(DISTINCT m.asset_id) AS unique_asset_count\nFROM trading_platform.dapps d\nL...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan...
[ { "role": "user", "content": "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": "List all tokens with a price below $1 and a 24-hour trading volume over $10 million." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE price < 1 AND CAST(total_volume AS double precision) > 100000...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character varying(100) NOT NULL, token_symbol ch...
[ { "role": "user", "content": "List all ERC20 tokens along with their contract addresses and the wallet address holding the largest balance for each token." }, { "role": "assistant", "content": "SELECT eb.contract_address, eb.wallet_address, eb.amount FROM erc20_balances eb WHERE (eb.contract_add...
You are an SQL statement expert. Given the table 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 ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar ) CR...
[ { "role": "user", "content": "List all unread notifications, including the notification ID, type, creation time, and the username of the sender (if available)." }, { "role": "assistant", "content": "SELECT T1.notification_id, T1.notification_type, T1.created_at, T2.username AS sender_username FR...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "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": "List all tokens with a price below $1 and a 24-hour trading volume over $5 million." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE price < 1 AND total_volume::numeric > 5000000;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character varying(100) NOT NULL, token_symbol ch...
[ { "role": "user", "content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and amount." }, { "role": "assistant", "content": "SELECT wallet_address, token_id, amount FROM nft_holders WHERE contract_type = 'ERC1155' AND CAST(amount AS decimal...
You are an SQL statement expert. Given the table 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": "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": "Count the number of registered citizens by gender." }, { "role": "assistant", "content": "SELECT\n gender,\n COUNT(*) AS citizen_count\nFROM government_services.citizens\nGROUP 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "How many agents were hired in the current year and what is their average commission rate?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS hired_this_year, AVG(commission_rate) AS average_commission_rate FROM insurance.agents WHERE EXTRACT(YEAR FROM hire_da...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara...
[ { "role": "user", "content": "Find all pairs of transactions that occurred in the same block and were sent to the same address. Show both transaction IDs, the shared recipient address, and the block number." }, { "role": "assistant", "content": "SELECT t1.transaction_id AS tx1,\n t2.transa...
You are an SQL statement expert. Given the table 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, from_address text, to_address text, value numeric, gas_used integer, gas_price...
[ { "role": "user", "content": "I need a combined report displaying each customer’s full name, their account number, account balance, and the ticker symbol and security name of every security traded in the same currency as their account." }, { "role": "assistant", "content": "SELECT c.first_name |...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ...
[ { "role": "user", "content": "List the first name, last name, email, and phone number of all clients who have a case of type 'Bankruptcy', along with the name of the case." }, { "role": "assistant", "content": "SELECT T1.first_name , T1.last_name , T1.email , T1.phone , T2.case_name FROM leg...
You are an SQL statement expert. Given the table 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": "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 items of rarity 'Epic', displaying the item's name and type, along with the title of the game it is part of." }, { "role": "assistant", "content": "SELECT igi.item_name, igi.item_type, g.title FROM gaming_technology.in_game_items igi JOIN gaming_technolo...
You are an SQL statement expert. Given the table 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(), -- unique identifier for...
[ { "role": "user", "content": "What is the total number of billable hours worked by each lawyer?" }, { "role": "assistant", "content": "SELECT lawyer_id,\n SUM(hours_spent) AS total_billable_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\nGROUP BY 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.time_entries ( entry_id.text, case_id.text, lawyer_id.text, date_worked.date, hours_spent.numeric, billi...
[ { "role": "user", "content": "Count the number of completed premium payments grouped by payment_method." }, { "role": "assistant", "content": "SELECT payment_method,\n COUNT(*) AS payment_count\nFROM insurance.premium_payments\nWHERE status = 'Completed'\nGROUP BY payment_method;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_id text, payment_date timestamp, amo...
[ { "role": "user", "content": "I want a list of game_id and the count of hidden achievements for each game." }, { "role": "assistant", "content": "SELECT game_id, COUNT(*) AS hidden_achievement_count\nFROM gaming_technology.achievements\nWHERE hidden = TRUE\nGROUP BY game_id;" }, { "role"...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "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": "For the 'DeFi' narrative, what is the average ROI and the total net inflow (usd_value where type=1) from smart money token inflow?" }, { "role": "assistant", "content": "SELECT AVG(sm.roi) AS avg_roi, SUM(smt.usd_value) AS total_net_inflow\nFROM smart_money_token_in...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "For each vehicle, list its vehicle_id, license_plate, and any older vehicle of the same type (showing older_vehicle_id and older year)." }, { "role": "assistant", "content": "SELECT cur.vehicle_id,\n cur.license_plate,\n old.vehicle_id AS older_vehicle_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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List the top 5 tokens by net_flow, showing token_symbol, net_flow, pnl, and price." }, { "role": "assistant", "content": "SELECT token_symbol,\n net_flow,\n pnl,\n price\nFROM smart_money_token_performance\nORDER BY net_flow DESC\nLIMIT 5;" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, net_flow.numeric, avg_cost.numeric,...
[ { "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": "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": "For each developer, can you find the next developer in the same country using a self join, returning developer_ids and names?" }, { "role": "assistant", "content": "SELECT d1.developer_id AS current_dev,\n d1.name AS current_name,\n d2.develo...
You are an SQL statement expert. Given the table 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 the full name (first name and last name) of all citizens who have uploaded documents whose expiry date is in the past." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 INNER JOIN governme...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show me the total transaction amount by transaction_type for all transactions processed by employees in the 'Trading' department, along with their department name." }, { "role": "assistant", "content": "SELECT t.transaction_type, SUM(t.amount) AS total_amount, e.dep...
You are an SQL statement expert. Given the table 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.transactions ( transaction_id character varying(64) NOT NULL, -- unique identifier for the trans...
[ { "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": "List all the appointments that overlap in time for the same location, showing both appointment IDs, their start and end times, and the location." }, { "role": "assistant", "content": "SELECT a1.appointment_id AS appointment_id_1, a2.appointment_id AS appointment_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.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "content": "Show me all appointments scheduled to last exactly 60 minutes." }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, doctor_id, appointment_time, duration_minutes, status\nFROM healthcare.appointments\nWHERE duration_minutes = 60;" } ]
You are an SQL statement expert. Given the table 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, -- unique identifier for the appointment ...
[ { "role": "user", "content": "Give a list of all policies where the deductible is less than 1000. Show policy_id, policy_number, start_date, and deductible." }, { "role": "assistant", "content": "SELECT policy_id, policy_number, start_date, deductible\nFROM insurance.policies\nWHERE deductible <...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "What is the current operational status of the train car with car_id 'CAR123'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the current operational status of the train car with car_id 'CAR123'. The data in the train_cars table ...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "role": "user", "content": "List all managers (employees who have other employees reporting to them) along with the count of their direct reports, showing only those with more than 5 reports." }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name, e.last_name, COUNT(r.employ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.employees ( employee_id text PRIMARY KEY, first_name text, last_name text, job_title text, departmen...
[ { "role": "user", "content": "List every diagnosis description paired with every insurance plan's website." }, { "role": "assistant", "content": "SELECT T1.description, T2.website FROM healthcare.diagnoses AS T1 CROSS JOIN healthcare.insurance_plans AS T2;" }, { "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 healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, patient_i...
[ { "role": "user", "content": "List all claim documents that are police reports and were uploaded in the last 30 days, along with their file sizes." }, { "role": "assistant", "content": "SELECT cd.document_id, cd.claim_id, cd.file_size_bytes FROM insurance.claim_documents cd WHERE cd.document_typ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...