Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
288
8.08k
[ { "content": "Show me all smart contracts created by addresses that have created more than 5 contracts, along with the count of contracts each creator has made.", "role": "user" }, { "content": "SELECT sc.contract_id, sc.creator_address, COUNT(*) OVER (PARTITION BY sc.creator_address) AS contract_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 blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "content": "Can you show me the number of lawyers grouped by specialization?", "role": "user" }, { "content": "SELECT specialization, COUNT(*) AS lawyer_count FROM lawyers GROUP BY specialization;", "role": "assistant" }, { "content": "Include only specializations that have more than 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "content": "I need to find every offline server alongside an online server in the same region.", "role": "user" }, { "content": "SELECT s_off.server_id AS offline_id,\n s_on.server_id AS online_id\nFROM gaming_technology.servers s_off\nJOIN gaming_technology.servers s_on\n ON s_off.region =...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p...
[ { "content": "I want to list all insurance plans along with the number of medical records that have a record_date in 2024. Display plan_id, plan_name, and the total medical records.", "role": "user" }, { "content": "SELECT ip.plan_id, ip.plan_name, COUNT(mr.record_id) AS total_medical_records\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 healthcare.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "content": "What is the schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?", "role": "user" }, { "content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not included in the platform management table. For ...
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 trips that were delayed by more than 30 minutes, along with their vehicle and driver details, and include the origin and destination city names.", "role": "user" }, { "content": "SELECT t.trip_id, t.vehicle_id, t.driver_id, t.scheduled_departure, t.actual_departure, EXTRACT...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, route_id character varying(64), vehicle_id character var...
[ { "content": "List all unique document types along with the count of documents for each type.", "role": "user" }, { "content": "SELECT document_type, COUNT(*) AS document_count FROM legal_services.documents GROUP BY document_type;", "role": "assistant" }, { "content": "Can you exclude do...
You are an SQL statement expert. Given the table 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...
[ { "content": "List all staff members, the property name they work for, and the number of services offered at their property.", "role": "user" }, { "content": "SELECT s.staff_id, s.first_name, s.last_name, p.property_name, COUNT(sv.service_id) AS service_count\nFROM hospitality_technology.staff s\nJO...
You are an SQL statement expert. Given the table 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": "Which chain has the highest total trading volume in the last 24 hours, and what is the top token by volume on that chain?", "role": "user" }, { "content": "WITH chain_volume AS (SELECT chain, SUM(volume_24h) AS total_volume_24h FROM token_dexpool_info GROUP BY chain), top_chain AS (SEL...
You are an SQL statement expert. Given the table 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...
[ { "content": "Show me all NFT holders who own more than 10 of the same token, including the contract address, token ID, and wallet address.", "role": "user" }, { "content": "SELECT nh.contract_address, nh.token_id, nh.wallet_address, CAST(nh.amount AS decimal) AS token_count FROM nft_holder_historic...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE nft_holder_historical ( block_number.bigint, contract_address.text, wallet_address.text, token_id.text, contract_type.t...
[ { "content": "List all services in the 'Concierge' department along with their names, price, and whether they are currently available. Include the property name as well.", "role": "user" }, { "content": "SELECT s.service_name, s.price, s.is_available, p.property_name\nFROM hospitality_technology.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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "content": "List all user IDs and the number of posts each has made where the post includes a media file (media_url is not null), along with whether their profile is private.", "role": "user" }, { "content": "SELECT p.user_id, COUNT(*) AS media_post_count, us.private_profile\nFROM social_media.pos...
You are an SQL statement expert. Given the table 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 ...
[ { "content": "How many documents are there for each document_type? Show document_type and count ordered by the count in descending order.", "role": "user" }, { "content": "SELECT document_type,\n COUNT(*) AS count\nFROM legal_services.documents\nGROUP BY document_type\nORDER BY count DESC;", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "content": "List the first name, last name, and firm name for all lawyers who are partners.", "role": "user" }, { "content": "SELECT T1.first_name , T1.last_name , T2.firm_name FROM legal_services.lawyers AS T1 JOIN law_firms AS T2 ON T1.firm_id = T2.firm_id WHERE T1.is_partner = TRUE", ...
You are an SQL statement expert. Given the table 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...
[ { "content": "Retrieve the vehicle_id, make, model, and the next_service_due_date for each vehicle based on the most recent maintenance log.", "role": "user" }, { "content": "SELECT DISTINCT ON (ml.vehicle_id) v.vehicle_id, v.make, v.model, ml.next_service_due_date FROM transportation.maintenance_lo...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "content": "List all cryptocurrency assets that have been traded at least 50 times, along with their average trade price.", "role": "user" }, { "content": "SELECT a.asset_id, a.name, a.symbol, COUNT(t.trade_id) AS trade_count, AVG(t.price) AS avg_price FROM trading_platform.assets a JOIN trading_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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "content": "What is the current market cap and 7-day price change percentage for the top 3 narratives by trend rank?", "role": "user" }, { "content": "SELECT narrative, market_cap, price_change_percentage_7d FROM narrative_info ORDER BY trend_rank ASC LIMIT 3;", "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, -- the id of the token", "token_name character...
[ { "content": "Show the top 5 properties by average overall review rating.", "role": "user" }, { "content": "SELECT p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.reviews r\n ON p.property_id = r.property_id\nGROUP BY p.pro...
You are an SQL statement expert. Given the table 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": "特定のプラットフォームID 'plat_123' に関連するメンテナンス記録を取得するのを手伝っていただけますか?また、記録のステータスも含めてください。", "role": "user" }, { "content": "SMEMBERS platform:plat_123:maintenance\nHGETALL maintenance_record:<record_id>", "role": "assistant" }, { "content": "ステータスが 'Completed' の記録だけを表示するようにフィルタリングしていただ...
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 ticket details. Key format: ticket:<ticket_id> // HSET ticket:tkt_1a2b ticket_i...
[ { "content": "List all DApps along with the number of metadata entries linked to each, even if the DApp has no linked metadata.", "role": "user" }, { "content": "SELECT d.name, d.url, COUNT(m.metadata_id) AS metadata_count\nFROM trading_platform.dapps d\nLEFT JOIN trading_platform.metadata m ON d.da...
You are an SQL statement expert. Given the table 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": "Show the full names and contact emails of all citizens who have applied for services with a standard fee greater than 100.", "role": "user" }, { "content": "SELECT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM government_services.citizens c\nJOIN 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.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "content": "I need to get the total quantity of components in inventory for a specific warehouse location. Can you help with that?", "role": "user" }, { "content": "SELECT location_warehouse, SUM(quantity) AS total_quantity\nFROM component_inventory\nWHERE location_warehouse = 'specific_warehouse'...
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 Index 'aircraft_models'. Mapping: { properties: { model_id: { type: 'keyword' }, model_name: { ty...
[ { "content": "For each game, count how many achievements it has and calculate the average points.", "role": "user" }, { "content": "SELECT game_id,\n COUNT(*) AS total_achievements,\n AVG(points) AS avg_points\nFROM achievements\nGROUP BY game_id;", "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 gaming_technology.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name text, description text, icon_url t...
[ { "content": "Show me all active customers from California who were born before 1980, along with their contact information.", "role": "user" }, { "content": "SELECT first_name, last_name, phone_number, email, address_line1, city, zip_code FROM insurance.customers WHERE state = 'California' AND 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.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "content": "List all lawyers who have never had a time entry that was billed, showing lawyer_id, first_name, and last_name.", "role": "user" }, { "content": "SELECT l.lawyer_id, l.first_name, l.last_name \nFROM legal_services.lawyers l \nLEFT JOIN legal_services.time_entries te \n ON l.lawyer_...
You are an SQL statement expert. Given the table 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...
[ { "content": "I need to know the total USD value of all ERC-20 holdings by each wallet. Calculate the sum of (amount * price) using the latest token prices from token_prices_latest, grouped by wallet_address.", "role": "user" }, { "content": "SELECT eb.wallet_address,\n SUM(CAST(eb.amount AS 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 erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, amount.text, pk.text ) CREATE TABLE n...
[ { "content": "Find all contracts where the deployer address is the same as the contract address, indicating self-deployed contracts, and show their network IDs and deployment timestamps.", "role": "user" }, { "content": "SELECT address, network_id, deployed_at FROM web3.contracts WHERE address = 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, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "content": "List the diagnosis_id, patient_id, and doctor_id for all diagnoses with status 'Pending' and is_chronic set to TRUE.", "role": "user" }, { "content": "SELECT diagnosis_id, patient_id, doctor_id FROM healthcare.diagnoses WHERE status = 'Pending' AND is_chronic = TRUE;", "role": "ass...
You are an SQL statement expert. Given the table 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, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty...
[ { "content": "For each player, show the player_id and the count of inventory items they acquired with a quantity greater than 1.", "role": "user" }, { "content": "SELECT player_id, COUNT(inventory_id) AS items_qty_gt_1_count FROM gaming_technology.player_inventory WHERE quantity > 1 GROUP BY player_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "content": "List all distinct pairs of hashtag_id that are applied to the same post_id.", "role": "user" }, { "content": "SELECT ph1.post_id, ph1.hashtag_id AS hashtag1_id, ph2.hashtag_id AS hashtag2_id\nFROM social_media.post_hashtags ph1\nJOIN social_media.post_hashtags ph2\n ON ph1.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.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id character varying(64) NOT NULL, ha...
[ { "content": "List all insurance policies along with the product name and product type for each policy.", "role": "user" }, { "content": "SELECT p.policy_id, p.policy_number, p.start_date, p.end_date, p.premium_amount, ip.product_name, ip.product_type\nFROM insurance.policies p\nINNER JOIN insurance...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "content": "Show all active customers who live in the same zip_code.", "role": "user" }, { "content": "SELECT a.customer_id AS cust1,\n b.customer_id AS cust2,\n a.zip_code\nFROM financial_services.customers a\nJOIN financial_services.customers b\n ON a.zip_code = b.zip_code\n AND a.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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "content": "Show me projects that raised funds in 2022 and have a corresponding token held by CEXes on the 'Ethereum' chain. Display the project name, fundraising round name, investment value, the associated token symbol, and the total USD value of that token held by CEXes on Ethereum.", "role": "user" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "content": "List all NFT collections where the floor price is greater than 0.5 ETH, including their names and contract addresses.", "role": "user" }, { "content": "SELECT name, contract_address FROM nft_collections WHERE CAST(floor_price AS decimal) > 0.5 AND floor_price_symbol = 'ETH';", "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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "content": "Show me all insurance plans where the website includes 'secure'.", "role": "user" }, { "content": "SELECT * FROM healthcare.insurance_plans WHERE website ILIKE '%secure%';", "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.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "content": "For each vehicle, show vehicle_id, make, model, the earliest and latest fuel log IDs with their timestamps.", "role": "user" }, { "content": "WITH extremes AS (\n SELECT vehicle_id,\n MIN(log_timestamp) AS first_ts,\n MAX(log_timestamp) AS last_ts\n FROM transportatio...
You are an SQL statement expert. Given the table 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": "What are the maintenance costs for a specific aircraft model like the Airbus A320?", "role": "user" }, { "content": "I'm sorry, but I don't have access to data regarding maintenance costs for specific aircraft models such as the Airbus A320. The information in the database is limited t...
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.aircraft_mod...
[ { "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": "Show me the total number of reservations for each property along with the property's name.", "role": "user" }, { "content": "SELECT p.property_id, p.property_name, COUNT(r.reservation_id) AS reservation_count\nFROM hospitality_technology.properties p\nLEFT JOIN hospitality_technology.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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "content": "List the document ID, file name, and size for all documents uploaded in the last 30 days by user 'agent_smith' that are larger than 5 megabytes, ordered by upload time descending.", "role": "user" }, { "content": "SELECT document_id, file_name, file_size_bytes FROM insurance.claim_docu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_type text, file_name text, file_path ...
[ { "content": "Show a list of all asset names along with the current KYC status of each user, including the asset symbol. Join the assets and kyc_audit tables.", "role": "user" }, { "content": "SELECT a.name AS asset_name, a.symbol, k.user_id, k.status AS kyc_status \nFROM trading_platform.assets a\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 trading_platform.assets ( asset_id character varying(64) NOT NULL, name character varying(128) NOT NULL, symbol charact...
[ { "content": "Show me the top 3 tokens by USD value inflow where smart money was buying (type = 1), along with their token symbol and narrative.", "role": "user" }, { "content": "SELECT token_symbol, narrative, usd_value FROM smart_money_token_inflow WHERE type = 1 ORDER BY usd_value DESC LIMIT 3;",...
You are an SQL statement expert. Given the table 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": "Find pairs of cases that belong to the same client, listing the case number, case name, and the shared client ID for each pair.", "role": "user" }, { "content": "SELECT c1.case_number AS case_number_1, c1.case_name AS case_name_1, c2.case_number AS case_number_2, c2.case_name AS case_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 legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t...
[ { "content": "Show me the total fuel quantity and cost for each route, grouped by route number, only for trips that have associated fuel logs.", "role": "user" }, { "content": "SELECT r.route_number, SUM(f.quantity) AS total_quantity, SUM(f.total_cost) AS total_cost\nFROM transportation.fuel_logs 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 transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "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 all users who have liked comments made by users with a specified location, say 'Paris'. For each, show their username, the comment_id, and the location of the comment's author.", "role": "user" }, { "content": "SELECT l.user_id AS liker_user_id, u_liker.username, l.comment_id, u_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 social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "content": "List the first name, last name, license number, and status for all drivers whose license expires in the next 6 months.", "role": "user" }, { "content": "SELECT\n first_name,\n last_name,\n license_number,\n status\nFROM transportation.drivers\nWHERE\n license_expiry_date BETWEEN 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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ...
[ { "content": "Find the full names and emails of citizens who have received notifications with the status 'Sent' related to a document. Also show the document_id for each notification.", "role": "user" }, { "content": "SELECT c.first_name || ' ' || c.last_name AS full_name, c.contact_email, n.related...
You are an SQL statement expert. Given the table 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...
[ { "content": "Calculate for each player the timespan between their earliest and latest achievement unlocks.", "role": "user" }, { "content": "SELECT pa_min.player_id,\n pa_max.max_time - pa_min.min_time AS span\nFROM (\n SELECT player_id,\n MIN(unlocked_at) AS min_time\n FROM gaming_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique id...
[ { "content": "How many claims were reported in the last 90 days?", "role": "user" }, { "content": "SELECT COUNT(*) FROM claims WHERE reported_date >= CURRENT_DATE - INTERVAL '90 days'", "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.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "content": "List all reservations that have a total_amount greater than the amount_paid. Include the reservation_id, guest_id, total_amount, and amount_paid.", "role": "user" }, { "content": "SELECT reservation_id, guest_id, total_amount, amount_paid\nFROM hospitality_technology.reservations\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 hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r...
[ { "content": "Get the total payment amount grouped by currency.", "role": "user" }, { "content": "SELECT currency_code, SUM(amount) AS total_amount\nFROM hospitality_technology.payments\nGROUP BY currency_code;", "role": "assistant" }, { "content": "Now show only those currencies where 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.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "content": "List all pairs of clients who registered in the same month and year. Show both clients’ first and last names, plus the month and year they share.", "role": "user" }, { "content": "SELECT c1.first_name AS first_name_1,\n c1.last_name AS last_name_1,\n c2.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 character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "content": "For each customer with at least one open claim, list the customer_id, first_name, last_name, policy_number, claim_id, and incident_date.", "role": "user" }, { "content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_number, cl.claim_id, cl.incident_date\nFROM insurance.cus...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "content": "What is the current location of train number Acela 2151?", "role": "user" }, { "content": "I'm sorry, but I don't have access to real-time location data for trains. The database only contains static information such as train ID, model, capacity, and maintenance schedules. For current l...
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...
[ { "content": "Show me the top 5 NFT collections with the highest average rarity score, along with their contract addresses and names.", "role": "user" }, { "content": "SELECT contract_address, name, AVG(rarity_score) as avg_rarity_score FROM nft_metadata GROUP BY contract_address, name ORDER BY avg_...
You are an SQL statement expert. Given the table 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...
[ { "content": "Show me all ERC20 token transfers where the amount is over 5000, including the sender and receiver addresses.", "role": "user" }, { "content": "SELECT from_address, to_address, amt, tick, tx_hash FROM token_activities WHERE type = 'transfer' AND CAST(amt AS DECIMAL) > 5000;", "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 erc20_balances ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar ) CR...
[ { "content": "List all beneficiaries associated with policy ID 'POL12345', including their full name and relationship.", "role": "user" }, { "content": "SELECT beneficiary_id, first_name, last_name, relationship FROM insurance.policy_beneficiaries WHERE policy_id = 'POL12345';", "role": "assista...
You are an SQL statement expert. Given the table 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.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la...
[ { "content": "Provide a count of players for each registered country.", "role": "user" }, { "content": "SELECT country_code, COUNT(*) FROM gaming_technology.players GROUP BY country_code;", "role": "assistant" }, { "content": "Filter the results to only show countries that have more than...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "content": "Show me assets along with their associated 'symbol' metadata value. Assume an assets table with asset_id exists.", "role": "user" }, { "content": "SELECT a.asset_id, m.value FROM assets a JOIN metadata m ON a.asset_id = m.asset_id WHERE m.key = 'symbol'", "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 CREATE TABLE trading_platform.utxos ( utxo_id text PRIMARY KEY, transaction_id text, output_index...
[ { "content": "How many appointments are scheduled to start tomorrow?", "role": "user" }, { "content": "SELECT count(*) FROM government_services.appointments WHERE DATE(scheduled_start_time) = CURRENT_DATE + INTERVAL '1 day'", "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.appointments ( appointment_id text PRIMARY KEY, citizen_id text, employee_id text, location_id text...
[ { "content": "List for each fuel type the number of unique vehicle models available. Show the fuel_type and the model count.", "role": "user" }, { "content": "SELECT fuel_type, COUNT(DISTINCT model) AS model_count FROM transportation.vehicles GROUP BY fuel_type ORDER BY fuel_type;", "role": "ass...
You are an SQL statement expert. Given the table 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 me all insurance products along with the number of distinct agents whose handled claims are for policies using that product. Include product_id, product_name, and agent_count.", "role": "user" }, { "content": "SELECT ip.product_id, ip.product_name, COUNT(DISTINCT c.claim_handler_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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
6