Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
288
8.03k
[ { "role": "user", "content": "Show the application ID, payment amount, and payment method for all payments that have a status of 'Completed' and are related to services in the 'Licensing' category." }, { "role": "assistant", "content": "SELECT p.application_id, p.amount, p.payment_method\nFROM g...
You are an SQL statement expert. Given the table 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": "For the 'DeFi' narrative, what is the average ROI and the total net inflow (usd_value where type=1) from smart money token inflow?" }, { "role": "assistant", "content": "SELECT AVG(sm.roi) AS avg_roi, SUM(smt.usd_value) AS total_net_inflow\nFROM smart_money_token_in...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "Find all wallets created by users in the last 7 days along with any tokens that have a total supply greater than 10 million, showing the wallet address and token details." }, { "role": "assistant", "content": "SELECT w.address AS wallet_address, t.token_name, t.toke...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha...
[ { "role": "user", "content": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count." }, { "role": "assistant", "content": "SELECT g.genre, COUNT(gs.session_id) AS session_count, COUNT(DISTIN...
You are an SQL statement expert. Given the table 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": "List all overdue premium payments with their policy IDs and due dates, sorted by due date in ascending order." }, { "role": "assistant", "content": "SELECT policy_id, due_date FROM insurance.premium_payments WHERE status = 'overdue' ORDER BY due_date ASC;" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id.text, policy_id.text, customer_id.text, payment_date.timestamp, amount_paid.num...
[ { "role": "user", "content": "How many posts have a media file attached?" }, { "role": "assistant", "content": "SELECT count(*) FROM social_media.posts WHERE media_url IS NOT NULL;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "I need a report of patients who have received prescriptions for medications manufactured by 'Pfizer'. Include patient ID, first name, last name, medication_name, and prescription_date." }, { "role": "assistant", "content": "SELECT p.patient_id,\n p.first_name,...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "How many documents were uploaded in the year 2023?" }, { "role": "assistant", "content": "SELECT count(*) FROM government_services.documents WHERE date_part('year', upload_timestamp) = 2023;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "Which claims have an estimated_loss greater than 20000 and also have any premium payment that is not completed? Return claim_id, policy_id, estimated_loss, due_date, and amount_paid." }, { "role": "assistant", "content": "SELECT c.claim_id,\n c.policy_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 insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d...
[ { "role": "user", "content": "Show me the top 5 smart money addresses by profit on the Ethereum chain, along with their most profitable token and ROI." }, { "role": "assistant", "content": "SELECT address, most_profit_token, roi FROM smart_money_profit WHERE chain = 'Ethereum' ORDER BY profit 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 smart_money_profit ( address character varying(100) NOT NULL, -- the user's address rank INT, -- the rank of the addres...
[ { "role": "user", "content": "List the names and types of all in-game items that have a rarity of 'Epic'." }, { "role": "assistant", "content": "SELECT item_name, item_type FROM gaming_technology.in_game_items WHERE rarity = 'Epic';" }, { "role": "user", "content": "Further restrict ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "List all patients who have had appointments and were prescribed a medication manufactured by 'Merck'. Show the patient ID, full name, appointment ID, and medication name." }, { "role": "assistant", "content": "SELECT DISTINCT p.patient_id, p.first_name, p.last_name,...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "Show me all properties in California with a star rating above 4.0, along with the names of their managers and the count of active staff members at each property." }, { "role": "assistant", "content": "SELECT p.property_name, p.star_rating, s.first_name || ' ' || s.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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "List the username and email of users whose first wallet creation date is the same day as their user registration date." }, { "role": "assistant", "content": "SELECT u.username, u.email FROM web3.users u JOIN (SELECT user_id, MIN(created_at) as first_wallet_created_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 web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "Show the total number of customers in each state." }, { "role": "assistant", "content": "SELECT\n state,\n COUNT(customer_id)\nFROM insurance.customers\nGROUP BY\n state;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin...
[ { "role": "user", "content": "List pairs of citizens who share the same email domain." }, { "role": "assistant", "content": "SELECT c1.first_name AS first1,\n c1.last_name AS last1,\n c2.first_name AS first2,\n c2.last_name AS last2,\n SPLIT_PART(c1.contact_email, '@', 2)...
You are an SQL statement expert. Given the table 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": "Find all users who registered with a Yahoo email address, along with their registration dates." }, { "role": "assistant", "content": "SELECT user_id, username, email, password_hash FROM blockchain.users WHERE email LIKE '%@yahoo.com';" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "role": "user", "content": "How many likes were given to comments in June 2024?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS comment_likes_count\nFROM social_media.likes\nWHERE comment_id IS NOT NULL \n AND DATE_TRUNC('month', created_at) = '2024-06-01';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, post_id character varying(64) NOT NULL, user_id char...
[ { "role": "user", "content": "Find all pairs of transactions where both transactions have the same nonce and from_address, but different transaction_id. Show both transaction IDs, the shared from_address, shared nonce, and their block numbers." }, { "role": "assistant", "content": "SELECT t1.tra...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, -- unique identifier for the transaction fr...
[ { "role": "user", "content": "特定のラインIDに関連する組み立て手順と、使用されている材料の情報を取得したいです。ラインID、ステップ名、材料名、材料の説明を含めてください。" }, { "role": "assistant", "content": "SELECT s.line_id, s.step_name, m.material_name, m.description\nFROM manufacturing.assembly_steps s\nJOIN manufacturing.materials m ON s.step_id = m.materi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE manufacturing.materials ( material_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "List all patients who have an active prescription for a medication manufactured by 'AstraZeneca', along with their policy number and the prescription ID." }, { "role": "assistant", "content": "SELECT p.patient_id, pi.policy_number, pr.prescription_id\nFROM healthcar...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medications ( medication_id.text, medication_name.text, generic_name.text, manufacturer.text, ndc_code.text,...
[ { "role": "user", "content": "Show me all vehicles that had maintenance in the past month, including their make, model, maintenance service_date, and depot name." }, { "role": "assistant", "content": "SELECT v.vehicle_id,\n v.make,\n v.model,\n m.service_date,\n l.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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "List the first name and last name of citizens along with the amount of payments they have made." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.amount FROM government_services.citizens AS T1 JOIN government_services.payments AS T2 ON T1...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "I want a list of all claims where at least one document is larger than 2 megabytes. Include the claim ID, incident date, and the file name of such documents." }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, d.file_name\nFROM 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.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "Show all rooms that are on floor 3." }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number FROM hospitality_technology.rooms WHERE floor = 3;" }, { "role": "user", "content": "For these rooms, include the property name and room n...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show the guest's full name, reservation ID, check-in date, and status for all reservations made via 'Phone'." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, r.reservation_id, r.check_in_date, r.status FROM hospitality_technology.reservations...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "Get the number of agents grouped by status. Return status and agent_count." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS agent_count\n FROM insurance.agents\n GROUP BY status;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "Find all medical records where the treatment plan includes 'physical therapy' and the patient has an active primary insurance plan, showing the patient ID, record date, and insurance provider details." }, { "role": "assistant", "content": "SELECT mr.patient_id, mr.r...
You are an SQL statement expert. Given the table 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": "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": "How many lawyers who are partners were hired in each year? Show the hire year and the count." }, { "role": "assistant", "content": "SELECT strftime('%Y', hire_date) AS hire_year , count(lawyer_id) FROM legal_services.lawyers WHERE is_partner = true GROUP BY hire_...
You are an SQL statement expert. Given the table 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": "For each user, show their user ID and the count of unique wallet addresses they own." }, { "role": "assistant", "content": "SELECT user_id, COUNT(DISTINCT address) FROM wallets GROUP BY user_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.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
[ { "role": "user", "content": "How many documents are there for each document_type? Show document_type and count ordered by the count in descending order." }, { "role": "assistant", "content": "SELECT document_type,\n COUNT(*) AS count\nFROM legal_services.documents\nGROUP BY document_type\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "What is the average number of wallets each user owns?" }, { "role": "assistant", "content": "SELECT\n AVG(wallet_count) AS avg_wallets_per_user\nFROM (\n SELECT user_id, COUNT(*) AS wallet_count\n FROM web3.wallets\n GROUP BY user_id\n) AS sub;" }, { "ro...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
[ { "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": "Show me the usernames and email addresses of users who commented on any post tagged with the hashtag 'H777'." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email\nFROM social_media.comments c\nJOIN social_media.users u ON c.user_id = u.user_id\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Show me all events emitted by contracts where the event name contains 'Approval', along with the contract ID and transaction ID, sorted by emitted timestamp in descending order." }, { "role": "assistant", "content": "SELECT event_id, contract_id, event_name, transac...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "Show the invoice number, issue date, total amount, and the client's full name for all invoices, including only those invoices that have not been paid fully." }, { "role": "assistant", "content": "SELECT i.invoice_number, i.issue_date, i.total_amount, c.first_name ||...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id.text, first_name.text, last_name.text, company_name.text, email.text, phone.text, ad...
[ { "role": "user", "content": "Provide the contract ID, creator address, and timestamp for all smart contracts created between January 1st, 2022, and December 31st, 2024." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE ti...
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.smart_contracts ( contract_id.text, creator_address.text, code.text, time...
[ { "role": "user", "content": "List the product ID and product name of all insurance products created in 2024." }, { "role": "assistant", "content": "SELECT product_id, product_name\nFROM insurance.insurance_products\nWHERE created_at >= '2024-01-01' AND created_at < '2025-01-01';" }, { "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, product_type text, description text, bas...
[ { "role": "user", "content": "Show me all savings accounts (account_id, account_number, balance) with an interest rate above 2.5%, along with the security details (ticker_symbol, issuer_name) for securities in the same currency as the account." }, { "role": "assistant", "content": "SELECT a.acco...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac...
[ { "role": "user", "content": "Calculate the average number of days between when an incident occurred and when the claim was reported, but only for claims that were settled in the year 2023." }, { "role": "assistant", "content": "SELECT\n AVG(EXTRACT(EPOCH FROM (reported_date - incident_date)) /...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, -- unique identifier for the claim policy_id charac...
[ { "role": "user", "content": "Find projects from the project_fundraising_record table that have completed both a 'Seed' fundraising round and a 'Series A' fundraising round." }, { "role": "assistant", "content": "SELECT pf_seed.project_name FROM project_fundraising_record pf_seed JOIN project_fu...
You are an SQL statement expert. Given the table 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": "What is the current job satisfaction level or feedback from staff members working at a specific train station?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on job satisfaction levels or feedback from staff members as this data is...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.s...
[ { "role": "user", "content": "What is the total revenue generated by ticket sales at the station with ID 'ST101' for the past month?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the revenue generated by ticket sales as this data is not available in the cur...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.s...
[ { "role": "user", "content": "Find cases where an address received tokens in one transfer and then sent tokens in another. List the receive transfer_id, the send transfer_id, the address, and both transfer values." }, { "role": "assistant", "content": "SELECT recv.transfer_id AS receive_transfer...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.token_transfers ( transfer_id character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "Which guests have used services that are currently unavailable? Show guest full names, the service name, and the order status." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, s.service_name, so.status\nFROM hospitality_technology.guests g\nJ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, email.text, phone_number.text, date_of_...
[ { "role": "user", "content": "List all events and any token transfers that occurred in the same transaction, showing event_id, event_name, transfer_id, and token_symbol." }, { "role": "assistant", "content": "SELECT\n e.event_id,\n e.event_name,\n tt.transfer_id,\n tk.token_symbol\nFROM 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.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "List pairs of game titles in the same genre but developed by different developers." }, { "role": "assistant", "content": "SELECT g1.title AS game1_title,\n g2.title AS game2_title,\n g1.genre\nFROM gaming_technology.games g1\nJOIN gaming_technology.games...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date...
[ { "role": "user", "content": "List all active SUI coins with status 'exists' in metadata, showing coin_type, symbol, name, balance, and description." }, { "role": "assistant", "content": "SELECT sc.coin_type, sm.symbol, sm.name, sc.balance, sm.description\nFROM sui_coins sc\nJOIN sui_coins_metad...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "List all pairs of tokens (show token_id for both) that share the same contract address, excluding pairs where the token_id is the same." }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id1, t2.token_id AS token_id2, t1.contract_address FROM web3.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 web3.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha...
[ { "role": "user", "content": "I want a summary of each asset showing the total number of trades executed and the average trade price, including asset name and symbol." }, { "role": "assistant", "content": "SELECT a.asset_id,\n a.name,\n a.symbol,\n COUNT(t.trade_id) AS trades_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 trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp ) CREATE ...
[ { "role": "user", "content": "How many patients have at least one medical record associated with them?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT patient_id) FROM healthcare.medical_records;" }, { "role": "user", "content": "Now, can you show me the count of patient...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List all users and the count of wallets they own." }, { "role": "assistant", "content": "SELECT u.username, COUNT(w.wallet_id) AS wallet_count FROM blockchain.users u JOIN blockchain.wallets w ON u.user_id = w.user_id GROUP BY u.user_id, u.username;" }, { "r...
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.addresses ( address_id character varying(128) NOT NULL, public_key text N...
[ { "role": "user", "content": "List all job titles of employees who work in the 'Finance' department." }, { "role": "assistant", "content": "SELECT DISTINCT job_title\nFROM government_services.employees\nWHERE department = 'Finance';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "List all prescriptions where the dosage text contains the word 'unit'. Show the prescription ID, medication ID, and dosage." }, { "role": "assistant", "content": "SELECT prescription_id, medication_id, dosage FROM healthcare.prescriptions WHERE dosage LIKE '%unit%';...
You are an SQL statement expert. Given the table 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": "List the full names and dates of birth for all patients who do not have a phone number on record." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE phone_number IS NULL OR TRIM(phone_number) = '';" } ...
You are an SQL statement expert. Given the table 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": "For each player, count the total number of achievements they've unlocked." }, { "role": "assistant", "content": "SELECT player_id,\n COUNT(*) AS total_achievements\nFROM gaming_technology.player_achievements\nGROUP BY player_id;" }, { "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.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique id...
[ { "role": "user", "content": "Show me the top 5 narratives by market cap, along with their 24-hour trading volume and 7-day price change percentage." }, { "role": "assistant", "content": "SELECT narrative.text, volume_24h.numeric, price_change_percentage_7d.numeric FROM narrative_info ORDER BY 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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume...
[ { "role": "user", "content": "What is the fuel efficiency of the train car with car_id 'TC456'?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the fuel efficiency of specific train cars. The data available in the train_cars table only includes deta...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "role": "user", "content": "List all doctors who were created in the year 2022. Show their doctor ID, first name, and last name." }, { "role": "assistant", "content": "SELECT doctor_id, first_name, last_name FROM healthcare.doctors WHERE EXTRACT(YEAR FROM created_at) = 2022" }, { "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 healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "List all invoices that were paid within 7 days of their issue date. Show invoice number, issue date, payment date, and total amount." }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, payment_date, total_amount FROM legal_services.invoices WHE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest tpl ON tm.contract...
You are an SQL statement expert. Given the table 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": "What is the reason behind the cost variation for maintenance of asset_id 'ASSET456' over the past year?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the reasons behind cost variations for maintenance. The data in the maintenan...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.m...
[ { "role": "user", "content": "Which agencies offer more than three services? List the agency ID and the total number of services they provide." }, { "role": "assistant", "content": "SELECT agency_id, COUNT(service_id) AS total_services\nFROM government_services.services\nGROUP BY agency_id\nHAVI...
You are an SQL statement expert. Given the table 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": "List all appointments scheduled for the service named 'Passport Renewal', showing the appointment ID, citizen ID, and scheduled start time." }, { "role": "assistant", "content": "SELECT T1.appointment_id, T1.citizen_id, T1.scheduled_start_time FROM government_servic...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id text, location_id text, service_id...
[ { "role": "user", "content": "Show the name of beneficiaries and the policy number for policies that are of product type 'life'." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.policy_number FROM insurance.policy_beneficiaries AS T1 JOIN insurance.policies 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table." }, { "role": "assistant", "content": "SELECT pfr.project_name, pfr.valuation, tbi.token_symbol,...
You are an SQL statement expert. Given the table 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 premium payments made after April 1, 2024, including the payment_id, policy_id, customer_id, and amount_paid." }, { "role": "assistant", "content": "SELECT payment_id, policy_id, customer_id, amount_paid\nFROM insurance.premium_payments\nWHERE payment_date ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, custo...
[ { "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...
[ { "role": "user", "content": "Provide a count of notifications, separated by whether they have been read or not." }, { "role": "assistant", "content": "SELECT CASE WHEN T1.read_at IS NULL THEN 'Unread' ELSE 'Read' END, count(T1.notification_id) FROM trading_platform.notifications AS T1 GROUP BY ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id.text, user_id.text, message.text, sent_at.timestamp, read_at.timestamp...
[ { "role": "user", "content": "For each event recorded, list its ID, name, and the status and value of the transaction in which it occurred." }, { "role": "assistant", "content": "SELECT E.event_id, E.event_name, E.transaction_id, T.status, T.value FROM web3.events AS E JOIN web3.transactions 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 web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "Show me all rooms with their room number, the type name, and the maximum occupancy for each room." }, { "role": "assistant", "content": "SELECT r.room_id, r.room_number, rt.type_name, rt.max_occupancy\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "List each achievement with the very next achievement unlocked by the same player using a self-join. Show player_id, current_ach, current_unlocked_at, next_ach, and next_unlocked_at." }, { "role": "assistant", "content": "SELECT pa1.player_id,\n pa1.achievement...
You are an SQL statement expert. Given the table 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, player_id uuid, achievement_id uuid, unlocked_at ti...
[ { "role": "user", "content": "Can you list the invoice numbers, issue dates, and due dates for all invoices, sorted by issue date ascending?" }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, due_date FROM legal_services.invoices ORDER BY issue_date ASC;" }, { "rol...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id character varying(64) NOT NULL, -- unique identifier for the invoice invo...
[ { "role": "user", "content": "For each patient, find the next appointment after each one. Return patient_id, appointment_id, next_appointment_id, and the waiting time in minutes between them." }, { "role": "assistant", "content": "SELECT A.patient_id,\n A.appointment_id AS current_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.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,...
[ { "role": "user", "content": "Show me the list of hashtags that have been used, along with the time they were first used." }, { "role": "assistant", "content": "SELECT tag_name, created_at \nFROM social_media.hashtags;" } ]
You are an SQL statement expert. Given the table 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": "What are the specific tools or equipment used during the maintenance with record_id 'REC456'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about the specific tools or equipment used during a maintenance record. The data in the ma...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.m...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
3