Dataset Viewer
Auto-converted to Parquet Duplicate
system
stringlengths
315
8.35k
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 trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "role": "user", "content": "Show the username and the total number of log entries for each user who has logged any action." }, { "role": "assistant", "content": "SELECT T1.username, COUNT(T2.log_id) FROM users AS T1 JOIN logs AS T2 ON T1.user_id = T2.user_id GROUP BY T1.username;" }, { ...
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 PRIMARY KEY, username text, email text, password_h...
[ { "role": "user", "content": "How many users have non-empty full_name and bio fields? Return only the count." }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM social_media.users\nWHERE full_name IS NOT NULL\n AND full_name <> ''\n AND bio IS NOT NULL\n AND bio <> '';" } ]
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": "List all appointments scheduled in the next 7 days along with the appointment_id, appointment_time, patient's full name, doctor's full name, and the patient's primary insurance plan_name." }, { "role": "assistant", "content": "SELECT ap.appointment_id,\n ap.ap...
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": "Show me the first and last names of citizens and the number of appointments they have scheduled with the employee whose last name is 'Smith'." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(a.appointment_id) AS appointment_count\nFROM ...
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.appointments ( appointment_id text, client_id text, lawyer_id text, c...
[ { "role": "user", "content": "List all appointments for the client with ID 'client_001' showing the lawyer's ID, appointment subject, and start time." }, { "role": "assistant", "content": "SELECT a.lawyer_id, a.subject, a.start_time\nFROM legal_services.appointments a\nWHERE a.client_id = 'clien...
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.payments ( payment_id text, reservation_id text, guest_id tex...
[ { "role": "user", "content": "List all payments processed in USD, showing payment_id, guest_id, amount, and payment_timestamp." }, { "role": "assistant", "content": "SELECT payment_id,\n guest_id,\n amount,\n payment_timestamp\nFROM hospitality_technology.payments\nWHERE curren...
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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern...
[ { "role": "user", "content": "Count how many achievements were unlocked on each calendar day. Show the date and the count." }, { "role": "assistant", "content": "SELECT DATE(unlocked_at) AS unlock_date, COUNT(*) AS achievement_count FROM gaming_technology.player_achievements GROUP BY unlock_date...
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.assets ( asset_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "I want a list of DApp names and the asset symbols mentioned in their descriptions." }, { "role": "assistant", "content": "SELECT d.name AS dapp_name,\n a.symbol AS asset_symbol\nFROM trading_platform.dapps d\nJOIN trading_platform.assets a\n ON d.description ...
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": "Show me all service orders along with their status and the associated review comment for the same reservation, if there is one." }, { "role": "assistant", "content": "SELECT so.order_id, so.status, r.comment \nFROM hospitality_technology.service_orders so\nLEFT 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "List all patients who have had appointments with doctors specializing in 'Oncology', showing patient ID, patient first name, patient last name, doctor ID, doctor first name, and doctor last name." }, { "role": "assistant", "content": "SELECT\n p.patient_id,\n p.fi...
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.orders ( order_id character varying(64) NOT NULL, user_id character...
[ { "role": "user", "content": "Show each user_id for users with 'pending' KYC status along with the count of unread notifications they have." }, { "role": "assistant", "content": "SELECT k.user_id, COUNT(n.notification_id) AS unread_count\nFROM trading_platform.kyc_audit k\nJOIN trading_platform....
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 character varying(64) NOT NULL, license_plate c...
[ { "role": "user", "content": "Can you show the driver first name, last name, and the make and model of the vehicle for each trip, along with the scheduled departure time?" }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, v.make, v.model, t.scheduled_departure\nFROM transpo...
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 case numbers, names, and related invoice numbers." }, { "role": "assistant", "content": "SELECT T1.case_number, T1.case_name, T2.invoice_number FROM legal_services.cases AS T1 JOIN legal_services.invoices AS T2 ON T1.case_id = T2.case_id;" }, { "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.medical_records ( record_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Can you provide a list of all medical records created by doctors for patients who are associated with 'PPO' type insurance plans? I need the record ID, patient ID, doctor ID, record date, and insurance plan name." }, { "role": "assistant", "content": "SELECT mr.reco...
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 PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "Find all pairs of vehicles that have the same make and model but different fuel types. For each pair, display the first vehicle_id, the second vehicle_id, make, model, fuel_type of the first as fuel_type1 and of the second as fuel_type2." }, { "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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number...
[ { "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 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": "Provide a summary for each user, showing their user_id, username, and the total number of orders they have placed overall." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(o.order_id) AS total_orders\nFROM trading_platform.users u\nLEFT JOI...
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.market_data ( data_point_id bigserial NOT NULL, security_id chara...
[ { "role": "user", "content": "Provide for each security its ticker_symbol, the most recent close_price and corresponding timestamp." }, { "role": "assistant", "content": "SELECT s.ticker_symbol, md.close_price, md.data_timestamp\nFROM financial_services.market_data md\nJOIN financial_services.se...
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, national_id_number text, first_name ...
[ { "role": "user", "content": "Show the full name and contact email of citizens who have submitted at least one application for services that are currently inactive." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM gover...
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.text, customer_id.text, product_id.text, agent_id.tex...
[ { "role": "user", "content": "Show the agent_id and the total number of policies managed by each agent, but only include agents with at least 5 policies." }, { "role": "assistant", "content": "SELECT agent_id, COUNT(*) AS policy_count FROM insurance.policies GROUP BY agent_id HAVING COUNT(*) >= ...
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 the policy number, policy start date, and the name and type of the insurance product for all active policies." }, { "role": "assistant", "content": "SELECT p.policy_number, p.start_date, ip.product_name, ip.product_type FROM insurance.policies p JOIN insurance....
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.maintenance_logs ( log_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Show me all vehicles that are due for their next service before the end of this month, along with their last service type and date." }, { "role": "assistant", "content": "SELECT vehicle_id, service_type, service_date FROM transportation.maintenance_logs WHERE next_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 government_services.employees ( employee_id text, agency_id text, first_name text, l...
[ { "role": "user", "content": "List the full names of employees whose direct manager themselves report to another manager. Also show the direct manager's full name." }, { "role": "assistant", "content": "SELECT E.first_name, E.last_name, M.first_name AS manager_first_name, M.last_name AS manager_...
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": "List all SUI coins that have the status 'inactive', including their owner address and coin_type." }, { "role": "assistant", "content": "SELECT coin_type, owner FROM sui_coins WHERE status = 'inactive';" }, { "role": "user", "content": "Add the name and 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 web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "Count the number of contracts per network and status." }, { "role": "assistant", "content": "SELECT\n network_id,\n status,\n COUNT(*) AS contract_count\nFROM web3.contracts\nGROUP BY network_id, status;" }, { "role": "user", "content": "Actually, ple...
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": "Show me the first name, last name, and position of all staff members, along with the name of the property they work at." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T1.position, T2.property_name FROM hospitality_technology.staff AS T1 J...
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": "List all wallets created before '2024-01-01', including the wallet_id, user_id, and creation date." }, { "role": "assistant", "content": "SELECT wallet_id, user_id, created_at FROM wallets WHERE created_at < '2024-01-01';" }, { "role": "user", "content":...
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.customers ( customer_id text, first_name text, last_name text, date_of_bir...
[ { "role": "user", "content": "List customers who have active 'Auto' policies, showing their first name, last name, the policy number, and the product name." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.policy_number, T3.product_name FROM insurance.customers AS 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "List all SUI coins, showing object ID, owner address, and balance." }, { "role": "assistant", "content": "SELECT object_id, owner, balance FROM sui_coins;" }, { "role": "user", "content": "Include the coin symbol and name by joining with the metadata tab...
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.maintenance_logs ( log_id text, vehicle_id text, service_date date, o...
[ { "role": "user", "content": "Can you provide the mechanic name, service date, and service type for each maintenance log, along with the vehicle's odometer reading for all logs with a cost greater than 1000?" }, { "role": "assistant", "content": "SELECT mechanic_name, service_date, service_type,...
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 all available rooms with their room number, property_name, type_name, and the number of days since they were last cleaned." }, { "role": "assistant", "content": "SELECT p.property_name,\n r.room_number,\n rt.type_name,\n date_part('day', curre...
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.follows ( follow_id character varying(64) NOT NULL, follower_user_id ch...
[ { "role": "user", "content": "Can you find all mutual follows in the system by joining the table with itself? For each mutual follow, show both user IDs and the date when the follow occurred." }, { "role": "assistant", "content": "SELECT f1.follower_user_id AS user_a, f1.following_user_id AS use...
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 PRIMARY KEY, case_id text, document_name...
[ { "role": "user", "content": "Can you list all documents along with their upload timestamp and the lawyer ID who uploaded them, for documents of type 'Memorandum'?" }, { "role": "assistant", "content": "SELECT document_name, upload_timestamp, uploaded_by_lawyer_id FROM legal_services.documents W...
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 text PRIMARY KEY, first_name text, last_name text, sp...
[ { "role": "user", "content": "List all active prescriptions for medication 'ibuprofen' with dosage greater than 200mg, including patient ID and doctor details." }, { "role": "assistant", "content": "SELECT p.patient_id, d.first_name, d.last_name, d.specialty, m.medication_name, p.dosage, p.start...
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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "List all in-game items' names, types, and rarity along with their total cost in USD, for items that belong to games released on or after 2021-01-01." }, { "role": "assistant", "content": "SELECT i.item_name, i.item_type, i.rarity, i.cost_amount\nFROM gaming_technolo...
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.achievements ( achievement_id uuid NOT NULL DEFAULT gen_random...
[ { "role": "user", "content": "Can you list the names of achievements and the length of their descriptions? Show the ones with the longest descriptions first." }, { "role": "assistant", "content": "SELECT name, LENGTH(description) AS description_length FROM achievements ORDER BY description_lengt...
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.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all agents along with the first and last name of their manager." }, { "role": "assistant", "content": "SELECT a1.first_name AS agent_first_name, a1.last_name AS agent_last_name, a2.first_name AS manager_first_name, a2.last_name AS manager_last_name FROM insuran...
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_inventory ( inventory_id uuid NOT NULL DEFAULT gen_rand...
[ { "role": "user", "content": "Show the latest time each player acquired any item." }, { "role": "assistant", "content": "SELECT player_id, MAX(acquired_at) AS last_acquired_at FROM gaming_technology.player_inventory GROUP BY player_id;" }, { "role": "user", "content": "Actually, can ...
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": "How many service locations are marked as accessible?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.service_locations WHERE is_accessible = TRUE;" } ]
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": "List all bookings with the first and last name of the passenger and trip_id." }, { "role": "assistant", "content": "SELECT b.booking_id, b.trip_id, p.first_name, p.last_name\nFROM transportation.bookings b\nJOIN transportation.passengers p ON b.passenger_id = p.pass...
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.payments ( payment_id.text, application_id.text, citizen_id.text...
[ { "role": "user", "content": "For each service ID, show the average and maximum payment amount for payments made in the last 90 days." }, { "role": "assistant", "content": "SELECT service_id, AVG(amount), MAX(amount) FROM government_services.payments WHERE payment_timestamp >= NOW() - INTERVAL '...
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 me the balance history of wallet '0xdeadbeef' for token at contract '0xaaaa...' ." }, { "role": "assistant", "content": "SELECT block_number, amount\nFROM erc20_balances_historical\nWHERE wallet_address = '0xdeadbeef'\n AND contract_address = '0xaaaa...';" }...
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.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all pairs of customers who live in the same zip_code. Show customer1_id, customer2_id, and zip_code." }, { "role": "assistant", "content": "SELECT\n c1.customer_id AS customer1_id,\n c2.customer_id AS customer2_id,\n c1.zip_code\nFROM insurance.customers c1\...
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.text, token_name.text, token_symbol.text, token_address.t...
[ { "role": "user", "content": "Show me tokens with a 24-hour trading volume over $1,000,000 from DEX pools that also have a positive net flow from smart money addresses. Display the token symbol, chain, 24h volume, and net flow." }, { "role": "assistant", "content": "SELECT tdi.token_symbol, tdi....
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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3...
[ { "role": "user", "content": "List NFTs on 'Ethereum' with name, contract address, token ID, and rarity score." }, { "role": "assistant", "content": "SELECT name, contract_address, token_id, rarity_score FROM nft_metadata WHERE blockchain = 'Ethereum';" }, { "role": "user", "content"...
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, medication_na...
[ { "role": "user", "content": "Show me all medications, their manufacturer, and NDC code for medications manufactured by 'Johnson & Johnson' or 'Roche'." }, { "role": "assistant", "content": "SELECT medication_name, manufacturer, ndc_code FROM healthcare.medications WHERE manufacturer IN ('Johnso...
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": "I need a list of patients along with their chronic diagnosis codes and diagnosis dates." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, d.diagnosis_code, d.diagnosis_date FROM healthcare.patients p JOIN healthcare.diagnoses d ON p.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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "Which players have acquired more than 3 different items in their inventory? Show player_id and the count of unique item_ids." }, { "role": "assistant", "content": "SELECT pi.player_id, COUNT(DISTINCT pi.item_id) AS unique_items\nFROM gaming_technology.player_invento...
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": "Retrieve route_number, description, and distance_km for routes that have a distance greater than the average distance of all routes." }, { "role": "assistant", "content": "SELECT route_number, description, distance_km\nFROM transportation.routes\nWHERE distance_km >...
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.transactions ( transaction_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "For each transaction, show the transaction_id, amount, and the number of other transactions that have the same related_account_id and happened on the same effective_date." }, { "role": "assistant", "content": "SELECT t1.transaction_id, t1.amount, (SELECT COUNT(*) FR...
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 character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Retrieve the product_id, product_name, base_premium, and created_at for all active insurance products with a base_premium greater than 1000, ordered by base_premium descending." }, { "role": "assistant", "content": "SELECT\n product_id,\n product_name,\n base_pre...
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": "Get all non-smoking rooms with status 'Available'." }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number, floor\nFROM hospitality_technology.rooms\nWHERE is_smoking = FALSE\n AND status = 'Available';" }, { "role": "user", "con...
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.employees ( employee_id.text, agency_id.text, first_name.text, l...
[ { "role": "user", "content": "For each access level, count the number of employees. Return access_level and the corresponding employee_count." }, { "role": "assistant", "content": "SELECT access_level, COUNT(*) AS employee_count FROM government_services.employees GROUP BY access_level;" } ]
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, property_name text, address_li...
[ { "role": "user", "content": "Show me the property ID, name, and creation date for all properties created after January 1, 2022." }, { "role": "assistant", "content": "SELECT property_id, property_name, created_at FROM hospitality_technology.properties WHERE created_at >= '2022-01-01';" }, {...
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 usernames of users who participate in any group chat and also have a private profile. Include the name of the group chat." }, { "role": "assistant", "content": "SELECT DISTINCT\n U.username,\n C.group_name\nFROM\n social_media.users AS U\nJOIN\n soc...
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.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all inactive customers from Texas who were created in the last 2 years, showing their full names and creation dates." }, { "role": "assistant", "content": "SELECT first_name, last_name, created_at FROM insurance.customers WHERE state = 'Texas' AND status = 'Ina...
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": "Find all users who have wallets but have never logged any actions, along with their wallet creation date." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, w.created_at AS wallet_created_at FROM trading_platform.users u JOIN trading_platform.wallets ...
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.text, first_name.text, last_name.text, specialty.text...
[ { "role": "user", "content": "Retrieve prescription_id, medication_name, and insurance plan_name for all prescriptions." }, { "role": "assistant", "content": "SELECT p.prescription_id,\n m.medication_name,\n ip.plan_name\nFROM healthcare.prescriptions p\nJOIN healthcare.medications m...
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 text, patient_id text, doctor_id text, appo...
[ { "role": "user", "content": "Get the total number of appointments grouped by status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS appointment_count\nFROM healthcare.appointments\nGROUP BY status;" }, { "role": "user", "content": "Now filter to include on...
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 all passengers born before 1990 with their first and last names and email addresses." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM transportation.passengers WHERE date_of_birth < '1990-01-01';" }, { "role": "user", ...
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.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_pro...
[ { "role": "user", "content": "Give me the website for the insurance plan named 'Family Advantage'." }, { "role": "assistant", "content": "SELECT website FROM healthcare.insurance_plans WHERE plan_name = 'Family Advantage';" } ]
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.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_...
[ { "role": "user", "content": "Show me the number of direct replies each top-level comment has on post 'P200'." }, { "role": "assistant", "content": "SELECT c.comment_id, COUNT(r.comment_id) AS reply_count FROM comments AS c LEFT JOIN comments AS r ON r.parent_comment_id = c.comment_id WHERE c.po...
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, patient_id, and doctor_id for all diagnoses with status 'Pending' and is_chronic set to TRUE." }, { "role": "assistant", "content": "SELECT diagnosis_id, patient_id, doctor_id FROM healthcare.diagnoses WHERE status = 'Pending' AND is_chronic =...
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.notifications ( notification_id.text, citizen_id.text, applicati...
[ { "role": "user", "content": "List the message subjects for all notifications sent via the 'Push' channel that have a 'Sent' status." }, { "role": "assistant", "content": "SELECT message_subject FROM government_services.notifications WHERE channel = 'Push' AND status = 'Sent';" } ]
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.guests ( guest_id character varying(64) NOT NULL, first_name ...
[ { "role": "user", "content": "Find all guests who live in the same city and list each guest's name along with the name of another guest in that city." }, { "role": "assistant", "content": "SELECT g1.first_name || ' ' || g1.last_name AS guest_name,\n g2.first_name || ' ' || g2.last_name AS ...
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.text, user_id.text, content.text, media_url.text, media...
[ { "role": "user", "content": "How many followers does each user have? Show user_id and follower_count." }, { "role": "assistant", "content": "SELECT following_user_id AS user_id, COUNT(*) AS follower_count\nFROM social_media.follows\nGROUP BY following_user_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 smart_money_token_performance ( token_address character varying(100) NOT NULL, token...
[ { "role": "user", "content": "Which token on the Ethereum chain had the highest realized ratio last quarter? Show the symbol, realized ratio, and ROI." }, { "role": "assistant", "content": "SELECT token_symbol, realized_ratio, roi FROM smart_money_token_performance WHERE chain = 'Ethereum' AND d...
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 all active SUI coins (status 'exists') with their `coin_type`, `symbol`, `name`, and the total balance across all owners." }, { "role": "assistant", "content": "SELECT sc.coin_type,\n sm.symbol,\n sm.name,\n SUM(CAST(sc.balance AS bigint)) AS ...
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.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id...
[ { "role": "user", "content": "How many unique hashtags are linked to each post? Return post_id and hashtag_count." }, { "role": "assistant", "content": "SELECT post_id, COUNT(DISTINCT hashtag_id) AS hashtag_count\nFROM social_media.post_hashtags\nGROUP BY post_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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3...
[ { "role": "user", "content": "List SUI coins with owner, coin type, balance, and status." }, { "role": "assistant", "content": "SELECT owner, coin_type, balance, status FROM sui_coins;" }, { "role": "user", "content": "Only include coins where status is 'exists' and balance is greate...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
3