Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
303
8.4k
[ { "content": "List the first name, last name, prescription ID, diagnosis code, and diagnosis description for patients who have both an ongoing prescription and an active chronic diagnosis.", "role": "user" }, { "content": "SELECT DISTINCT T1.first_name, T1.last_name, T2.prescription_id, T3.diagnosis...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "content": "Which players unlocked achievements in the shortest span of time? For each player with at least two achievements, show player_id and the time difference in minutes between the first and last achievement unlock.", "role": "user" }, { "content": "SELECT player_id, (EXTRACT(EPOCH FROM MAX...
You are an SQL statement expert. Given the table 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...
[ { "content": "List document names and versions for documents that share the same case_id, showing each pair of versions.", "role": "user" }, { "content": "SELECT d1.case_id, d1.document_name AS doc_name_v1, d1.version AS version1, d2.document_name AS doc_name_v2, d2.version AS version2 FROM legal_se...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "content": "Show the number of employees in each department.", "role": "user" }, { "content": "SELECT department, COUNT(*) AS employee_count\nFROM financial_services.employees\ngroup BY department;", "role": "assistant" }, { "content": "Exclude departments that have less than 3 employe...
You are an SQL statement expert. Given the table 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...
[ { "content": "List all unread notifications for group conversations, including the conversation name, sender_user_id, and notification creation time.", "role": "user" }, { "content": "SELECT c.group_name, n.sender_user_id, n.created_at\nFROM social_media.notifications n\nJOIN social_media.conversati...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text ) CREATE TABLE social_media.conversati...
[ { "content": "List each policy ID and its customer ID for which there are both premium payments recorded and beneficiaries listed. Include the total amount paid for that policy by that customer and the count of beneficiaries listed for that policy by that customer.", "role": "user" }, { "content": "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "content": "For each block number, show the highest transaction value and the status of the transaction with the highest value.", "role": "user" }, { "content": "SELECT t.block_number, t.value AS max_value, t.status\nFROM web3.transactions t\nJOIN (\n SELECT block_number, MAX(value) AS max_value\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.transactions ( transaction_id.text, from_address.text, to_address.text, value.numeric, gas_used.integer, gas_price...
[ { "content": "How many likes were given to comments in June 2024?", "role": "user" }, { "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';", "role": "assistant" } ]
You are an SQL statement expert. Given the table 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...
[ { "content": "Can you help me fetch the inventory details for components associated with a specific aircraft build, including the batch number, quantity, and warehouse location?", "role": "user" }, { "content": "MATCH (ab:AircraftBuild {build_id: 'specific_build_id'})-[:IS_MODEL]->(am:AircraftModel)...
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 Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str...
[ { "content": "Show me all patients who have both primary and non-primary insurance plans, along with their policy numbers and expiration dates.", "role": "user" }, { "content": "SELECT p1.patient_id, p1.policy_number AS primary_policy, p1.expiration_date AS primary_expiry, p2.policy_number AS non_pr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.text, policy_number.text, group_numb...
[ { "content": "List all pairs of vehicles in the same depot with different status. Include both vehicle IDs with their statuses and the depot_id.", "role": "user" }, { "content": "SELECT v1.vehicle_id AS vehicle1_id,\n v1.status AS status1,\n v2.vehicle_id AS vehicle2_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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "content": "Show the document ID, file name, and the first 100 characters of the description for claim documents that have a description.", "role": "user" }, { "content": "SELECT document_id, file_name, SUBSTRING(description FROM 1 FOR 100) FROM insurance.claim_documents WHERE description IS NOT 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.claim_documents ( document_id character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "content": "Show me the top 5 buyers by total trade volume (quantity * price) in the last 30 days, along with their trade count.", "role": "user" }, { "content": "SELECT buyer_id, COUNT(trade_id) AS trade_count, SUM(quantity * price) AS total_volume FROM trading_platform.trades WHERE traded_at >= ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "content": "What is the average ROI for smart money addresses on the Ethereum chain with a realized profit ratio above 50%?", "role": "user" }, { "content": "SELECT AVG(roi) AS average_roi FROM smart_money_profit WHERE chain = 'Ethereum' AND realized_ratio > 50;", "role": "assistant" } ]
You are an SQL statement expert. Given the table 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...
[ { "content": "What is the average processing time in days for each service category?", "role": "user" }, { "content": "SELECT category, AVG(average_processing_time_days) AS avg_processing_time\nFROM government_services.services\nGROUP BY category;", "role": "assistant" }, { "content": "O...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego...
[ { "content": "Find guests who have made at least one payment using a 'CreditCard'. List their full name (first and last name) and email address.", "role": "user" }, { "content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.email FROM hospitality_technology.guests AS T1 JOIN 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.guests ( guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil...
[ { "content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address.", "role": "user" }, { "content": "SELECT nh.wallet_address, nh.token_id, nh.contract_address FROM nft_holders nh WHERE nh.contract_type = 'ERC1155' AND CAST(nh.amou...
You are an SQL statement expert. Given the table 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...
[ { "content": "List the full names and email addresses of citizens who have submitted an application but have not uploaded any documents for that application. Display the citizen's full name, application_id, and submitted_at.", "role": "user" }, { "content": "SELECT c.first_name || ' ' || c.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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "content": "What is the history of incidents or accidents that occurred on platform 5 at station GHI?", "role": "user" }, { "content": "I'm sorry, but I can't provide information about the history of incidents or accidents on platform 5 at station GHI. My data is limited to the structural and oper...
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.p...
[ { "content": "Show me all insurance plans that have more than 5 patients enrolled, along with the provider name and count of patients, sorted by patient count in descending order.", "role": "user" }, { "content": "SELECT i.plan_name, i.insurance_provider, COUNT(p.patient_id) AS patient_count FROM he...
You are an SQL statement expert. Given the table 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, ...
[ { "content": "Can you provide the total number of cars associated with a specific train with train_id 'train_789'?", "role": "user" }, { "content": "SCARD train:train_789:cars", "role": "assistant" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Use Hashes for platform details. Key format: platform:<platform_id> // HSET platform:plat_123 ...
[ { "content": "List all wallets that were created during the hour of the day which saw the highest number of wallet creations. Show the wallet ID, user ID, address, and creation timestamp.", "role": "user" }, { "content": "WITH HourlyCounts AS (\n SELECT EXTRACT(HOUR FROM created_at) AS hour, 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 web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
[ { "content": "Show me the top 5 ERC20 tokens with the highest total supply on Ethereum, including their names, symbols, and contract addresses.", "role": "user" }, { "content": "SELECT name, symbol, contract_address FROM token_metas WHERE is_erc20 = 1 ORDER BY CAST(total_supply AS decimal) DESC LIMI...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "content": "Show the top 3 tokens on Polygon with the greatest positive price change over the last 6 hours, including their symbol, price, 6h change, and the number of smart money buy addresses in the last 24h.", "role": "user" }, { "content": "SELECT tdi.token_symbol, tdi.price, tdi.price_change_...
You are an SQL statement expert. Given the table 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, token_name character varying(100) NOT NULL, token_symbol ch...
[ { "content": "Show me all insurance plans that have more than 5 patients enrolled as their primary insurance, along with the provider name and count of patients, sorted by patient count in descending order.", "role": "user" }, { "content": "SELECT ip.insurance_provider, ip.plan_name, COUNT(pi.patien...
You are an SQL statement expert. Given the table 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...
[ { "content": "For each contract, can you list the token symbols and total supply of all tokens created by that contract, along with the contract's current status?", "role": "user" }, { "content": "SELECT c.contract_id, c.address AS contract_address, c.status, t.token_symbol, t.total_supply\nFROM web...
You are an SQL statement expert. Given the table 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,...
[ { "content": "Show me all patients who have been prescribed medications along with their doctor's name and the medication details, ordered by the prescription date.", "role": "user" }, { "content": "SELECT p.first_name, p.last_name, d.first_name AS doctor_first_name, d.last_name AS doctor_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 character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "content": "Provide a summary of the total number of loans and the average principal_amount for each loan_type.", "role": "user" }, { "content": "SELECT loan_type, COUNT(*) AS loan_count, AVG(principal_amount) AS avg_principal\nFROM financial_services.loans\nGROUP BY loan_type;", "role": "assi...
You are an SQL statement expert. Given the table 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...
[ { "content": "List all active staff members who are managers, along with their hire dates and email addresses.", "role": "user" }, { "content": "SELECT staff_id, first_name, last_name, position, work_email, hire_date FROM hospitality_technology.staff WHERE is_active = true AND position = 'Manager';"...
You are an SQL statement expert. Given the table 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...
[ { "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": "user" }, { "content": "SELECT w.address AS wallet_address, t.token_name, t.token_symbol, t.total_supply,...
You are an SQL statement expert. Given the table 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...
[ { "content": "What is the current number of passengers at station with ID 'ST123' right now?", "role": "user" }, { "content": "I'm sorry, but I can't provide information on the current number of passengers at a station. The data I have access to only includes static details about stations such as th...
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...
[ { "content": "For each doctor, show their full name along with all plan names of insurance plans that have a 'contact_phone' beginning with '+44'.", "role": "user" }, { "content": "SELECT d.first_name, d.last_name, ip.plan_name\nFROM healthcare.doctors d\nCROSS JOIN healthcare.insurance_plans ip\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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "content": "For each group conversation, show its name and the creation time of the earliest notification associated with it.", "role": "user" }, { "content": "SELECT c.group_name, MIN(n.created_at) AS earliest_notification_time FROM social_media.conversations AS c JOIN social_media.notifications ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp, last_message_at timestamp, is_grou...
[ { "content": "Find all blocks where the difficulty is between 1000 and 2000.", "role": "user" }, { "content": "SELECT * FROM blockchain.blocks WHERE difficulty BETWEEN 1000 AND 2000;", "role": "assistant" }, { "content": "Now filter these results to only show blocks mined after June 1, 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 blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "content": "For each player, list their username and the total number of unique servers they have played on, only including players who have played on two or more different servers. Also show the titles of all games they've played sessions on.", "role": "user" }, { "content": "SELECT p.username, 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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player ...
[ { "content": "能否帮我查询特定路线(route_id 为 'RT001')的所有行程信息,并关联到乘客的联系方式?", "role": "user" }, { "content": "SELECT s.schedule_id, s.train_id, s.route_id, s.departure_datetime, s.arrival_datetime, s.status, p.passenger_id, p.first_name, p.last_name, p.phone_number, p.email\nFROM schedules s\nLEFT JOIN passeng...
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 /schedules { "mappings": { "properties": { "schedule_id": { "type": "keyword" ...
[ { "content": "List all reservations made by guests from 'US', showing the reservation ID, guest first name, last name, and the property name.", "role": "user" }, { "content": "SELECT T1.reservation_id, T2.first_name, T2.last_name, T3.property_name FROM hospitality_technology.reservations AS T1 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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "content": "What is the average number of wallets each user owns?", "role": "user" }, { "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;", "role": "assistant" }, { "co...
You are an SQL statement expert. Given the table 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 )
[ { "content": "List all depot locations in the United States with their city and state information.", "role": "user" }, { "content": "SELECT name, city, state_province FROM transportation.locations WHERE type = 'depot' AND country = 'United States';", "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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "content": "Show me all claims with police reports that were filed in the last 3 months, along with the policy details and customer information.", "role": "user" }, { "content": "SELECT c.claim_id, c.policy_id, c.customer_id, c.incident_date, c.reported_date, c.description, c.estimated_loss, c.sta...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara...
[ { "content": "Show me the earliest created smart contract for each creator address.", "role": "user" }, { "content": "SELECT sc1.contract_id, sc1.creator_address, sc1.timestamp FROM blockchain.smart_contracts sc1 WHERE sc1.timestamp = (SELECT MIN(sc2.timestamp) FROM blockchain.smart_contracts sc2 WH...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "content": "Which document types have been uploaded by citizens, and how many times has each type been uploaded?", "role": "user" }, { "content": "SELECT document_type, COUNT(document_id) AS upload_count\nFROM government_services.documents\nGROUP BY document_type;", "role": "assistant" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "content": "Show me all active policies with coverage limits above $1,000,000, along with their customer IDs and agent IDs, sorted by coverage limit in descending order.", "role": "user" }, { "content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.coverage_limit FROM insurance.policies p WHER...
You are an SQL statement expert. Given the table 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, customer_id character varying(64) NOT NULL, product_id c...
[ { "content": "For each user, list their user_id, username, the count of log entries in the last 30 days, and the count of unread notifications.", "role": "user" }, { "content": "SELECT u.user_id,\n u.username,\n COUNT(l.log_id) FILTER (WHERE l.logged_at >= NOW() - INTERVAL '30 days') AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp ) CREATE TAB...
[ { "content": "Find all room types that have 'sofa' mentioned in their amenities.", "role": "user" }, { "content": "SELECT * FROM hospitality_technology.room_types WHERE amenities LIKE '%sofa%'", "role": "assistant" }, { "content": "Also include the max_occupancy and filter to only show 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.room_types ( room_type_id character varying(64) NOT NULL, -- unique identifier for the room ...
[ { "content": "List all tokens with a price below $1 and a 24-hour trading volume over $5 million.", "role": "user" }, { "content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE price < 1 AND total_volume::numeric > 5000000;", "role": "assistant" } ]
You are an SQL statement expert. Given the table 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, token_name character varying(100) NOT NULL, token_symbol ch...
[ { "content": "Find all pairs of transactions where the sender address and the receiver address are the same, but the transactions occurred on different days. Show transaction IDs, addresses, and their timestamps.", "role": "user" }, { "content": "SELECT t1.transaction_id AS tx1_id, t2.transaction_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 blockchain.transactions ( transaction_id character varying(64) NOT NULL, -- unique identifier for the transaction ...
[ { "content": "List the full names and dates of birth for all patients who do not have a phone number on record.", "role": "user" }, { "content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE phone_number IS NULL OR TRIM(phone_number) = '';", "role": "assistant" } ...
You are an SQL statement expert. Given the table 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 ...
[ { "content": "List all policies that expired in the last 30 days, along with their product IDs and premium amounts.", "role": "user" }, { "content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE end_date BETWEEN DATE_SUB(CURRENT_DATE, INTERVAL 30 DAY) AND CURRENT_DATE 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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d...
[ { "content": "Provide a count of locations for each country listed in the table.", "role": "user" }, { "content": "SELECT country, COUNT(*) FROM transportation.locations GROUP BY country", "role": "assistant" } ]
You are an SQL statement expert. Given the table 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, ...
[ { "content": "For all NFT collections on the Ethereum blockchain, show me the collection name and the current floor price. Sort by floor price descending.", "role": "user" }, { "content": "SELECT name, floor_price FROM nft_collections WHERE blockchain = 'Ethereum' ORDER BY CAST(floor_price AS FLOAT)...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "content": "List the trip ID, route number, vehicle ID, and the total fuel cost associated with each trip.", "role": "user" }, { "content": "SELECT t.trip_id, r.route_number, t.vehicle_id, SUM(fl.total_cost) AS total_fuel_cost FROM transportation.trips t JOIN transportation.routes r ON t.route_id ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description text, origin_location_id text, destin...
[ { "content": "Show me all premium payments made in the last quarter, along with the corresponding policy and customer information.", "role": "user" }, { "content": "SELECT pp.payment_id, pp.policy_id, pp.customer_id, pp.payment_date, pp.amount_paid, pp.payment_method FROM insurance.premium_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 insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "content": "For each Sui coin type with status 'exists' in both sui_coins and sui_coins_metadata, calculate the average balance per owner. Include coin_type, symbol, name, description, and avg_balance. Sort by avg_balance descending.", "role": "user" }, { "content": "SELECT\n sc.coin_type,\n met...
You are an SQL statement expert. Given the table 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...
[ { "content": "I want to list all pairs of customers living in the same city with different risk profiles.", "role": "user" }, { "content": "SELECT a.customer_id AS customer_a,\n b.customer_id AS customer_b,\n a.city,\n a.risk_profile AS risk_a,\n b.risk_profile AS risk_b\nFRO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "content": "Show me all vehicles that are due for their next service before the end of this month, along with their last service date and type.", "role": "user" }, { "content": "SELECT v.vehicle_id, v.make, v.model, s.service_date, s.service_type FROM transportation.vehicles v JOIN 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.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "content": "Show the total number of customers in each state.", "role": "user" }, { "content": "SELECT\n state,\n COUNT(customer_id)\nFROM insurance.customers\nGROUP BY\n state;", "role": "assistant" } ]
You are an SQL statement expert. Given the table 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...
[ { "content": "Which pairs of tokens on the same chain have the greatest difference in 24h trading volume? List the two token symbols, their volumes, the absolute difference, and the chain. Limit to the top 3 pairs.", "role": "user" }, { "content": "SELECT a.chain,\n a.token_symbol AS token_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 token_dexpool_info (", "pair_address character varying(512) NOT NULL, -- the id of dexpool", "token_name cha...
[ { "content": "Provide the total number of vehicles for each fuel_type.", "role": "user" }, { "content": "SELECT fuel_type, COUNT(*) AS vehicle_count\nFROM transportation.vehicles\nGROUP BY fuel_type;", "role": "assistant" }, { "content": "Only include fuel types with more than 5 vehicles...
You are an SQL statement expert. Given the table 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...
[ { "content": "I want to find each user’s total count of completed orders and the last action they logged.", "role": "user" }, { "content": "SELECT\n o.user_id,\n COUNT(*) AS completed_order_count,\n MAX(l.logged_at) AS last_log_time,\n (SELECT action\n FROM trading_platform.logs l2\n WHERE 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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan...
[ { "content": "Which locations have received fuel logs greater than 300 liters in total? Please include the location name and city.", "role": "user" }, { "content": "SELECT l.name AS location_name, l.city, SUM(f.quantity) AS total_quantity\nFROM transportation.fuel_logs f\nJOIN transportation.locatio...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "content": "List all properties located in the USA with a star rating of 4.0 or higher, along with their city and property type.", "role": "user" }, { "content": "SELECT property_name, city, property_type, star_rating FROM hospitality_technology.properties WHERE country_code = 'USA' AND star_ratin...
You are an SQL statement expert. Given the table 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...
[ { "content": "List the names of services for which documents are set to expire in the next 90 days.", "role": "user" }, { "content": "SELECT DISTINCT T1.service_name FROM government_services.services AS T1 JOIN applications AS T2 ON T1.service_id = T2.service_id JOIN government_services.documents 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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego...
[ { "content": "Show me all SUI coins with a balance greater than 1000, including their symbol and name.", "role": "user" }, { "content": "SELECT sc.object_id, sc.coin_type, sc.balance, scm.symbol, scm.name FROM sui_coins sc JOIN sui_coins_metadata scm ON sc.coin_type = scm.coin_type WHERE CAST(sc.bal...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc20_balances ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar ) CR...
[ { "content": "List all booking IDs and their status for bookings that have a special request recorded.", "role": "user" }, { "content": "SELECT booking_id, status\nFROM transportation.bookings\nWHERE special_requests IS NOT NULL;", "role": "assistant" }, { "content": "Also show passenger...
You are an SQL statement expert. Given the table 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.bookings ( booking_id character varying(64) NOT NULL, passenger_id character varying(64) NOT NULL, trip_...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
4