Dataset Viewer
Auto-converted to Parquet Duplicate
system
stringlengths
315
8.44k
conversations
listlengths
2
8
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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List all reviews for properties with a star rating of at least 4.5. Include the property_name, review_id, rating_overall, and review_date.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_name, r.review_id, r.rating_overall, r.review_date\nF...
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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "Get a list of all patients and all medications they could potentially take. Include patient_id, full name, medication_id, and medication_name.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name || ' ' || p.last_name AS full_nam...
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 healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id...
[ { "role": "user", "content": "Count the total number of chronic diagnoses for each code_type.", "sql": null }, { "role": "assistant", "content": "SELECT\n code_type,\n COUNT(*) AS chronic_diagnosis_count\nFROM healthcare.diagnoses\nWHERE is_chronic = TRUE\nGROUP BY code_type;", "sql": ...
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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum...
[ { "role": "user", "content": "List all documents of type 'Pleading' uploaded between '2023-01-01' and '2023-12-31', including their name, case ID, and upload timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT document_name, case_id, upload_timestamp FROM legal_services.doc...
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 healthcare.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id...
[ { "role": "user", "content": "List the diagnosis ID, description, and diagnosis date for all non-chronic diagnoses recorded for patient 'pat123'.", "sql": null }, { "role": "assistant", "content": "SELECT diagnosis_id, description, diagnosis_date FROM healthcare.diagnoses WHERE patient_id = ...
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 legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c...
[ { "role": "user", "content": "List pairs of invoices for the same case where one invoice's total_amount is lower than another's; show lower_invoice_number, higher_invoice_number, and case_id.", "sql": null }, { "role": "assistant", "content": "SELECT a.invoice_number AS lower_invoice_number,...
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 healthcare.appointments ( appointment_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Can you find all appointments where the duration is less than 20 minutes and the status is not 'Cancelled'? For each, show the appointment_id, appointment_time, status, and doctor_id.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id, app...
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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ...
[ { "role": "user", "content": "Compute for each narrative the average ROI from smart_money_token_performance and the total usd_value of buy transactions (type=1) from smart_money_token_inflow. Show narrative, avg_roi, total_buy_usd_value, and chain.", "sql": null }, { "role": "assistant", "co...
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 transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ...
[ { "role": "user", "content": "For each route type, count the distinct vehicles that have completed trips on those routes. Return type and vehicle_count, sorted by vehicle_count descending.", "sql": null }, { "role": "assistant", "content": "SELECT r.type,\n COUNT(DISTINCT t.vehicle_id)...
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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "List the full name of each lawyer along with the location and status of their appointments.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.location, T2.status FROM legal_services.lawyers AS T1 JOIN legal_services.appoi...
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 gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT ...
[ { "role": "user", "content": "Show me how many achievements each player has unlocked.", "sql": null }, { "role": "assistant", "content": "SELECT player_id,\n COUNT(*) AS total_unlocked\nFROM gaming_technology.player_achievements\nGROUP BY player_id;", "sql": null }, { "role...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "List the names and URLs of all available decentralized applications (DApps).", "sql": null }, { "role": "assistant", "content": "SELECT name, url FROM dapps;", "sql": null } ]
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 financial_services.trades ( trade_id character varying(64) NOT NULL, -- unique i...
[ { "role": "user", "content": "Show me all trades for account 'ACC654321' executed after January 1, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT *\nFROM financial_services.trades\nWHERE account_id = 'ACC654321' AND trade_timestamp > '2024-01-01';", "sql": null }, {...
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 all SUI coin types with more than 6 decimals and status 'exists' in the metadata table.", "sql": null }, { "role": "assistant", "content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nWHERE status = 'exists' AND decimals > 6;", "s...
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, -- the id of the token t...
[ { "role": "user", "content": "Show tokens held by CEX addresses that have a positive ROI from smart money. Display the token symbol, chain, the exchange holding it, the CEX USD value of the holding, and the smart money ROI. Limit the results to the top 10 tokens ranked by smart money ROI in descending order...
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 transportation.passengers ( passenger_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "List the number of bookings made by each loyalty program member. Show the loyalty_program_id and the booking count.", "sql": null }, { "role": "assistant", "content": "SELECT p.loyalty_program_id, COUNT(b.booking_id) AS booking_count\nFROM transportation.passeng...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created...
[ { "role": "user", "content": "How many wallets were created in each distinct month?", "sql": null }, { "role": "assistant", "content": "SELECT DATE_TRUNC('month', created_at) AS creation_month, COUNT(*) AS wallet_count FROM web3.wallets GROUP BY DATE_TRUNC('month', created_at) ORDER BY creat...
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 hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_i...
[ { "role": "user", "content": "Which reservations included at least two different services ordered? Display the reservation ID and a count of distinct services.", "sql": null }, { "role": "assistant", "content": "SELECT reservation_id, COUNT(DISTINCT service_id) AS distinct_service_count\nFRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "List users and their latest wallet address if they have one, ordered by username.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, w.address FROM users u JOIN wallets w ON u.user_id = w.user_id WHERE w.created_at = (SELECT MAX(w2.created_at...
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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre...
[ { "role": "user", "content": "For each city that has a fueling location, show the city name and the total quantity of fuel refueled.", "sql": null }, { "role": "assistant", "content": "SELECT T2.city , SUM(T1.quantity) FROM transportation.fuel_logs AS T1 JOIN transportation.locations AS T2 ...
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 web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "List the username, registration date, and the creation date of the first wallet created by each user who owns at least one wallet.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, u.created_at AS registration_date, MIN(w.created_at) AS firs...
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 healthcare.medications ( medication_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "List the medication_id, medication_name, and description for all medications whose generic_name starts with 'A'.", "sql": null }, { "role": "assistant", "content": "SELECT medication_id, medication_name, description\nFROM healthcare.medications\nWHERE generic_na...
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,...
[ { "role": "user", "content": "Retrieve all notifications with status 'failed' along with the citizen's full name and contact_phone for those notifications that occurred in the past 30 days.", "sql": null }, { "role": "assistant", "content": "SELECT n.notification_id,\n n.sent_at,\n ...
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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu...
[ { "role": "user", "content": "List the username and full name of all users who have set their profile to private.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, u.full_name FROM social_media.users u JOIN social_media.user_settings us ON u.user_id = us.user_id WHERE us...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "How many DApps have names that start with the letter 'A'?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS dapp_count\nFROM trading_platform.dapps\nWHERE name LIKE 'A%';", "sql": null } ]
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 transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "For each fuel type, list the number of unique locations where fuel refueling occurred, and also show the total quantity refueled for that fuel type and location.", "sql": null }, { "role": "assistant", "content": "SELECT fuel_type, location_id, COUNT(DISTINCT lo...
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": "List the ERC20 tokens (from token_metas) with exactly 6 decimals. Show their symbol, contract_address, and name.", "sql": null }, { "role": "assistant", "content": "SELECT symbol, contract_address, name FROM token_metas WHERE is_erc20 = 1 AND decimals = 6;", ...
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": "For each SUI coin type, show the total balance across all owners and the number of distinct owners.", "sql": null }, { "role": "assistant", "content": "SELECT\n coin_type,\n SUM(CAST(balance AS DECIMAL)) AS total_balance,\n COUNT(DISTINCT owner) AS owner_coun...
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 legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex...
[ { "role": "user", "content": "Show me all time entries, including the case name they are associated with.", "sql": null }, { "role": "assistant", "content": "SELECT T1.*, T2.case_name FROM time_entries AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id", "sql": null }, { "role": "...
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 healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ...
[ { "role": "user", "content": "Show me all doctors who have prescribed medications along with the count of prescriptions they've made, ordered by the count in descending order.", "sql": null }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(p.prescript...
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 cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the ...
[ { "role": "user", "content": "What is the total USD value of tokens held by CEX addresses on the 'Ethereum' chain for the most recent snapshot time?", "sql": null }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT max(snapshot_time) as max_time\n FROM cex_token_balanc...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "How many orders in the system have the status 'completed'?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS completed_orders\nFROM trading_platform.orders\nWHERE status = 'completed';", "sql": null } ]
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 gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country tex...
[ { "role": "user", "content": "How many developers are there in each country? Show country and developer_count.", "sql": null }, { "role": "assistant", "content": "SELECT country,\n COUNT(*) AS developer_count\nFROM gaming_technology.developers\nGROUP BY country;", "sql": null }, ...
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 social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "Show all users who have liked comments made by users with a specified location, say 'Paris'. For each, show their username, the comment_id, and the location of the comment's author.", "sql": null }, { "role": "assistant", "content": "SELECT l.user_id AS liker_us...
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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List all staff members who are not managers, including their first name, last name, position, and the name of the property they work at.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T1.position, T2.property_name FROM ho...
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 hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "Show all service orders with the service_id, guest's full name, and the status of each order.", "sql": null }, { "role": "assistant", "content": "SELECT so.order_id, so.service_id, g.first_name, g.last_name, so.status\nFROM hospitality_technology.service_orders ...
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 varch...
[ { "role": "user", "content": "I would like to calculate the average rarity_score for each NFT collection on the Ethereum blockchain.", "sql": null }, { "role": "assistant", "content": "SELECT c.contract_address,\n AVG(m.rarity_score) AS avg_rarity\nFROM nft_collections c\nJOIN nft_meta...
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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Retrieve the document_id, document_type, citizen full name, and verification_status for all documents that have no expiry date set.", "sql": null }, { "role": "assistant", "content": "SELECT d.document_id,\n d.document_type,\n c.first_name || ' ' || ...
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 transportation.trips ( trip_id character varying(64) NOT NULL, route_id character va...
[ { "role": "user", "content": "What is the count of trips for each status?", "sql": null }, { "role": "assistant", "content": "SELECT\n status,\n COUNT(*) AS trip_count\nFROM transportation.trips\nGROUP BY\n status;", "sql": null }, { "role": "user", "content": "Only includ...
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 web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "For each distinct deployer address, how many contracts have they deployed and what is the most recent deployment time? Please show deployer_address, contract_count, and latest_deployed_at.", "sql": null }, { "role": "assistant", "content": "SELECT deployer_addre...
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 social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "List each conversation_id and the number of unread messages (where read_at is null).", "sql": null }, { "role": "assistant", "content": "SELECT m.conversation_id, COUNT(*) AS unread_messages FROM social_media.messages m WHERE m.read_at IS NULL GROUP BY m.convers...
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 train_station_management.platforms ( platform_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "Can you help me retrieve the details of all platforms at a specific station with station_id 'STATION_001', including the platform status and whether they are accessible?", "sql": null }, { "role": "assistant", "content": "SELECT platform_id, platform_number, tra...
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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "Show the name of each insurance plan and the total number of patients whose primary insurance policy for that plan is currently active. Include only plans that have at least one such patient.", "sql": null }, { "role": "assistant", "content": "SELECT T1.plan_nam...
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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi...
[ { "role": "user", "content": "Provide the message_subject and agency_name for all notifications that are related to agencies and have a status of 'Sent'.", "sql": null }, { "role": "assistant", "content": "SELECT n.message_subject, a.agency_name\nFROM government_services.notifications n\nJOI...
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. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c...
[ { "role": "user", "content": "I need to get the inventory quantity and location for a specific batch number. Can you help with that?", "sql": null }, { "role": "assistant", "content": "HGETALL inv:<inventory_record_id>", "sql": null }, { "role": "user", "content": "Can you al...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text...
[ { "role": "user", "content": "List the names and URLs of all decentralized applications where the description includes the word 'exchange'.", "sql": null }, { "role": "assistant", "content": "SELECT d.name, d.url\nFROM trading_platform.dapps d\nWHERE d.description ILIKE '%exchange%';", "...
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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri...
[ { "role": "user", "content": "For narratives listed in `narrative_info`, find the total USD value held by CEXes for tokens that are among their top 3 listed coins. Show the narrative and the total CEX USD value.", "sql": null }, { "role": "assistant", "content": "SELECT T2.narrative, SUM(T1....
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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ...
[ { "role": "user", "content": "Which insurance products have 'comprehensive' in their coverage details? Show the product_id and product_name.", "sql": null }, { "role": "assistant", "content": "SELECT product_id, product_name FROM insurance.insurance_products WHERE coverage_details ILIKE '%co...
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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level....
[ { "role": "user", "content": "List the employee ID, first name, last name, and hire date for all employees who were hired in the year 2022.", "sql": null }, { "role": "assistant", "content": "SELECT employee_id, first_name, last_name, hire_date FROM government_services.employees WHERE EXTRAC...
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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "Find all pairs of drivers who share the same status. Include both driver_ids, full names, and the shared status.", "sql": null }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver1_id, d1.first_name || ' ' || d1.last_name AS driver1_name, d2.drive...
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 social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, crea...
[ { "role": "user", "content": "I need to find users who have liked both a post and a comment on the same day. For each such user and date, list user_id, date, post_id, and comment_id.", "sql": null }, { "role": "assistant", "content": "SELECT p.user_id, DATE(p.created_at) AS like_date, p.post...
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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam...
[ { "role": "user", "content": "I need a report showing the count of drivers per status.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS driver_count\nFROM transportation.drivers\nGROUP BY status;", "sql": null }, { "role": "user", "content": "Act...
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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "List each property and the number of public reviews it has received.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, COUNT(r.review_id) AS public_review_count\nFROM hospitality_technology.properties p\nLEFT JOIN hospita...
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 healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointmen...
[ { "role": "user", "content": "Show me all medical records created before January 1, 2022.", "sql": null }, { "role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE record_date < '2022-01-01';", "sql": null } ]
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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List all rooms that are currently marked as 'OutOfOrder' or 'Maintenance'. Show their room number and current status.", "sql": null }, { "role": "assistant", "content": "SELECT room_number, status FROM hospitality_technology.rooms WHERE status IN ('OutOfOrder', ...
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 healthcare.medical_records ( record_id text, patient_id text, appointment_id text, d...
[ { "role": "user", "content": "Count the total number of medical records where both assessment and treatment_plan fields are provided.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS total_records\nFROM healthcare.medical_records\nWHERE assessment IS NOT NULL AND treatm...
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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi...
[ { "role": "user", "content": "Show me the count of posts per media_type for public posts.", "sql": null }, { "role": "assistant", "content": "SELECT media_type, COUNT(*) AS post_count\nFROM social_media.posts\nWHERE visibility = 'public'\nGROUP BY media_type;", "sql": null } ]
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_dexpool_info ( pair_address character varying(512) NOT NULL, token_name charac...
[ { "role": "user", "content": "List tokens on the 'Arbitrum' chain with a 24-hour trading volume greater than 1,000,000 USD. Show symbol, volume, and price.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, volume_24h, price FROM token_dexpool_info WHERE chain = 'Arbitr...
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 transportation.routes ( route_id text, route_number text, description text, origin_l...
[ { "role": "user", "content": "For each route, show the route number and the total number of bookings.", "sql": null }, { "role": "assistant", "content": "SELECT r.route_number, COUNT(b.booking_id) FROM transportation.routes r JOIN transportation.trips t ON r.route_id = t.route_id JOIN transp...
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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "List the names of agencies and their established dates, but only for agencies that offer at least one service.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.agency_name , T1.established_date FROM government_services.agencies AS T1 JOIN ...
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 transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time...
[ { "role": "user", "content": "For each vehicle and unit combination, show the total quantity of fuel refueled and the total cost.", "sql": null }, { "role": "assistant", "content": "SELECT vehicle_id, unit, SUM(quantity) AS total_quantity, SUM(total_cost) AS total_cost\nFROM transportation.f...
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 gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_...
[ { "role": "user", "content": "Show each player's highest score for each game they have played.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, game_id, MAX(score) AS highest_score FROM gaming_technology.game_sessions GROUP BY player_id, game_id;", "sql": null }, ...
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "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.", "sql": null }, { "role": "assistant", "content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) ...
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 insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identif...
[ { "role": "user", "content": "For each insurance product type, retrieve the total premium_amount and average coverage_limit for policies under active products. Include product_type, total_premium, and avg_coverage_limit, sorted by total_premium descending.", "sql": null }, { "role": "assistant",...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text, user_id text, address text, private_key text, created...
[ { "role": "user", "content": "Which user has the earliest created wallet? Show the user_id, wallet_id, address, and the creation timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, wallet_id, address, created_at\nFROM web3.wallets\nORDER BY created_at ASC\nLIMIT 1;...
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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "Show all policies that started in 2024, including the policy_id, customer_id, and start_date. Order the results by start_date ascending.", "sql": null }, { "role": "assistant", "content": "SELECT policy_id, customer_id, start_date\nFROM insurance.policies\nWHERE...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id text, block_id text, sender_address text, r...
[ { "role": "user", "content": "I need to list each user’s ID, email, and the total amount they've sent in transactions.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.email, COALESCE(SUM(t.amount), 0) AS total_sent\nFROM blockchain.users u\nJOIN blockchain.wallets w O...
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(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "List all ERC20 token symbols and their latest prices for tokens where the total supply is greater than '100000000000000000000'.", "sql": null }, { "role": "assistant", "content": "SELECT T1.symbol, T2.price FROM token_metas AS T1 JOIN token_prices_latest AS T2 O...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
10