conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Show me all wallet addresses that belong to user_id 'U12345'." }, { "role": "assistant", "content": "SELECT address_id FROM blockchain.wallets WHERE user_id = 'U12345';" }, { "role": "user", "content": "Now join this with another table to show the privat...
You are an SQL statement expert. Given the table 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 the top 5 guests who have submitted the most reviews. Include guest_id and review_count." }, { "role": "assistant", "content": "SELECT guest_id, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY guest_id\nORDER BY review_count DESC\nLIM...
You are an SQL statement expert. Given the table 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": "What is the total market cap for all tokens listed on the 'Polygon' chain?" }, { "role": "assistant", "content": "SELECT SUM(market_cap) FROM token_dexpool_info WHERE chain = 'Polygon';" }, { "role": "user", "content": "Only sum the market cap for tokens...
You are an SQL statement expert. Given the table 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_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "role": "user", "content": "Show me all NFT holders who own more than 10 of the same token, including the contract address, token ID, and wallet address." }, { "role": "assistant", "content": "SELECT nh.contract_address, nh.token_id, nh.wallet_address, CAST(nh.amount AS decimal) AS token_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 nft_holder_historical ( block_number.bigint, contract_address.text, wallet_address.text, token_id.text, contract_type.t...
[ { "role": "user", "content": "List all insurance products that have 'auto' in their product type and are currently active, showing their product name and base premium." }, { "role": "assistant", "content": "SELECT product_id, product_name, product_type, base_premium FROM insurance.insurance_prod...
You are an SQL statement expert. Given the table 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 me all properties in California with a star rating above 4.0, along with the count of available rooms at each property." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, p.city, p.star_rating, COUNT(r.room_id) AS available_rooms_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Show me the first name, last name, and date of birth for all patients who are male." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE gender = 'Male';" }, { "role": "user", "content": "Pleas...
You are an SQL statement expert. Given the table 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": "I want to see the total fare and number of bookings for each passenger." }, { "role": "assistant", "content": "SELECT b.passenger_id, COUNT(b.booking_id) AS booking_count, SUM(b.fare) AS total_fare\nFROM transportation.bookings b\nGROUP BY b.passenger_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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "Find the total transfer volume for each Avalanche token over the past 7 days and include the token's creator." }, { "role": "assistant", "content": "SELECT a.tick,\n i.creator,\n SUM(a.amt) AS total_volume\nFROM token_activities_avalanche a\nJOIN token_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "How many posts has user 'U150' made so far?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS post_count\nFROM social_media.posts\nWHERE user_id = 'U150';" } ]
You are an SQL statement expert. Given the table 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 reservations with more than 2 adults, along with their property names and room types." }, { "role": "assistant", "content": "SELECT r.reservation_id, p.property_name, rt.room_type_name, r.check_in_date, r.check_out_date, r.num_adults FROM 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 character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Find the total number of unique document types stored in the claim_documents table." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT document_type) FROM insurance.claim_documents;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "I want to find all pairs of documents for the same claim where one document is a PDF and the other is an image. Return claim_id, the PDF's document_id as pdf_doc_id, the image's document_id as img_doc_id, and their file names." }, { "role": "assistant", "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 insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_type text, file_name text, file_path ...
[ { "role": "user", "content": "List the product_id, product_name, and description of any insurance products created before 2024 whose description contains the word 'theft'." }, { "role": "assistant", "content": "SELECT product_id, product_name, description\nFROM insurance.insurance_products\nWHER...
You are an SQL statement expert. Given the table 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 the 10 most recent achievement unlocks across all players. Show player ID, achievement ID, and unlock timestamp." }, { "role": "assistant", "content": "SELECT player_id, achievement_id, unlocked_at FROM gaming_technology.player_achievements ORDER BY unlocked_at...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,...
[ { "role": "user", "content": "Show all claims along with the total percentage share of beneficiaries for the related policy. Include claim_id, policy_id, incident_date, and total_share." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, c.incident_date, SUM(pb.percentage_shar...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara...
[ { "role": "user", "content": "Find the top 5 most recently created users along with their email domains (the part after '@' in their email addresses)." }, { "role": "assistant", "content": "SELECT username, SUBSTRING(email FROM POSITION('@' IN email)+1) AS email_domain FROM web3.users ORDER BY c...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp )
[ { "role": "user", "content": "List all peer logs, showing the user_id and the action taken, ordered by the most recent log entry." }, { "role": "assistant", "content": "SELECT user_id, action, logged_at\nFROM trading_platform.logs\nORDER BY logged_at 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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp ) CREATE TAB...
[ { "role": "user", "content": "For each transaction, find the next transaction by the same sender. Show the original transaction_id as current_tx, the next transaction_id as next_tx, from_address, and the time difference in minutes between them." }, { "role": "assistant", "content": "SELECT t1.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.transactions ( transaction_id text, from_address text, to_address text, value numeric, gas_used integer, gas_price...
[ { "role": "user", "content": "Show me the usernames and emails of all users who have placed at least one 'buy' order for the asset named 'Bitcoin'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM trading_platform.users AS T1 JOIN trading_platform.orders AS T2 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.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "List all patients who have a medical record with a chief complaint containing the word 'headache'. Show patient ID, first name, last name, and date of birth." }, { "role": "assistant", "content": "SELECT DISTINCT\n p.patient_id,\n p.first_name,\n p.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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Can you list each in-game item type and for each, show the number of players who have items of that type and the total quantity held across all players?" }, { "role": "assistant", "content": "SELECT i.item_type, COUNT(DISTINCT pi.player_id) AS player_count, COALESCE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, server_id uuid, start_time timestamp w...
[ { "role": "user", "content": "Can you show me the average session duration and total score for each server and game combination?" }, { "role": "assistant", "content": "SELECT server_id, game_id, AVG(duration_seconds) AS avg_duration, SUM(score) AS total_score FROM gaming_technology.game_sessions...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, server_id uuid, start_time timestamp w...
[ { "role": "user", "content": "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 smart money addresses with an ROI greater than 3 and a realized ratio greater than 0.7. Display the address, chain, ROI, realized ratio, and most profitable token." }, { "role": "assistant", "content": "SELECT address, chain, roi, realized_ratio, most_profit_to...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "What is the average total_supply for each decimals value?" }, { "role": "assistant", "content": "SELECT decimals,\n AVG(total_supply) AS avg_total_supply\nFROM web3.tokens\nGROUP BY decimals;" }, { "role": "user", "content": "Actually, I only want ...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, contract_address text, token_name text, token_symbol text, decimals int, total...
[ { "role": "user", "content": "Find patients who currently have both a primary and a secondary insurance policy. For each, show patient_id, full name, primary policy_number, and secondary policy_number." }, { "role": "assistant", "content": "SELECT p.patient_id,\n p.first_name || ' ' || p.l...
You are an SQL statement expert. Given the table 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 types and the name of the property manager responsible for that property." }, { "role": "assistant", "content": "SELECT t1.type_name, t3.first_name, t3.last_name FROM hospitality_technology.room_types AS t1 JOIN hospitality_technology.properties AS t2 ...
You are an SQL statement expert. Given the table 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": "Show me the top 10 NFT collections with the highest token count, along with their names, symbols, and floor prices." }, { "role": "assistant", "content": "SELECT name, symbol, floor_price, token_count FROM nft_collections ORDER BY token_count DESC LIMIT 10;" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "For each application that has at least one failed notification, provide the application ID, the total number of notifications received for that application, and the count of failed notifications." }, { "role": "assistant", "content": "SELECT application_id, COUNT(*)...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.notifications ( notification_id.text, citizen_id.text, application_id.text, message_subject.text, m...
[ { "role": "user", "content": "Show me the total number of hours worked by each lawyer for each case." }, { "role": "assistant", "content": "SELECT t.lawyer_id, t.case_id, SUM(t.hours_spent) AS total_hours\nFROM legal_services.time_entries t\nGROUP BY t.lawyer_id, t.case_id;" }, { "role":...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad...
[ { "role": "user", "content": "Show me all PDF claim documents that were uploaded after March 1st, 2024, and the usernames of those who uploaded them, along with the related claim ID." }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_name, uploaded_by FROM insurance.claim_...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, claim_id text, document_type text, file_name text, file_path ...
[ { "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": "List all appointments scheduled in the next 7 days along with the appointment_id, appointment_time, patient's full name, doctor's full name, and the patient's primary insurance plan_name." }, { "role": "assistant", "content": "SELECT ap.appointment_id,\n ap.ap...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show each player's ID along with the name and quantity of every item they have in their inventory. Join the player inventory with item details." }, { "role": "assistant", "content": "SELECT pi.player_id, igi.item_name, pi.quantity FROM gaming_technology.player_inven...
You are an SQL statement expert. Given the table 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": "Show me a list of all notifications that are related to comments. Include the notification ID, the recipient user ID, and the target entity ID, which corresponds to the comment ID." }, { "role": "assistant", "content": "SELECT notification_id, recipient_user_id, tar...
You are an SQL statement expert. Given the table 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": "Show me the top 5 addresses with the highest balances, along with their public keys." }, { "role": "assistant", "content": "SELECT address_id, public_key, balance FROM blockchain.addresses ORDER BY balance DESC LIMIT 5;" }, { "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 blockchain.addresses ( address_id character varying(128) NOT NULL, -- unique identifier for the address public...
[ { "role": "user", "content": "List all properties together with the floor numbers and room numbers of their rooms located in cities with a star rating greater than 4." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, p.city, p.star_rating, r.floor, r.room_number\nFROM...
You are an SQL statement expert. Given the table 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 SUI coins with their symbol, name, and total balance across all owners." }, { "role": "assistant", "content": "SELECT scm.coin_type, scm.symbol, scm.name, SUM(CAST(sc.balance AS DECIMAL)) AS total_balance\nFROM sui_coins_metadata scm\nJOIN sui_coins ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "List the content and comment ID for all comments made by users with private profiles." }, { "role": "assistant", "content": "SELECT c.comment_id, c.content FROM social_media.comments AS c JOIN social_media.user_settings AS us ON c.user_id = us.user_id WHERE us.priva...
You are an SQL statement expert. Given the table 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": "List all clients along with their case_number and case_type for cases that are currently 'Open'." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, c.email, cs.case_number, cs.case_type\nFROM legal_services.clients AS c\nJOIN legal_services.cas...
You are an SQL statement expert. Given the table 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": "Give me the case_id and the count of appointments and documents for each case where at least one appointment exists." }, { "role": "assistant", "content": "SELECT a.case_id, COUNT(DISTINCT a.appointment_id) AS appointment_count, COUNT(DISTINCT d.document_id) AS docu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "Show me the block with the earliest timestamp and its corresponding previous block's difficulty level." }, { "role": "assistant", "content": "SELECT b1.block_id, b1.timestamp, b2.difficulty AS previous_block_difficulty FROM blockchain.blocks b1 LEFT JOIN blockchain....
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, previous_block_id character varying(64), timestamp timesta...
[ { "role": "user", "content": "List all maintenance logs for vehicles whose fuel type is 'Diesel', showing the log ID, vehicle make and model, service date, and service type." }, { "role": "assistant", "content": "SELECT ml.log_id, v.make, v.model, ml.service_date, ml.service_type\nFROM transport...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Show me the first and last names of customers who have purchased a policy for an insurance product of type 'travel', along with the policy number and product name." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, p.policy_number, ip.product_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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "How many tokens are there for each unique token symbol?" }, { "role": "assistant", "content": "SELECT token_symbol, COUNT(*) AS token_count FROM web3.tokens GROUP BY token_symbol;" }, { "role": "user", "content": "Now, only show symbols that have more th...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha...
[ { "role": "user", "content": "List all pairs of active services in the same category where one service’s standard fee is higher than the other’s. Display the category, the higher-fee service name with its fee, and the lower-fee service name with its fee." }, { "role": "assistant", "content": "SE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli...
[ { "role": "user", "content": "Show me the conversation ID and creation time for group chats that have received at least one message." }, { "role": "assistant", "content": "SELECT DISTINCT T1.conversation_id, T1.created_at FROM social_media.conversations AS T1 INNER JOIN social_media.messages AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.likes ( like_id text, user_id text, post_id text, comment_id text, created_at timestamp ) CREATE TABLE soc...
[ { "role": "user", "content": "Show me the record_id, patient_id, prescription_id, medication_id, start_date, and the systolic blood pressure from the associated medical record for all prescriptions." }, { "role": "assistant", "content": "SELECT p.prescription_id,\n p.medication_id,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id character varying(64) NOT NULL, appoi...
[ { "role": "user", "content": "Which patients have a primary insurance policy and are subscribed to a plan provided by 'Cigna'? List patient ID, full name, policy number, plan ID, and insurance provider." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pi.pol...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Give a list of all policies where the deductible is less than 1000. Show policy_id, policy_number, start_date, and deductible." }, { "role": "assistant", "content": "SELECT policy_id, policy_number, start_date, deductible\nFROM insurance.policies\nWHERE deductible <...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "List the names of agencies and the total standard fee sum for all active services they currently provide." }, { "role": "assistant", "content": "SELECT a.agency_name, SUM(s.standard_fee) AS total_active_service_fee\nFROM government_services.agencies a\nJOIN governme...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "List all medical records along with the doctor's first and last name who created them. Show the record ID, record date, doctor ID, and doctor full name." }, { "role": "assistant", "content": "SELECT mr.record_id, mr.record_date, d.doctor_id, d.first_name, d.last_nam...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "How many hashtags are there whose tag_name contains 'tech'?" }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM social_media.hashtags\nWHERE tag_name LIKE '%tech%';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "Show all reviews with the guest's ID, review comment, and the full name of the staff member who responded." }, { "role": "assistant", "content": "SELECT r.review_id, r.guest_id, r.comment, s.first_name AS response_staff_first_name, s.last_name AS response_staff_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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Show me all premium payments made via credit card in the last 30 days, along with their policy IDs and payment amounts." }, { "role": "assistant", "content": "SELECT payment_id, policy_id, amount_paid FROM insurance.premium_payments WHERE payment_method = 'credit_ca...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_id text, payment_date timestamp, amo...
[ { "role": "user", "content": "List all invoices where amount_paid is less than total_amount." }, { "role": "assistant", "content": "SELECT *\nFROM legal_services.invoices\nWHERE amount_paid < total_amount;" }, { "role": "user", "content": "Only include those with due_date before toda...
You are an SQL statement expert. Given the table 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.text, invoice_number.text, client_id.text, case_id.text, issue_date.date, due_date...
[ { "role": "user", "content": "Show the names of all insurance plans and the number of patients enrolled in each plan." }, { "role": "assistant", "content": "SELECT ip.plan_name, COUNT(pi.patient_id) AS enrolled_patients FROM healthcare.insurance_plans ip JOIN healthcare.patient_insurance pi ON i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "I need a report of total maintenance cost per vehicle type." }, { "role": "assistant", "content": "SELECT v.type AS vehicle_type,\n SUM(m.cost) AS total_maintenance_cost\nFROM transportation.vehicles v\nJOIN transportation.maintenance_logs m ON v.vehicle_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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Find tokens that have a positive price change percentage over the last 1 hour, 6 hours, and 24 hours. Display their symbol and chain." }, { "role": "assistant", "content": "SELECT token_symbol, chain FROM token_dexpool_info WHERE price_change_percentage_1h > 0 AND 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 token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "role": "user", "content": "Can you give me the list of server names and their regions, along with the total number of players currently online in each region?" }, { "role": "assistant", "content": "SELECT region, SUM(current_players) AS total_current_players, STRING_AGG(server_name, ', ') AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,...
[ { "role": "user", "content": "Please find the number of transactions per account in November 2023, and list the account_number along with the transaction count." }, { "role": "assistant", "content": "SELECT a.account_number, COUNT(t.transaction_id) AS transaction_count\nFROM financial_services.a...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba...
[ { "role": "user", "content": "List all claims and the first and last name of the agent who handled each claim." }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.estimated_loss, T2.first_name, T2.last_name FROM claims AS T1 JOIN agents AS T2 ON T1.claim_handler_id = T2.agent_id" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d...
[ { "role": "user", "content": "What is the average interest rate for personal loans (loan_type = 'Personal') with a term of 60 months?" }, { "role": "assistant", "content": "SELECT AVG(interest_rate) FROM financial_services.loans WHERE loan_type = 'Personal' AND term_months = 60;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.loans ( loan_id text, account_id text, loan_type text, principal_amount numeric, current_principal_b...
[ { "role": "user", "content": "List fuel log entries where the cost per unit is greater than 5.00, showing the log ID, vehicle ID, timestamp, quantity, unit, and cost per unit." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, log_timestamp, quantity, unit, cost_per_unit FROM...
You are an SQL statement expert. Given the table 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": "Show me the top 3 narratives by 24-hour trading volume, along with their 1-hour and 24-hour price change percentages." }, { "role": "assistant", "content": "SELECT narrative, volume_24h, price_change_percentage_1h, price_change_percentage_24h FROM narrative_info ORD...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE narrative_info (", "narrative character varying(512) NOT NULL, -- the id of narrative", "top_3_coins text, --...
[ { "role": "user", "content": "List all tokens, showing their symbol, name, and the status of the contract they were deployed on." }, { "role": "assistant", "content": "SELECT T1.token_symbol, T1.token_name, T2.status FROM web3.tokens AS T1 JOIN web3.contracts AS T2 ON T1.contract_address = T2.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.contracts ( contract_id character varying(64) NOT NULL, -- unique identifier for the contract address cha...
[ { "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": "Generate a report showing the total number of achievement unlocks broken down by the calendar day they occurred. Show the date and the total number of unlocks for that day." }, { "role": "assistant", "content": "SELECT DATE(unlocked_at) AS unlock_date, COUNT(player_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid N...
[ { "role": "user", "content": "List the titles of games that have at least one server listed in the servers table." }, { "role": "assistant", "content": "SELECT DISTINCT g.title FROM gaming_technology.games g INNER JOIN gaming_technology.servers s ON g.game_id = s.game_id;" }, { "role": "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "Show me all chronic diagnoses along with their descriptions and the patient IDs, sorted by diagnosis date in descending order." }, { "role": "assistant", "content": "SELECT patient_id, description, diagnosis_date FROM healthcare.diagnoses WHERE is_chronic = true ORD...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id text PRIMARY KEY, record_id text, patient_id text, doctor_id text, diagnosis_code t...
[ { "role": "user", "content": "For each asset, show its name and symbol, and the total number of completed orders that have resulted in at least one trade." }, { "role": "assistant", "content": "SELECT a.name, a.symbol, COUNT(DISTINCT o.order_id) AS completed_order_count\nFROM trading_platform.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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "List all invoices with a total_amount greater than 5000, and show the associated case name and client_id." }, { "role": "assistant", "content": "SELECT i.invoice_id, i.invoice_number, i.total_amount, i.client_id, c.case_name\nFROM legal_services.invoices i\nLEFT JOI...
You are an SQL statement expert. Given the table 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, case_number character varying(100) UNIQUE, case_name tex...
[ { "role": "user", "content": "What is the average and maximum total_supply for tokens grouped by decimals? Provide columns: decimals, avg_supply, max_supply." }, { "role": "assistant", "content": "SELECT decimals,\n AVG(total_supply) AS avg_supply,\n MAX(total_supply) AS max_supply\n...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "Find acquisition event pairs for each player where they acquired two distinct items. Show player_id, the first inventory_id as inv1, the second inventory_id as inv2, and their corresponding item_ids." }, { "role": "assistant", "content": "SELECT p1.player_id,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, item_id uuid, quantity int, acquire...
[ { "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": "List all players from 'Germany' whose status is currently 'online', and show their username and registration date." }, { "role": "assistant", "content": "SELECT username, registration_date FROM gaming_technology.players WHERE country_code = 'DE' AND status = 'online...
You are an SQL statement expert. Given the table 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": "For each location, what is the average appointment duration? Show location_id and the average duration." }, { "role": "assistant", "content": "SELECT location_id, AVG(duration_minutes) FROM healthcare.appointments GROUP BY location_id;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appointment_time.timestamp, duration_mi...
[ { "role": "user", "content": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens with decimals equal to 18." }, { "role": "assistant", "content": "SELECT name, contract_address, total_supply FROM token_metas 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "List the medication names and dosage for all prescriptions issued for patient with ID 'patient_555'." }, { "role": "assistant", "content": "SELECT m.medication_name, p.dosage\nFROM healthcare.prescriptions p\nJOIN healthcare.medications m ON p.medication_id = m.medi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me the document_id, document_name, and upload_timestamp for all documents uploaded by lawyer with ID 'lawyer_456'." }, { "role": "assistant", "content": "SELECT document_id, document_name, upload_timestamp\nFROM legal_services.documents\nWHERE uploaded_by_lawye...
You are an SQL statement expert. Given the table 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, case_number character varying(100) UNIQUE, case_name tex...
[ { "role": "user", "content": "For each security traded on the 'LSE', what is the total quantity traded and the average price_per_unit? Include the security_name and ticker_symbol." }, { "role": "assistant", "content": "SELECT s.security_name,\n s.ticker_symbol,\n SUM(t.quantity) 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 financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba...
[ { "role": "user", "content": "List the full names of patients who have ever been prescribed a medication manufactured by 'Novartis'." }, { "role": "assistant", "content": "SELECT DISTINCT p.first_name, p.last_name\nFROM healthcare.patients p\nJOIN healthcare.prescriptions pr ON p.patient_id = pr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "List the full name of all guests who have submitted a review." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM hospitality_technology.guests AS T1 JOIN hospitality_technology.reviews AS T2 ON T1.guest_id = T2.guest_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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "Show me all invoices where the total_amount is more than 2000, including the invoice number, the associated case name, and the full name of the client." }, { "role": "assistant", "content": "SELECT i.invoice_number, c.case_name, cl.first_name || ' ' || cl.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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "List all active staff members who are managers, along with their hire dates and email addresses." }, { "role": "assistant", "content": "SELECT first_name, last_name, hire_date, work_email FROM hospitality_technology.staff WHERE is_active = true AND position LIKE '%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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Find players who own items with rarity 'Rare' or higher ('Epic', 'Legendary') and list their usernames." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username FROM players AS T1 INNER JOIN player_inventory AS T2 ON T1.player_id = T2.player_id INNER JOIN ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, ite...
[ { "role": "user", "content": "Which projects that raised funds in 2023 have an associated token, and what are their fundraising amounts, token symbols, and token market caps?" }, { "role": "assistant", "content": "SELECT T1.project_name, T1.investment_value, T2.token_symbol, T2.market_cap FROM 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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "For each user, show how many users registered after them. Return the user_id, username, and the count of later registrants." }, { "role": "assistant", "content": "SELECT u1.user_id, u1.username, COUNT(u2.user_id) AS later_user_count FROM web3.users u1 LEFT JOIN web3...
You are an SQL statement expert. Given the table 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 the full names and specialties of all doctors who have issued a prescription for a patient enrolled in an insurance plan provided by 'Global Health'." }, { "role": "assistant", "content": "SELECT DISTINCT d.first_name, d.last_name, d.specialty\nFROM healthca...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Which beneficiaries have a percentage_share above 20% on active policies? Show beneficiary_id, first_name, last_name, percentage_share, and policy_number." }, { "role": "assistant", "content": "SELECT pb.beneficiary_id, pb.first_name, pb.last_name, pb.percentage_sha...
You are an SQL statement expert. Given the table 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": "Show me all events with the name 'Transfer' that occurred in the last 7 days, including the contract_id and transaction_id." }, { "role": "assistant", "content": "SELECT e.contract_id, e.transaction_id FROM web3.events e WHERE e.event_name = 'Transfer' AND e.emitted...
You are an SQL statement expert. Given the table 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, contract_id character varying(64) NOT NULL, event_name character...
[ { "role": "user", "content": "List all combinations of manufacturers and generic names. For each combination, display the manufacturer, generic_name, and the number of medications." }, { "role": "assistant", "content": "SELECT manufacturer, generic_name, COUNT(*) AS medication_count FROM healthc...
You are an SQL statement expert. Given the table 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": "For each type of entity a notification can be related to, how many notifications have been successfully sent?" }, { "role": "assistant", "content": "SELECT related_entity_type, COUNT(*) AS sent_notification_count FROM government_services.notifications WHERE status =...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego...
[ { "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 all reservations with more than 2 adults that are confirmed (status = 'Confirmed'), including their check-in dates and total amounts." }, { "role": "assistant", "content": "SELECT r.reservation_id, r.property_id, r.guest_id, r.check_in_date, r.total_amount F...
You are an SQL statement expert. Given the table 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": "Can you show me the full name, date of birth, and policy number for all patients who have insurance policies that will expire in the next 60 days, including the insurance plan ID?" }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, p.date_of_bir...
You are an SQL statement expert. Given the table 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": "How many agents are currently active in each license state?" }, { "role": "assistant", "content": "SELECT license_state, COUNT(*) AS active_agent_count\nFROM insurance.agents\nWHERE status = 'Active'\nGROUP BY license_state;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, -- unique identifier for the claim policy_id charac...
[ { "role": "user", "content": "Which games have the highest average item cost for Legendary rarity items? Please show the game title, genre, and the average cost of those items." }, { "role": "assistant", "content": "SELECT g.title, g.genre, AVG(igi.cost_amount) AS avg_legendary_cost\nFROM gaming...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "How many smart money addresses fall into each rank bracket: 1-100, 101-1000, and 1001-5000? Show the bracket and the count of addresses." }, { "role": "assistant", "content": "SELECT CASE WHEN rank BETWEEN 1 AND 100 THEN '1-100' WHEN rank BETWEEN 101 AND 1000 THEN '...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...