Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
288
8.03k
[ { "role": "user", "content": "Show each player’s username, the number of achievements they have unlocked, and the total quantity of items they currently have in their inventory." }, { "role": "assistant", "content": "SELECT p.username,\n COUNT(DISTINCT pa.achievement_id) AS achievements_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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "List all primary insurance policies that will expire within the next 30 days. Return patient_insurance_id, patient_id, policy_number, and expiration_date." }, { "role": "assistant", "content": "SELECT patient_insurance_id,\n patient_id,\n policy_number,\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id.text, patient_id.text, appointment_id.text, doctor_id.text, record_date.timestam...
[ { "role": "user", "content": "Count the number of policies issued in each calendar year, and show the year and the count." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM issued_at), COUNT(*) FROM insurance.policies WHERE issued_at IS NOT NULL 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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin...
[ { "role": "user", "content": "Find all wallet addresses that don't have an associated user_id." }, { "role": "assistant", "content": "SELECT address_id FROM blockchain.wallets WHERE user_id IS NULL;" }, { "role": "user", "content": "Now show me these addresses along with their privat...
You are an SQL statement expert. Given the table 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.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text )
[ { "role": "user", "content": "List all patients who have a medical record with a chief complaint containing the word 'headache'. Show patient ID, first name, last name, and date of birth." }, { "role": "assistant", "content": "SELECT DISTINCT\n p.patient_id,\n p.first_name,\n p.last_name,\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.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me the subject and start times of all appointments along with the corresponding lawyer IDs for each client." }, { "role": "assistant", "content": "SELECT client_id, lawyer_id, subject, start_time FROM legal_services.appointments;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.appointments ( appointment_id character varying(64) NOT NULL, client_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List the service_id, service_name, and agency_id for all active services that have an online application URL provided." }, { "role": "assistant", "content": "SELECT service_id,\n service_name,\n agency_id\nFROM government_services.services\nWHERE is_acti...
You are an SQL statement expert. Given the table 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 document ID, document type, and upload timestamp for all documents uploaded by citizens who registered after January 1st, 2023." }, { "role": "assistant", "content": "SELECT d.document_id, d.document_type, d.upload_timestamp FROM government_services.documen...
You are an SQL statement expert. Given the table 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 text, application_id text, citizen_id text, document_type text, file_refere...
[ { "role": "user", "content": "List pairs of citizens who share the same email domain." }, { "role": "assistant", "content": "SELECT c1.first_name AS first1,\n c1.last_name AS last1,\n c2.first_name AS first2,\n c2.last_name AS last2,\n SPLIT_PART(c1.contact_email, '@', 2)...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "List the first name, last name, license number, and status for all drivers whose license expires in the next 6 months." }, { "role": "assistant", "content": "SELECT\n first_name,\n last_name,\n license_number,\n status\nFROM transportation.drivers\nWHERE\n lice...
You are an SQL statement expert. Given the table 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 ...
[ { "role": "user", "content": "How many documents are there for each document_type? Show document_type and count ordered by the count in descending order." }, { "role": "assistant", "content": "SELECT document_type,\n COUNT(*) AS count\nFROM legal_services.documents\nGROUP BY document_type\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "Show me all transactions (transaction_id, amount, transaction_type) where the transaction_type is 'Transfer' and the status is 'Completed', along with the account_id and related_account_id." }, { "role": "assistant", "content": "SELECT transaction_id, amount, transa...
You are an SQL statement expert. Given the table 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.transactions ( transaction_id character varying(64) NOT NULL, -- unique identifier for the trans...
[ { "role": "user", "content": "For each claim, show the claim ID, policy ID, and the product name of the insurance product that applies to the policy." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, ip.product_name FROM insurance.claims c JOIN insurance.insurance_products 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 ...
[ { "role": "user", "content": "List the user IDs of all private profiles who last updated their settings in 2024." }, { "role": "assistant", "content": "SELECT user_id FROM social_media.user_settings WHERE private_profile = true AND updated_at >= '2024-01-01' AND updated_at < '2025-01-01';" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.user_settings ( setting_id text, user_id text, theme text, email_notifications_enabled boolean, push_notif...
[ { "role": "user", "content": "For each user, show their username and the timestamp of their most recent notification. Include users who have never received notifications." }, { "role": "assistant", "content": "SELECT T1.username, max(T2.sent_at) FROM users AS T1 LEFT JOIN trading_platform.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 trading_platform.notifications ( notification_id.text, user_id.text, message.text, sent_at.timestamp, read_at.timestamp...
[ { "role": "user", "content": "Find all patients who have both a primary insurance plan and at least one completed appointment, along with their insurance policy numbers and the count of appointments." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pi.policy...
You are an SQL statement expert. Given the table 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 cryptocurrency assets that have been traded more than 50 times but have never been traded in quantities greater than 100, along with their average trade price." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name, a.symbol, COUNT(t.trade_id) ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "Show me all insurance plans where the website includes 'secure'." }, { "role": "assistant", "content": "SELECT * FROM healthcare.insurance_plans WHERE website ILIKE '%secure%';" } ]
You are an SQL statement expert. Given the table 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 the ERC20 tokens (from token_metas) with exactly 6 decimals. Show their symbol, contract_address, and name." }, { "role": "assistant", "content": "SELECT symbol, contract_address, name FROM token_metas WHERE is_erc20 = 1 AND decimals = 6;" }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "I want to identify pairs of bookings that share the same payment_transaction_id, showing both booking IDs and the payment_transaction_id." }, { "role": "assistant", "content": "SELECT b1.booking_id AS booking1, b2.booking_id AS booking2, b1.payment_transaction_id\nF...
You are an SQL statement expert. Given the table 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.text, passenger_id.text, trip_id.text, seat_number.text, booking_time.timestamp, s...
[ { "role": "user", "content": "For projects that have completed more than one fundraising round, calculate the average investment value across all their recorded rounds. Display the project name and this average value." }, { "role": "assistant", "content": "SELECT project_name, AVG(investment_val...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "List the full names and dates of birth for all patients who do not have a phone number on record." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE phone_number IS NULL OR TRIM(phone_number) = '';" } ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Find all wallets that have deployed contracts on both 'ethereum' and 'polygon' networks, showing the wallet address and the count of contracts deployed on each network." }, { "role": "assistant", "content": "SELECT w.address, SUM(CASE WHEN c.network_id = 'ethereum' ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "Show the name, symbol, and type of each asset, along with the total number of orders placed for each asset." }, { "role": "assistant", "content": "SELECT a.name, a.symbol, a.type, COUNT(o.order_id) AS order_count\nFROM trading_platform.assets a\nLEFT JOIN trading_pl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "How many distinct ports have been used by peers in the system?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT port) AS distinct_port_count\nFROM trading_platform.peers;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "For each property, show the most expensive room type by base_rate, including the property name, room type name, and the highest base_rate." }, { "role": "assistant", "content": "SELECT p.property_name,\n rt.type_name,\n MAX(rt.base_rate) AS max_base_rate...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "Find all nodes that were last seen in the last 30 days and have port numbers between 8000 and 9000." }, { "role": "assistant", "content": "SELECT node_id, ip_address, port FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '30 days' AND port BETWEEN 8000 AND ...
You are an SQL statement expert. Given the table 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 text, block_id text, sender_address text, receiver_address text, amount numeri...
[ { "role": "user", "content": "For each event recorded, list its ID, name, and the status and value of the transaction in which it occurred." }, { "role": "assistant", "content": "SELECT E.event_id, E.event_name, E.transaction_id, T.status, T.value FROM web3.events AS E JOIN web3.transactions AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "List all medical records along with the chief complaint and record date for patients who had their medical record created after March 1, 2023 and whose record was created by doctor with ID 'doctor_123'." }, { "role": "assistant", "content": "SELECT record_id, 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.medical_records ( record_id text PRIMARY KEY, patient_id text, appointment_id text, doctor_id text, record_d...
[ { "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": "Could you list each game title along with the total number of players currently connected across all its servers?" }, { "role": "assistant", "content": "SELECT g.title, SUM(s.current_players) AS total_current_players FROM gaming_technology.games g JOIN gaming_techno...
You are an SQL statement expert. Given the table 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": "Show all payments made for reservations that had more than 2 adults. Include the payment ID, amount, currency, reservation ID, guest full name, and the number of adults in the reservation." }, { "role": "assistant", "content": "SELECT T1.payment_id, T1.amount, T1.cu...
You are an SQL statement expert. Given the table 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": "List the medication names and dosage for all prescriptions issued for patient with ID 'patient_555'." }, { "role": "assistant", "content": "SELECT m.medication_name, p.dosage\nFROM healthcare.prescriptions p\nJOIN healthcare.medications m ON p.medication_id = m.medi...
You are an SQL statement expert. Given the table 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": "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": "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": "Find all non-smoking rooms that have not been cleaned in the last 7 days." }, { "role": "assistant", "content": "SELECT room_id, room_number, last_cleaned_at\nFROM hospitality_technology.rooms\nWHERE is_smoking = false\n AND last_cleaned_at < NOW() - INTERVAL '7 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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "What are the fuel consumption rates per hour for the Boeing 747-8 model?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the fuel consumption rates for the Boeing 747-8 model as this data is not included in the aircraft_models ta...
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": "Please list the contact phone number and website for each insurance plan." }, { "role": "assistant", "content": "SELECT plan_id, plan_name, contact_phone, website FROM healthcare.insurance_plans;" }, { "role": "user", "content": "Show only the plans 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 healthcare.insurance_plans ( plan_id text, plan_name text, insurance_provider text, plan_type text, contact_phone text,...
[ { "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 the top 5 users who have interacted with DApps, along with the count of distinct DApps they interacted with and their wallet addresses." }, { "role": "assistant", "content": "SELECT w.user_id, COUNT(DISTINCT d.dapp_id) AS dapp_count, w.address FROM 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.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Show the list of developer names and their corresponding website domains (the domain part of the website URL)." }, { "role": "assistant", "content": "SELECT name, \n CASE \n WHEN website LIKE 'http%' THEN SUBSTRING(website FROM '://([^/]+)')\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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "What is the maintenance schedule for platform 3 at station DEF for the next month?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the maintenance schedule for platforms. The data I have only includes static information about platform de...
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": "List all maintenance service records for vehicles that have successfully completed any trip." }, { "role": "assistant", "content": "SELECT DISTINCT ml.* FROM transportation.maintenance_logs AS ml JOIN transportation.trips AS t ON ml.vehicle_id = t.vehicle_id 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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "What is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the detailed repair history of equipment used by staff memb...
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": "For each employee who has verified documents, show their full name and the total number of documents they have verified with a status of 'Verified'." }, { "role": "assistant", "content": "SELECT e.full_name, COUNT(d.document_id) FROM government_services.documents d ...
You are an SQL statement expert. Given the table 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 text, application_id text, citizen_id text, document_type text, file_refere...
[ { "role": "user", "content": "For each user, show their user ID and the count of unique wallet addresses they own." }, { "role": "assistant", "content": "SELECT user_id, COUNT(DISTINCT address) FROM wallets GROUP BY user_id;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp )
[ { "role": "user", "content": "For the 'DeFi' narrative, what is the average ROI and the total net inflow (usd_value where type=1) from smart money token inflow?" }, { "role": "assistant", "content": "SELECT AVG(sm.roi) AS avg_roi, SUM(smt.usd_value) AS total_net_inflow\nFROM smart_money_token_in...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "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": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT name, symbol, address FROM token_prices_latest WHERE price BETWEEN 1 AND 10 AND blockchain = 'ethereum'...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "Which route numbers connect locations with a distance less than 80 km and more than 5 words in their description? Include the route type in the results." }, { "role": "assistant", "content": "SELECT route_number, type FROM transportation.routes WHERE distance_km < 8...
You are an SQL statement expert. Given the table 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": "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": "What is the fuel consumption rate of train number T1234?" }, { "role": "assistant", "content": "I'm sorry, but I don't have information on the fuel consumption rate of train number T1234. The data available in the system only includes details such as train ID, model...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "role": "user", "content": "List the usernames and full names of users who created their account in 2024 and are verified." }, { "role": "assistant", "content": "SELECT username, full_name FROM social_media.users WHERE created_at >= '2024-01-01' AND created_at < '2025-01-01' AND is_verified = ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "Show me properties that have more than 10 service orders delivered in the last month. Include the property_name and the number of delivered orders." }, { "role": "assistant", "content": "SELECT p.property_name,\n COUNT(o.order_id) AS delivered_orders\nFROM hos...
You are an SQL statement expert. Given the table 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": "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 all users who follow both user 'U100' and user 'U101'." }, { "role": "assistant", "content": "SELECT f1.follower_user_id\nFROM social_media.follows f1\nJOIN social_media.follows f2 ON f1.follower_user_id = f2.follower_user_id\nWHERE f1.following_user_id = 'U100...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ...
[ { "role": "user", "content": "List all invoices that were paid within 7 days of their issue date. Show invoice number, issue date, payment date, and total amount." }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, payment_date, total_amount FROM legal_services.invoices WHE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "Show the total fuel cost for each month in 2023 based on the log timestamp." }, { "role": "assistant", "content": "SELECT\n EXTRACT(MONTH FROM log_timestamp) AS log_month,\n SUM(total_cost) AS monthly_total_cost\nFROM transportation.fuel_logs\nWHERE EXTRACT(YE...
You are an SQL statement expert. Given the table 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, vehicle_id character varying(64) NOT NULL, trip_...
[ { "role": "user", "content": "I need a report of total maintenance cost per vehicle type." }, { "role": "assistant", "content": "SELECT v.type AS vehicle_type,\n SUM(m.cost) AS total_maintenance_cost\nFROM transportation.vehicles v\nJOIN transportation.maintenance_logs m ON v.vehicle_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.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List all follow IDs that were created on '2024-06-18'." }, { "role": "assistant", "content": "SELECT follow_id FROM social_media.follows WHERE DATE(created_at) = '2024-06-18';" } ]
You are an SQL statement expert. Given the table 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.follows ( follow_id.text, follower_user_id.text, following_user_id.text, created_at.timestamp )
[ { "role": "user", "content": "For each achievement, show its name, the game_id it belongs to, and the number of distinct players who have played a session for that game." }, { "role": "assistant", "content": "SELECT a.name, a.game_id, COUNT(DISTINCT gs.player_id) AS players_with_sessions\nFROM g...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt...
[ { "role": "user", "content": "For each relationship type among policy beneficiaries, count how many beneficiaries exist of that type. Provide relationship and count, ordered by count descending." }, { "role": "assistant", "content": "SELECT relationship,\n COUNT(*) AS beneficiary_count\nFR...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Show me all wallet addresses that belong to user_id 'U1001', along with their private keys." }, { "role": "assistant", "content": "SELECT address_id, private_key FROM blockchain.wallets WHERE user_id = 'U1001';" }, { "role": "user", "content": "Now 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 blockchain.wallets ( wallet_id text, user_id text, address_id text, private_key text )
[ { "role": "user", "content": "Which games have at least one achievement worth exactly 75 points, and what are the names and descriptions of those achievements?" }, { "role": "assistant", "content": "SELECT g.title, a.name AS achievement_name, a.description\nFROM gaming_technology.games g\nJOIN g...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "What are the personal contact details of the staff member associated with staff_id 'STAFF789' who worked on a specific maintenance record?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide personal contact details of staff members as this informa...
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 is the current job satisfaction level or feedback from staff members working at a specific train station?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on job satisfaction levels or feedback from staff members as this data is...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.s...
[ { "role": "user", "content": "List all medical records, showing the record ID, record date, and the full name of the doctor who created the record. Include the patient ID as well." }, { "role": "assistant", "content": "SELECT mr.record_id, mr.record_date, mr.patient_id, d.first_name, d.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.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "role": "user", "content": "Show me the content of all comments that have received at least one like." }, { "role": "assistant", "content": "SELECT DISTINCT T1.content FROM social_media.comments AS T1 JOIN social_media.likes AS T2 ON T1.comment_id = T2.comment_id;" }, { "role": "user",...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "Show all rooms that are on floor 3." }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number FROM hospitality_technology.rooms WHERE floor = 3;" }, { "role": "user", "content": "For these rooms, include the property name and room n...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "List all servers that are currently online and have a player count greater than their average player count across all servers in the same region." }, { "role": "assistant", "content": "SELECT s.server_id, s.server_name, s.region, s.current_players\nFROM gaming_techn...
You are an SQL statement expert. Given the table 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.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time...
[ { "role": "user", "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": "assistant", "content": "SELECT property_name, city, property_type, star_rating FROM hospitality_technology.properties WHERE country_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "What are the specific tools or equipment used during the maintenance with record_id 'REC456'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about the specific tools or equipment used during a maintenance record. The data in the ma...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.m...
[ { "role": "user", "content": "Can you help me get the total number of operational platforms across all stations?" }, { "role": "assistant", "content": "db.platforms.countDocuments({ status: 'Operational' });" } ]
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 // db.createCollection('platforms') // Optional: db.platforms.createIndex({ platform_id: 1 }, { u...
[ { "role": "user", "content": "Show me the number of guests for each city they reside in." }, { "role": "assistant", "content": "SELECT city, count(*) AS guest_count FROM hospitality_technology.guests WHERE city IS NOT NULL GROUP BY city;" }, { "role": "user", "content": "Now, only sh...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te...
[ { "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 users who have received notifications triggered by another user (non-system notifications). Show the recipient username, notification type, and the sender username." }, { "role": "assistant", "content": "SELECT T1.username AS recipient_username, T2.notification...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "Show me the count of service orders for each distinct status." }, { "role": "assistant", "content": "SELECT status, COUNT(order_id) FROM hospitality_technology.service_orders GROUP BY status;" }, { "role": "user", "content": "Also, include the total quan...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id character varying(64) NOT NULL, property_id character varying(64) ...
[ { "role": "user", "content": "How many policies are there for each status, and what is the average premium amount for policies in each status?" }, { "role": "assistant", "content": "SELECT status, COUNT(policy_id), AVG(premium_amount) FROM insurance.policies GROUP BY status ORDER BY COUNT(policy...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
2