conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List all narratives that have a market cap between 500,000,000 and 5,000,000,000 USD and a positive price change over the last 7 days. Show the narrative name, market cap, and price change percentage for the last 7 days." }, { "role": "assistant", "content": "SELECT...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume...
[ { "role": "user", "content": "List all user IDs that user 'user123' is following, including the date they started following." }, { "role": "assistant", "content": "SELECT following_user_id, created_at FROM social_media.follows WHERE follower_user_id = 'user123';" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.follows ( follow_id text, follower_user_id text, following_user_id text, created_at timestamp )
[ { "role": "user", "content": "Show the total number of notifications sent per user." }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) AS total_notifications\nFROM trading_platform.notifications\nGROUP BY user_id;" }, { "role": "user", "content": "I only want to see user...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, -- unique identifier for the asset name cha...
[ { "role": "user", "content": "Show me all patients who have had prescriptions for a medication named 'Metformin', including their full name, prescription date, and prescribing doctor's ID." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pr.prescription_date...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "For each private conversation (is_group_chat = false), list the conversation_id and the usernames of its two participants." }, { "role": "assistant", "content": "SELECT c.conversation_id,\n u1.username AS participant_one,\n u2.username AS participant_two...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "For each NFT collection on Ethereum, calculate the number of unique tokens and the average rarity_score. Show contract_address, token_count, and avg_rarity." }, { "role": "assistant", "content": "SELECT nm.contract_address,\n COUNT(DISTINCT nm.token_id) AS tok...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Can you provide the total capacity of all train cars for a specific train with train_id 'TR789'?" }, { "role": "assistant", "content": "SELECT SUM(capacity) AS total_capacity\nFROM train_cars\nWHERE train_id = 'TR789';" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // PUT /stations { "mappings": { "properties": { "station_id": { "type": "keyword" },...
[ { "role": "user", "content": "List the content and creation time of posts made by users who are following user 'U200'." }, { "role": "assistant", "content": "SELECT T1.content, T1.created_at FROM social_media.posts AS T1 JOIN social_media.follows AS T2 ON T1.user_id = T2.follower_user_id WHERE T...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id text, user_id text, content text, media_url text, media_type text, created_at timestamp, u...
[ { "role": "user", "content": "I need pairs of items within the same game where one item_type is 'Weapon' and the other is 'Consumable'. Show game_id, weapon_name, and consumable_name." }, { "role": "assistant", "content": "SELECT i1.game_id, i1.item_name AS weapon_name, i2.item_name AS consumabl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.in_game_items ( item_id uuid PRIMARY KEY, game_id uuid, item_name text, item_type text, description t...
[ { "role": "user", "content": "For each wallet address, list the total amount of UTXOs associated with it along with its wallet_id." }, { "role": "assistant", "content": "SELECT w.wallet_id,\n u.address,\n SUM(u.amount) AS total_amount\nFROM trading_platform.wallets w\nJOIN trading_pl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp ) CREATE ...
[ { "role": "user", "content": "List the names and rarity of all items with a cost above 50." }, { "role": "assistant", "content": "SELECT item_name, rarity\nFROM gaming_technology.in_game_items\nWHERE cost_amount > 50;" }, { "role": "user", "content": "Now, only include items where th...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ite...
[ { "role": "user", "content": "What is the average project valuation for each round name in 2023?" }, { "role": "assistant", "content": "SELECT rounds_name, AVG(valuation) AS avg_valuation\nFROM project_fundraising_record\nWHERE investment_date LIKE '2023-%'\nGROUP BY rounds_name;" }, { "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "What is the average investment_value and total number of projects for each rounds_name in project_fundraising_record?" }, { "role": "assistant", "content": "SELECT rounds_name,\n AVG(investment_value) AS avg_investment,\n COUNT(DISTINCT project_id) AS pr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id text, project_id text, project_name text, rounds_name text, investment_value numeric, i...
[ { "role": "user", "content": "List all servers hosting games that have more than 50 achievements. Show server name, region, and the total achievement count for the game." }, { "role": "assistant", "content": "SELECT s.server_name, s.region, COUNT(a.achievement_id) AS total_achievements FROM gami...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,...
[ { "role": "user", "content": "Show a list of diagnoses along with the chief complaint noted in the corresponding medical record. Display diagnosis description, diagnosis date, and the chief complaint." }, { "role": "assistant", "content": "SELECT T1.description, T1.diagnosis_date, T2.chief_compl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ch...
[ { "role": "user", "content": "I need a list of conversation IDs and participant usernames for conversations that have media messages. Include conversation_id, username, and media_type." }, { "role": "assistant", "content": "SELECT m.conversation_id, u.username, m.media_type\nFROM social_media.me...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Show me the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their narrative and 7-day price change percentage." }, { "role": "assistant", "content": "SELECT t.token_symbol, t.narrative, t.price_change_percentage_7d FROM token_basic_info t WH...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO...
[ { "role": "user", "content": "List pairs of invoice_number for invoices that share the same due_date." }, { "role": "assistant", "content": "SELECT a.due_date,\n a.invoice_number AS invoice1,\n b.invoice_number AS invoice2\nFROM legal_services.invoices a\nJOIN legal_services.invoices...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id character varying(64) NOT NULL, -- unique identifier for the invoice invo...
[ { "role": "user", "content": "List pairs of routes where one route’s origin matches another route’s destination. Show both route numbers." }, { "role": "assistant", "content": "SELECT r1.route_number AS route1, r2.route_number AS route2\nFROM transportation.routes r1\nJOIN transportation.routes ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "List the document names and subjects of appointments that are linked to the same case, but only for documents uploaded after March 1st, 2024." }, { "role": "assistant", "content": "SELECT d.document_name, a.subject, d.case_id\nFROM legal_services.documents d\nJOIN l...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "What is the average price of services grouped by category? Display category and average_price." }, { "role": "assistant", "content": "SELECT category, AVG(price) AS average_price FROM hospitality_technology.services GROUP BY category;" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id text PRIMARY KEY, property_id text, service_name text, description text, c...
[ { "role": "user", "content": "List all insurance products with a base premium exceeding 500, showing the product name, type, and base premium." }, { "role": "assistant", "content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WHERE base_premium > 500;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_name character varying(150) NOT NULL,...
[ { "role": "user", "content": "How many tokens are there for each number of decimals?" }, { "role": "assistant", "content": "SELECT decimals, COUNT(*) FROM web3.tokens GROUP BY decimals;" }, { "role": "user", "content": "Now, only show the decimal counts where there are more than 10 t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_at.timestamp, transaction_id.text, l...
[ { "role": "user", "content": "List the appointment ID, subject, and duration in minutes for all completed appointments." }, { "role": "assistant", "content": "SELECT appointment_id, subject, EXTRACT(EPOCH FROM (end_time - start_time))/60 AS duration_minutes FROM legal_services.appointments WHERE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "content": "Which cities have more than 10 active customers in the state of Texas? Provide the city name and the customer count." }, { "role": "assistant", "content": "SELECT city, COUNT(*) AS customer_count\nFROM insurance.customers\nWHERE state = 'TX' AND status = 'Active'\nG...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Can you help me find all bookings made by passengers from a specific city, say 'Boston', including the passenger details and the scheduled trip information?" }, { "role": "assistant", "content": "MATCH (p:Passenger)-[:MADE_BOOKING]->(b:Booking)-[:FOR_TRIP]->(st:Sche...
You are an expert in writing database language. You can write 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": "Count how many fundraising rounds each project has. Show project_name and round_count." }, { "role": "assistant", "content": "SELECT\n project_name,\n COUNT(*) AS round_count\nFROM project_fundraising_record\nGROUP BY project_name;" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "I need to find all group chats created after 2024-01-01, showing group_name and the total number of participants in each." }, { "role": "assistant", "content": "SELECT c.group_name, COUNT(cp.participant_id) AS participant_count\nFROM social_media.conversations c\nJO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "Show me the full name of all partner lawyers and the total hours they have spent on all time entries." }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, SUM(te.hours_spent) AS total_hours FROM legal_services.lawyers l JOIN legal_services.time_e...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "List addresses on the 'Ethereum' chain that have an ROI greater than 5 and a profit greater than $1000. Show their address, profit, ROI, and realized ratio." }, { "role": "assistant", "content": "SELECT address, profit, roi, realized_ratio FROM smart_money_profit WH...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token...
[ { "role": "user", "content": "How many service locations are marked as accessible?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.service_locations WHERE is_accessible = TRUE;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "For each player, show the player_id and the count of inventory items they acquired with a quantity greater than 1." }, { "role": "assistant", "content": "SELECT player_id, COUNT(inventory_id) AS items_qty_gt_1_count FROM gaming_technology.player_inventory WHERE quan...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "Which token symbols have the highest number of addresses buying them on the Ethereum chain? Show the top 3 symbols, their total address_amount, and narrative." }, { "role": "assistant", "content": "SELECT token_symbol, narrative, SUM(address_amount) AS total_buying_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the token's address token_symbol character...
[ { "role": "user", "content": "List developers along with the count of games they released in the 2010s (2010-2019)." }, { "role": "assistant", "content": "SELECT\n d.developer_id,\n d.name,\n COUNT(g.game_id) AS games_in_2010s_count\nFROM\n gaming_technology.developers d\nJOIN\n gaming_tech...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "List each staff member who delivered orders, along with the number of orders they delivered." }, { "role": "assistant", "content": "SELECT staff_id_delivered, COUNT(order_id) AS delivered_orders FROM hospitality_technology.service_orders WHERE staff_id_delivered IS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id text, guest_id text, service_id text,...
[ { "role": "user", "content": "特定の予約ID 'book_zyx' に関連するすべてのチケットの詳細を取得するのを手伝っていただけますか?また、関連する車両情報も含めてください。" }, { "role": "assistant", "content": "SMEMBERS booking:book_zyx:tickets\nHGETALL ticket:<ticket_id>\nHGETALL car:<car_id>" }, { "role": "user", "content": "チェックイン済みのチケットだけを表示するよう...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Use Hashes for ticket details. Key format: ticket:<ticket_id> // HSET ticket:tkt_1a2b ticket_i...
[ { "role": "user", "content": "List all cases opened in the 'State Court' jurisdiction in the year 2023, including their name, number, and client ID." }, { "role": "assistant", "content": "SELECT case_name, case_number, client_id FROM legal_services.cases WHERE court_jurisdiction = 'State Court' ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t...
[ { "role": "user", "content": "List all citizens who registered in the last 90 days but haven't scheduled any appointments. Display their citizen_id, full name, and registration_date." }, { "role": "assistant", "content": "SELECT c.citizen_id,\n c.first_name || ' ' || c.last_name AS full_na...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Find all cryptocurrency assets that have been traded more than 50 times but have an average trade quantity less than 10." }, { "role": "assistant", "content": "SELECT t.asset_id, COUNT(t.trade_id) AS trade_count, AVG(t.quantity) AS avg_quantity FROM trading_platform...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "List all servers that have zero current players. Show their server name, region, and status." }, { "role": "assistant", "content": "SELECT server_name, region, status FROM gaming_technology.servers WHERE current_players = 0;" }, { "role": "user", "conten...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p...
[ { "role": "user", "content": "For each fundraising round, what is the average valuation of the participating projects? Show the round name and the average valuation." }, { "role": "assistant", "content": "SELECT rounds_name, AVG(valuation) AS avg_valuation FROM project_fundraising_record WHERE v...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "How many documents of each type currently have a verification_status of 'Pending'?" }, { "role": "assistant", "content": "SELECT\n document_type,\n COUNT(*) AS pending_count\nFROM government_services.documents\nWHERE verification_status = 'Pending'\nGROUP BY docum...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "How many customers have a non-null phone number in your system?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM insurance.customers WHERE phone_number IS NOT NULL;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Count the number of documents submitted for each service. Show the service_name and the document_count." }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(d.document_id) AS document_count\nFROM government_services.services s\nJOIN government_service...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id.text, agency_id.text, service_name.text, description.text, category.text, eli...
[ { "role": "user", "content": "Give me a daily breakdown of the total number of payments and total amount processed in the last 14 days." }, { "role": "assistant", "content": "SELECT DATE(payment_timestamp) AS day, COUNT(*) AS payment_count, SUM(amount) AS total_amount\nFROM hospitality_technolog...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.payments ( payment_id text, reservation_id text, guest_id text, bill_id text, amount numeric, cu...
[ { "role": "user", "content": "Can you show me, for each player, the total number of different in-game items they have acquired, along with the names and types of these items?" }, { "role": "assistant", "content": "SELECT pi.player_id, COUNT(DISTINCT pi.item_id) AS unique_items_acquired, STRING_A...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ...
[ { "role": "user", "content": "Which room types have a base rate above 250, and what are their property names and maximum occupancy?" }, { "role": "assistant", "content": "SELECT rt.room_type_id, rt.type_name, p.property_name, rt.base_rate, rt.max_occupancy\nFROM hospitality_technology.room_types...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Show me all fuel logs where the fuel type is diesel and the quantity is more than 50 liters, including the vehicle ID and trip ID." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, trip_id, quantity, fuel_type FROM transportation.fuel_logs WHERE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_timestamp.timestamp, fuel_type.text, qu...
[ { "role": "user", "content": "What is the average investment value for projects that completed Series A funding rounds?" }, { "role": "assistant", "content": "SELECT AVG(investment_value) AS average_investment FROM project_fundraising_record WHERE rounds_name = 'Series A';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "Find the day with the highest total game session count. Show the date and the total session count." }, { "role": "assistant", "content": "SELECT DATE(start_time) AS session_date, COUNT(*) AS total_sessions\nFROM gaming_technology.game_sessions\nGROUP BY session_date...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time...
[ { "role": "user", "content": "For each player, list the total number of 'Legendary' rarity items they have in their inventory, along with the titles of the respective games those items belong to." }, { "role": "assistant", "content": "SELECT pi.player_id, g.game_id, g.title, COUNT(*) AS legendar...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time...
[ { "role": "user", "content": "Show me the top 3 buyers by total trade quantity, along with the average price they paid per trade." }, { "role": "assistant", "content": "SELECT buyer_id, SUM(quantity) AS total_quantity, AVG(price) AS avg_price FROM trading_platform.trades GROUP BY buyer_id ORDER ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.trades ( trade_id text, order_id text, buyer_id text, seller_id text, asset_id text, quantity numeric,...
[ { "role": "user", "content": "Show the name, symbol, and type of each asset, along with the total number of orders placed for each asset." }, { "role": "assistant", "content": "SELECT a.name, a.symbol, a.type, COUNT(o.order_id) AS order_count\nFROM trading_platform.assets a\nLEFT JOIN trading_pl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "List all users who have sent messages containing media files in group conversations, showing their username, email, and the group name." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email, c.group_name\nFROM social_media.messages m\nJOIN socia...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "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 vehicle_id, service_date AS last_service_date, service_type FROM transportation.maintena...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.maintenance_logs ( log_id text PRIMARY KEY, vehicle_id text, service_date date, odometer_reading int, se...
[ { "role": "user", "content": "What is the average profit and average ROI for smart money addresses ranked in the top 500?" }, { "role": "assistant", "content": "SELECT AVG(profit), AVG(roi) FROM smart_money_profit WHERE rank <= 500" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token...
[ { "role": "user", "content": "List the name, city, state, and country for all locations with a latitude greater than 40 and a longitude less than -70." }, { "role": "assistant", "content": "SELECT name, city, state_province, country FROM transportation.locations WHERE latitude > 40 AND longitude...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "List all medical records created by doctor 'doc001' for patient 'pat456', displaying the record ID and record date." }, { "role": "assistant", "content": "SELECT record_id, record_date\nFROM healthcare.medical_records\nWHERE doctor_id = 'doc001' AND patient_id = 'pa...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "role": "user", "content": "List all pairs of routes where the origin location of one route is the destination location of the other, showing both route numbers and their types." }, { "role": "assistant", "content": "SELECT r1.route_number AS route_number_1, r1.type AS type_1,\n r2.route...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_location_id.text, destination_locati...
[ { "role": "user", "content": "Provide the count of diagnoses by status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS count\nFROM healthcare.diagnoses\nGROUP BY status;" }, { "role": "user", "content": "Now only include statuses with more than 10 diagnoses...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry ...
[ { "role": "user", "content": "Show me all appointments along with any diagnoses recorded for the same patient on the same day. Include appointment_id, patient_id, appointment_time, and diagnosis_description." }, { "role": "assistant", "content": "SELECT T1.appointment_id, T1.patient_id, T1.appoi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ch...
[ { "role": "user", "content": "Show me the username and email of all users who own at least one wallet." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM blockchain.users AS T1 JOIN blockchain.wallets AS T2 ON T1.user_id = T2.user_id;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text ) CREATE TABLE blockchain.users ( ...
[ { "role": "user", "content": "Find all users who created accounts in the last 30 days and show their usernames and email addresses, sorted by creation date in descending order." }, { "role": "assistant", "content": "SELECT username, email FROM web3.users WHERE created_at >= NOW() - INTERVAL '30 ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email character varying(...
[ { "role": "user", "content": "Show me all contracts deployed on the 'ethereum' network along with their deployer usernames and email addresses." }, { "role": "assistant", "content": "SELECT c.contract_id, c.address, u.username, u.email FROM web3.contracts c JOIN web3.users u ON c.deployer_addres...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "Show the invoice number, issue date, total amount, and the client's full name for all invoices, including only those invoices that have not been paid fully." }, { "role": "assistant", "content": "SELECT i.invoice_number, i.issue_date, i.total_amount, c.first_name ||...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id.text, first_name.text, last_name.text, company_name.text, email.text, phone.text, ad...
[ { "role": "user", "content": "List the names and types of all properties, along with the full names and positions of their managers." }, { "role": "assistant", "content": "SELECT p.property_name, p.property_type, s.first_name || ' ' || s.last_name AS manager_full_name, s.position AS manager_posi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "List all maintenance logs where the odometer reading was greater than 150000. Display log ID, vehicle ID, service date, and odometer reading." }, { "role": "assistant", "content": "SELECT log_id, vehicle_id, service_date, odometer_reading FROM transportation.mainten...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id character varying(64) NOT NULL, ser...
[ { "role": "user", "content": "Can you show the total quantity of items acquired on each calendar day?" }, { "role": "assistant", "content": "SELECT DATE(acquired_at) AS acquisition_date, SUM(quantity) AS total_items_acquired FROM gaming_technology.player_inventory GROUP BY acquisition_date;" }...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for...
[ { "role": "user", "content": "Find the top 3 drivers by their average number of passengers per trip, including driver_id, first_name, last_name, and avg_passengers, ordered by avg_passengers descending." }, { "role": "assistant", "content": "SELECT d.driver_id,\n d.first_name,\n d.la...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Which staff members ordered more than 5 service orders in total? List their staff_id, full name, and the total number of orders they've placed." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, COUNT(so.order_id) AS total_orders\nF...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "List the block ID, timestamp, and difficulty for all blocks created before '2024-01-01', ordered by timestamp in descending order." }, { "role": "assistant", "content": "SELECT block_id, timestamp, difficulty FROM blockchain.blocks WHERE timestamp < '2024-01-01' ORD...
You are an expert in writing database language. You can write a corresponding 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.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonc...
[ { "role": "user", "content": "Which user has the earliest created wallet? Show the user_id, wallet_id, address, and the creation timestamp." }, { "role": "assistant", "content": "SELECT user_id, wallet_id, address, created_at\nFROM web3.wallets\nORDER BY created_at ASC\nLIMIT 1;" }, { "r...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "Get the total value and average gas_price for each from_address in transactions, but only include senders who have sent more than 5 transactions." }, { "role": "assistant", "content": "SELECT from_address,\n SUM(value) AS total_value,\n AVG(gas_price) AS...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Show me the top 5 users by the total trade volume (quantity * price) as buyers, along with their email addresses and the number of distinct assets they traded." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, COUNT(DISTINCT t.asset_id) AS distinct_a...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "Show me all token transfers where the from_address is the same as the to_address, indicating self-transfers, along with the token_id and value." }, { "role": "assistant", "content": "SELECT transfer_id, token_id, from_address, to_address, value, transaction_id FROM ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.token_transfers ( transfer_id.text, token_id.text, from_address.text, to_address.text, value.numeric, transaction_...
[ { "role": "user", "content": "I need to find pairs of nodes that share the same port but have different IP addresses. Can you write a query for that?" }, { "role": "assistant", "content": "SELECT n1.node_id AS node1_id,\n n2.node_id AS node2_id,\n n1.port\nFROM blockchain.nodes n1\nJ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ...
[ { "role": "user", "content": "List all pairs of diagnoses that belong to the same medical record. Show record_id, diagnosis_id from the first entry as diag1_id, and diagnosis_id from the second entry as diag2_id." }, { "role": "assistant", "content": "SELECT d1.record_id,\n d1.diagnosis_id...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry ...
[ { "role": "user", "content": "Show me all employees (employee_id, first_name, last_name) who work in the 'Investment' department and have processed transactions (transaction_id) in the last month, along with the total transaction amount they processed." }, { "role": "assistant", "content": "SELE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad...
[ { "role": "user", "content": "Show me all active policies with coverage limits above $1,000,000, along with their customer IDs and agent IDs, sorted by coverage limit in descending order." }, { "role": "assistant", "content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.coverage_limit FROM ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "List pairs of wallet IDs owned by the same user where the creation dates are more than one year apart. Show the user ID and the wallet IDs of both wallets." }, { "role": "assistant", "content": "SELECT w1.user_id, w1.wallet_id AS wallet_id_1, w2.wallet_id AS wallet_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "Identify pairs of consecutive fueling events for each vehicle where the interval between them is greater than 7 days. For each pair include vehicle_id, first fuel_log_id and timestamp, second fuel_log_id and timestamp, and days difference between events." }, { "role": "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id character varying(64) NOT NULL, -- unique identifier for the fuel log entry...
[ { "role": "user", "content": "What is the average token price held by Binance exchange across all chains?" }, { "role": "assistant", "content": "SELECT AVG(price) as average_token_price FROM cex_token_balance WHERE exchange = 'Binance';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE cex_token_balance ( snapshot_time.text, chain.text, address.text, exchange.text, token_address.text, token_symbol.text,...
[ { "role": "user", "content": "I need a report showing each passenger's total number of bookings and the date of their most recent booking." }, { "role": "assistant", "content": "SELECT b.passenger_id,\n COUNT(*) AS total_bookings,\n MAX(b.booking_time) AS last_booking_date\nFROM tran...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id character varying(64) NOT NULL, route_number character varying(32) NOT NULL UNIQUE, de...
[ { "role": "user", "content": "Show me the document name and the date worked for time entries logged by the same lawyer." }, { "role": "assistant", "content": "SELECT T1.document_name , T2.date_worked FROM documents AS T1 JOIN time_entries AS T2 ON T1.uploaded_by_lawyer_id = T2.lawyer_id" },...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u...
[ { "role": "user", "content": "Show the usernames and email addresses of all users who have never created a post." }, { "role": "assistant", "content": "SELECT u.username, u.email\nFROM social_media.users u\nLEFT JOIN social_media.posts p ON u.user_id = p.user_id\nWHERE p.post_id IS NULL;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "For each trip that has bookings, show the trip ID and the total number of bookings associated with it." }, { "role": "assistant", "content": "SELECT T.trip_id, COUNT(B.booking_id) AS booking_count FROM transportation.trips AS T JOIN transportation.bookings AS B ON T...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "For each player, show how many achievements they have unlocked in games with items of type 'Consumable'." }, { "role": "assistant", "content": "SELECT pa.player_id, COUNT(DISTINCT pa.achievement_id) AS achievements_unlocked\nFROM gaming_technology.player_achievement...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "List all top-level comments (comments without a parent_comment_id), showing the comment ID and content." }, { "role": "assistant", "content": "SELECT comment_id, content FROM social_media.comments WHERE parent_comment_id IS NULL;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_id.text, content.text, created_at.t...
[ { "role": "user", "content": "Find all pairs of games developed by the same developer but available on different platforms. Include each game's title and platform." }, { "role": "assistant", "content": "SELECT g1.title AS game1_title,\n g1.platform AS game1_platform,\n g2.title AS ga...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "Show me all active customers from New York who were born before 1980, along with their contact information." }, { "role": "assistant", "content": "SELECT first_name, last_name, phone_number, email, address_line1, city, state, zip_code FROM insurance.customers WHERE ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Show me the review_id, review_date, and comment for all non-public reviews along with the guest's first and last name." }, { "role": "assistant", "content": "SELECT r.review_id, r.review_date, r.comment, g.first_name, g.last_name\nFROM hospitality_technology.reviews...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reviews ( review_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Show the patient ID, first name, last name, and email for all patients who have provided both an email address and a phone number." }, { "role": "assistant", "content": "SELECT patient_id, first_name, last_name, email FROM healthcare.patients WHERE email IS NOT NULL...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me the top 5 NFT collections with the highest token count on Ethereum, along with their names, symbols, and floor prices." }, { "role": "assistant", "content": "SELECT nc.name, nc.symbol, nc.floor_price, nc.token_count FROM nft_collections nc WHERE nc.blockchai...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transaction_index.integer, transaction_hash....
[ { "role": "user", "content": "Find all wallet addresses that don't have an associated user_id." }, { "role": "assistant", "content": "SELECT address_id FROM blockchain.wallets WHERE user_id IS NULL;" }, { "role": "user", "content": "Now show me these addresses along with their privat...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text )
[ { "role": "user", "content": "Which three smart money addresses on the Arbitrum chain have the most recent last_trade_time? Please show address and last_trade_time." }, { "role": "assistant", "content": "SELECT address, last_trade_time FROM smart_money_profit WHERE chain = 'Arbitrum' ORDER BY la...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token...
[ { "role": "user", "content": "For all bookings, can you provide the booking ID, the passenger ID, and the make and model of the vehicle used for the associated trip?" }, { "role": "assistant", "content": "SELECT b.booking_id, b.passenger_id, v.make, v.model\nFROM transportation.bookings b\nJOIN ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "List all claims with police reports that were filed in the last 3 months, showing the claim ID, policy ID, and estimated loss amount." }, { "role": "assistant", "content": "SELECT claim_id, policy_id, estimated_loss FROM insurance.claims WHERE police_report_number I...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "List all doctors who have not written any prescriptions. Return doctor_id, first_name, and last_name." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name FROM healthcare.doctors d LEFT JOIN healthcare.prescriptions p ON d.doctor_id =...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "List the full name of employees and the names of the agencies they work for, but only for employees who are currently employed." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, a.agency_name\nFROM government_ser...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "List all active staff members who are managers, along with their hire dates and email addresses." }, { "role": "assistant", "content": "SELECT staff_id, first_name, last_name, position, hire_date, work_email FROM hospitality_technology.staff WHERE is_active = true A...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...