system
stringlengths
3.67k
8.63k
conversations
listlengths
4
26
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique i...
[ { "role": "user", "content": "List each asset's name and symbol along with the total number of open orders for that asset." }, { "role": "assistant", "content": "SELECT a.name,\n a.symbol,\n COUNT(o.order_id) AS open_order_count\nFROM trading_platform.assets a\nLEFT JOIN trading_plat...
You are an expert in writing database language. You can write a corresponding 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_birth...
[ { "role": "user", "content": "List patient_id, full name, policy_number, plan_type, and insurance_provider for all active primary insurance policies." }, { "role": "assistant", "content": "SELECT pi.patient_id,\n p.first_name,\n p.last_name,\n pi.policy_number,\n ip.plan_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.passengers ( passenger_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Show me the email and full name of passengers who are enrolled in a loyalty program, along with the date they joined, ordered by most recent sign-up." }, { "role": "assistant", "content": "SELECT email, CONCAT(first_name, ' ', last_name) AS full_name, created_at FRO...
You are an expert in writing database language. You can write a corresponding 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 i...
[ { "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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, ...
[ { "role": "user", "content": "Show all SUI coin types with more than 6 decimals and status 'exists' in the metadata table." }, { "role": "assistant", "content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nWHERE status = 'exists' AND decimals > 6;" }, { "role": "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 character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "List the agency name, location name, address, and contact phone for all accessible service locations in the city of 'Seattle'." }, { "role": "assistant", "content": "SELECT t1.agency_name, t2.location_name, t2.address, t2.contact_phone FROM government_services.agenc...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "List consecutive fueling events for each vehicle where the refill quantity increased compared to the previous event. Include vehicle_id, previous timestamp and quantity, current timestamp and quantity." }, { "role": "assistant", "content": "SELECT\n prev.vehicle_id...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Provide a breakdown of the total number of applications submitted for each service category." }, { "role": "assistant", "content": "SELECT T2.category, count(T1.application_id) FROM applications AS T1 JOIN services AS T2 ON T1.service_id = T2.service_id GROUP BY T2....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.te...
[ { "role": "user", "content": "Show the number of wallets created each month in 2024, showing the year and month." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM created_at) AS year, EXTRACT(MONTH FROM created_at) AS month, COUNT(*) FROM wallets WHERE EXTRACT(YEAR FROM created_at)...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varcha...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount." }, { "role": "assistant", "content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas tm ON eb.contract_address = tm...
You are an expert in writing database language. You can write a corresponding 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_name...
[ { "role": "user", "content": "List all maintenance logs for vehicles that had 'Oil Change' service in the last 3 months, showing vehicle ID, service date, and cost." }, { "role": "assistant", "content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE service_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varcha...
[ { "role": "user", "content": "Show me the current amount held and wallet address for all wallets holding more than 100,000 units of the ERC20 token with contract address '0xeeee...'." }, { "role": "assistant", "content": "SELECT wallet_address, amount FROM erc20_balances WHERE contract_address =...
You are an expert in writing database language. You can write a corresponding 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 identifie...
[ { "role": "user", "content": "List each conversation_id and the number of unread messages (where read_at is null)." }, { "role": "assistant", "content": "SELECT m.conversation_id, COUNT(*) AS unread_messages FROM social_media.messages m WHERE m.read_at IS NULL GROUP BY m.conversation_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.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url ...
[ { "role": "user", "content": "List all post IDs and their corresponding hashtag names for posts that include media." }, { "role": "assistant", "content": "SELECT ph.post_id, h.tag_name\nFROM social_media.post_hashtags ph\nJOIN social_media.hashtags h ON ph.hashtag_id = h.hashtag_id\nJOIN social_...
You are an expert in writing database language. You can write a corresponding 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 i...
[ { "role": "user", "content": "Show the average maintenance cost for vehicles of each make, including only vehicles that have had at least one maintenance log." }, { "role": "assistant", "content": "SELECT v.make, AVG(ml.cost) AS average_maintenance_cost FROM transportation.vehicles AS v JOIN 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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, ful...
[ { "role": "user", "content": "Show the usernames and their profile picture URLs for users who have a profile picture set and are also verified." }, { "role": "assistant", "content": "SELECT username, profile_picture_url FROM social_media.users WHERE profile_picture_url IS NOT NULL AND profile_pi...
You are an expert in writing database language. You can write a corresponding 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." }, { "role": "assistant", "content": "SELECT p.property_name, COUNT(s.staff_id) AS active_staff_count\nFROM hospitality_technology.properties p\nLEFT JOIN hospitalit...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, m...
[ { "role": "user", "content": "Show me all vehicles that are due for their next service before the end of this month, along with their last service date and type." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, s.service_date, s.service_type FROM transportation.vehicl...
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uui...
[ { "role": "user", "content": "Find the date (calendar day) with the highest total number of game sessions. Show the date and the total session count." }, { "role": "assistant", "content": "SELECT CAST(start_time AS DATE) AS session_date, COUNT(*) AS total_sessions\nFROM gaming_technology.game_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List property names and the total maximum occupancy across all their room types." }, { "role": "assistant", "content": "SELECT T1.property_name, SUM(T2.max_occupancy) FROM properties AS T1 JOIN room_types AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Which law firms have handled appointments with clients who registered in 2024? Please provide the law firm name, the client’s first and last name, and the appointment subject." }, { "role": "assistant", "content": "SELECT lf.firm_name, c.first_name, c.last_name, a.s...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produc...
[ { "role": "user", "content": "Which insurance products have 'comprehensive' in their coverage details? Show the product_id and product_name." }, { "role": "assistant", "content": "SELECT product_id, product_name FROM insurance.insurance_products WHERE coverage_details ILIKE '%comprehensive%';" ...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique i...
[ { "role": "user", "content": "Get a list of appointment_id, start_time, and invoice_number for appointments that have a related invoice." }, { "role": "assistant", "content": "SELECT a.appointment_id,\n a.start_time,\n i.invoice_number\nFROM legal_services.appointments a\nJOIN legal_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- U...
[ { "role": "user", "content": "Can you retrieve the total number of tickets sold for each car type?" }, { "role": "assistant", "content": "SELECT tc.car_type, COUNT(t.ticket_id) AS total_tickets\nFROM train_station_management.train_cars tc\nJOIN train_station_management.tickets t ON tc.car_id = t...
You are an expert in writing database language. You can write a corresponding 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, -- fundrais...
[ { "role": "user", "content": "Show me the total USD value of tokens held by each centralized exchange on the 'Polygon' chain for the most recent snapshot time. List the exchange name and the total USD value." }, { "role": "assistant", "content": "WITH LatestSnapshot AS ( SELECT MAX(snapshot_time...
You are an expert in writing database language. You can write a corresponding 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": "List each wallet that has received tokens of more than one distinct token type. Show wallet_id, address, the number of distinct tokens received as distinct_token_count, and the total received value, ordered by total_received_value descending." }, { "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 narrative_info (", "narrative character varying(512) NOT NULL, -- the id of nar...
[ { "role": "user", "content": "List all tokens from the token_dexpool_info table with a liquidity over $10 million and a positive 6-hour price change percentage on the Ethereum chain." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, liquidity, price_change_percentage_6h FRO...
You are an expert in writing database language. You can write a corresponding 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, serv...
[ { "role": "user", "content": "List the names of servers and their regions, and the names of achievements available in the games hosted on those servers." }, { "role": "assistant", "content": "SELECT s.server_name, s.region, a.name AS achievement_name FROM gaming_technology.servers AS s JOIN gami...
You are an expert in writing database language. You can write a corresponding 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 identifie...
[ { "role": "user", "content": "List the username and email of users who have disabled push notifications." }, { "role": "assistant", "content": "SELECT u.username, u.email\nFROM social_media.users u\nJOIN social_media.user_settings s ON u.user_id = s.user_id\nWHERE s.push_notifications_enabled = ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, spe...
[ { "role": "user", "content": "List all prescriptions, showing the prescription ID, the medication name, and the dosage." }, { "role": "assistant", "content": "SELECT p.prescription_id, m.medication_name, p.dosage FROM healthcare.prescriptions AS p JOIN healthcare.medications AS m ON p.medication...
You are an expert in writing database language. You can write a corresponding 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, room...
[ { "role": "user", "content": "Show me all rooms along with their current overall review rating for each room, including the room number and property id." }, { "role": "assistant", "content": "SELECT r.room_number, r.property_id, AVG(rv.rating_overall) AS average_overall_rating\nFROM hospitality_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "For each fueling event, show its fuel_log_id, vehicle_id, log_timestamp, and the previous fueling event's fuel_log_id, log_timestamp, and quantity for the same vehicle." }, { "role": "assistant", "content": "SELECT fl.fuel_log_id,\n fl.vehicle_id,\n fl.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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique i...
[ { "role": "user", "content": "List all vehicles that have no associated fuel logs. Include the vehicle's make, model, and license plate." }, { "role": "assistant", "content": "SELECT T1.make , T1.model , T1.license_plate FROM transportation.vehicles AS T1 LEFT JOIN transportation.fuel_logs 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charact...
[ { "role": "user", "content": "List the full name and bar number of all lawyers who were hired before 2015." }, { "role": "assistant", "content": "SELECT first_name || ' ' || last_name AS lawyer_full_name, bar_number\nFROM legal_services.lawyers\nWHERE hire_date < '2015-01-01';" }, { "rol...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, cl...
[ { "role": "user", "content": "Show me pairs of invoice numbers for the same case." }, { "role": "assistant", "content": "SELECT T1.invoice_number, T2.invoice_number, T1.case_id FROM legal_services.invoices AS T1 JOIN legal_services.invoices AS T2 ON T1.case_id = T2.case_id AND T1.invoice_id <> T...
You are an expert in writing database language. You can write a corresponding 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 varyi...
[ { "role": "user", "content": "List all posts that have received at least one like and at least one comment, showing the post_id and the total number of likes and comments each has." }, { "role": "assistant", "content": "SELECT p.post_id, COUNT(DISTINCT l.like_id) AS like_count, COUNT(DISTINCT 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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ...
[ { "role": "user", "content": "What is the total payment amount for each currency recorded in the payments table?" }, { "role": "assistant", "content": "SELECT currency , sum(amount) FROM government_services.payments GROUP BY currency" }, { "role": "user", "content": "Now, only 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 financial_services.accounts ( account_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "For each customer, provide a summary of their account statuses, showing their full name, account status, and the count of accounts for each status." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.status, COUNT(a.account_id) AS account_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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), --...
[ { "role": "user", "content": "Show me each player's last_login and the end_time of their most recent game session." }, { "role": "assistant", "content": "SELECT p.player_id,\n p.username,\n p.last_login,\n gs.last_end_time\nFROM gaming_technology.players p\nLEFT JOIN (\n SELEC...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), --...
[ { "role": "user", "content": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count." }, { "role": "assistant", "content": "SELECT g.genre, COUNT(gs.session_id) AS session_count, COUNT(DISTIN...
You are an expert in writing database language. You can write a corresponding 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, -- uniqu...
[ { "role": "user", "content": "Show me all appointments scheduled to last exactly 60 minutes." }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, doctor_id, appointment_time, duration_minutes, status\nFROM healthcare.appointments\nWHERE duration_minutes = 60;" }, { "...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addres...
[ { "role": "user", "content": "What is the average cost per unit for fuel at each location type? Show the location type and the average cost." }, { "role": "assistant", "content": "SELECT T2.type , AVG(T1.cost_per_unit) FROM transportation.fuel_logs AS T1 JOIN transportation.locations AS T2 ON T...
You are an expert in writing database language. You can write a corresponding 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, first_name...
[ { "role": "user", "content": "Show me all trades with their corresponding ticker_symbol and security_name for trades executed in the last 7 days." }, { "role": "assistant", "content": "SELECT tr.trade_id, tr.account_id, tr.trade_type, tr.quantity, tr.price_per_unit, tr.total_amount,\n tr.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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique i...
[ { "role": "user", "content": "Provide a list of all drivers and for each, show their driver_id, full name, the total number of completed trips they've driven, and the sum of all fares from bookings on those completed trips. Include drivers even if they have no completed trips. Order by total_fares descendin...
You are an expert in writing database language. You can write a corresponding 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, -- uni...
[ { "role": "user", "content": "List all applications that have at least one document with a verification status of 'Verified'. Show the application reference number and the name of the service associated with the application." }, { "role": "assistant", "content": "SELECT\n T1.reference_number,\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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ...
[ { "role": "user", "content": "Retrieve the service names, location names, and cities for active services offered at accessible locations in California." }, { "role": "assistant", "content": "SELECT s.service_name,\n sl.location_name,\n sl.city\nFROM government_services.services AS s\...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_i...
[ { "role": "user", "content": "I need to find users who follow both 'U100' and 'U200'. Show the follower_user_id and the creation dates of both follow events." }, { "role": "assistant", "content": "SELECT f1.follower_user_id,\n f1.created_at AS follow_u100_at,\n f2.created_at AS follo...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Find the citizen ID and document ID for documents with a 'Proof of Address' document type, for citizens who have also received at least one notification. Show distinct combinations." }, { "role": "assistant", "content": "SELECT DISTINCT d.citizen_id, d.document_id F...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prope...
[ { "role": "user", "content": "Show me the list of all guests who have reservations along with the room number, room type name, and property name for each reservation." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, r.room_number, rt.type_name AS room_type_name, p.propert...
You are an expert in writing database language. You can write a corresponding 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, first_name...
[ { "role": "user", "content": "For each security, show the average daily volume from market data and the total quantity traded across all trades." }, { "role": "assistant", "content": "WITH MarketDataAgg AS ( SELECT security_id, AVG(volume) AS avg_daily_volume FROM financial_services.market_data ...
You are an expert in writing database language. You can write a corresponding 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, prope...
[ { "role": "user", "content": "List all room types along with their property name, bed type, and base rate for properties located in Canada, ordered by base rate descending." }, { "role": "assistant", "content": "SELECT rt.type_name, p.property_name, rt.bed_type, rt.base_rate\nFROM hospitality_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 CREATE TABLE erc20_balances ( block_number bigint, contract_address varchar, wallet_address varcha...
[ { "role": "user", "content": "List all active SUI coins showing coin_type, balance, and owner from sui_coins." }, { "role": "assistant", "content": "SELECT coin_type, balance, owner\nFROM sui_coins\nWHERE status = 'exists';" }, { "role": "user", "content": "Add symbol and decimals fr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.employees ( employee_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List the first name, last name, and job title of each employee, along with the job title of their manager." }, { "role": "assistant", "content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, e.job_title AS employee_job_title, m.job_...
You are an expert in writing database language. You can write a corresponding 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 i...
[ { "role": "user", "content": "List trips where the actual arrival was earlier than the scheduled arrival, including the trip ID, scheduled and actual arrival times, and the vehicle make and model used." }, { "role": "assistant", "content": "SELECT T1.trip_id, T1.scheduled_arrival, T1.actual_arri...
You are an expert in writing database language. You can write a corresponding 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.service_locations ( location_id.text, agency_id.text, location_na...
[ { "role": "user", "content": "Could you retrieve pairs of accessible service locations in the same city but with different postal codes?" }, { "role": "assistant", "content": "SELECT sl1.location_id AS location1_id,\n sl2.location_id AS location2_id,\n sl1.city\nFROM government_servi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.trades ( trade_id character varying(64) NOT NULL, account_id chara...
[ { "role": "user", "content": "Show me the total number of trades and the sum of total_amount for each status in the trades table." }, { "role": "assistant", "content": "SELECT\n t.status,\n COUNT(t.trade_id) AS trade_count,\n SUM(t.total_amount) AS total_amount_by_status\nFROM financial_servi...
You are an expert in writing database language. You can write a corresponding 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_birth...
[ { "role": "user", "content": "What is the average number of refills allowed across all prescriptions?" }, { "role": "assistant", "content": "SELECT AVG(refills_allowed) FROM healthcare.prescriptions;" }, { "role": "user", "content": "Which token on each chain has the highest ROI and ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "List all policies that have been cancelled, showing the policy number, cancellation date, and reason." }, { "role": "assistant", "content": "SELECT policy_number, cancellation_date, cancellation_reason FROM insurance.policies WHERE status = 'Cancelled';" }, { ...
You are an expert in writing database language. You can write a corresponding 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, -- uni...
[ { "role": "user", "content": "List each citizen's first and last name along with the first and last name of another citizen who shares the same last name. Show each pair only once." }, { "role": "assistant", "content": "SELECT c1.first_name || ' ' || c1.last_name AS citizen_name,\n c2.firs...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure "CREATE TABLE project_fundraising_record (", "id character varying(32) NOT NULL, -- fundrais...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table." }, { "role": "assistant", "content": "SELECT pfr.project_name, pfr.valuation, tbi.token_symbol,...
You are an expert in writing database language. You can write a corresponding 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_id...
[ { "role": "user", "content": "List the sent notifications related to appointments, including notification ID, message subject, citizen full name, and scheduled start time of the appointment." }, { "role": "assistant", "content": "SELECT\n n.notification_id,\n n.message_subject,\n c.first_name...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_nam...
[ { "role": "user", "content": "Which clients have at least one open case, and what are the names and numbers of those cases?" }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, cs.case_name, cs.case_number \nFROM legal_services.clients c\nJOIN legal_services.cases cs ON c.cli...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, firm_name text, address text, ph...
[ { "role": "user", "content": "List the names of law firms whose managing partner has uploaded at least one document, and show the managing partner ID along with the firm's phone number." }, { "role": "assistant", "content": "SELECT DISTINCT T1.firm_name, T1.managing_partner_id, T1.phone FROM leg...
You are an expert in writing database language. You can write a corresponding 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, prope...
[ { "role": "user", "content": "Provide the total number of room types and the average base_rate for each property that has a star_rating of at least 4.0." }, { "role": "assistant", "content": "SELECT p.property_id,\n p.property_name,\n COUNT(rt.room_type_id) AS room_type_count,\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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising recor...
[ { "role": "user", "content": "List narratives that have a 24-hour trading volume exceeding $50,000,000 and include at least 100 distinct tokens. Show the narrative name, volume, and token count." }, { "role": "assistant", "content": "SELECT narrative, volume_24h, token_num FROM narrative_info WH...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text,...
[ { "role": "user", "content": "Show each user's username along with their KYC status and the date of their latest KYC review." }, { "role": "assistant", "content": "SELECT u.username, ka.status, ka.reviewed_at AS latest_review\nFROM trading_platform.users u\nJOIN trading_platform.kyc_audit ka 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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_ha...
[ { "role": "user", "content": "Show all notifications of type 'comment' with the content of the corresponding comment and the author's username." }, { "role": "assistant", "content": "SELECT n.notification_id,\n n.recipient_user_id,\n c.content AS comment_content,\n u.username\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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3)...
[ { "role": "user", "content": "I need a list of all SUI coins with their object ID, coin type, and balance." }, { "role": "assistant", "content": "SELECT object_id, coin_type, balance FROM sui_coins;" }, { "role": "user", "content": "Only include coins where status is 'exists'." }, ...
You are an expert in writing database language. You can write a corresponding 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": "Show the full name and email of each driver and the number of vehicles currently assigned to their depot." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, d.email, COUNT(v.vehicle_id) AS vehicles_at_depot\nFROM transportation.drivers d\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.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List all room types and the name of the property manager responsible for that property." }, { "role": "assistant", "content": "SELECT t1.type_name, t3.first_name, t3.last_name FROM hospitality_technology.room_types AS t1 JOIN hospitality_technology.properties AS t2 ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifie...
[ { "role": "user", "content": "Show me the usernames of users who have the word 'explorer' in their bio." }, { "role": "assistant", "content": "SELECT username\nFROM social_media.users\nWHERE bio ILIKE '%explorer%';" }, { "role": "user", "content": "List all wallet addresses holding 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id...
[ { "role": "user", "content": "List the names of active services offered by agencies with at least one accessible service location in the state of 'New York'. Show the service name, category, agency name, and the location name." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.cat...
You are an expert in writing database language. You can write a corresponding 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 varyi...
[ { "role": "user", "content": "Which hashtags have never been used in any post? Show their tag_name and creation date." }, { "role": "assistant", "content": "SELECT h.tag_name, h.created_at\nFROM social_media.hashtags h\nLEFT JOIN social_media.post_hashtags ph ON h.hashtag_id = ph.hashtag_id\nWHE...
You are an expert in writing database language. You can write a corresponding 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, -- uni...
[ { "role": "user", "content": "What is the sum of the amounts for all payments that have a status of 'Completed'?" }, { "role": "assistant", "content": "SELECT sum(amount) FROM government_services.payments WHERE status = 'Completed'" }, { "role": "user", "content": "List each law firm...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, route_number charact...
[ { "role": "user", "content": "Please provide a list of all trips along with their route details, including the route_number, origin city, and destination city, ordered by scheduled_departure." }, { "role": "assistant", "content": "SELECT t.trip_id,\n t.vehicle_id,\n t.driver_id,\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 gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, a...
[ { "role": "user", "content": "List each player's most recent achievement unlock, showing the player_id, achievement_id, and unlocked_at timestamp." }, { "role": "assistant", "content": "SELECT pa.player_id, pa.achievement_id, pa.unlocked_at FROM gaming_technology.player_achievements pa INNER JOI...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Provide a count of appointments grouped by their current status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM government_services.appointments GROUP BY status;" }, { "role": "user", "content": "Show me all appointments where the 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 trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwor...
[ { "role": "user", "content": "List the names and URLs of all available decentralized applications (DApps)." }, { "role": "assistant", "content": "SELECT name, url FROM dapps;" }, { "role": "user", "content": "For each agency, list the agency name and the total count of employees who ...
You are an expert in writing database language. You can write a corresponding 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": "List all replacement policies where a customer received a new policy starting the day after their previous policy was cancelled. Return customer_id, original_policy_id, original_cancellation_date, new_policy_id, new_start_date." }, { "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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), --...
[ { "role": "user", "content": "List game titles released on the 'PC' platform along with the count of servers currently hosting each game." }, { "role": "assistant", "content": "SELECT T1.title, count(T2.server_id) FROM games AS T1 JOIN servers AS T2 ON T1.game_id = T2.game_id WHERE T1.platform =...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyin...
[ { "role": "user", "content": "List all notifications of type 'like' where the target_entity_type is 'post'. For each notification, return notification_id, sender_user_id, target_entity_id (as post_id), and the notification creation time." }, { "role": "assistant", "content": "SELECT notification...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.payments ( payment_id.text, application_id.text, citizen_id.text,...
[ { "role": "user", "content": "For each service ID, show the average and maximum payment amount for payments made in the last 90 days." }, { "role": "assistant", "content": "SELECT service_id, AVG(amount), MAX(amount) FROM government_services.payments WHERE payment_timestamp >= NOW() - INTERVAL '...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_lo...
[ { "role": "user", "content": "List all completed trips, showing the trip ID, the names of the origin and destination locations for the trip, and the actual arrival time." }, { "role": "assistant", "content": "SELECT t.trip_id, loc_origin.name AS origin_location_name, loc_dest.name AS destination...
You are an expert in writing database language. You can write a corresponding 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, project_id character ...
[ { "role": "user", "content": "What are the top 5 tokens by 7-day price change percentage? Show token_symbol, token_name, narrative, and chain, ordered by price_change_percentage_7d descending." }, { "role": "assistant", "content": "```sql\nSELECT\n token_symbol,\n token_name,\n narrative,\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 hospitality_technology.properties ( property_id text, property_name text, address_lin...
[ { "role": "user", "content": "List every staff member's full name and their position." }, { "role": "assistant", "content": "SELECT first_name || ' ' || last_name AS staff_full_name, position\nFROM hospitality_technology.staff;" }, { "role": "user", "content": "Also include the prope...
You are an expert in writing database language. You can write a corresponding 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": "Show all cases that were opened and subsequently closed in the same calendar year. List the case name, case number, date opened, and date closed." }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened, date_closed FROM legal_services.cases...
You are an expert in writing database language. You can write a corresponding 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": "List the city and the count of accessible and inaccessible service locations separately. Return city, accessible_count, and inaccessible_count." }, { "role": "assistant", "content": "SELECT city,\n SUM(CASE WHEN is_accessible THEN 1 ELSE 0 END) AS accessible_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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyin...
[ { "role": "user", "content": "Find posts that have been liked by users the author of the post is following. List the post_id and the user_id of the post author." }, { "role": "assistant", "content": "SELECT p.post_id, p.user_id AS post_author_user_id FROM social_media.posts AS p JOIN social_medi...
You are an expert in writing database language. You can write a corresponding 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 i...
[ { "role": "user", "content": "For each trip, show the trip_id, vehicle's license plate, total fuel quantity, and number of fueling events." }, { "role": "assistant", "content": "SELECT t.trip_id, v.license_plate, SUM(f.quantity) AS total_fuel, COUNT(f.fuel_log_id) AS fueling_events FROM transpor...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), --...
[ { "role": "user", "content": "How many players are there in each country?" }, { "role": "assistant", "content": "SELECT country_code, COUNT(*) AS player_count\nFROM gaming_technology.players\nGROUP BY country_code;" }, { "role": "user", "content": "Only include countries with more 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "Show the total number of policies in each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.policies GROUP BY status" }, { "role": "user", "content": "For each payment, list its payment_id, guest_id, payment_timestamp,...
You are an expert in writing database language. You can write a corresponding 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 recor...
[ { "role": "user", "content": "Which tokens have a current price above $20 and belong to the 'DeFi' narrative?" }, { "role": "assistant", "content": "SELECT token_symbol, token_name, chain, price\nFROM token_basic_info\nWHERE price > 20 AND narrative = 'DeFi';" }, { "role": "user", "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 cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the s...
[ { "role": "user", "content": "For the latest snapshot time, list the total `usd_value` held by CEXes for each distinct `token_symbol` across all chains. Order the results by total value descending." }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT max(snapshot_time) as 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 legal_services.cases ( case_id character varying(64) NOT NULL, -- unique identif...
[ { "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." }, { "role": "assistant", "content": "SELECT case_type, AVG(DATE_PART('day', date_closed - date_opened)) AS average_duration...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containi...
[ { "role": "user", "content": "List all ERC20 tokens with their names and symbols where the price is greater than $10, sorted by price in descending order." }, { "role": "assistant", "content": "SELECT t.symbol, t.name, p.price FROM sui_coins_metadata t JOIN token_prices_latest p ON t.coin_type =...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, ful...
[ { "role": "user", "content": "Show me the full names of users and the total number of likes they have given to comments." }, { "role": "assistant", "content": "SELECT u.full_name, COUNT(l.like_id) AS likes_given_to_comments\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.u...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character...
[ { "role": "user", "content": "List all diagnoses made in the last month including diagnosis_date, patient full name, doctor's full name, and description." }, { "role": "assistant", "content": "SELECT d.diagnosis_date,\n p.first_name || ' ' || p.last_name AS patient_name,\n doc.first_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Which room types have a base rate above 250 USD, and what are their maximum occupancies?" }, { "role": "assistant", "content": "SELECT room_type_id, type_name, base_rate, max_occupancy\nFROM hospitality_technology.room_types\nWHERE base_rate > 250;" }, { "ro...
You are an expert in writing database language. You can write a corresponding 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 charac...
[ { "role": "user", "content": "Provide for each security its ticker_symbol, the most recent close_price and corresponding timestamp." }, { "role": "assistant", "content": "SELECT s.ticker_symbol, md.close_price, md.data_timestamp\nFROM financial_services.market_data md\nJOIN financial_services.se...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure "CREATE TABLE cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the s...
[ { "role": "user", "content": "For each exchange, compute the percentage change in total USD value of its holdings between snapshots '2023-01-01 00:00:00' and '2023-02-01 00:00:00'. Show exchange, chain, value_jan, value_feb, and pct_change." }, { "role": "assistant", "content": "SELECT t1.exchan...