Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Find all wallets that were created on the same day and list their wallet IDs, addresses, and the creation date." }, { "role": "assistant", "content": "SELECT w1.wallet_id, w1.address, w1.created_at::date AS creation_date FROM web3.wallets w1 JOIN (SELECT created_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 web3.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_id character...
[ { "role": "user", "content": "What is the history of incidents or accidents that occurred on platform 5 at station GHI?" }, { "role": "assistant", "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 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 train_station_management.p...
[ { "role": "user", "content": "Which chain has the highest total USD inflow from buy transactions (type=1), and how many distinct tokens were involved in that inflow?" }, { "role": "assistant", "content": "SELECT chain, SUM(usd_value) AS total_inflow, COUNT(DISTINCT token_symbol) AS distinct_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 smart_money_token_inflow ( token_address text, token_symbol text, token_amount numeric, usd_value numeric, avg_price nu...
[ { "role": "user", "content": "For each user, find the previous user by registration time. List current user_id and username, previous user_id and username, and the time difference in minutes between their registrations." }, { "role": "assistant", "content": "SELECT u.user_id AS current_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 web3.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email character varying(...
[ { "role": "user", "content": "Can you narrow this down to only show cases where the case type is 'Criminal'?" }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Crimin...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "Can you provide the total number of fuel refueling events and the sum of total_cost at each fueling location, including the location name and city?" }, { "role": "assistant", "content": "SELECT l.location_id, l.name, l.city, COUNT(fl.fuel_log_id) AS num_refuels, SUM...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "Find the names of service locations where services categorized as 'Licensing' have had appointments scheduled." }, { "role": "assistant", "content": "SELECT DISTINCT T1.location_name FROM service_locations AS T1 JOIN appointments AS T2 ON T1.location_id = T2.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 government_services.services ( service_id character varying(64) NOT NULL, -- unique identifier for the service ...
[ { "role": "user", "content": "Find all pairs of different insurance records that share the same group_number, and show group_number, the patient_insurance_id of both records, and their corresponding patient_ids." }, { "role": "assistant", "content": "SELECT a.group_number,\n a.patient_insu...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "What is the average ROI and average realized_ratio for each chain?" }, { "role": "assistant", "content": "SELECT chain,\n AVG(roi) AS avg_roi,\n AVG(realized_ratio) AS avg_realized_ratio\nFROM smart_money_token_performance\nGROUP BY chain;" }, { ...
You are an SQL statement expert. Given the table 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_token_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,...
[ { "role": "user", "content": "List all patients who have insurance plans with group numbers, showing their patient IDs and the count of such plans per patient." }, { "role": "assistant", "content": "SELECT patient_id, COUNT(*) AS plan_count FROM healthcare.patient_insurance WHERE group_number IS...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for this p...
[ { "role": "user", "content": "List the full name (first name and last name) of all citizens who have uploaded documents whose expiry date is in the past." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 INNER JOIN governme...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show the full names and contact emails of all citizens who have applied for services with a standard fee greater than 100." }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM government_services.citize...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "List all payments for reservations made at properties with a star rating of 5.0. Include the payment amount, guest ID, reservation ID, and property name." }, { "role": "assistant", "content": "SELECT T1.amount, T1.guest_id, T1.reservation_id, T3.property_name FROM h...
You are an SQL statement expert. Given the table 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": "For each service location, find its nearest accessible location by geographic distance." }, { "role": "assistant", "content": "SELECT sl.location_id,\n sl.location_name,\n nearest.location_id AS nearest_location_id,\n nearest.location_name AS nea...
You are an SQL statement expert. Given the table 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.service_locations ( location_id.text, agency_id.text, location_name.text, address.text, city.text, ...
[ { "role": "user", "content": "Which routes have their origin and destination in the same city? Show the route number, description, and the origin and destination location IDs." }, { "role": "assistant", "content": "SELECT r.route_number, r.description, r.origin_location_id, r.destination_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...
[ { "role": "user", "content": "Show me the average market cap and average 24-hour price change percentage for tokens on each chain." }, { "role": "assistant", "content": "SELECT chain, AVG(market_cap) AS average_market_cap, AVG(price_change_percentage_24h) AS average_price_change_24h FROM token_b...
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 token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var...
[ { "role": "user", "content": "Show me the wallet addresses holding the ERC20 token with contract address '0xabcdeffedcba9876543210abcdefedcba9876'. Include the amount they hold." }, { "role": "assistant", "content": "SELECT wallet_address, amount FROM erc20_balances WHERE contract_address = '0xa...
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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,...
[ { "role": "user", "content": "Show each asset's symbol and the number of unique addresses that have UTXOs associated with it." }, { "role": "assistant", "content": "SELECT a.symbol, COUNT(DISTINCT u.address) AS unique_addresses\nFROM trading_platform.assets a\nJOIN trading_platform.utxos u ON 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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "Show me all contracts deployed on the 'ethereum' network along with their deployer addresses and deployment timestamps, sorted by the most recent deployments first." }, { "role": "assistant", "content": "SELECT address, deployer_address, deployed_at FROM web3.contra...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "For each vehicle, show the first and last fueling events including their timestamps and the quantities refueled." }, { "role": "assistant", "content": "WITH first_last AS (\n SELECT\n vehicle_id,\n MIN(log_timestamp) AS first_time,\n MAX(log_timestamp) 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.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry...
[ { "role": "user", "content": "Find all patients who have been prescribed medications with dosage greater than 50mg, along with their medication details and prescribing doctor's name." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pr.dosage, pr.medication_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "What is the schedule of trains arriving at station with ID 'ST789' tomorrow?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the train schedule for station ID 'ST789' as this information is not available in the current database. The table only ...
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": "Calculate the average payment amount for all completed payments associated with services categorized as 'Healthcare'." }, { "role": "assistant", "content": "SELECT AVG(T1.amount) FROM government_services.payments AS T1 INNER JOIN government_services.applications 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.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Find all chronic diagnoses made by Cardiology doctors in the last year, including patient ID, diagnosis description, and doctor's full name." }, { "role": "assistant", "content": "SELECT di.patient_id, di.description, d.first_name || ' ' || d.last_name AS doctor_nam...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "Show me all prescriptions made by doctors who have issued diagnoses described as 'Hypertension'. Include the doctor's ID, prescription ID, medication ID, and prescription date." }, { "role": "assistant", "content": "SELECT p.doctor_id, p.prescription_id, p.medicatio...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "Show me claims reported in 2024, including the claim ID, incident date, estimated loss, and the full name of the agent who handled it." }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.incident_date, T1.estimated_loss, T2.first_name, T2.last_name FROM 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 insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "List patient_id, first_name, last_name, and date_of_birth for all patients older than 65 years." }, { "role": "assistant", "content": "SELECT patient_id, first_name, last_name, date_of_birth\nFROM healthcare.patients\nWHERE date_of_birth < CURRENT_DATE - INTERVAL '6...
You are an SQL statement expert. Given the table 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": "What is the current market price of a Boeing 737 MAX aircraft?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and general information ab...
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...
[ { "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": "I need to find all bookings for a specific schedule with schedule_id 'sched_1122' and include the passenger and ticket details." }, { "role": "assistant", "content": "SMEMBERS schedule:sched_1122:bookings\nHGETALL booking:book_*\nHGETALL passenger:pass_*\nSMEMBERS b...
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 ...
[ { "role": "user", "content": "List all unique actions that have been logged in the system." }, { "role": "assistant", "content": "SELECT DISTINCT action FROM trading_platform.logs;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp ) CREATE TAB...
[ { "role": "user", "content": "List all tokens with a price below $1 and a 24-hour trading volume over $5 million." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE price < 1 AND total_volume::numeric > 5000000;" } ]
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "Provide a count of citizens registered per calendar year." }, { "role": "assistant", "content": "SELECT CAST(EXTRACT(YEAR FROM registration_date) AS INTEGER) AS registration_year, COUNT(*) AS citizen_count FROM government_services.citizens GROUP BY 1 ORDER BY 1;" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "List every diagnosis description paired with every insurance plan's website." }, { "role": "assistant", "content": "SELECT T1.description, T2.website FROM healthcare.diagnoses AS T1 CROSS JOIN healthcare.insurance_plans AS T2;" }, { "role": "user", "cont...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, record_id character varying(64) NOT NULL, patient_i...
[ { "role": "user", "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": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name, T2.pres...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "List each insurance product's name and type, along with the number of active policies and the total premium_amount collected for those policies. Only include products that have at least one active policy." }, { "role": "assistant", "content": "SELECT p.product_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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "How many diagnoses does each status have grouped by is_chronic flag?" }, { "role": "assistant", "content": "SELECT is_chronic, status, COUNT(*) AS count FROM healthcare.diagnoses GROUP BY is_chronic, 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 healthcare.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id text, diagnosis_code text, code_ty...
[ { "role": "user", "content": "Provide a count of appointments grouped by the booking method." }, { "role": "assistant", "content": "SELECT booking_method, COUNT(*) AS appointment_count FROM government_services.appointments GROUP BY booking_method;" } ]
You are an SQL statement expert. Given the table 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, -- unique identifier for the document i...
[ { "role": "user", "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": "assistant", "content": "SELECT eb.wallet_address,\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...
[ { "role": "user", "content": "I want to see, for each guest, the total number of payments they have made and the timestamp of their latest payment." }, { "role": "assistant", "content": "SELECT p.guest_id,\n COUNT(p.payment_id) AS payment_count,\n t.last_ts\nFROM hospitality_technolo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.payments ( payment_id character varying(64) NOT NULL, reservation_id character varying(64), gues...
[ { "role": "user", "content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address." }, { "role": "assistant", "content": "SELECT wallet_address, token_id, contract_address FROM nft_holders WHERE contract_type = 'ERC1155' AND CA...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded ...
[ { "role": "user", "content": "特定のプラットフォームID 'plat_123' に関連するメンテナンス記録を取得するのを手伝っていただけますか?また、記録のステータスも含めてください。" }, { "role": "assistant", "content": "SMEMBERS platform:plat_123:maintenance\nHGETALL maintenance_record:<record_id>" }, { "role": "user", "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...
[ { "role": "user", "content": "Show the first name, last name, relationship, and percentage share for all policy beneficiaries added after January 1st, 2024." }, { "role": "assistant", "content": "SELECT first_name, last_name, relationship, percentage_share FROM insurance.policy_beneficiaries 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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "Find the total amount paid for all premium payments made in the last 30 days." }, { "role": "assistant", "content": "SELECT SUM(amount_paid) FROM insurance.premium_payments WHERE payment_date >= CURRENT_DATE - INTERVAL '30 day';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "List all vehicles and their last maintenance service date along with the odometer reading, including only those that have not had a fuel refill in the past 30 days." }, { "role": "assistant", "content": "SELECT m.vehicle_id,\n m.last_service_date,\n m.la...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, route_number character varying(32) NOT NULL UNIQUE, de...
[ { "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": "For each vehicle, list its vehicle_id, license_plate, and any older vehicle of the same type (showing older_vehicle_id and older year)." }, { "role": "assistant", "content": "SELECT cur.vehicle_id,\n cur.license_plate,\n old.vehicle_id AS older_vehicle_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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "What is the performance review score for employee with ID 'EMP456' for the last quarter?" }, { "role": "assistant", "content": "I'm sorry, but I can't assist with information about performance review scores as this data is not included in the employees table." } ]
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE manufacturing.employees ( ...
[ { "role": "user", "content": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan." }, { "role": "assistant", "content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) AS enrolled_patie...
You are an SQL statement expert. Given the table 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 room types with a base rate over $200 and max occupancy of at least 4, along with their property IDs and amenities." }, { "role": "assistant", "content": "SELECT room_type_id, property_id, type_name, base_rate, max_occupancy, amenities FROM hospitality_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text, type_name text, description text, ...
[ { "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": "What are the qualifications or training history of the staff member who performed the maintenance with record_id 'REC123'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about the qualifications or training history of staff members...
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": "What are the training programs or certifications completed by a staff member with the role of Platform Supervisor?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the training programs or certifications completed by sta...
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": "Show me the number of players registered in each country, along with the number of different games available for each country." }, { "role": "assistant", "content": "SELECT p.country_code, COUNT(DISTINCT p.player_id) AS player_count, COUNT(DISTINCT g.game_id) AS gam...
You are an SQL statement expert. Given the table 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.timestampt...
[ { "role": "user", "content": "What is the average processing time in days for each service category?" }, { "role": "assistant", "content": "SELECT category, AVG(average_processing_time_days) AS avg_processing_time\nFROM government_services.services\nGROUP BY category;" }, { "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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego...
[ { "role": "user", "content": "Find employees who work in the same department as their manager. Display the employee's full name, the manager's full name, and the department they share." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, m.first...
You are an SQL statement expert. Given the table 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.employees ( employee_id character varying(64) NOT NULL, -- unique identifier for the government...
[ { "role": "user", "content": "List lawyers who have any unbilled time entries. Show their first name, last name, and the count of their unbilled entries." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, COUNT(T2.entry_id) FROM lawyers AS T1 JOIN time_entries 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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text, bar_number text UNIQUE, firm_id t...
[ { "role": "user", "content": "List all pairs of service orders that share the same bill_id, showing order1_id, order2_id, and the bill_id." }, { "role": "assistant", "content": "SELECT s1.order_id AS order1_id,\n s2.order_id AS order2_id,\n s1.bill_id\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.service_orders ( order_id.text, reservation_id.text, guest_id.text, service_id.text, staff_id_or...
[ { "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": "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": "Show me all claims with police reports that were filed in the last 3 months, along with the policy details and customer information." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, c.customer_id, c.incident_date, c.reported_date, c.description...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "List all tokens from the token_dexpool_info table with a liquidity over $10 million and a positive 6-hour price change percentage on the Ethereum chain." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, liquidity, price_change_percentage_6h FRO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure "CREATE TABLE narrative_info (", "narrative character varying(512) NOT NULL, -- the id of narrative", "top_3_coins text, --...
[ { "role": "user", "content": "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": "For each guest, list reservation_id, guest_id, check_in_date, and the next reservation_id and its check_in_date." }, { "role": "assistant", "content": "SELECT r1.reservation_id,\n r1.guest_id,\n r1.check_in_date,\n r2.reservation_id AS next_reserva...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ...
[ { "role": "user", "content": "List the name of each agency and the total number of service locations it operates in New York State." }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(sl.location_id) AS location_count\nFROM government_services.agencies a\nLEFT JOIN government_serv...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "Show all room types that offer 'WiFi' in their amenities." }, { "role": "assistant", "content": "SELECT room_type_id, property_id, type_name, amenities FROM hospitality_technology.room_types WHERE amenities LIKE '%WiFi%';" }, { "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 hospitality_technology.room_types ( room_type_id.text, property_id.text, type_name.text, description.text, base_rate.nu...
[ { "role": "user", "content": "Now, sort the results by the date opened, oldest first, and show only the top 10." }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Cri...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "For each user, list all pairs of read and unread notifications, showing the recipient_user_id, the unread notification_id and type, and the read notification_id and type." }, { "role": "assistant", "content": "SELECT\n n_unread.recipient_user_id,\n n_unread.notifi...
You are an SQL statement expert. Given the table 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.notifications ( notification_id character varying(64) NOT NULL, recipient_user_id character varying(64) NO...
[ { "role": "user", "content": "Show me the number of distinct room types offered by each property, including the property name and the count." }, { "role": "assistant", "content": "SELECT T1.property_name, COUNT(DISTINCT T2.room_type_id) FROM hospitality_technology.properties AS T1 JOIN hospitali...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "I need to find patients who received prescriptions within 7 days after their latest appointment. Show patient_id, first and last name, appointment_time, prescription_date, and medication_name." }, { "role": "assistant", "content": "WITH latest_appt AS (\n SELECT pa...
You are an SQL statement expert. Given the table 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 all medical records with the record_id, record_date, the patient's insurance policy_number, and the doctor's ID, for records linked to a currently active insurance policy." }, { "role": "assistant", "content": "SELECT mr.record_id, mr.record_date, pi.policy_num...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appointment_time.timestamp, duration_mi...
[ { "role": "user", "content": "How many agents were hired in the current year and what is their average commission rate?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS hired_this_year, AVG(commission_rate) AS average_commission_rate FROM insurance.agents WHERE EXTRACT(YEAR FROM hire_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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara...
[ { "role": "user", "content": "What is the average balance of all addresses in the database?" }, { "role": "assistant", "content": "SELECT AVG(balance) as average_balance FROM blockchain.addresses;" }, { "role": "user", "content": "Can you break this down by the first 3 characters of ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.addresses ( address_id.text, public_key.text, balance.numeric )
[ { "role": "user", "content": "List the name and symbol for all assets that do not have a corresponding entry with the key 'website' in the metadata table." }, { "role": "assistant", "content": "SELECT T1.name , T1.symbol FROM trading_platform.assets AS T1 LEFT JOIN trading_platform.metadata AS T...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "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": "What is the total number of drivers hired each year? Provide the hire_year and driver_count." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM hire_date) AS hire_year,\n COUNT(*) AS driver_count\nFROM transportation.drivers\nGROU...
You are an SQL statement expert. Given the table 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, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "List active policies where the premium amount is greater than the base premium of the linked insurance product. Show policy number, policy premium, product name, and product base premium." }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.premium_amo...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "For each user, show the most recently created wallet address and the wallet creation timestamp." }, { "role": "assistant", "content": "SELECT w1.user_id, w1.address, w1.created_at\nFROM web3.wallets w1\nJOIN (\n SELECT user_id, MAX(created_at) AS max_created_at\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "List all agencies that do not have a website URL specified. Return their agency_id, agency_name, and main_phone_number." }, { "role": "assistant", "content": "SELECT agency_id, agency_name, main_phone_number FROM government_services.agencies WHERE website_url IS NUL...
You are an SQL statement expert. Given the table 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...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
3