conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List all job titles of employees who work in the 'Finance' department." }, { "role": "assistant", "content": "SELECT DISTINCT job_title\nFROM government_services.employees\nWHERE department = 'Finance';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "List the policy number, start date, product name, and base premium for policies where the base premium of the associated product is greater than 1000." }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.start_date, T2.product_name, T2.base_premium FRO...
You are an SQL statement expert. Given the table 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 the trip_id, status, and passenger_count for all trips where the scheduled_departure and scheduled_arrival are on the same day, but the actual_arrival is later than the scheduled_arrival." }, { "role": "assistant", "content": "SELECT trip_id, status, passeng...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, -- unique identifier for a specific trip instance ...
[ { "role": "user", "content": "List all active SUI coins with status 'exists' in metadata, showing coin_type, symbol, name, balance, and description." }, { "role": "assistant", "content": "SELECT sc.coin_type, sm.symbol, sm.name, sc.balance, sm.description\nFROM sui_coins sc\nJOIN sui_coins_metad...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "Show all users who have liked comments made by users with a specified location, say 'Paris'. For each, show their username, the comment_id, and the location of the comment's author." }, { "role": "assistant", "content": "SELECT l.user_id AS liker_user_id, u_liker.us...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "Show me the usernames and email addresses of users who have commented on their own posts, and the content of such comments." }, { "role": "assistant", "content": "SELECT u.username, u.email, c.content AS comment_content\nFROM social_media.comments c\nJOIN social_med...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Are there any developers with the same name? Show me the name and the count of developers sharing that name." }, { "role": "assistant", "content": "SELECT name, COUNT(*) AS num_developers FROM gaming_technology.developers GROUP BY name;" }, { "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.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "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": "List reservations made by guests who have communication consent enabled, showing the reservation ID, guest full name, and property name." }, { "role": "assistant", "content": "SELECT T1.reservation_id, T2.first_name, T2.last_name, T3.property_name FROM hospitality_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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ...
[ { "role": "user", "content": "Show me all messages sent after July 1, 2024, including the sender_user_id, content, and sent_at." }, { "role": "assistant", "content": "SELECT message_id, sender_user_id, content, sent_at\nFROM social_media.messages\nWHERE sent_at > '2024-07-01';" }, { "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 social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_user_id text, content text, media_url...
[ { "role": "user", "content": "List each property along with the count of available rooms grouped by bed type." }, { "role": "assistant", "content": "SELECT rt.property_id, p.property_name, rt.bed_type, COUNT(r.room_id) AS available_count\nFROM hospitality_technology.rooms r\nJOIN hospitality_tec...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name) from California (state = 'CA') who have both a checking account (account_type = 'Checking') and a home loan (loan_type = 'Home'), along with their total account balance and loan principal amount." }, { "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 financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad...
[ { "role": "user", "content": "List the full name of citizens who have appointments scheduled for services in the 'Licensing' category." }, { "role": "assistant", "content": "SELECT T1.full_name FROM government_services.citizens AS T1 JOIN government_services.appointments AS T2 ON T1.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.appointments ( appointment_id text PRIMARY KEY, citizen_id text, employee_id text, location_id text...
[ { "role": "user", "content": "List all tokens on the 'BSC' chain with a trend rank between 6 and 20 (inclusive), along with their symbol, price, and liquidity." }, { "role": "assistant", "content": "SELECT t.token_symbol, t.price, d.liquidity\nFROM token_basic_info t\nJOIN token_dexpool_info d 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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show me all available non-smoking rooms on floors 3 or higher, along with their room numbers and features, ordered by floor number." }, { "role": "assistant", "content": "SELECT room_number, floor, features FROM hospitality_technology.rooms WHERE status = 'available...
You are an SQL statement expert. Given the table 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": "Show me all smart contracts created by addresses that have sent more than 100 transactions, along with the contract creation timestamp." }, { "role": "assistant", "content": "SELECT sc.contract_id, sc.timestamp FROM blockchain.smart_contracts sc JOIN (SELECT sender_...
You are an SQL statement expert. Given the table 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.transactions ( transaction_id text, block_id text, sender_address text, receiver_address text, amount numeri...
[ { "role": "user", "content": "Show me the top 5 users with the most wallet addresses, along with the count of their wallets." }, { "role": "assistant", "content": "SELECT user_id, COUNT(wallet_id) AS wallet_count FROM blockchain.wallets WHERE user_id IS NOT NULL GROUP BY user_id ORDER BY wallet_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.wallets ( wallet_id text, user_id text, address_id text, private_key text )
[ { "role": "user", "content": "List all patients who have had appointments and were prescribed a medication manufactured by 'Merck'. Show the patient ID, full name, appointment ID, and medication name." }, { "role": "assistant", "content": "SELECT DISTINCT p.patient_id, p.first_name, p.last_name,...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "Find all users whose usernames contain numbers and have email addresses from either Gmail or Yahoo." }, { "role": "assistant", "content": "SELECT user_id, username, email FROM blockchain.users WHERE username ~ '[0-9]' AND (email LIKE '%@gmail.com' OR email LIKE '%@y...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.nodes ( node_id text, ip_address text, port integer, last_seen timestamp ) CREATE TABLE blockchain.users ( ...
[ { "role": "user", "content": "Get all hashtags that were created after the hashtag with ID 'H100', showing their ID, name, and creation time." }, { "role": "assistant", "content": "SELECT h2.hashtag_id, h2.tag_name, h2.created_at\nFROM social_media.hashtags h1\nJOIN social_media.hashtags h2\n 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 social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name character varying(100) NOT NULL UNIQUE, cre...
[ { "role": "user", "content": "List all service orders along with the quantity, unit price, and total price for each order. Filter for orders placed on or after the start of the year 2023." }, { "role": "assistant", "content": "SELECT order_id, quantity, unit_price, total_price FROM hospitality_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "I'd like a report showing for each sector the average close_price and maximum volume from market_data for the previous quarter." }, { "role": "assistant", "content": "SELECT s.sector, AVG(md.close_price) AS avg_close_price, MAX(md.volume) AS max_volume\nFROM financi...
You are an SQL statement expert. Given the table 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 bigserial NOT NULL, security_id character varying(64) NOT NULL, data_tim...
[ { "role": "user", "content": "Show the total hours spent by each lawyer across all their time entries. Display the lawyer's first name, last name, and the total hours." }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, SUM(te.hours_spent) AS total_hours FROM legal_services....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer first_n...
[ { "role": "user", "content": "Show me prescription_id, prescription_date, medication_id, and the chief_complaint from the linked medical record for all prescriptions where quantity_dispensed is greater than 10." }, { "role": "assistant", "content": "SELECT p.prescription_id,\n p.prescripti...
You are an SQL statement expert. Given the table 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, patient_id character varying(64) NOT NULL, appoi...
[ { "role": "user", "content": "I want to know, for each conversation participant, how many unread messages they have. Return participant_id, conversation_id, and unread_count." }, { "role": "assistant", "content": "SELECT cp.participant_id,\n cp.conversation_id,\n COUNT(m.message_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 social_media.posts ( post_id character varying(64) NOT NULL, -- unique identifier for the post user_id characte...
[ { "role": "user", "content": "List all ERC20 tokens from the sui_coins_metadata table where the decimals are 18, including their names and symbols." }, { "role": "assistant", "content": "SELECT name, symbol FROM sui_coins_metadata WHERE decimals = 18;" }, { "role": "user", "content":...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc20_balances_historical ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk i...
[ { "role": "user", "content": "Show me a list of players and, for each, list all the different games where they have acquired items. Also include the number of unique item types they've acquired per game." }, { "role": "assistant", "content": "SELECT p.player_id, p.username, g.title AS game_title...
You are an SQL statement expert. Given the table 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 posts that have never received a 'like' notification. Return post_id, user_id, and created_at." }, { "role": "assistant", "content": "SELECT p.post_id,\n p.user_id,\n p.created_at\nFROM social_media.posts p\nLEFT JOIN social_media.notifications ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "List all patients who have active chronic diagnoses, including their diagnosis descriptions and dates." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, d.description, d.diagnosis_date FROM healthcare.patients p JOIN healthcare.diagnoses d ON ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "List all conversation participants along with post_hashtag details where the participant's user_id matches the hashtag_id." }, { "role": "assistant", "content": "SELECT cp.conversation_id, cp.user_id, ph.post_id, ph.hashtag_id\nFROM social_media.conversation_partici...
You are an SQL statement expert. Given the table 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.post_hashtags ( post_hashtag_id.text, post_id.text, hashtag_id.text ) CREATE TABLE social_media.conversati...
[ { "role": "user", "content": "Find transactions that triggered events and whose to_address matches the contract_id of the emitted event. List the transaction ID, the to_address, and the count of such events for that transaction." }, { "role": "assistant", "content": "SELECT t.transaction_id, t.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 web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "For each vehicle, show vehicle_id, make, model, the earliest and latest fuel log IDs with their timestamps." }, { "role": "assistant", "content": "WITH extremes AS (\n SELECT vehicle_id,\n MIN(log_timestamp) AS first_ts,\n MAX(log_timestamp) AS last...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Show all cities in the USA that have more than one distinct location type represented. List the city, country, and number of distinct location types." }, { "role": "assistant", "content": "SELECT city, country, COUNT(DISTINCT type) AS distinct_location_types\nFROM t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "For each payment status, how many payments were made and what was the total amount paid? Order the results by the total amount paid in descending order." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS payment_count, SUM(amount_paid) AS total_amount...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, custo...
[ { "role": "user", "content": "List each game and the number of unique in-game items available for it." }, { "role": "assistant", "content": "SELECT T1.title, count(T2.item_id) FROM gaming_technology.games AS T1 LEFT JOIN gaming_technology.in_game_items AS T2 ON T1.game_id = T2.game_id GROUP BY 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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "Find all nodes that were last seen in the last 7 days, along with their IP addresses and ports." }, { "role": "assistant", "content": "SELECT node_id, ip_address, port FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '7 days';" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "role": "user", "content": "List the document ID, document type, and verification status for all documents verified by employees working for the agency with ID 'AG101'. Also include the verifying employee's full name." }, { "role": "assistant", "content": "SELECT T1.document_id , T1.document_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "For each employee, find their first and last name along with the number of applications they've been assigned. Only include employees with at least 5 assigned applications." }, { "role": "assistant", "content": "SELECT e.first_name,\n e.last_name,\n COUN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "List all patients who do not have an email address on file, showing their patient_id, first_name, last_name, and phone_number." }, { "role": "assistant", "content": "SELECT patient_id,\n first_name,\n last_name,\n phone_number\nFROM healthcare.pati...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List all reservations with their guest IDs and room IDs where the total amount is greater than $300, ordered by check-in date." }, { "role": "assistant", "content": "SELECT reservation_id, guest_id, room_id, check_in_date FROM hospitality_technology.reservations WHE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r...
[ { "role": "user", "content": "List all hashtags that have never been associated with any post, showing hashtag_id and tag_name." }, { "role": "assistant", "content": "SELECT h.hashtag_id, h.tag_name\nFROM social_media.hashtags h\nLEFT JOIN social_media.post_hashtags ph ON h.hashtag_id = ph.hasht...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "For properties located in the city 'Los Angeles', list all rooms that are on floor 3. Include the property name and room number." }, { "role": "assistant", "content": "SELECT p.property_name, r.room_number FROM hospitality_technology.properties p JOIN hospitality_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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Show me all invoice numbers together with the client IDs and related case IDs for invoices issued after March 1st, 2024." }, { "role": "assistant", "content": "SELECT invoice_number, client_id, case_id FROM legal_services.invoices WHERE issue_date > '2024-03-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 legal_services.invoices ( invoice_id character varying(64) NOT NULL, -- unique identifier for the invoice invo...
[ { "role": "user", "content": "Find all wallet addresses that don't have an associated user_id." }, { "role": "assistant", "content": "SELECT address_id, private_key FROM blockchain.wallets WHERE user_id IS NULL;" }, { "role": "user", "content": "Now show me these addresses along with...
You are an SQL statement expert. Given the table 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.wallets ( wallet_id text, user_id text, address_id text, private_key text )
[ { "role": "user", "content": "Show me all active agents who have a commission rate above the company average, along with their agency names and contact information." }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name, a.last_name, a.agency_name, a.contact_email, a.contact_phon...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id text, first_name text, last_name text, agency_name text, license_number text, license_state...
[ { "role": "user", "content": "List each property_name and the count of available rooms." }, { "role": "assistant", "content": "SELECT p.property_name,\n COUNT(*) AS available_rooms_count\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.properties p\n ON r.property_id = 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.rooms ( room_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, room...
[ { "role": "user", "content": "For each payment, list its payment_id, guest_id, payment_timestamp, and the next payment_id and next payment_timestamp made by the same guest." }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.guest_id,\n p.payment_timestamp,\n n.paym...
You are an SQL statement expert. Given the table 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.payments ( payment_id text, reservation_id text, guest_id text, bill_id text, amount numeric, cu...
[ { "role": "user", "content": "Count how many fundraising rounds each project has. Show project_name and round_count." }, { "role": "assistant", "content": "SELECT\n project_name,\n COUNT(*) AS round_count\nFROM project_fundraising_record\nGROUP BY project_name;" }, { "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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show the top 5 narratives by 24 hour trading volume. Include the narrative name and volume." }, { "role": "assistant", "content": "SELECT narrative, volume_24h FROM narrative_info ORDER BY volume_24h DESC LIMIT 5;" }, { "role": "user", "content": "Can yo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE narrative_info ( narrative character varying(512) NOT NULL, top_3_coins text, price_change_percentage_1h double precisi...
[ { "role": "user", "content": "For each loan, show the loan ID, principal amount, interest rate, and the balance and currency of the associated account." }, { "role": "assistant", "content": "SELECT l.loan_id, l.principal_amount, l.interest_rate, a.balance, a.currency FROM financial_services.loan...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac...
[ { "role": "user", "content": "Show me all staff members who are currently active, along with their property name and position." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name \nFROM hospitality_technology.staff s \nJOIN hospitality...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Retrieve the number of claim documents uploaded by each user. Show uploaded_by and the document count." }, { "role": "assistant", "content": "SELECT uploaded_by, COUNT(document_id) AS document_count\nFROM insurance.claim_documents\nGROUP BY uploaded_by;" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, -- unique identifier for the claim policy_id charac...
[ { "role": "user", "content": "List all securities (security_id, ticker_symbol, security_name) from the 'Technology' sector that have had a daily trading volume exceeding 1 million shares in the last week." }, { "role": "assistant", "content": "SELECT s.security_id, s.ticker_symbol, s.security_na...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer ...
[ { "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": "List each port along with the count of distinct IP addresses observed on that port." }, { "role": "assistant", "content": "SELECT port, COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes GROUP BY port;" }, { "role": "user", "content": "O...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ...
[ { "role": "user", "content": "List all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange (exchange = 'NASDAQ') and have had at least one trade with a total_amount greater than $100,000, along with the count of such trades for each security." }, { "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 financial_services.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ...
[ { "role": "user", "content": "List all users who commented on posts tagged with hashtag 'spring', showing user_id, comment_id, content, and tag_name." }, { "role": "assistant", "content": "SELECT c.user_id, c.comment_id, c.content, h.tag_name\nFROM social_media.comments c\nJOIN social_media.post...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Show me all claim documents that are police reports and were uploaded in the last 30 days, along with their file sizes." }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_name, file_size_bytes, uploaded_at FROM insurance.claim_documents WHERE ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id text, claim_id text, document_type text, file_name text, file_path text, file_s...
[ { "role": "user", "content": "List the names of all agencies that do not have any associated service locations." }, { "role": "assistant", "content": "SELECT agency_name FROM government_services.agencies a WHERE NOT EXISTS (SELECT 1 FROM government_services.service_locations sl WHERE sl.agency_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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "List all document IDs and document types for documents that have been verified by an employee, along with the verification timestamp and the ID of the verifying employee." }, { "role": "assistant", "content": "SELECT document_id, document_type, verification_timestam...
You are an SQL statement expert. Given the table 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, application_id text, citizen_id text, document_type text, file_refere...
[ { "role": "user", "content": "Count the total number of public posts." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.posts WHERE visibility = 'public';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, -- unique identifier for the post user_id characte...
[ { "role": "user", "content": "For each day in the past month, can you show the combined total transaction amount and the total volume traded from market data?" }, { "role": "assistant", "content": "SELECT t.effective_date, SUM(t.amount) AS total_transaction_amount, SUM(md.volume) AS total_traded...
You are an SQL statement expert. Given the table 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.text, account_id.text, related_account_id.text, transaction_type.text,...
[ { "role": "user", "content": "List all spa services available at properties in New York, along with their prices and property names." }, { "role": "assistant", "content": "SELECT s.service_name, s.price, p.property_name FROM hospitality_technology.services s JOIN hospitality_technology.propertie...
You are an SQL statement expert. Given the table 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 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": "For each asset, show the asset name, symbol, and the latest trade price." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name AS asset_name, a.symbol AS asset_symbol, (\n SELECT t1.price FROM trading_platform.trades t1\n WHERE t1.asset_id = a.asset...
You are an SQL statement expert. Given the table 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.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "role": "user", "content": "Show me each generic_name and the number of medications with that generic_name, sorted by the highest count first." }, { "role": "assistant", "content": "SELECT generic_name, COUNT(*) AS medication_count FROM healthcare.medications GROUP BY generic_name ORDER BY med...
You are an SQL statement expert. Given the table 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 text PRIMARY KEY, medication_name text, generic_name text, manufacturer text, nd...
[ { "role": "user", "content": "Show me all trades (trade_id, account_id, total_amount) along with the corresponding loan details (loan_type, interest_rate) for accounts that have both trades and loans, where the trade was executed in the last 30 days and the loan has an interest rate above 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 financial_services.trades ( trade_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL, securit...
[ { "role": "user", "content": "List all policy beneficiaries with their relationship and the date they were added, ordered by added_at descending." }, { "role": "assistant", "content": "SELECT first_name, last_name, relationship, added_at\nFROM insurance.policy_beneficiaries\nORDER BY added_at DE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "role": "user", "content": "Show the guest's full name, reservation ID, check-in date, and status for all reservations made via 'Phone'." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, r.reservation_id, r.check_in_date, r.status FROM hospitality_technology.reservations...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "Calculate the average number of days cases stay open before being closed, grouped by case type. Only consider cases that have a date closed." }, { "role": "assistant", "content": "SELECT case_type, AVG(DATE_PART('day', date_closed - date_opened)) AS average_duration...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.cases ( case_id character varying(64) NOT NULL, -- unique identifier for the case/matter case_n...
[ { "role": "user", "content": "Show the total payment amount per currency for payments that are either 'Pending' or 'Failed', grouped by currency_code." }, { "role": "assistant", "content": "SELECT currency_code, SUM(amount) AS total_payment_amount\nFROM hospitality_technology.payments\nWHERE sta...
You are an SQL statement expert. Given the table 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": "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": "Show the product name, type, and creation date for products created before January 1st, 2023." }, { "role": "assistant", "content": "SELECT product_name, product_type, created_at FROM insurance.insurance_products WHERE created_at < '2023-01-01';" }, { "role"...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text, product_name text, product_type text, description text, base_premium nu...
[ { "role": "user", "content": "List all reservations for rooms on the 3rd floor, including guest_id, reservation_id, room_number, property_name, and check_in_date." }, { "role": "assistant", "content": "SELECT r.reservation_id, r.guest_id, ro.room_number, p.property_name, r.check_in_date\nFROM ho...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "List all active drivers with their license expiry dates and contact information." }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, license_number, license_expiry_date, contact_number, email FROM transportation.drivers WHERE status = '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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ...
[ { "role": "user", "content": "Get each user's ID, the count of wallets they own, and the total amount of their unspent UTXOs across all wallets." }, { "role": "assistant", "content": "SELECT w.user_id,\n COUNT(DISTINCT w.wallet_id) AS wallet_count,\n COA...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_...
[ { "role": "user", "content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector, along with their last_updated timestamp." }, { "role": "assistant", "content": "SELECT security_id, ticker_symbol, securi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.securities ( security_id text, ticker_symbol text, isin_code text, cusip_code text, security_name te...
[ { "role": "user", "content": "Can you show me all pairs of customers living in the same city but with different last names? Show both customer IDs, both full names, and their city." }, { "role": "assistant", "content": "SELECT a.customer_id AS customer_id_a, CONCAT(a.first_name, ' ', a.last_name...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad...
[ { "role": "user", "content": "Retrieve the first and last names and email addresses of all customers who registered after '2024-01-01'." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM insurance.customers WHERE created_at > '2024-01-01';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin...
[ { "role": "user", "content": "Retrieve a list of agents who were hired in 2024. Include agent_id, first_name, last_name, hire_date." }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, hire_date\nFROM insurance.agents\nWHERE hire_date >= '2024-01-01' AND hire_date < '20...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state...
[ { "role": "user", "content": "Show me all metadata keys and their values for the asset with asset_id 'BTC'." }, { "role": "assistant", "content": "SELECT key, value FROM trading_platform.metadata WHERE asset_id = 'BTC';" }, { "role": "user", "content": "Now filter these results to on...
You are an SQL statement expert. Given the table 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, -- unique identifier for the metadata ...
[ { "role": "user", "content": "Show me all clients whose company name contains 'Tech' and display their email and date of registration." }, { "role": "assistant", "content": "SELECT first_name, last_name, company_name, email, date_registered FROM legal_services.clients WHERE company_name ILIKE '%...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "Show me all active customers from California who were born before 1980, along with their contact information." }, { "role": "assistant", "content": "SELECT first_name, last_name, phone_number, email, address_line1, address_line2, city, state, zip_code FROM insurance...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Show me all drivers who have completed more than 5 trips in the last month, along with their contact information and the average passenger count per trip." }, { "role": "assistant", "content": "SELECT d.driver_id, d.first_name, d.last_name, d.contact_number, d.email...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ...
[ { "role": "user", "content": "List all tokens from the token_dexpool_info table with a liquidity over $10 million and a positive 6-hour price change percentage on the Ethereum chain." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, liquidity, price_change_percentage_6h FRO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE narrative_info (", "narrative character varying(512) NOT NULL, -- the id of narrative", "top_3_coins text, --...
[ { "role": "user", "content": "Find all patients who have both a primary insurance plan and at least one completed appointment, along with their insurance policy numbers and the count of appointments." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, pi.policy_number, 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 healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "List all room numbers with their room type name and property name for rooms that have a Jacuzzi feature." }, { "role": "assistant", "content": "SELECT r.room_number, rt.type_name, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.room...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "Provide a count of notifications for each unique message subject." }, { "role": "assistant", "content": "SELECT message_subject, COUNT(*) AS notification_count FROM government_services.notifications GROUP BY message_subject ORDER BY notification_count DESC;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.notifications ( notification_id text PRIMARY KEY, citizen_id text, application_id text, message_sub...
[ { "role": "user", "content": "For each appointment, show the appointment ID, the associated citizen's full name, and the document types they have uploaded for that appointment's application." }, { "role": "assistant", "content": "SELECT a.appointment_id, c.first_name || ' ' || c.last_name AS cit...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "List the total number of notifications sent through each channel for appointments." }, { "role": "assistant", "content": "SELECT n.channel, COUNT(*) AS notification_count\nFROM government_services.notifications n\nWHERE n.related_entity_type = 'Appointment'\nGROUP B...
You are an SQL statement expert. Given the table 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": "我想了解某个组件的库存情况,包括库存数量、仓库位置和接收日期。" }, { "role": "assistant", "content": "SELECT ci.quantity, ci.location_warehouse, ci.received_date\nFROM manufacturing.component_inventory ci\nWHERE ci.component_id = 'specific_component_id';" }, { "role": "user", "content...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE manufacturing.components ( component_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show me all log entries for user ID 'user123'." }, { "role": "assistant", "content": "SELECT log_id, user_id, action, details, logged_at FROM trading_platform.logs WHERE user_id = 'user123' ORDER BY logged_at DESC;" }, { "role": "user", "content": "Show ...
You are an SQL statement expert. Given the table 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": "For each case, show the latest uploaded document's name, version number, and upload timestamp." }, { "role": "assistant", "content": "SELECT d.case_id, d.document_name, d.version, d.upload_timestamp\nFROM legal_services.documents d\nINNER JOIN (\n SELECT case_id, M...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "Find all pairs of users where the registration times are within 30 minutes of each other, and show both user IDs, usernames, and the time difference in minutes." }, { "role": "assistant", "content": "SELECT u1.user_id AS user1_id, u1.username AS user1_name, u2.user_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp )
[ { "role": "user", "content": "Show me all in-game items of type 'Weapon' along with the server names where the games they belong to are currently online." }, { "role": "assistant", "content": "SELECT i.item_id, i.item_name, g.title, s.server_name\nFROM gaming_technology.in_game_items i\nJOIN gam...
You are an SQL statement expert. Given the table 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": "Show me the number of notifications received by each citizen, including their full name." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(n.notification_id) AS notification_count\nFROM government_services.citizens c\nLEFT JOIN governmen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "For each employee, show their first and last name and the number of documents they have verified." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, COUNT(d.document_id) AS verified_documents_count\nFROM government_services.employees e\nJOIN go...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "List all completed appointments in the last week, showing patient_id, doctor_id and appointment_time." }, { "role": "assistant", "content": "SELECT patient_id, doctor_id, appointment_time FROM healthcare.appointments WHERE status = 'Completed' AND appointment_time >...
You are an SQL statement expert. Given the table 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": "Provide a summary showing, for each vehicle type, the total number of fueling events and the combined total fuel quantity refueled." }, { "role": "assistant", "content": "SELECT v.type AS vehicle_type, COUNT(f.fuel_log_id) AS total_fueling_events, SUM(f.quantity) AS...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Could you list each game title along with its developer's name and the total number of servers hosting it?" }, { "role": "assistant", "content": "SELECT g.title, d.name AS developer_name, COUNT(s.server_id) AS server_count\nFROM gaming_technology.games g\nLEFT JOIN ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id uuid, genre text, release_date date...