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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern...
[ { "role": "user", "content": "Count the number of servers for each possible status recorded in the servers table.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(server_id) AS server_count FROM gaming_technology.servers GROUP BY status;", "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_basic_info ( coin_id text, token_name text, token_symbol text, token_address t...
[ { "role": "user", "content": "For the 'DeFi' narrative, what is the average ROI and the total net inflow (usd_value where type=1) from smart money token inflow?", "sql": null }, { "role": "assistant", "content": "SELECT AVG(sm.roi) AS avg_roi, SUM(smt.usd_value) AS total_net_inflow\nFROM sma...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. 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 CREA...
[ { "role": "user", "content": "What is the total number of vacation days taken by employee with ID 'EMP101' in the past year?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the vacation days taken by an employee as this data is not stored in ...
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": "For each user, show their username and how many unique conversations they have sent at least one message in where the conversation is a group chat.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, COUNT(DISTINCT m.conversation_id) AS group_...
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": "Get the total number of participants per conversation along with the number of participants who have private profiles.", "sql": null }, { "role": "assistant", "content": "SELECT cp.conversation_id, COUNT(cp.user_id) AS total_participants, SUM(CASE WHEN us.privat...
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": "Show all beneficiaries added in 2024. Include beneficiary_id, full name, relationship, percentage_share, and the added_at timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name || ' ' || last_name AS full_name, relations...
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": "Which agents have sold policies with a coverage limit over 1,000,000, and what are the policy numbers and their respective coverage limits?", "sql": null }, { "role": "assistant", "content": "SELECT agent_id, policy_number, coverage_limit FROM insurance.policies...
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": "Find all pairs of partners who share the same specialization but work at different firms.", "sql": null }, { "role": "assistant", "content": "SELECT l1.first_name || ' ' || l1.last_name AS partner_one,\n l2.first_name || ' ' || l2.last_name AS partner_two,...
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, ...
[ { "role": "user", "content": "List each property name with the count of active staff members currently employed at that property.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_name, COUNT(s.staff_id) AS active_staff_count\nFROM hospitality_technology.properties p\nLEF...
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": "How many cases are associated with each unique lead lawyer ID? Show the lead lawyer ID and the count of cases, but only for lawyers who lead at least 5 cases. Sort the results by the case count in descending order.", "sql": null }, { "role": "assistant", "conten...
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": "List each server's name and region along with the total number of sessions hosted on that server.", "sql": null }, { "role": "assistant", "content": "SELECT s.server_name,\n s.region,\n COUNT(gs.session_id) AS session_count\nFROM gaming_technology.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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "Show each player with their player_id, username, the number of distinct in-game items they own, and the total quantity of those items.", "sql": null }, { "role": "assistant", "content": "```sql\nSELECT\n p.player_id,\n p.username,\n COUNT(DISTINCT i.item_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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Get the review comments along with the reservation check-in and check-out dates, and the guest's first and last name.", "sql": null }, { "role": "assistant", "content": "SELECT rev.comment, res.check_in_date, res.check_out_date, g.first_name, g.last_name\nFROM h...
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.documents ( document_id text, application_id text, citizen_id te...
[ { "role": "user", "content": "List the full names of employees who have verified 'Proof of Identity' documents.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.employees AS T1 JOIN government_services.documents AS T2 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 legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "List the invoice_number, total_amount, the full name of the client, and the case_number for all invoices.", "sql": null }, { "role": "assistant", "content": "SELECT i.invoice_number, i.total_amount, c.first_name || ' ' || c.last_name AS client_full_name, cs.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 // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_...
[ { "role": "user", "content": "Can you retrieve the total number of train cars for each train in the database?", "sql": null }, { "role": "assistant", "content": "MATCH (t:Train)<-[:PART_OF_TRAIN]-(tc:TrainCar)\nRETURN t.train_id, t.train_number, COUNT(tc) AS total_cars\nORDER BY t.train_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 social_media.user_settings ( setting_id text, user_id text, theme text, email_notifi...
[ { "role": "user", "content": "Show the user IDs of all users whose theme is set to 'blue'.", "sql": null }, { "role": "assistant", "content": "SELECT user_id FROM social_media.user_settings WHERE theme = 'blue';", "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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t...
[ { "role": "user", "content": "List the order ID, type, and quantity for all orders placed using the wallet with ID 'wallet123'.", "sql": null }, { "role": "assistant", "content": "SELECT order_id, order_type, quantity FROM orders WHERE wallet_id = 'wallet123'", "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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number...
[ { "role": "user", "content": "Get all appointments scheduled in the next 7 days, showing the appointment_id, start_time, end_time, subject, and associated case_name. Only include appointments with status 'Scheduled', and sort by start_time ascending.", "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 financial_services.accounts ( account_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Show me a summary listing each customer's full name and the number of accounts they have, broken down by account status.", "sql": null }, { "role": "assistant", "content": "SELECT\n c.first_name,\n c.last_name,\n a.status,\n COUNT(a.account_id) AS account_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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var...
[ { "role": "user", "content": "List the agent ID, first name, last name, hire date, and commission rate for all agents hired in the year 2023 with a commission rate less than 0.06.", "sql": null }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, hire_date, commissio...
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 character varying(64) NOT NULL, employee_id chara...
[ { "role": "user", "content": "How many passengers were born in each year? Please show the birth year and the count.", "sql": null }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM date_of_birth) AS birth_year , COUNT(*) AS passenger_count FROM transportation.passengers WHERE da...
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.staff ( staff_id character varying(64) NOT NULL, property_id ...
[ { "role": "user", "content": "What is the number of active staff members in each position?", "sql": null }, { "role": "assistant", "content": "SELECT position,\n COUNT(*) AS staff_count\nFROM hospitality_technology.staff\nWHERE is_active = true\nGROUP BY position;", "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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "Show me each user's username, their wallet address, and the total quantity of open orders they have placed, along with the name of the asset for each order.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, w.address, o.asset_id, SUM(o.quant...
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": "What was the total quantity and total cost of 'Gasoline' fuel logged in the year 2023?", "sql": null }, { "role": "assistant", "content": "SELECT SUM(quantity) , SUM(total_cost) FROM transportation.fuel_logs WHERE fuel_type = 'Gasoline' AND EXTRACT(YEAR FROM ...
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": "Count the number of assets for each asset type.", "sql": null }, { "role": "assistant", "content": "SELECT type, COUNT(*) FROM trading_platform.assets GROUP BY 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 financial_services.employees ( employee_id character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "List employees whose job title is different from their manager's job title, showing the employee's full name and their manager's full name.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, m.first_name AS manager_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 financial_services.customers ( customer_id text, first_name text, last_name text, da...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name, email) who were born after 1985 (date_of_birth > '1985-12-31') and have an email address ending with '@yahoo.com', along with their city and state information.", "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 financial_services.accounts ( account_id.text, customer_id.text, account_number.text...
[ { "role": "user", "content": "List all accounts opened in the last year. Show account_id, account_type, status, and opened_date.", "sql": null }, { "role": "assistant", "content": "SELECT account_id, account_type, status, opened_date FROM financial_services.accounts WHERE opened_date >= CURR...
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 character varying(100) NOT NULL, rank INT, profit numer...
[ { "role": "user", "content": "What is the average ROI for all smart money addresses on the Binance chain?", "sql": null }, { "role": "assistant", "content": "SELECT AVG(roi) FROM smart_money_profit WHERE chain = 'Binance';", "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.follows ( follow_id text, follower_user_id text, following_user_id text...
[ { "role": "user", "content": "Find pairs of user IDs (A, B) such that user A follows user B, and user B also follows user A (mutual follows). List user A's ID and user B's ID.", "sql": null }, { "role": "assistant", "content": "SELECT T1.follower_user_id AS user_a, T1.following_user_id AS 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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,...
[ { "role": "user", "content": "Show me the full name of each citizen and the status of their latest application, along with the name of the service and the agency responsible for that service.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.status, s.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 gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, descr...
[ { "role": "user", "content": "Find all pairs of achievement unlocks and item acquisitions by the same player where the item was acquired after the achievement was unlocked. List player_id, achievement_id, unlocked_at, item_id, and acquired_at.", "sql": null }, { "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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c...
[ { "role": "user", "content": "Retrieve the first and last names of passengers along with the total sum of fares they've paid for bookings with status 'Completed', ordered by the sum descending.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, SUM(b.fare) ...
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": "Find pairs of players from the same country who have different last login dates. Show their usernames, country code, and last login dates. Exclude pairs where either last login date is null.", "sql": null }, { "role": "assistant", "content": "SELECT p1.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 financial_services.customers ( customer_id character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "List all distinct pairs of customers who live in the same zip_code, without duplicating pairs.", "sql": null }, { "role": "assistant", "content": "SELECT\n c1.customer_id AS customer_a,\n c2.customer_id AS customer_b,\n c1.zip_code\nFROM financial_services.cu...
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.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for...
[ { "role": "user", "content": "Show the distribution of total supply for tokens, grouped into ranges like < 1 million, 1 million to 1 billion, and > 1 billion. Count how many tokens fall into each range.", "sql": null }, { "role": "assistant", "content": "SELECT CASE WHEN total_supply < 10000...
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": "Find all service locations that currently have no appointments scheduled. Display the location name and contact phone number.", "sql": null }, { "role": "assistant", "content": "SELECT sl.location_name,\n sl.contact_phone\nFROM government_services.service_...
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 character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show me document names and upload timestamps for documents linked to cases that were opened after January 1, 2023.", "sql": null }, { "role": "assistant", "content": "SELECT T1.document_name, T1.upload_timestamp FROM documents AS T1 JOIN cases AS T2 ON T1.case_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 hospitality_technology.reservations ( reservation_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "List all reservations where the number of adults is greater than 2, showing reservation_id, guest_id, and the total_amount.", "sql": null }, { "role": "assistant", "content": "SELECT reservation_id, guest_id, total_amount\nFROM hospitality_technology.reservation...
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": "List all active agents with the number of open claims they've handled and the average settlement amount for their closed claims. Include agent_id, first_name, last_name, open_claims_count, and avg_settlement_closed.", "sql": null }, { "role": "assistant", "conte...
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, first_name.text, last_name.text, da...
[ { "role": "user", "content": "Retrieve all loans along with the corresponding customer's first and last name and the current principal balance.", "sql": null }, { "role": "assistant", "content": "SELECT l.loan_id, c.first_name, c.last_name, l.current_principal_balance\nFROM financial_service...
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.smart_contracts ( contract_id.text, creator_address.text, code.text, time...
[ { "role": "user", "content": "Find all smart contracts where the contract code contains the keyword 'proxy'.", "sql": null }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE code LIKE '%proxy%';", "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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi...
[ { "role": "user", "content": "Show the full name and job title of employees whose job title includes 'Manager' and who do not have a listed manager.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, job_title FROM government_services.employees WHERE job_title ...
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": "Show the average base rate and maximum occupancy of room types grouped by property_type.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_type,\n AVG(rt.base_rate) AS avg_base_rate,\n MAX(rt.max_occupancy) AS max_occupancy\nFR...
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 character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "For each customer, show their full name and the average amount of all transactions linked to any of their accounts.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS customer_full_name, AVG(t.amount) AS average_tran...
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": "Show the usernames of users who have used any hashtag in their posts, along with the tag name.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T4.tag_name FROM social_media.users AS T1 JOIN posts AS T2 ON T1.user_id = T2.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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "Provide a list of all vehicles along with the total maintenance cost they have incurred, and show the make and model of each vehicle.", "sql": null }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, SUM(m.cost) AS total_maintenance_cost\...
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.", "sql": null }, { "role": "assistant", "content": "SELECT session_id, player_id, game_id, start_time FROM gaming_technology.game_sessions WHERE...
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.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for...
[ { "role": "user", "content": "For each token, show its token_id, decimals, and the average total_supply of all tokens with the same decimals.", "sql": null }, { "role": "assistant", "content": "SELECT t.token_id,\n t.decimals,\n avg_data.avg_total_supply\nFROM web3.tokens t\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 hospitality_technology.room_types ( room_type_id text, property_id text, type_name t...
[ { "role": "user", "content": "List all room types along with the name of the property they belong to. Show the room type name, property name, and base rate.", "sql": null }, { "role": "assistant", "content": "SELECT t1.type_name, t2.property_name, t1.base_rate FROM hospitality_technology.roo...
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": "How many likes has post 'P789' received in total?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS total_likes\nFROM social_media.likes\nWHERE post_id = 'P789';", "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, property_name text, address_li...
[ { "role": "user", "content": "Show me the payment amount and the name of the property associated with each payment record.", "sql": null }, { "role": "assistant", "content": "SELECT\n p.amount,\n prop.property_name\nFROM hospitality_technology.payments AS p\nJOIN hospitality_technology.res...
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, address character varyi...
[ { "role": "user", "content": "For each user, count the number of distinct smart contracts they have called. Return user_id, username, and contract_count, ordered by contract_count descending.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id,\n u.username,\n 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 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.", "sql": null }, { "role": "assistant", "content": "SELECT payment_method, COUNT(*) AS payment_count FROM insurance.premium_payments G...
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": "Get the number of log entries for each user where the action contains 'fail' in the last 30 days.", "sql": null }, { "role": "assistant", "content": "SELECT l.user_id, COUNT(*) AS fail_count\nFROM trading_platform.logs l\nWHERE l.action ILIKE '%fail%' AND l.logg...
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 character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "Calculate the average number of days cases stay open before being closed, grouped by case type. Only consider cases that have a date closed.", "sql": null }, { "role": "assistant", "content": "SELECT case_type, AVG(DATE_PART('day', date_closed - date_opened)) 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.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_...
[ { "role": "user", "content": "Show me all comments that are replies to other comments, along with the ID of the parent comment and the post ID.", "sql": null }, { "role": "assistant", "content": "SELECT comment_id, parent_comment_id, post_id\nFROM social_media.comments\nWHERE parent_comment_...
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 each doctor's ID, first name, last name, and the total number of appointments they have. Display columns doctor_id, first_name, last_name, and appointment_count.", "sql": null }, { "role": "assistant", "content": "SELECT d.doctor_id,\n d.first_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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h...
[ { "role": "user", "content": "Show the usernames of all users who were created in 2024.", "sql": null }, { "role": "assistant", "content": "SELECT username\nFROM social_media.users\nWHERE EXTRACT(YEAR FROM created_at) = 2024;", "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 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.", "sql": null }, { "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;", ...
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 PRIMARY KEY, client_id text, lawye...
[ { "role": "user", "content": "Show me the subjects and start times of all appointments for a specific client, along with the assigned lawyer ID.", "sql": null }, { "role": "assistant", "content": "SELECT subject, start_time, lawyer_id FROM legal_services.appointments WHERE 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.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List each property with the total number of active staff members and the average base rate of its room types.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, COUNT(s.staff_id) AS active_staff_count, ROUND(AVG(rt.base_ra...
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.services ( service_id text, property_id text, service_name te...
[ { "role": "user", "content": "Show me all services that have a price above 100, including their service_id, service_name, and category.", "sql": null }, { "role": "assistant", "content": "SELECT service_id, service_name, category\nFROM hospitality_technology.services\nWHERE price > 100;", ...
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 character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Provide the count of diagnoses by status.", "sql": null }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS count\nFROM healthcare.diagnoses\nGROUP BY status;", "sql": null }, { "role": "user", "content": "Now only include st...
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 NOT NULL DEFAULT gen_random_uuid(), -- un...
[ { "role": "user", "content": "Show me the average number of current players per server for each region.", "sql": null }, { "role": "assistant", "content": "SELECT region, AVG(current_players) AS avg_current_players\nFROM gaming_technology.servers\nGROUP BY region;", "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 varch...
[ { "role": "user", "content": "List the top 5 Avalanche tokens by total transfer volume in token_activities_avalanche.", "sql": null }, { "role": "assistant", "content": "SELECT tick, SUM(amt) AS total_volume\nFROM token_activities_avalanche\nGROUP BY tick\nORDER BY total_volume DESC\nLIMIT 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 gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFA...
[ { "role": "user", "content": "Show me all pairs of achievements unlocked by the same player on the same calendar date, returning player_id, achievement_id as achv1, achv2, and the date.", "sql": null }, { "role": "assistant", "content": "SELECT pa1.player_id,\n DATE(pa1.unlocked_at) 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.", "sql": null }, { "role": "assistant", "content": "SELECT policy_id, policy_number, premium_amount\nFROM insurance.policies\nWHERE coverage_limit < 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 legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "Show me all clients along with the total number of invoices they have and the sum of total_amount for those invoices.", "sql": null }, { "role": "assistant", "content": "SELECT cl.client_id, cl.first_name, cl.last_name, COUNT(inv.invoice_id) AS invoice_count, SU...
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 wallet addresses that hold SUI coins with a balance greater than 1,000,000. Please show the coin_type as well.", "sql": null }, { "role": "assistant", "content": "SELECT owner, coin_type, balance\nFROM sui_coins\nWHERE CAST(balance AS DECIMAL) > 1000000...
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 the earliest and latest creation timestamps recorded in the posts table.", "sql": null }, { "role": "assistant", "content": "SELECT MIN(created_at), MAX(created_at) FROM social_media.posts", "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 legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "How many time entries does each client have? Provide the client's first and last name along with the count, sorted by count descending.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(te.entry_id) AS entry_count FROM l...
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 PRIMARY KEY, title text, developer_id uuid, p...
[ { "role": "user", "content": "Show item_id, item_name, and the damage attribute extracted from attributes JSON for items of type 'Weapon'.", "sql": null }, { "role": "assistant", "content": "SELECT item_id,\n item_name,\n (attributes->>'damage')::numeric AS damage\nFROM gaming_te...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // db.createCollection('passengers') // Optional: db.passengers.createIndex({ passenger_id: 1 }, ...
[ { "role": "user", "content": "Can you show me the total number of passengers registered in the database?", "sql": null }, { "role": "assistant", "content": "db.passengers.countDocuments({})", "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_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t...
[ { "role": "user", "content": "Which narratives saw the highest average net flow from smart money performance this year, and what is the average roi for those narratives along with the total number of tokens in each?", "sql": null }, { "role": "assistant", "content": "SELECT tbi.narrative, AV...
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": "Provide a summary for each transaction ID, showing the total amount of all its unspent UTXOs.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, SUM(amount) FROM utxos WHERE spent = false GROUP BY transaction_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "List NFTs minted on Ethereum after block 18000000, showing contract address, token ID, name, and mint_block_number.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, token_id, name, mint_block_number FROM nft_metadata WHERE blockchain ...
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 each item's name, type, and rarity, along with the currency in which it can be purchased and its cost.", "sql": null }, { "role": "assistant", "content": "SELECT item_name, item_type, rarity, cost_currency, cost_amount FROM gaming_technology.in_game_items;"...
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.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for...
[ { "role": "user", "content": "Show all token symbols along with the names of any other tokens on the same contract address.", "sql": null }, { "role": "assistant", "content": "SELECT t1.token_symbol, t2.token_name AS other_token_name, t1.contract_address\nFROM web3.tokens t1\nJOIN web3.token...
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 PRIMARY KEY, title text, developer_id uuid, p...
[ { "role": "user", "content": "Which games were developed by companies in 'United Kingdom'? List the game title and the developer's name.", "sql": null }, { "role": "assistant", "content": "SELECT T1.title, T2.name FROM gaming_technology.games AS T1 JOIN gaming_technology.developers AS T2 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 legal_services.documents ( document_id text PRIMARY KEY, case_id text, document_name...
[ { "role": "user", "content": "Show all documents where the document description includes the word 'summary'. Please display their document name and type.", "sql": null }, { "role": "assistant", "content": "SELECT document_name, document_type FROM legal_services.documents WHERE description IL...
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 character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "For each security traded in April 2024, calculate the total quantity traded and the maximum close_price from market_data for the same period.", "sql": null }, { "role": "assistant", "content": "SELECT t.security_id,\n SUM(t.quantity) AS total_quantity,\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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,...
[ { "role": "user", "content": "List all ERC20 tokens from the `token_metas` table that have a total supply greater than 1 followed by 21 zeros. Show their contract address, symbol, name, and total supply.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, symbol, 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, agency_name text, jurisdiction_level ...
[ { "role": "user", "content": "Can you show me a list of all agencies along with their parent agency names?", "sql": null }, { "role": "assistant", "content": "SELECT a.agency_id, a.agency_name, pa.agency_name AS parent_agency_name\nFROM government_services.agencies a\nLEFT JOIN government_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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern...
[ { "role": "user", "content": "List the usernames and status of all players who have 'de' as their country_code.", "sql": null }, { "role": "assistant", "content": "SELECT username, status FROM gaming_technology.players WHERE country_code = 'DE';", "sql": null }, { "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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "For each property, compute the average price and count of available services grouped by department.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, s.department, COUNT(*) AS service_count, AVG(s.price) AS avg_price\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 healthcare.doctors ( doctor_id character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "List the description and diagnosis date for all diagnoses that are marked as chronic and were made in the year 2023.", "sql": null }, { "role": "assistant", "content": "SELECT description, diagnosis_date FROM healthcare.diagnoses WHERE is_chronic = true AND diag...
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": "Find overlapping appointments for each doctor. Return doctor_id, appointment_id_1, appointment_id_2, and overlap duration in minutes.", "sql": null }, { "role": "assistant", "content": "SELECT a.doctor_id,\n a.appointment_id AS appointment_id_1,\n b....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "Retrieve each patient's full name, total number of appointments, and date of their most recent appointment.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name || ' ' || p.last_name AS patient_name, COUNT(a.appointment_id) AS appointment_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.invoices ( invoice_id.text, invoice_number.text, client_id.text, case...
[ { "role": "user", "content": "I want to find all pairs of invoices belonging to the same client. Show me the client_id, the invoice_number for the earlier invoice and the invoice_number for the later invoice.", "sql": null }, { "role": "assistant", "content": "SELECT i1.client_id,\n i1...
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 route, show the route_number, origin and destination location names with their cities, and the average departure delay (in minutes) for trips where actual_departure was later than scheduled_departure.", "sql": null }, { "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 web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char...
[ { "role": "user", "content": "For each block that contains more than 5 transactions, list the block number, the total sum of values transferred within that block, and the average gas used per transaction in that block.", "sql": null }, { "role": "assistant", "content": "SELECT block_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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_nam...
[ { "role": "user", "content": "Retrieve the first name, last name, and email for all guests.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM hospitality_technology.guests;", "sql": null }, { "role": "user", "content": "Can you also ...
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": "Count the number of trips for each route type.", "sql": null }, { "role": "assistant", "content": "SELECT R.type, COUNT(T.trip_id) FROM transportation.trips AS T JOIN transportation.routes AS R ON T.route_id = R.route_id GROUP BY R.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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name ...
[ { "role": "user", "content": "List all unique service categories and the count of services in each category.", "sql": null }, { "role": "assistant", "content": "SELECT category, COUNT(service_id) FROM hospitality_technology.services GROUP BY category;", "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 web3.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address t...
[ { "role": "user", "content": "For each block, compute the total number of transactions and the average gas_price.", "sql": null }, { "role": "assistant", "content": "SELECT block_number, COUNT(*) AS total_txs, AVG(gas_price) AS avg_gas_price FROM web3.transactions GROUP BY block_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 insurance.insurance_products ( product_id text, product_name text, product_type text...
[ { "role": "user", "content": "List all active products, showing their product ID, name, and type, ordered by their creation date.", "sql": null }, { "role": "assistant", "content": "SELECT product_id, product_name, product_type FROM insurance.insurance_products WHERE is_active = TRUE ORDER B...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name....
[ { "role": "user", "content": "For each employee, show their first and last name and the number of documents they have verified.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, COUNT(d.document_id) AS verified_documents_count\nFROM government_services.emp...
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.", "sql": null }, { "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 ...