conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List all in-game items' names, types, and rarity along with their total cost in USD, for items that belong to games released on or after 2021-01-01." }, { "role": "assistant", "content": "SELECT i.item_name, i.item_type, i.rarity, i.cost_amount\nFROM gaming_technolo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player ...
[ { "role": "user", "content": "Retrieve all room types with a base_rate above 150 for each property." }, { "role": "assistant", "content": "SELECT property_id, type_name, base_rate\nFROM hospitality_technology.room_types\nWHERE base_rate > 150;" }, { "role": "user", "content": "Also 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, -- unique identifier for the room ...
[ { "role": "user", "content": "Show me each law firm's ID, name, managing_partner_id, and the number of appointments scheduled with that managing partner." }, { "role": "assistant", "content": "SELECT f.firm_id, \n f.firm_name, \n f.managing_partner_id, \n COUNT(a.appointment_id...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "I want to find all appointment pairs where two appointments are scheduled for the same client at overlapping times. Provide the appointment_id from both overlapping appointments." }, { "role": "assistant", "content": "SELECT a1.appointment_id AS appointment_id_1, a2...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.appointments ( appointment_id text PRIMARY KEY, client_id text, lawyer_id text, case_id text, start_time...
[ { "role": "user", "content": "For Sui NFTs with status 'exists', list their object_id, name, and owner." }, { "role": "assistant", "content": "SELECT object_id, name, owner\nFROM sui_nfts\nWHERE status = 'exists';" }, { "role": "user", "content": "I also need to see collection_type 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 erc20_balances_historical ( block_number bigint NOT NULL, -- Block number containing the transaction contract_a...
[ { "role": "user", "content": "Find all pairs of customers who live in the same state but have different risk profiles." }, { "role": "assistant", "content": "SELECT a.customer_id AS customer_id_a, a.first_name || ' ' || a.last_name AS full_name_a, a.risk_profile AS risk_profile_a, b.customer_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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "Show me the full names and phone numbers of customers living in Chicago who registered after January 1, 2023, along with their current status." }, { "role": "assistant", "content": "SELECT customer_id, first_name, last_name, phone_number, status\nFROM insurance.cust...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "role": "user", "content": "I need a list of unread notifications for user 'U123', including the sender's username and the notification type." }, { "role": "assistant", "content": "SELECT n.notification_id, u.username AS sender_username, n.notification_type, n.created_at\nFROM social_media.not...
You are an SQL statement expert. Given the table 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": "List the service names, agency names, and standard fees for all services that are active and have a standard fee between 50 and 100 inclusive." }, { "role": "assistant", "content": "SELECT s.service_name, ag.agency_name, s.standard_fee\nFROM government_services.serv...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Show me all bookings with a status of 'confirmed' that were made in the last 7 days, including passenger_id and fare." }, { "role": "assistant", "content": "SELECT b.booking_id, b.passenger_id, b.fare FROM transportation.bookings b WHERE b.status = 'confirmed' AND 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "Get a list of room types along with their property name and the count of rooms currently Available for each type." }, { "role": "assistant", "content": "SELECT rt.type_name, p.property_name, COUNT(r.room_id) AS available_rooms_count\nFROM hospitality_technology.room...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Show me the top 5 users by the total number of trades they participated in as buyers, along with their email addresses." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, u.email, COUNT(t.trade_id) AS total_trades FROM trading_platform.users u 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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "List all ERC20 tokens where the total supply is between 1 million and 10 million, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT ti.tick as name, ti.tick as symbol, tb.tick as contract_address FROM token_info ti...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transaction_index.integer, transaction_hash....
[ { "role": "user", "content": "Show me the average difficulty for blocks that have a previous block versus those that don't have a previous block." }, { "role": "assistant", "content": "SELECT CASE WHEN previous_block_id IS NULL THEN 'No Previous Block' ELSE 'Has Previous Block' END AS block_type...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id character varying(64) NOT NULL, -- unique identifier for the block previous_block...
[ { "role": "user", "content": "Show me all active policies with coverage limits above $500,000, along with the customer names and agent names." }, { "role": "assistant", "content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.coverage_limit, c.name AS customer_name, a.name AS agent_name 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 insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "Provide a summary of the total number of loans and the average principal_amount for each loan_type." }, { "role": "assistant", "content": "SELECT loan_type, COUNT(*) AS loan_count, AVG(principal_amount) AS avg_principal\nFROM financial_services.loans\nGROUP BY 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.loans ( loan_id text PRIMARY KEY, account_id text, loan_type text, principal_amount numeric, current...
[ { "role": "user", "content": "List each post_id, user_id, and the number of hashtags associated with that post for posts with visibility = 'public'." }, { "role": "assistant", "content": "SELECT p.post_id, p.user_id, COUNT(ph.hashtag_id) AS hashtag_count\nFROM social_media.posts p\nLEFT JOIN soc...
You are an SQL statement expert. Given the table 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 text PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ...
[ { "role": "user", "content": "List all post IDs and the corresponding hashtag names where posts were created near latitude 40.0 and longitude -74.0." }, { "role": "assistant", "content": "SELECT p.post_id, h.tag_name\nFROM social_media.posts p\nJOIN social_media.post_hashtags ph ON p.post_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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u...
[ { "role": "user", "content": "List all guests from California who are loyalty members and have provided their email addresses, ordered by last name." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, loyalty_member_id FROM hospitality_technology.guests WHERE state_provin...
You are an SQL statement expert. Given the table 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": "Can you help me find all schedules for a specific route with route_id 'RT789' that includes the train details and the departure times?" }, { "role": "assistant", "content": "SELECT s.schedule_id, s.departure_datetime, s.arrival_datetime, s.status, t.train_id\nFROM s...
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 // PUT /stations { "mappings": { "properties": { "station_id": { "type": "keyword" },...
[ { "role": "user", "content": "Show me all wallet_ids and their corresponding user_id where the wallet's address has a balance below 100." }, { "role": "assistant", "content": "SELECT w.wallet_id, w.user_id\nFROM blockchain.wallets w\nJOIN blockchain.addresses a ON w.address_id = a.address_id\nWH...
You are an SQL statement expert. Given the table 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": "Retrieve the top 5 tokens by 24h price_change_percentage_24h from token_basic_info along with their chain, narrative, and total 24h trading volume. Also include the narrative's token count from narrative_info." }, { "role": "assistant", "content": "SELECT t.token_sy...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO...
[ { "role": "user", "content": "For each chain, which token has the greatest absolute difference between its 1-hour and 6-hour price change percentage? Show the chain, token symbol, and the absolute difference." }, { "role": "assistant", "content": "SELECT chain, token_symbol, ABS(price_change_per...
You are an SQL statement expert. Given the table 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 cha...
[ { "role": "user", "content": "For each group conversation, show its name and the creation time of the earliest notification associated with it." }, { "role": "assistant", "content": "SELECT c.group_name, MIN(n.created_at) AS earliest_notification_time FROM social_media.conversations AS c JOIN so...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp, last_message_at timestamp, is_grou...
[ { "role": "user", "content": "List all claims that have at least one document of type 'INVOICE', including the claim ID, incident date, estimated loss, and the document's file name." }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, c.estimated_loss, d.file_name\nFROM ins...
You are an SQL statement expert. Given the table 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": "Show all reviews made by guests along with the guest_id, guest's reservation_id, and the related property's property_id and review_date." }, { "role": "assistant", "content": "SELECT r.review_id, r.guest_id, r.reservation_id, r.property_id, r.review_date\nFROM hospi...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, property_id character varying(64) ...
[ { "role": "user", "content": "Retrieve, for each room type, the total number of services offered by its property, including the property_name, type_name, and service_count." }, { "role": "assistant", "content": "SELECT p.property_name,\n rt.type_name,\n COUNT(s.service_id) AS service...
You are an SQL statement expert. Given the table 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": "I want a list of DApp names and the asset symbols mentioned in their descriptions." }, { "role": "assistant", "content": "SELECT d.name AS dapp_name,\n a.symbol AS asset_symbol\nFROM trading_platform.dapps d\nJOIN trading_platform.assets a\n ON d.description ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, -- unique identifier for the asset name cha...
[ { "role": "user", "content": "List all DApps together with the names of assets that have metadata linking them to these DApps using the 'associated_dapp' key (assuming metadata.value matches the dapp_id)." }, { "role": "assistant", "content": "SELECT d.name AS dapp_name, a.name AS asset_name\nFR...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "Show me the top 3 narratives by trend rank, along with their top 3 tokens and 7-day price change percentage." }, { "role": "assistant", "content": "SELECT ni.narrative, ni.top_3_coins, ni.price_change_percentage_7d FROM narrative_info ni ORDER BY ni.trend_rank ASC 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 project_fundraising_record (", "id character varying(32) NOT NULL, -- fundraising record id", "project_id ch...
[ { "role": "user", "content": "List all patients who have been prescribed medications with dosage greater than 100mg, including their names and the medication details." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, m.medication_name, m.generic_name, pr.dosa...
You are an SQL statement expert. Given the table 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'd like to see a list of users who have enabled email notifications." }, { "role": "assistant", "content": "SELECT user_id FROM social_media.user_settings WHERE email_notifications_enabled = true;" }, { "role": "user", "content": "Also, include those 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.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id character varying(64) NOT NULL, ha...
[ { "role": "user", "content": "Show me the total payment amounts grouped by currency_code and payment_method for payments with status 'Succeeded'. Include currency_code, payment_method, and total_amount." }, { "role": "assistant", "content": "SELECT currency_code, payment_method, SUM(amount) 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "Show me the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their price and 24-hour price change percentage." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, price_change_percentage_24h, volume_24h FROM token_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 token_dexpool_info ( pair_address character varying(512) NOT NULL, token_name character varying(100) NOT NULL, token_sy...
[ { "role": "user", "content": "Show me the content of comments made by users that I am following (assuming my user ID is 'current_user_id'). Include the comment ID and the user ID of the commenter." }, { "role": "assistant", "content": "SELECT c.comment_id, c.user_id AS commenter_user_id, c.conte...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_id.text, content.text, created_at.t...
[ { "role": "user", "content": "List all guests from California who are loyalty members and have provided their email addresses, ordered by last name." }, { "role": "assistant", "content": "SELECT guest_id, first_name, last_name, email, phone_number FROM hospitality_technology.guests WHERE state_p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id.text, property_name.text, address_line1.text, address_line2.text, city....
[ { "role": "user", "content": "Find pairs of wallet IDs that belong to the same user, showing the user ID and the two wallet IDs." }, { "role": "assistant", "content": "SELECT w1.user_id, w1.wallet_id AS wallet1_id, w2.wallet_id AS wallet2_id FROM web3.wallets w1 JOIN web3.wallets w2 ON w1.user_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 web3.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "Show the name of each agency and whether it operates at least one service location marked as accessible." }, { "role": "assistant", "content": "SELECT T1.agency_name FROM government_services.agencies AS T1 JOIN government_services.service_locations AS T2 ON T1.agenc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, -- unique identifier for the agency ag...
[ { "role": "user", "content": "For each fuel type, show the number of unique vehicles that have used it and the total quantity refueled." }, { "role": "assistant", "content": "SELECT f.fuel_type, COUNT(DISTINCT f.vehicle_id) AS vehicle_count, SUM(f.quantity) AS total_quantity\nFROM transportation...
You are an SQL statement expert. Given the table 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": "Provide the total number of vehicles for each fuel_type." }, { "role": "assistant", "content": "SELECT fuel_type, COUNT(*) AS vehicle_count\nFROM transportation.vehicles\nGROUP BY fuel_type;" }, { "role": "user", "content": "Only include fuel types 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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "Calculate the average total amount and average amount paid for reservations grouped by booking source." }, { "role": "assistant", "content": "SELECT booking_source, AVG(total_amount) AS avg_total_amount, AVG(amount_paid) AS avg_amount_paid FROM hospitality_technolog...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ...
[ { "role": "user", "content": "Show me the appointment_id alongside plan_id and plan_name for all appointments exceeding 30 minutes with plan_type 'PPO'." }, { "role": "assistant", "content": "SELECT a.appointment_id, p.plan_id, p.plan_name FROM healthcare.appointments a CROSS JOIN healthcare.ins...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,...
[ { "role": "user", "content": "For each premium payment, show payment_id, amount_paid, payment_date, and the policy number for the associated policy." }, { "role": "assistant", "content": "SELECT pp.payment_id, pp.amount_paid, pp.payment_date, p.policy_number\nFROM insurance.premium_payments pp\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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "role": "user", "content": "List all pairs of securities that are issued by the same issuer but trade on different exchanges. Show the ticker symbols and exchanges for both securities as symbol_a, exchange_a, symbol_b, exchange_b, and include issuer_name." }, { "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 financial_services.securities ( security_id text, ticker_symbol text, isin_code text, cusip_code text, security_name te...
[ { "role": "user", "content": "List each comment_id and the number of likes it has received, but only include comments with at least 5 likes, ordered by like_count ascending." }, { "role": "assistant", "content": "SELECT l.comment_id, COUNT(*) AS like_count\nFROM social_media.likes l\nWHERE l.com...
You are an SQL statement expert. Given the table 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 text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ...
[ { "role": "user", "content": "Retrieve all applications that have no assigned employee. Display the application_id, citizen_id, service_id, submitted_at, and status." }, { "role": "assistant", "content": "SELECT\n application_id,\n citizen_id,\n service_id,\n submitted_at,\n status\nFROM 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 character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "List clients who have appointments with lawyers from law firms founded before the year 2010. Show the client's first name, last name, the appointment subject, the lawyer's first name, last name, and the firm name." }, { "role": "assistant", "content": "SELECT T1.fir...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "For each property in the 'USA' country, list the property name and the total count of services that cost more than 50." }, { "role": "assistant", "content": "SELECT T1.property_name, COUNT(T2.service_id) FROM hospitality_technology.properties AS T1 JOIN 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, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "What is the average balance of all addresses in the database?" }, { "role": "assistant", "content": "SELECT AVG(balance) as average_balance FROM blockchain.addresses;" }, { "role": "user", "content": "Can you break this down by the first 3 characters of ...
You are an SQL statement expert. Given the table 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.text, public_key.text, balance.numeric )
[ { "role": "user", "content": "Which are the top 3 tokens on BSC by total USD value held by all CEXs, and what is their narrative and current price?" }, { "role": "assistant", "content": "SELECT ctb.token_symbol, tbi.narrative, tbi.price, SUM(ctb.usd_value) AS total_usd_value\nFROM cex_token_bala...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "I need a report listing each customer’s full name, the number of accounts they hold, and the date when they opened their first account." }, { "role": "assistant", "content": "SELECT c.customer_id,\n c.first_name || ' ' || c.last_name AS full_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "Get total quantity_dispensed and average refills_allowed for each medication_id, plan_id, and policy_number for patients with active primary insurance (expiration_date is null or in the future)." }, { "role": "assistant", "content": "SELECT 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.prescriptions ( prescription_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, pa...
[ { "role": "user", "content": "List tokens with trend rank 5 or better and a price below $1. Show symbol, price, and trend rank." }, { "role": "assistant", "content": "SELECT token_symbol, price, trend_rank FROM token_dexpool_info WHERE trend_rank IS NOT NULL AND trend_rank <= 5 AND price < 1;" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "role": "user", "content": "Show me the number of clients who registered in each year." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM date_registered), COUNT(*) FROM clients GROUP BY EXTRACT(YEAR FROM date_registered)" }, { "role": "user", "content": "Only include ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "What is the current address of the employee with ID 'EMP234'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the current address of an employee as this information is not stored in the database table." } ]
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE manufacturing.employees ( ...
[ { "role": "user", "content": "List all contracts with status 'active' and include their ABI length in characters." }, { "role": "assistant", "content": "SELECT address, LENGTH(abi) AS abi_length FROM web3.contracts WHERE status = 'active';" }, { "role": "user", "content": "Actually, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "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": "Find all users who have deployed contracts, along with their email addresses and the count of contracts they've deployed, sorted by contract count in descending order." }, { "role": "assistant", "content": "SELECT u.username, u.email, COUNT(c.contract_id) AS contrac...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "List all agents who have a commission rate above 0.1, showing their full names and agency names." }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, agency_name, commission_rate FROM insurance.agents WHERE commission_rate > 0.1 AND status ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "For each employee, show their first name, last name, and the total payment amount for applications they have been assigned to process." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, SUM(p.amount) AS total_payment_amount\nFROM government_ser...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli...
[ { "role": "user", "content": "List all appointments handled by lawyers from law firms founded after 2015, showing the appointment subject and the lawyer's firm name." }, { "role": "assistant", "content": "SELECT a.subject, f.firm_name\nFROM legal_services.appointments a\nJOIN legal_services.lawy...
You are an SQL statement expert. Given the table 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": "List all distinct currency types used in payments." }, { "role": "assistant", "content": "SELECT DISTINCT currency\nFROM government_services.payments;" } ]
You are an SQL statement expert. Given the table 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": "Count the number of metadata entries for each asset_id." }, { "role": "assistant", "content": "SELECT asset_id,\n COUNT(*) AS metadata_count\nFROM trading_platform.metadata\nGROUP BY asset_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 trading_platform.metadata ( metadata_id character varying(64) NOT NULL, asset_id character varying(64) NOT NULL, key ch...
[ { "role": "user", "content": "List the number of bookings made by each loyalty program member. Show the loyalty_program_id and the booking count." }, { "role": "assistant", "content": "SELECT p.loyalty_program_id, COUNT(b.booking_id) AS booking_count\nFROM transportation.passengers p\nJOIN trans...
You are an SQL statement expert. Given the table 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.passengers ( passenger_id character varying(64) NOT NULL, -- unique identifier for the passenger ...
[ { "role": "user", "content": "Show all room types available at properties located in 'US', including the property name, room type name, base rate, and maximum occupancy." }, { "role": "assistant", "content": "SELECT p.property_name, rt.type_name, rt.base_rate, rt.max_occupancy 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 text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Provide a summary of transactions by status, showing the count and the total amount for each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS transaction_count, SUM(amount) AS total_amount FROM financial_services.transactions GROUP BY status...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "List diagnoses and the name of any medication mentioned in the treatment plan of the associated medical record. Show diagnosis ID, diagnosis description, medication name, and record ID." }, { "role": "assistant", "content": "SELECT T1.diagnosis_id, T1.description, 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 healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "Show me all customers who have purchased policies for insurance products of type 'health', including their full name, policy number, and the insurance product's name." }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_nu...
You are an SQL statement expert. Given the table 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 the user ID, wallet ID, contract ID, creator address, and timestamp for smart contracts created by addresses associated with any wallet." }, { "role": "assistant", "content": "SELECT w.user_id, w.wallet_id, sc.contract_id, sc.creator_address, sc.timestamp FR...
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 blockchain.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonc...
[ { "role": "user", "content": "Retrieve the count of active insurance products for each product_type and order the results by the count descending." }, { "role": "assistant", "content": "SELECT product_type,\n COUNT(*) AS active_count\nFROM insurance.insurance_products\nWHERE is_active = 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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, product_type text, description text, bas...
[ { "role": "user", "content": "Show me the count of lawyers per specialization." }, { "role": "assistant", "content": "SELECT specialization,\n COUNT(*) AS lawyer_count\nFROM legal_services.lawyers\nGROUP BY specialization;" }, { "role": "user", "content": "Only include speciali...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id text, first_name text, last_name text, bar_number text, firm_id text, email text, ph...
[ { "role": "user", "content": "List all policy beneficiaries who have a percentage share greater than 50%, along with their policy details." }, { "role": "assistant", "content": "SELECT pb.beneficiary_id, pb.policy_id, pb.customer_id, pb.first_name, pb.last_name, pb.relationship, pb.percentage_sh...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "Can you find all policyholders who have submitted a claim that has already been settled, along with the policy number and the settlement amount?" }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_number, cl.settlement_am...
You are an SQL statement expert. Given the table 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": "List all token symbols and their total supply for tokens where the total supply is greater than the average total supply of all tokens." }, { "role": "assistant", "content": "SELECT token_symbol, total_supply FROM web3.tokens WHERE total_supply > (SELECT AVG(total_s...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying(64) NOT NULL, event_name character...
[ { "role": "user", "content": "How many distinct ports have been used by peers in the system?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT port) AS distinct_port_count\nFROM trading_platform.peers;" } ]
You are an SQL statement expert. Given the table 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": "Please show me the first name, last name, and date of birth for all passengers born between 1990 and 1999, inclusive." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM transportation.passengers WHERE date_of_birth BETWEEN '1990-...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ...
[ { "role": "user", "content": "List all unspent UTXOs, including their utxo_id, address, amount, and transaction_id." }, { "role": "assistant", "content": "SELECT utxo_id, address, amount, transaction_id \nFROM trading_platform.utxos \nWHERE spent = false;" } ]
You are an SQL statement expert. Given the table 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 text, order_id text, buyer_id text, seller_id text, asset_id text, quantity numeric,...
[ { "role": "user", "content": "List all time entries that do not have a description, including the entry ID, date worked, hours spent, and the first and last name of the lawyer who recorded the entry." }, { "role": "assistant", "content": "SELECT te.entry_id, te.date_worked, te.hours_spent, l.fir...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu...
[ { "role": "user", "content": "What is the average market cap for all tokens belonging to the 'GameFi' narrative?" }, { "role": "assistant", "content": "SELECT AVG(market_cap) FROM token_basic_info WHERE narrative = 'GameFi'" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "How many players are registered for each country? Return the country_code and the player count." }, { "role": "assistant", "content": "SELECT country_code, COUNT(*) AS player_count FROM gaming_technology.players GROUP BY country_code;" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "Show me all participants who joined any conversation before January 1st, 2024. Return participant_id, user_id, conversation_id and the joined_at timestamp." }, { "role": "assistant", "content": "SELECT participant_id, user_id, conversation_id, joined_at FROM social_...
You are an SQL statement expert. Given the table 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.conversation_participants ( participant_id.text, conversation_id.text, user_id.text, joined_at.timestamp, ...
[ { "role": "user", "content": "For each claim, show the claim ID, incident date, and the number of documents attached to it. Only include claims that have at least 2 documents." }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, COUNT(d.document_id) AS document_count\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 insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name) who have both a checking account (account_type = 'Checking') and a savings account (account_type = 'Savings'), along with their total combined balance." }, { "role": "assistant", "content": "SELECT c.custome...
You are an SQL statement expert. Given the table 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": "Show me all available spa services (category = 'Wellness') with their names and prices, ordered by price in descending order." }, { "role": "assistant", "content": "SELECT service_name, price FROM hospitality_technology.services WHERE category = 'Wellness' AND is_av...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "role": "user", "content": "Find all managing partners who oversee more than one firm at the same address. Show the managing partner ID, the shared address, and the number of firms they manage at that address." }, { "role": "assistant", "content": "SELECT managing_partner_id, address, 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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name character varying(200) NOT NULL, address t...
[ { "role": "user", "content": "List all contracts that were deployed by the same deployer address on the same network, showing the contract IDs, deployer address, and network ID." }, { "role": "assistant", "content": "SELECT c1.contract_id AS contract_id_1, c2.contract_id AS contract_id_2, c1.dep...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifier for the contract address cha...
[ { "role": "user", "content": "List each citizen's first and last name along with the first and last name of another citizen who shares the same last name. Show each pair only once." }, { "role": "assistant", "content": "SELECT c1.first_name || ' ' || c1.last_name AS citizen_name,\n c2.firs...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show the full names and registration dates of citizens who have submitted applications with the status 'Processing'." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name, c.last_name, c.registration_date\nFROM government_services.citizens c\nJOIN gove...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show me each product_type along with the count of products for that type, but only include types where the average base_premium exceeds 500. Order the results by the product count in descending order." }, { "role": "assistant", "content": "SELECT product_type,\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.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Can you list for each player their most recent and second most recent achievements, showing columns player_id, recent_achievement_id, second_recent_achievement_id, and recent_unlocked_at?" }, { "role": "assistant", "content": "SELECT recent.player_id,\n recent...
You are an SQL statement expert. Given the table 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": "Show me all wallets holding at least 3 different ERC1155 NFTs on Ethereum, along with the number of distinct tokens held by each wallet." }, { "role": "assistant", "content": "SELECT wallet_address, COUNT(DISTINCT token_id) as distinct_tokens\nFROM nft_holders\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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Find the average session duration in minutes for players from each country." }, { "role": "assistant", "content": "SELECT p.country_code, AVG(gs.duration_seconds) / 60 AS avg_duration_minutes FROM gaming_technology.players p JOIN gaming_technology.game_sessions gs 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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player ...
[ { "role": "user", "content": "For each Bitcoin token tick, find the wallet address holding the largest amount and include the creator from token_info_bitcoin." }, { "role": "assistant", "content": "SELECT b.tick,\n b.wallet_address,\n CAST(b.amount AS DECIMAL) AS max_amount,\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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "List the top 5 accounts by total commission paid in trades during June 2024. Include account_number and total_commission." }, { "role": "assistant", "content": "SELECT a.account_number,\n SUM(t.commission) AS total_commission\nFROM financial_services.trades 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": "Find all services that cost exactly 25, showing their name, department, and property_id." }, { "role": "assistant", "content": "SELECT service_name, department, property_id\nFROM hospitality_technology.services\nWHERE price = 25;" }, { "role": "user", "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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "Could you show each in-game item's name, its rarity, and the total quantity acquired by all players?" }, { "role": "assistant", "content": "SELECT i.item_name, i.rarity, SUM(pi.quantity) AS total_quantity\nFROM gaming_technology.in_game_items i\nJOIN gaming_technolo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id uuid, genre text, release_date date...
[ { "role": "user", "content": "Show me all smart contracts created by addresses that have created more than 3 contracts, along with the total number of contracts each creator has made." }, { "role": "assistant", "content": "SELECT sc.contract_id, sc.creator_address, COUNT(*) OVER (PARTITION BY sc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "role": "user", "content": "Retrieve the total revenue and order count for each department for services in July 2023. Show department, revenue, and order_count." }, { "role": "assistant", "content": "SELECT s.department,\n SUM(o.total_price) AS revenue,\n COUNT(o.order_id) AS order...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "For each user, can you show their username and the length of their email address?" }, { "role": "assistant", "content": "SELECT user_id, username, LENGTH(email) AS email_length FROM web3.users;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp )
[ { "role": "user", "content": "List the IDs and names of all service locations that have no phone number specified." }, { "role": "assistant", "content": "SELECT location_id, location_name \nFROM government_services.service_locations \nWHERE contact_phone IS NULL OR contact_phone = '';" } ]
You are an SQL statement expert. Given the table 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...