conversations
listlengths
2
8
system
stringlengths
288
8.23k
[ { "role": "user", "content": "For each reservation, show me the guest's full name, the property name, and the room type name." }, { "role": "assistant", "content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS guest_full_name, p.property_name, rt.type_name AS room_type_name\nFR...
You are an SQL statement expert. Given the table 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": "What is the average speed of train number T9876 during its last journey?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the average speed of train number T9876 during its last journey. The data in the trains table does not inclu...
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": "Could you show me each employee's full name along with their manager's full name?" }, { "role": "assistant", "content": "SELECT e.employee_id,\n e.first_name || ' ' || e.last_name AS employee_name,\n m.employee_id AS manager_id,\n m.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 government_services.employees ( employee_id character varying(64) NOT NULL, -- unique identifier for the government...
[ { "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": "What are the maintenance costs for a specific aircraft model like the Airbus A320?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to data regarding maintenance costs for specific aircraft models such as the Airbus A320. The information in ...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE manufacturing.aircraft_mod...
[ { "role": "user", "content": "List all guests who have communication consent enabled along with their email addresses." }, { "role": "assistant", "content": "SELECT guest_id,\n first_name || ' ' || last_name AS full_name,\n email\nFROM guests\nWHERE communication_consent = TRUE;" }...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts." }, { "role": "assistant", "content": "SELECT policy_id, product_id, premium_amount, end_date FROM insurance.policies WHERE status = 'Expired' AND end_date >= CU...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "For each route, list the route_number, origin city, destination city, and the total fare collected from completed bookings." }, { "role": "assistant", "content": "SELECT\n r.route_number,\n lo.city AS origin_city,\n ld.city AS destination_city,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "For each token, show its token_id, decimals, and the average total_supply of all tokens with the same decimals." }, { "role": "assistant", "content": "SELECT t.token_id,\n t.decimals,\n avg_data.avg_total_supply\nFROM web3.tokens t\nJOIN (\n SELECT deci...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "List the document ID, document_type, verification_timestamp, the full name of the employee who verified each document, and the agency_name for all documents verified in the last 30 days." }, { "role": "assistant", "content": "SELECT d.document_id,\n d.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": "Show me all insurance plans where the website includes 'secure'." }, { "role": "assistant", "content": "SELECT * FROM healthcare.insurance_plans WHERE website ILIKE '%secure%';" } ]
You are an SQL statement expert. Given the table 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": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and have a daily trading volume exceeding 1 million shares, along with the account details (account_id, account_number, balance) of customers who hold these securities in t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "Show each player with their player_id, username, the number of distinct in-game items they own, and the total quantity of those items." }, { "role": "assistant", "content": "```sql\nSELECT\n p.player_id,\n p.username,\n COUNT(DISTINCT i.item_id) AS distinct_item_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "Which chain has the highest total USD inflow from buy transactions (type=1), and how many distinct tokens were involved in that inflow?" }, { "role": "assistant", "content": "SELECT chain, SUM(usd_value) AS total_inflow, COUNT(DISTINCT token_symbol) AS distinct_toke...
You are an SQL statement expert. Given the table 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_inflow ( token_address text, token_symbol text, token_amount numeric, usd_value numeric, avg_price nu...
[ { "role": "user", "content": "For each user, list all the distinct actions they have performed along with the count of each action." }, { "role": "assistant", "content": "SELECT user_id, action, COUNT(*) FROM trading_platform.logs GROUP BY user_id, action ORDER BY user_id, action;" }, { ...
You are an SQL statement expert. Given the table 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.logs ( log_id character varying(64) NOT NULL, user_id character varying(64), action character varying(...
[ { "role": "user", "content": "Can you help me retrieve the inventory details for a specific component ID, including the quantity and warehouse location?" }, { "role": "assistant", "content": "HGETALL inv:<inventory_record_id>" }, { "role": "user", "content": "Can you also include the...
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: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c...
[ { "role": "user", "content": "I want to find pairs of developers that share the same website domain. For each pair, show both developer names and the domain." }, { "role": "assistant", "content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.domain AS domain\nFROM (\n SELECT develope...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "I need a list of customers who have filed at least one claim, along with the count of their claims and the total estimated loss per customer." }, { "role": "assistant", "content": "SELECT c.customer_id,\n COUNT(cl.claim_id) AS claim_count,\n SUM(cl.estim...
You are an SQL statement expert. Given the table 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 pairs of citizens who have the same last name but different national_id_number." }, { "role": "assistant", "content": "SELECT c1.citizen_id AS citizen_id_1, c1.first_name AS first_name_1, c1.last_name AS last_name_1, c1.national_id_number AS national_id_1, c2.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 government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "Which locations have received fuel logs greater than 300 liters in total? Please include the location name and city." }, { "role": "assistant", "content": "SELECT l.name AS location_name, l.city, SUM(f.quantity) AS total_quantity\nFROM transportation.fuel_logs f\nJO...
You are an SQL statement expert. Given the table 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": "Give me the total number of reservations and the sum of total_amount by month for the year 2023." }, { "role": "assistant", "content": "SELECT DATE_TRUNC('month', check_in_date) AS month,\n COUNT(*) AS reservation_count,\n SUM(tot...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r...
[ { "role": "user", "content": "Find the top 3 tokens by total supply that have a token symbol starting with 'T', showing their token names, contract addresses, and total supply." }, { "role": "assistant", "content": "SELECT token_name, contract_address, total_supply FROM web3.tokens WHERE token_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 web3.tokens ( token_id.text, contract_address.text, token_name.text, token_symbol.text, decimals.integer, total_supply....
[ { "role": "user", "content": "How many medications does each manufacturer have?" }, { "role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS med_count\nFROM healthcare.medications\nGROUP BY manufacturer;" }, { "role": "user", "content": "Only include manufacturers with mor...
You are an SQL statement expert. Given the table 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.medications ( medication_id character varying(64) NOT NULL, medication_name character varying(255) NOT NULL,...
[ { "role": "user", "content": "Find employees who work in the same department as their manager. Display the employee's full name, the manager's full name, and the department they share." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, m.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 government_services.employees ( employee_id character varying(64) NOT NULL, -- unique identifier for the government...
[ { "role": "user", "content": "Count how many posts have media attachments." }, { "role": "assistant", "content": "SELECT count(*) FROM social_media.posts WHERE media_url 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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "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 the user ID, username, and wallet address for all users who have at least one unspent UTXO associated with any of their wallets." }, { "role": "assistant", "content": "SELECT DISTINCT T1.user_id, T1.username, T2.address FROM trading_platform.users AS T1 JOIN tr...
You are an SQL statement expert. Given the table 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": "List all agents along with their manager's first and last name for agents whose status is 'active'." }, { "role": "assistant", "content": "SELECT a.agent_id,\n a.first_name AS agent_first_name,\n a.last_name AS agent_last_name,\n m.agent_id AS mana...
You are an SQL statement expert. Given the table 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": "What is the average number of days by which paid invoices were paid late? Calculate the average of (payment_date - due_date) for invoices with status 'Paid'." }, { "role": "assistant", "content": "SELECT AVG((payment_date::date - due_date)) AS average_late_days\nFRO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id character varying(64) NOT NULL, invoice_number character varying(100) UNIQUE NOT N...
[ { "role": "user", "content": "Provide a count of citizens registered per calendar year." }, { "role": "assistant", "content": "SELECT CAST(EXTRACT(YEAR FROM registration_date) AS INTEGER) AS registration_year, COUNT(*) AS citizen_count FROM government_services.citizens 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "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": "How many conversations are group chats?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.conversations WHERE is_group_chat = TRUE;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "Could you list the route number and description for any routes that have a fuel log entry associated with their origin or destination location?" }, { "role": "assistant", "content": "SELECT DISTINCT T1.route_number, T1.description FROM transportation.routes AS T1 JO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, -- unique identifier for the driver employe...
[ { "role": "user", "content": "Show the latest version number of each document_name for every case." }, { "role": "assistant", "content": "SELECT case_id,\n document_name,\n MAX(version) AS latest_version\nFROM legal_services.documents\nGROUP BY case_id, document_name;" }, { "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u...
[ { "role": "user", "content": "Find all DApps that have been interacted with by users who have wallets with more than 1000 in their order quantities." }, { "role": "assistant", "content": "SELECT DISTINCT d.dapp_id, d.name, d.description FROM trading_platform.dapps d JOIN trading_platform.orders ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "Show me the security_id, open_price, close_price, and volume for all market data points where the adjusted_close_price increased by more than 5% compared to the previous day's close, along with the data_timestamp." }, { "role": "assistant", "content": "SELECT m1.sec...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.market_data ( data_point_id bigint, security_id text, data_timestamp timestamp, open_price numeric, ...
[ { "role": "user", "content": "For each group chat, list its ID, name, creation time, and the creation time of the next group chat created after it, ordered by creation time." }, { "role": "assistant", "content": "SELECT conversation_id, group_name, created_at, LEAD(created_at) OVER (ORDER BY cre...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.conversations ( conversation_id character varying(64) NOT NULL, created_at timestamp NOT NULL DEFAULT CURR...
[ { "role": "user", "content": "List all Sui NFT collections where the owner is not null, including their name and collection_type." }, { "role": "assistant", "content": "SELECT name, collection_type FROM sui_nfts WHERE owner IS NOT NULL;" }, { "role": "user", "content": "Can you filte...
You are an SQL statement expert. Given the table 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 me all room types with their property IDs and amenities where the description includes 'ocean view'." }, { "role": "assistant", "content": "SELECT room_type_id, property_id, amenities FROM hospitality_technology.room_types WHERE description LIKE '%ocean view%';...
You are an SQL statement expert. Given the table 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 country code, what is the earliest registration date of a player?" }, { "role": "assistant", "content": "SELECT country_code, MIN(registration_date) AS earliest_reg_date FROM gaming_technology.players GROUP BY country_code;" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "List all appointments showing the appointment ID, the citizen's full name, and the name of the service associated with the appointment." }, { "role": "assistant", "content": "SELECT appt.appointment_id, c.first_name || ' ' || c.last_name AS citizen_full_name, s.serv...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Show me a list of all achievements with their name, point value, and the title of the game they are part of." }, { "role": "assistant", "content": "SELECT\n T1.name,\n T1.points,\n T2.title\nFROM gaming_technology.achievements AS T1\nJOIN gaming_technology.games ...
You are an SQL statement expert. Given the table 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": "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 me all properties in California with their star ratings and the total number of rooms they have, ordered by the room count in descending order." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, p.star_rating, COUNT(r.room_id) AS 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": "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": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own." }, { "role": "assistant", "content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.users ...
You are an SQL statement expert. Given the table 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": "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": "List the usernames and full names of users who created their account in 2024 and are verified." }, { "role": "assistant", "content": "SELECT username, full_name FROM social_media.users WHERE created_at >= '2024-01-01' AND created_at < '2025-01-01' AND is_verified = ...
You are an SQL statement expert. Given the table 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": "Find pairs of distinct routes that share the same destination location but start from different origins. Include the route ID and route number for both routes and the shared destination location ID." }, { "role": "assistant", "content": "SELECT\n r1.route_id AS rou...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "List asset_id, issuer and launch_date metadata values for each asset that has both 'issuer' and 'launch_date' keys." }, { "role": "assistant", "content": "SELECT m_iss.asset_id,\n m_iss.value AS issuer,\n m_ld.value AS launch_date\nFROM trading_platform....
You are an SQL statement expert. Given the table 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.metadata ( metadata_id character varying(64) NOT NULL, asset_id character varying(64) NOT NULL, key ch...
[ { "role": "user", "content": "Can you provide a list of all medical records created by doctors for patients who are associated with 'PPO' type insurance plans? I need the record ID, patient ID, doctor ID, record date, and insurance plan name." }, { "role": "assistant", "content": "SELECT mr.reco...
You are an SQL statement expert. Given the table 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.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "role": "user", "content": "List all NFT collections where the floor price is greater than 0.5 ETH, including their names and contract addresses." }, { "role": "assistant", "content": "SELECT name, contract_address FROM nft_collections WHERE CAST(floor_price AS decimal) > 0.5 AND floor_price_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 token_metas ( block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded ...
[ { "role": "user", "content": "Show me the name of each document, the name of the case it belongs to, and the full name of the lawyer who uploaded it." }, { "role": "assistant", "content": "SELECT T1.document_name, T2.case_name, T3.full_name FROM documents AS T1 JOIN cases AS T2 ON T1.case_id = T...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "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 text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "For service orders delivered in the last 30 days, show each guest's ID, first and last name, the count of service orders, and total spent." }, { "role": "assistant", "content": "SELECT so.guest_id,\n g.first_name,\n g.last_name,\n COUNT(*) AS order...
You are an SQL statement expert. Given the table 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": "Show me all diesel fuel logs where the quantity is more than 100 liters, including the vehicle ID and total cost." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, quantity, total_cost FROM transportation.fuel_logs WHERE fuel_type = 'diesel' AND...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "What is the current address of the employee with ID 'EMP234'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the current address of an employee as this information is not stored in the database table." } ]
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE manufacturing.employees ( ...
[ { "role": "user", "content": "Show me all active policies for customers who live in California, along with their total premium payments made so far." }, { "role": "assistant", "content": "SELECT p.policy_id, p.policy_number, c.first_name, c.last_name, p.premium_amount, SUM(pp.amount_paid) AS tot...
You are an SQL statement expert. Given the table 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": "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": "List the block_id, timestamp, and the total amount of transactions for each block, along with the sender and receiver addresses for each transaction that occurred on April 10th, 2023." }, { "role": "assistant", "content": "SELECT b.block_id, b.timestamp, t.sender_ad...
You are an SQL statement expert. Given the table 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": "Find all users who registered with a Yahoo email address, along with their registration dates." }, { "role": "assistant", "content": "SELECT user_id, username, email, password_hash FROM blockchain.users WHERE email LIKE '%@yahoo.com';" }, { "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": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address, from the nft_holders table." }, { "role": "assistant", "content": "SELECT nh.wallet_address, nh.token_id, nh.contract_address FROM nft_holders 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "Show me all trips that were completed with a passenger count greater than 15, including their route and vehicle details." }, { "role": "assistant", "content": "SELECT t.trip_id, t.route_id, t.vehicle_id, t.driver_id, t.scheduled_departure, t.actual_departure, t.sche...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti...
[ { "role": "user", "content": "Count the number of logs for each action type." }, { "role": "assistant", "content": "SELECT action,\n COUNT(*) AS count\nFROM trading_platform.logs\nGROUP BY action;" } ]
You are an SQL statement expert. Given the table 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.logs ( log_id text PRIMARY KEY, user_id text, action text, details text, logged_at timestamp )
[ { "role": "user", "content": "List all item names and quantities a player with username 'DragonRider' owns, and include the game titles for those items." }, { "role": "assistant", "content": "SELECT i.item_name, pi.quantity, g.title AS game_title\nFROM gaming_technology.players p\nJOIN gaming_te...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt...
[ { "role": "user", "content": "For each trip, show the trip_id, vehicle's license plate, total fuel quantity, and number of fueling events." }, { "role": "assistant", "content": "SELECT t.trip_id, v.license_plate, SUM(f.quantity) AS total_fuel, COUNT(f.fuel_log_id) AS fueling_events FROM transpor...
You are an SQL statement expert. Given the table 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": "How many users registered on each date?" }, { "role": "assistant", "content": "SELECT DATE(created_at) AS registration_date, COUNT(*) AS user_count FROM web3.users GROUP BY DATE(created_at) ORDER BY registration_date;" }, { "role": "user", "content": "Ac...
You are an SQL statement expert. Given the table 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": "For each driver, show their driver_id, first_name, last_name, along with any other driver whose license_expiry_date is earlier than theirs." }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver_id,\n d1.first_name,\n d1.last_name,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Calculate the average number of days between when an incident occurred and when the claim was reported, but only for claims that were settled in the year 2023." }, { "role": "assistant", "content": "SELECT\n AVG(EXTRACT(EPOCH FROM (reported_date - incident_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 insurance.claims ( claim_id character varying(64) NOT NULL, -- unique identifier for the claim policy_id charac...
[ { "role": "user", "content": "Show me the top 5 most recently minted NFTs on the Ethereum blockchain with their contract_address, token_id, name, and rarity_score from nft_metadata." }, { "role": "assistant", "content": "SELECT contract_address, token_id, name, rarity_score\nFROM nft_metadata\nW...
You are an SQL statement expert. Given the table 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 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": "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": "List the first name, last name, and date of birth for all citizens born before January 1, 1995." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM government_services.citizens WHERE date_of_birth < '1995-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 character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show me the policy number, claim ID, document file name, and document type for all policies that have associated claim documents." }, { "role": "assistant", "content": "SELECT T1.policy_number, T2.claim_id, T3.file_name, T3.document_type FROM insurance.policies AS T...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "For each chain, which token had the highest number of smart money addresses buying it this week? Show the token symbol and narrative too." }, { "role": "assistant", "content": "SELECT chain, token_symbol, narrative, MAX(address_amount) AS max_buyers FROM smart_money...
You are an SQL statement expert. Given the table 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_inflow ( token_address character varying(100) NOT NULL, -- the token's address token_symbol character...
[ { "role": "user", "content": "Show me all reservations with more than 2 adults that are confirmed (status = 'Confirmed'), including their check-in dates and total amounts, along with the guest's first and last name." }, { "role": "assistant", "content": "SELECT r.reservation_id, r.check_in_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 hospitality_technology.rooms ( room_id text PRIMARY KEY, property_id text, room_number text, room_type_id text, floor i...
[ { "role": "user", "content": "List all properties that have at least one room on the 10th floor. Include the property name and the count of such rooms." }, { "role": "assistant", "content": "SELECT p.property_name,\n COUNT(r.room_id) AS room_count\nFROM hospitality_technology.properties p\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Provide a count of how many peers were last seen on each distinct day recorded in the system." }, { "role": "assistant", "content": "SELECT DATE(last_seen), COUNT(*) FROM trading_platform.peers GROUP BY DATE(last_seen) ORDER BY DATE(last_seen);" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text, username text, email text, password_hash text, created_at timestamp ) CREATE TAB...
[ { "role": "user", "content": "Show me the total fuel quantity and cost for each route, grouped by route number, only for trips that have associated fuel logs." }, { "role": "assistant", "content": "SELECT r.route_number, SUM(f.quantity) AS total_quantity, SUM(f.total_cost) AS total_cost\nFROM tr...
You are an SQL statement expert. Given the table 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": "Show the payment_id and amount_paid for all premium payments where the status is 'pending'." }, { "role": "assistant", "content": "SELECT payment_id, amount_paid\nFROM insurance.premium_payments\nWHERE status = 'pending';" } ]
You are an SQL statement expert. Given the table 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, product_name character varying(150) NOT NULL,...
[ { "role": "user", "content": "List all depot locations in the United States with their city and state information." }, { "role": "assistant", "content": "SELECT name, city, state_province FROM transportation.locations WHERE type = 'depot' AND country = 'United States';" }, { "role": "use...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "Show me all cryptocurrency assets that have metadata entries for both 'category' and 'subcategory', along with their corresponding values." }, { "role": "assistant", "content": "SELECT m1.asset_id, m1.value AS category, m2.value AS subcategory FROM trading_platform....
You are an SQL statement expert. Given the table 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": "For each citizen who has made at least one payment, show the citizen's full name, number of payments, and total amount paid, grouped by currency." }, { "role": "assistant", "content": "SELECT\n c.first_name || ' ' || c.last_name AS full_name,\n p.currency,\n COUN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Show me the total number of items acquired per player for each item type, along with the player's username." }, { "role": "assistant", "content": "SELECT p.player_id, p.username, igi.item_type, SUM(pi.quantity) AS total_acquired\nFROM gaming_technology.player_invent...
You are an SQL statement expert. Given the table 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 vehicles that use diesel fuel, showing their make, model, and year." }, { "role": "assistant", "content": "SELECT make, model, year FROM transportation.vehicles WHERE fuel_type = 'diesel';" }, { "role": "user", "content": "Now include only vehic...
You are an SQL statement expert. Given the table 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 appointment IDs and their corresponding location IDs for appointments that have status 'cancelled'." }, { "role": "assistant", "content": "SELECT appointment_id, location_id FROM healthcare.appointments WHERE status = 'cancelled';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id character varying(64) NOT NULL, doc...
[ { "role": "user", "content": "List all pairs of token transfers where the sender is the same but the recipients differ. Show both transfer IDs and the common sender address." }, { "role": "assistant", "content": "SELECT t1.transfer_id AS transfer_id_1, t2.transfer_id AS transfer_id_2, t1.from_ad...
You are an SQL statement expert. Given the table 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": "Find the full names and emails of citizens who have received notifications with the status 'Sent' related to a document. Also show the document_id for each notification." }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS full_name, 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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "List all agents who have been terminated, showing their full name, agency name, and termination date." }, { "role": "assistant", "content": "SELECT first_name, last_name, agency_name, termination_date\nFROM insurance.agents\nWHERE status <> 'Active';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara...
[ { "role": "user", "content": "Calculate the monthly total quantity of fuel consumed and the average cost_per_unit for each fuel_type in 2023." }, { "role": "assistant", "content": "SELECT date_trunc('month', log_timestamp) AS month,\n fuel_type,\n SUM(quantity) AS total_quantity...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_timestamp.timestamp, fuel_type.text, qu...
[ { "role": "user", "content": "How many documents are set to expire in the year 2025?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS document_count\nFROM government_services.documents\nWHERE expiry_date >= '2025-01-01' AND expiry_date < '2026-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.agencies ( agency_id character varying(64) NOT NULL, -- unique identifier for the agency ag...
[ { "role": "user", "content": "I need the total amount and count of payments for each policy." }, { "role": "assistant", "content": "SELECT policy_id,\n COUNT(*) AS payment_count,\n SUM(amount_paid) AS total_paid\nFROM insurance.premium_payments\nGROUP BY policy_id;" }, { "rol...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the payment po...
[ { "role": "user", "content": "Find all contracts deployed by users who have also conducted transactions with a value greater than 1 ETH (where 1 ETH = 1e18 wei)." }, { "role": "assistant", "content": "SELECT DISTINCT c.contract_id, c.address, c.deployer_address FROM web3.contracts c JOIN web3.tr...
You are an SQL statement expert. Given the table 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": "Show me reviews from 'Expedia' that have an overall rating of 1 or 2." }, { "role": "assistant", "content": "SELECT review_id, property_id, guest_id, rating_overall, review_date, comment FROM hospitality_technology.reviews WHERE review_source = 'Expedia' AND rating_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.text, guest_id.text, rating_overall.i...
[ { "role": "user", "content": "List the NDC code and description for any medication that has an NDC code starting with '5'." }, { "role": "assistant", "content": "SELECT ndc_code, description FROM healthcare.medications WHERE ndc_code LIKE '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 healthcare.medications ( medication_id character varying(64) NOT NULL, medication_name character varying(255) NOT NULL,...
[ { "role": "user", "content": "Retrieve pairs of law firms that share the same managing_partner_id, showing the firm names and the managing_partner_id." }, { "role": "assistant", "content": "SELECT lf1.firm_name AS firm1, lf2.firm_name AS firm2, lf1.managing_partner_id FROM legal_services.law_fir...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, -- unique identifier for the law firm firm_...
[ { "role": "user", "content": "List each user along with the number of wallets they own and the number of unique addresses found in their UTXOs." }, { "role": "assistant", "content": "SELECT u.user_id, COUNT(DISTINCT w.wallet_id) as wallet_count, COUNT(DISTINCT ut.address) as unique_utxo_addresse...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Find vehicles whose capacity is greater than the average capacity for their type. Show the vehicle_id, type, and capacity." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.type, v.capacity FROM transportation.vehicles v JOIN (SELECT type, AVG(capacity) ...
You are an SQL statement expert. Given the table 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 each citizen's first and last name along with the number of applications they have submitted, only include those with at least 3 applications." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(a.application_id) AS application_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.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "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...