Dataset Viewer
Auto-converted to Parquet Duplicate
system
stringlengths
330
7.84k
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 social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Show all users whose full name starts with 'A' and who have updated their profile in June 2024. Please include their usernames and updated_at timestamps." }, { "role": "assistant", "content": "SELECT username, updated_at FROM social_media.users WHERE full_name ILIKE...
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": "Could you show me the usernames of users who have received likes on their posts, along with the total number of likes each user's posts have received?" }, { "role": "assistant", "content": "SELECT T1.username, count(T3.like_id) AS total_likes_received FROM social_me...
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.policy_beneficiaries ( beneficiary_id.text, policy_id.text, customer_id.te...
[ { "role": "user", "content": "For each relationship type among policy beneficiaries, show the average percentage_share and the count of unique beneficiaries. Please order the results with the highest average percentage_share first." }, { "role": "assistant", "content": "SELECT relationship, AVG(...
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.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(...
[ { "role": "user", "content": "List the names and rarity of all items with a cost above 50." }, { "role": "assistant", "content": "SELECT item_name, rarity\nFROM gaming_technology.in_game_items\nWHERE cost_amount > 50;" }, { "role": "user", "content": "Now, only include items where th...
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": "List all appointments that were marked as 'No-show'. Show appointment ID, patient ID, and appointment time." }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, appointment_time FROM healthcare.appointments WHERE status = 'No-show';" } ]
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 text PRIMARY KEY, user_id text, wallet_id text, a...
[ { "role": "user", "content": "Provide a list of order_id and notification_id for all orders and notifications that occurred on the same day for each user." }, { "role": "assistant", "content": "SELECT o.order_id,\n n.notification_id\nFROM trading_platform.orders o\nJOIN trading_platform.no...
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 character varying(64) NOT NULL, agency_name...
[ { "role": "user", "content": "List the full name of employees and the names of the agencies they work for, but only for employees who are currently employed." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, a.agency_name\nFROM government_ser...
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 all employees whose job titles differ from their direct managers. Provide each employee's full name, their job title, the manager's full name, and the manager's job title." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS emplo...
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.accounts ( account_id text PRIMARY KEY, customer_id text, account...
[ { "role": "user", "content": "Show the average current_principal_balance for each loan_type, and include the number of active loans per type." }, { "role": "assistant", "content": "SELECT loan_type,\n COUNT(*) AS active_loan_count,\n AVG(current_principal_balance) AS avg_balance\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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te...
[ { "role": "user", "content": "How many beneficiaries were added on each unique date?" }, { "role": "assistant", "content": "SELECT DATE(added_at), COUNT(*) FROM insurance.policy_beneficiaries GROUP BY DATE(added_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 social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,...
[ { "role": "user", "content": "List all notifications that are related to group conversations, showing notification ID, recipient user ID, and the associated group name." }, { "role": "assistant", "content": "SELECT n.notification_id, n.recipient_user_id, c.group_name FROM social_media.notificati...
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": "For each item, can you show the total quantity held by all players and the most recent acquisition date for that item?" }, { "role": "assistant", "content": "SELECT item_id, SUM(quantity) AS total_quantity, MAX(acquired_at) AS last_acquired_at\nFROM gaming_technolog...
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.law_firms ( firm_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Show me the name and founding date of every law firm." }, { "role": "assistant", "content": "SELECT firm_name, founded_date\nFROM law_firms;" }, { "role": "user", "content": "Also include the firm's phone number." }, { "role": "assistant", "c...
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, -- unique iden...
[ { "role": "user", "content": "Show the first and last names, date of birth, and phone number for all patients who have provided an emergency contact." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth, phone_number\nFROM healthcare.patients\nWHERE emergency_contac...
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": "List all unique hashtag IDs present in the system." }, { "role": "assistant", "content": "SELECT DISTINCT hashtag_id FROM social_media.post_hashtags;" }, { "role": "user", "content": "And how many users have chosen the 'dark' theme?" }, { "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.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id...
[ { "role": "user", "content": "How many unique patients have been diagnosed with code_type 'ICD-10'?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT patient_id) FROM healthcare.diagnoses WHERE code_type = 'ICD-10';" } ]
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.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "For each security, I want its ticker_symbol, the date when it hit its highest close_price, and the total traded quantity across all trades." }, { "role": "assistant", "content": "SELECT s.ticker_symbol,\n md.data_timestamp AS highest_close_date,\n md.clo...
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 healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ...
[ { "role": "user", "content": "List appointment_id, appointment_time, patient\\u2019s full name, and doctor\\u2019s specialty for all appointments scheduled in the next 7 days." }, { "role": "assistant", "content": "SELECT a.appointment_id, a.appointment_time, p.first_name || ' ' || p.last_name A...
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": "For each driver, show their driver_id, email, and the number of days until their license expires." }, { "role": "assistant", "content": "SELECT driver_id, email, (license_expiry_date - CURRENT_DATE) AS days_until_expiry\nFROM transportation.drivers;" } ]
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": "Give me a list of employees (first and last name) along with the count of appointments they have scheduled." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, COUNT(a.appointment_id) AS appointment_count\nFROM government_services.employees e\nL...
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.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i...
[ { "role": "user", "content": "Show the customer_id and pairs of payment_ids for any customers who have overlapping payment periods." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.payment_id AS payment1_id,\n p2.payment_id AS payment2_id\nFROM insurance.premium_pay...
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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco...
[ { "role": "user", "content": "Which projects that raised funds in 2023 have an associated token, and what are their fundraising amounts, token symbols, and token market caps?" }, { "role": "assistant", "content": "SELECT T1.project_name, T1.investment_value, T2.token_symbol, T2.market_cap FROM p...
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": "I need the average close_price per sector for the last month." }, { "role": "assistant", "content": "SELECT s.sector, AVG(m.close_price) AS avg_close_price\nFROM financial_services.market_data m\nJOIN financial_services.securities s ON m.security_id = s.security_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 healthcare.prescriptions ( prescription_id text, record_id text, patient_id text, do...
[ { "role": "user", "content": "Can you show me all prescriptions along with each patient's policy number and insurance plan ID?" }, { "role": "assistant", "content": "SELECT p.prescription_id, p.patient_id, p.medication_id, pi.policy_number, pi.plan_id\nFROM healthcare.prescriptions p\nJOIN healt...
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, player_id uuid, game_id uuid, ser...
[ { "role": "user", "content": "Show me all game sessions that do not have a score recorded. List the session_id, player_id, game_id, and start_time." }, { "role": "assistant", "content": "SELECT session_id, player_id, game_id, start_time FROM gaming_technology.game_sessions WHERE score IS 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.posts ( post_id.text, user_id.text, content.text, media_url.text, media...
[ { "role": "user", "content": "Show the count of unread notifications per user for notifications related to posts. Return recipient_user_id and unread_count." }, { "role": "assistant", "content": "SELECT recipient_user_id, COUNT(*) AS unread_count\nFROM social_media.notifications\nWHERE target_en...
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": "List all users who have sent messages containing media files in group conversations, showing their username, email, and the group name." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email, c.group_name\nFROM social_media.messages m\nJOIN socia...
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.rooms ( room_id text, property_id text, room_number text, roo...
[ { "role": "user", "content": "List all staff members who have an access level greater than 3, showing their staff ID, first name, and last name." }, { "role": "assistant", "content": "SELECT staff_id, first_name, last_name FROM hospitality_technology.staff WHERE access_level > 3;" }, { "...
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.securities ( security_id.text, ticker_symbol.text, isin_code.text...
[ { "role": "user", "content": "For each sector, could you show the sum of volume and the average close price from market_data, including the sector name?" }, { "role": "assistant", "content": "SELECT s.sector, SUM(md.volume) AS total_volume, AVG(md.close_price) AS avg_close_price\nFROM financial_...
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.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "List each partner lawyer's first_name, last_name along with the count of invoices for the cases they lead." }, { "role": "assistant", "content": "SELECT l.lawyer_id, l.first_name, l.last_name, COUNT(i.invoice_id) AS invoice_count\nFROM legal_services.lawyers l\nJOIN...
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.token_transfers ( transfer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Find pairs of token transfers within the same transaction and for the same token, where the value of one transfer is exactly twice the value of the other. Show the transaction ID, token ID, and both transfer IDs and their values." }, { "role": "assistant", "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 gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, descr...
[ { "role": "user", "content": "Could you list each game_id along with the count of hidden achievements and the count of visible achievements?" }, { "role": "assistant", "content": "SELECT game_id,\n SUM(CASE WHEN hidden THEN 1 ELSE 0 END) AS hidden_count,\n SUM(CASE WHEN NOT hidden TH...
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.applications ( application_id text, citizen_id text, service_id ...
[ { "role": "user", "content": "Show the count of applications submitted per day for the last 7 days. Include the date and application_count, ordered by date ascending." }, { "role": "assistant", "content": "SELECT CAST(submitted_at AS date) AS date,\n COUNT(*) AS application_count\nFROM gov...
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": "Which vehicles have been refueled more than 3 times in the last 30 days? Provide the vehicle_id, make, model, and refuel_count." }, { "role": "assistant", "content": "SELECT v.vehicle_id,\n v.make,\n v.model,\n COUNT(fl.fuel_log_id) AS refuel_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 smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the tok...
[ { "role": "user", "content": "How many distinct tokens did smart money buy on the 'BSC' chain in 2023?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT token_address) AS distinct_tokens_bought\nFROM smart_money_token_inflow\nWHERE type = 1\n AND chain = 'BSC'\n AND to_char(cast(tok...
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": "List all medical records created by doctor 'doctor_001' for patients who had their last medical record on or after '2024-01-01', including record_id, patient_id, record_date, chief_complaint, and doctor_id." }, { "role": "assistant", "content": "SELECT mr.record_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 government_services.employees ( employee_id.text, agency_id.text, first_name.text, l...
[ { "role": "user", "content": "Show a list of departments with more than 5 employees. Include the department name and the count." }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS employee_count\nFROM government_services.employees\nGROUP BY department\nHAVING COUNT(*) > 5;" }...
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_profit ( address text, rank numeric, profit numeric, roi numeric, realiz...
[ { "role": "user", "content": "List smart money addresses on the 'Arbitrum' chain with a realized ratio between 0.5 and 0.8 and positive profit. Show address, profit, and realized_ratio." }, { "role": "assistant", "content": "SELECT address, profit, realized_ratio FROM smart_money_profit WHERE ch...
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.claims ( claim_id text, policy_id text, customer_id text, incident_date ti...
[ { "role": "user", "content": "What is the total estimated_loss and average settlement_amount for all claims with status 'Approved'?" }, { "role": "assistant", "content": "SELECT SUM(estimated_loss) AS total_estimated_loss,\n AVG(settlement_amount) AS average_settlement\nFROM insurance.clai...
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": "Show me details of all premium payments made by customers for policies that had any claim filed in 2023." }, { "role": "assistant", "content": "SELECT pp.payment_id, pp.customer_id, pp.policy_id, pp.payment_date, pp.amount_paid\nFROM insurance.premium_payments pp\nW...
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, product_na...
[ { "role": "user", "content": "List the product_name and description for all active products." }, { "role": "assistant", "content": "SELECT product_name, description FROM insurance.insurance_products WHERE is_active = true;" }, { "role": "user", "content": "Can you also include the pr...
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": "Show me the number of lawyers for each law firm, along with the firm's ID." }, { "role": "assistant", "content": "SELECT firm_id, COUNT(*) AS lawyer_count FROM legal_services.lawyers GROUP BY firm_id;" }, { "role": "user", "content": "Can you also 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 legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case...
[ { "role": "user", "content": "Which invoices were issued in March 2024, and what are their invoice numbers, total amounts, and due dates?" }, { "role": "assistant", "content": "SELECT invoice_number, total_amount, due_date FROM legal_services.invoices WHERE issue_date >= '2024-03-01' AND issue_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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "Show the top 10 most expensive fuel log entries including fuel_log_id, vehicle make and model, location name and city, and total_cost." }, { "role": "assistant", "content": "SELECT f.fuel_log_id,\n v.make,\n v.model,\n loc.name AS location_name,\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 trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo...
[ { "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 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, -- unique ...
[ { "role": "user", "content": "For each depot, show the depot name, city, number of active vehicles, and average capacity." }, { "role": "assistant", "content": "SELECT loc.name AS depot_name, loc.city, COUNT(v.vehicle_id) AS active_vehicle_count, ROUND(AVG(v.capacity),2) AS avg_capacity FROM 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 legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w...
[ { "role": "user", "content": "List all law firms that do not have a managing partner listed." }, { "role": "assistant", "content": "SELECT firm_name, phone, address, founded_date\nFROM legal_services.law_firms\nWHERE managing_partner_id IS 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.appointments ( appointment_id character varying(64) NOT NULL, patient_id ...
[ { "role": "user", "content": "Retrieve all appointments for doctor 'doc123' scheduled in April 2024, showing appointment ID, patient ID, time, and status." }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, appointment_time, status FROM healthcare.appointments WHERE doctor_...
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": "Which users have participated in group chats and also liked comments? Please show their usernames, the group name, and the comment_id they've liked." }, { "role": "assistant", "content": "SELECT u.username, c.group_name, l.comment_id\nFROM social_media.conversation_...
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": "List all in-game items of type 'Consumable', showing for each item the item name, cost amount, and the total number of players who have that item in their inventory." }, { "role": "assistant", "content": "SELECT i.item_name, i.cost_amount, COUNT(DISTINCT pi.player_i...
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, username character vary...
[ { "role": "user", "content": "Show the usernames and email addresses of users who have commented on their own posts." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email\nFROM social_media.comments c\nJOIN social_media.users u ON c.user_id = u.user_id\nJOIN social_media.pos...
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": "Retrieve the title and release_date of all games on the 'PC' platform." }, { "role": "assistant", "content": "SELECT title, release_date\nFROM gaming_technology.games\nWHERE platform = 'PC';" }, { "role": "user", "content": "Now exclude any games release...
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": "Can you narrow this down to only show cases where the case type is 'Criminal'?" }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Crimin...
You are an 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, -- uni...
[ { "role": "user", "content": "Find guests who have made at least one payment using a 'CreditCard'. List their full name (first and last name) and email address." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.email FROM hospitality_technology.guests 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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex...
[ { "role": "user", "content": "List all policies that expired in the last 30 days, along with their product IDs and premium amounts." }, { "role": "assistant", "content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE end_date BETWEEN DATE_SUB(CURRENT_DATE, INTERVAL 3...
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.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id....
[ { "role": "user", "content": "List all games released in 2023 along with their titles, platforms, and the names of their developers." }, { "role": "assistant", "content": "SELECT g.game_id, g.title, g.platform, d.name AS developer_name\nFROM gaming_technology.games g\nJOIN gaming_technology.deve...
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.agents ( agent_id text, first_name text, last_name text, agency_name text,...
[ { "role": "user", "content": "Show me each payment_method and the number of premium payments made using that method, sorted by the count in descending order." }, { "role": "assistant", "content": "SELECT payment_method, COUNT(*) AS payment_count FROM insurance.premium_payments GROUP BY payment_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "List all guests who have made a reservation for a room type with a base rate over 300, showing their first name, last name, the property name, and the room type name." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T4.property_name, T3.typ...
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 character varying(64) NOT NULL, user_id character varying(6...
[ { "role": "user", "content": "Can you show me all wallet address pairs that are owned by the same user but have different private keys, along with their wallet_ids and user_id?" }, { "role": "assistant", "content": "SELECT w1.user_id, w1.wallet_id AS wallet_id_1, w1.address AS address_1, w1.priv...
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": "Find pairs of reservations at the same property where the second check-in is within 7 days after the first check-out. Return first_reservation, second_reservation, and gap_days." }, { "role": "assistant", "content": "SELECT r1.reservation_id AS first_reservation,\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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "Find all beneficiaries added in the last 7 days, include beneficiary_id, policy_id, and percentage_share, sorted by percentage_share descending." }, { "role": "assistant", "content": "SELECT beneficiary_id, policy_id, percentage_share\nFROM insurance.policy_benefici...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty...
[ { "role": "user", "content": "특정 공급업체 ID로 공급업체의 세부 정보를 조회하고 싶습니다. 모든 필드를 포함해 주세요." }, { "role": "assistant", "content": "GET suppliers/_doc/{supplier_id}" }, { "role": "user", "content": "만약 여러 공급업체 ID를 한 번에 조회하고 싶다면 어떻게 해야 하나요?" }, { "role": "assistant", "content": "GET ...
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": "What is the average ROI and average realized_ratio for each chain?" }, { "role": "assistant", "content": "SELECT chain,\n AVG(roi) AS avg_roi,\n AVG(realized_ratio) AS avg_realized_ratio\nFROM smart_money_token_performance\nGROUP BY chain;" }, { ...
You are an 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 wallet addresses holding NFTs for contract address '0xabcdef...'. Show the wallet address and amount held." }, { "role": "assistant", "content": "SELECT wallet_address, amount, token_id FROM nft_holders WHERE contract_address = '0xabcdef...';" }, { ...
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.services ( service_id text PRIMARY KEY, agency_id text, service_...
[ { "role": "user", "content": "Find for each category the service with the highest standard_fee and the service with the lowest standard_fee. Display the category, highest_fee_service, and lowest_fee_service." }, { "role": "assistant", "content": "SELECT m.category,\n s_max.service_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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.tex...
[ { "role": "user", "content": "Show the policy_id, policy_number, and premium_amount for all policies with a coverage_limit less than 100,000." }, { "role": "assistant", "content": "SELECT policy_id, policy_number, premium_amount\nFROM insurance.policies\nWHERE coverage_limit < 100000;" } ]
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.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "I need the case_number, client's full name, case_type, and status for all cases." }, { "role": "assistant", "content": "SELECT c.case_number,\n cl.first_name || ' ' || cl.last_name AS client_name,\n c.case_type,\n c.status\nFROM legal_services.case...
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, username text, email text, password_hash...
[ { "role": "user", "content": "Retrieve the top 5 players by the number of distinct achievements unlocked. Show player_id and distinct_unlocks." }, { "role": "assistant", "content": "SELECT p.player_id, COUNT(DISTINCT pa.achievement_id) AS distinct_unlocks\nFROM gaming_technology.players p\nJOIN ...
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_inflow ( token_address character varying(100) NOT NULL, -- the tok...
[ { "role": "user", "content": "For each chain, show the total token_amount and usd_value for selling transactions (type=2)." }, { "role": "assistant", "content": "SELECT chain, SUM(token_amount) AS total_sold_amount, SUM(usd_value) AS total_sold_usd_value\nFROM smart_money_token_inflow\nWHERE typ...
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.time_entries ( entry_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Calculate the total billable hours spent by each lawyer for entries in March 2024." }, { "role": "assistant", "content": "SELECT lawyer_id,\n SUM(hours_spent) AS total_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\n AND date_worked BETWEEN...
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": "For each user, show the date of their earliest and latest wallet creation." }, { "role": "assistant", "content": "SELECT user_id,\n MIN(created_at) AS first_created,\n MAX(created_at) AS last_created\nFROM web3.wallets\nGROUP BY user_id;" }, { "r...
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.games ( game_id uuid, title text, developer_id uuid, publisher_id ...
[ { "role": "user", "content": "Show total session duration and average score for each player across all their sessions. Display the player ID, total duration, and average score." }, { "role": "assistant", "content": "SELECT player_id, SUM(duration_seconds) AS total_duration, AVG(score) AS average...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
1