conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List each user along with the total number of public posts they have made, and the names of any hashtags associated with their posts." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(DISTINCT p.post_id) AS public_post_count, STRING_AGG(DIST...
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": "Show me all users who have both bought and sold the same cryptocurrency asset, along with the asset details and their total buy/sell volumes." }, { "role": "assistant", "content": "SELECT DISTINCT b.user_id, a.asset_id, a.name, a.symbol, b.buy_volume, s.sell_volume ...
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 PRIMARY KEY, user_id text, address text, private_key text, created_at timesta...
[ { "role": "user", "content": "List all vehicles that use diesel fuel, showing their make, model, and year." }, { "role": "assistant", "content": "SELECT make, model, year FROM transportation.vehicles WHERE fuel_type = 'diesel';" }, { "role": "user", "content": "Now include only vehic...
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 PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Show me all services along with their property names." }, { "role": "assistant", "content": "SELECT s.service_id, s.service_name, p.property_name\nFROM hospitality_technology.services s\nJOIN hospitality_technology.properties p ON s.property_id = p.property_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 hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "role": "user", "content": "List all guests who have written at least two reviews, including their full names and the total number of reviews they wrote." }, { "role": "assistant", "content": "SELECT g.guest_id, g.first_name, g.last_name, COUNT(rw.review_id) AS review_count\nFROM hospitality_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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "Which locations have received fuel logs greater than 300 liters in total? Please include the location name and city." }, { "role": "assistant", "content": "SELECT l.name AS location_name, l.city, SUM(f.quantity) AS total_quantity\nFROM transportation.fuel_logs f\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 transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "List pairs of games that share the same publisher but belong to different genres, showing both titles and genres." }, { "role": "assistant", "content": "SELECT g1.game_id AS game1_id,\n g1.title AS title1,\n g1.genre AS genre1,\n g2.game_id AS game...
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 the user IDs and the notification types for users who have participated in any conversation. Also show the conversation ID they joined." }, { "role": "assistant", "content": "SELECT cp.user_id, n.notification_type, cp.conversation_id\nFROM social_media.conve...
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": "List all vehicles with a capacity greater than 20, including their make, model, and depot location details." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, v.capacity, v.depot_id FROM transportation.vehicles v WHERE v.capacity > 20;" }...
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": "Find all properties in California (state_province = 'California') that have a phone number and email address listed." }, { "role": "assistant", "content": "SELECT property_name, city, phone_number, email_address FROM hospitality_technology.properties WHERE state_pro...
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 the case ID, case number, and case name for all cases with status 'Open'." }, { "role": "assistant", "content": "SELECT case_id, case_number, case_name FROM legal_services.cases WHERE status = 'Open';" }, { "role": "user", "content": "Now, only show...
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 character varying(64) NOT NULL, -- unique identifier for the case/matter case_n...
[ { "role": "user", "content": "List all posts created by user 'U100' in March 2024." }, { "role": "assistant", "content": "SELECT post_id, user_id, content, created_at FROM social_media.posts WHERE user_id = 'U100' AND created_at >= '2024-03-01' AND created_at < '2024-04-01';" }, { "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 social_media.posts ( post_id text, user_id text, content text, media_url text, media_type text, created_at timestamp, u...
[ { "role": "user", "content": "Show me all patients who have been prescribed medications with dosage greater than 100mg, along with their full names and the medication details, including the prescribing doctor's last name." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, m...
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": "Retrieve all documents uploaded in 2024, showing document_id, uploaded_by, and uploaded_at." }, { "role": "assistant", "content": "SELECT document_id,\n uploaded_by,\n uploaded_at\nFROM insurance.claim_documents\nWHERE uploaded_at >= '2024-01-01'\n AND ...
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.claim_documents ( document_id.text, claim_id.text, document_type.text, file_name.text, file_path.text, file_s...
[ { "role": "user", "content": "For each token_id, what is the average value of transfers? Show token_id and avg_value." }, { "role": "assistant", "content": "SELECT token_id, AVG(value) AS avg_value\nFROM web3.token_transfers\nGROUP BY token_id;" }, { "role": "user", "content": "Actua...
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 character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "List each document_name along with the count of its versions, but only include those document_names that have more than 3 versions." }, { "role": "assistant", "content": "SELECT document_name,\n COUNT(version) AS version_count\nFROM legal_services.documents\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 legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u...
[ { "role": "user", "content": "For each game, show the game title, the total duration of all sessions in seconds, and the average score." }, { "role": "assistant", "content": "SELECT g.title, SUM(gs.duration_seconds) AS total_duration_seconds, AVG(gs.score) AS average_score FROM gaming_technology...
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, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date...
[ { "role": "user", "content": "List all clients who have an active status." }, { "role": "assistant", "content": "SELECT first_name, last_name FROM legal_services.clients WHERE status = 'active';" }, { "role": "user", "content": "Can you include their phone numbers and the date they 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "Show all active customers who live in the same zip_code." }, { "role": "assistant", "content": "SELECT a.customer_id AS cust1,\n b.customer_id AS cust2,\n a.zip_code\nFROM financial_services.customers a\nJOIN financial_services.customers b\n ON a.zip_co...
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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount, from the erc20_balances table." }, { "role": "assistant", "content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas...
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 varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "List all game titles and corresponding server names for servers that are located in the same region as 'us-central-1'." }, { "role": "assistant", "content": "SELECT g.title, s.server_name\nFROM gaming_technology.servers s\nJOIN gaming_technology.games g ON s.game_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 gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "Show me each doctor and the total number of unique patients they have prescribed medications to. Include the doctor's full name and the patient count." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(DISTINCT p.patient_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 text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "How many unique IP addresses are there in the nodes table?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT ip_address) FROM blockchain.nodes;" }, { "role": "user", "content": "Can you break this down by port numbers, showing the count of nod...
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 text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
[ { "role": "user", "content": "I want to see pairs of items from the same game that share the same rarity but are of different types. Show each pair's names and types." }, { "role": "assistant", "content": "SELECT a.game_id,\n a.item_name AS item1_name,\n a.item_type AS item1_type,\n ...
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, game_id.uuid, item_name.text, item_type.text, description.text, rarity....
[ { "role": "user", "content": "Identify all instances where a vehicle's odometer_reading increased by more than 500 miles between two consecutive fuel log entries." }, { "role": "assistant", "content": "SELECT a.vehicle_id,\n a.fuel_log_id AS previous_log_id,\n ...
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": "For each asset, I want to know how many orders have the status 'filled', showing the asset symbol." }, { "role": "assistant", "content": "SELECT m.value AS asset_symbol,\n COUNT(*) AS filled_order_count\nFROM trading_platform.orders o\nJOIN trading_platform.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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "What is the average score across all game sessions for each game? Include the game title and the average score." }, { "role": "assistant", "content": "SELECT T1.title, AVG(T2.score) FROM gaming_technology.games AS T1 JOIN gaming_technology.game_sessions AS T2 ON T1....
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 PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea...
[ { "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 n.name, n.symbol, n.floor_price, n.token_count FROM nft_collections n WHERE n.blockchain = '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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Which regions have more than one server using the same status? Please show the region and the shared status." }, { "role": "assistant", "content": "SELECT region, status, COUNT(*) AS server_count\nFROM gaming_technology.servers\nGROUP BY region, status\nHAVING COUNT...
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 me all rooms that were last cleaned more than 3 days ago, along with their room numbers and cleaning status." }, { "role": "assistant", "content": "SELECT room_number, current_condition FROM hospitality_technology.rooms WHERE last_cleaned_at < CURRENT_DATE - IN...
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 text PRIMARY KEY, property_id text, room_number text, room_type_id text, floor i...
[ { "role": "user", "content": "Return the usernames and emails of users who have bios that mention the word 'travel'." }, { "role": "assistant", "content": "SELECT username, email\nFROM social_media.users\nWHERE bio ILIKE '%travel%';" } ]
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": "Could you provide a count of guests for each country code?" }, { "role": "assistant", "content": "SELECT country_code, COUNT(*) FROM hospitality_technology.guests GROUP BY country_code" }, { "role": "user", "content": "Now show only those countries that ...
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 ...
[ { "role": "user", "content": "Show me the count of lawyers per specialization." }, { "role": "assistant", "content": "SELECT specialization,\n COUNT(*) AS lawyer_count\nFROM legal_services.lawyers\nGROUP BY specialization;" }, { "role": "user", "content": "Only include speciali...
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.lawyers ( lawyer_id text, first_name text, last_name text, bar_number text, firm_id text, email text, ph...
[ { "role": "user", "content": "List all insurance products that have a base premium greater than 1000 and are currently active, showing product name, type, and base premium." }, { "role": "assistant", "content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products 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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "Show the policy number, start date, and the first and last name of the agent for all policies that started in 2024." }, { "role": "assistant", "content": "SELECT p.policy_number, p.start_date, a.first_name AS agent_first_name, a.last_name AS agent_last_name\nFROM in...
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": "List all overdue premium payments with their policy IDs and due dates, sorted by due date in ascending order." }, { "role": "assistant", "content": "SELECT policy_id, due_date FROM insurance.premium_payments WHERE status = 'overdue' ORDER BY due_date ASC;" }, { ...
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.premium_payments ( payment_id.text, policy_id.text, customer_id.text, payment_date.timestamp, amount_paid.num...
[ { "role": "user", "content": "Can you tell me the average and maximum session duration for each player and server combination?" }, { "role": "assistant", "content": "SELECT player_id, server_id, AVG(duration_seconds) AS avg_duration, MAX(duration_seconds) AS max_duration\nFROM gaming_technology....
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, player_id.uuid, game_id.uuid, server_id.uuid, start_time.timestamptz...
[ { "role": "user", "content": "What is the schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not included in the platfo...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 train_station_management.p...
[ { "role": "user", "content": "Get a list of all distinct specialties found among the doctors." }, { "role": "assistant", "content": "SELECT DISTINCT specialty FROM healthcare.doctors;" } ]
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 text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "role": "user", "content": "List all pairs of token transfers occurring within the same transaction where one transferred value is greater than the other, showing both transfer IDs, the transaction ID, and both values." }, { "role": "assistant", "content": "SELECT t1.transaction_id,\n t1...
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 PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ...
[ { "role": "user", "content": "Find all transactions where the from_address is the same as the to_address, indicating self-transactions, and show the transaction_id, value, and gas_used." }, { "role": "assistant", "content": "SELECT transaction_id, value, gas_used FROM web3.transactions WHERE fro...
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.transactions ( transaction_id text, from_address text, to_address text, value numeric, gas_used integer, gas_price...
[ { "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 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 the usernames and emails of users who have sent at least one notification." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM social_media.users AS T1 JOIN social_media.notifications AS T2 ON T1.user_id = T2.sender_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 social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Show me all claim documents that are police reports and were uploaded in the last 30 days, along with their file sizes." }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_name, file_size_bytes, uploaded_at FROM insurance.claim_documents 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.claim_documents ( document_id text, claim_id text, document_type text, file_name text, file_path text, file_s...
[ { "role": "user", "content": "Show me all non-smoking rooms on the first floor, including their room number and the property name." }, { "role": "assistant", "content": "SELECT r.room_number, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.properties p ON r.prop...
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": "Generate a report showing the total number of achievement unlocks broken down by the calendar day they occurred. Show the date and the total number of unlocks for that day." }, { "role": "assistant", "content": "SELECT DATE(unlocked_at) AS unlock_date, COUNT(player_...
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_achievements ( player_achievement_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid N...
[ { "role": "user", "content": "What is the history of incidents or accidents that occurred on platform 5 at station GHI?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about the history of incidents or accidents on platform 5 at station GHI. My data is limited t...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 train_station_management.p...
[ { "role": "user", "content": "List all staff members, showing their full name, position, and the name of the property where they work." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T1.position, T2.property_name FROM hospitality_technology.staff AS T1 JOIN hospitality...
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": "Can you list all securities that have had at least one trade in the past 30 days? Please include the ticker_symbol, security_name, exchange, and the total number of trades for each security." }, { "role": "assistant", "content": "SELECT s.ticker_symbol, s.security_n...
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.securities ( security_id text, ticker_symbol text, isin_code text, cusip_code text, security_name te...
[ { "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, work_email, hire_date 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 character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "List each game's title along with the name of the developer and the total number of servers currently hosting that game." }, { "role": "assistant", "content": "SELECT g.title, g.developer_id, COUNT(s.server_id) AS total_servers\nFROM gaming_technology.games g\nLEFT ...
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, username.text, email.text, password_hash.text, registration_date.timestampt...
[ { "role": "user", "content": "For each trade, show the buyer_id, seller_id, asset_id, quantity, and also include any metadata value where the key is 'exchange' for the asset involved." }, { "role": "assistant", "content": "SELECT t.buyer_id, t.seller_id, t.asset_id, t.quantity, m.value AS exchan...
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": "Find all pairs of tokens that share the same token_name but have different token_symbols. Show both token IDs, the shared token_name, and each token’s symbol." }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id_1,\n t2.token_id AS token_id_2,...
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.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "Can you show, for each employee, the full name and job title of their direct manager, as well as the employee's department and branch_id?" }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name AS employee_first_name, e.last_name AS employee_last_n...
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.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "Find all documents that are associated with an application but have a verification status of 'Pending'. Show the document ID, document type, and application ID." }, { "role": "assistant", "content": "SELECT document_id, document_type, application_id FROM government_...
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": "Show me a summary of customers with their total account balance and the count of accounts." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(a.account_id) AS account_count, SUM(a.balance) AS total_account_balance FROM financial_services....
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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "What is the average price of tokens held by Binance exchange across all chains?" }, { "role": "assistant", "content": "SELECT AVG(price) as average_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 character varying(32) NOT NULL, chain character varying(128) NOT NULL, address charac...
[ { "role": "user", "content": "List all time entries for lawyers specializing in 'Criminal Law'. Show the entry ID, the date worked, hours spent, and the first and last name of the lawyer who performed the work." }, { "role": "assistant", "content": "SELECT te.entry_id, te.date_worked, te.hours_s...
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.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer first_n...
[ { "role": "user", "content": "Show me all cryptocurrency assets that have been traded more than 50 times but have never been traded in quantities greater than 100, along with their average trade price." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name, a.symbol, COUNT(t.trade_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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "List each driver's first name, last name, and hire_date." }, { "role": "assistant", "content": "SELECT first_name, last_name, hire_date\nFROM transportation.drivers;" }, { "role": "user", "content": "Now include the number of drivers hired on the same da...
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.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "Show me all intercity routes that have an estimated duration of more than 2 hours, along with their origin and destination locations." }, { "role": "assistant", "content": "SELECT r.route_id, r.route_number, r.estimated_duration_minutes, lo.name AS origin_location, ...
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.drivers ( driver_id character varying(64) NOT NULL, employee_id character varying(64) NOT NULL UNIQUE, f...
[ { "role": "user", "content": "Get me a list of upcoming appointments with appointment_id, client full name, case number, and start_time for appointments with status 'scheduled'." }, { "role": "assistant", "content": "SELECT a.appointment_id,\n CONCAT(cl.first_name, ' ', cl.last_name) AS cl...
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, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "I want to find all appointment pairs where two appointments are scheduled for the same client at overlapping times. Provide the appointment_id from both overlapping appointments." }, { "role": "assistant", "content": "SELECT a1.appointment_id AS appointment_id_1, a2...
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 PRIMARY KEY, client_id text, lawyer_id text, case_id text, start_time...
[ { "role": "user", "content": "List all agents who have been terminated, showing their full name, agency name, and termination date." }, { "role": "assistant", "content": "SELECT first_name, last_name, agency_name, termination_date\nFROM insurance.agents\nWHERE status <> 'Active';" } ]
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.agents ( agent_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara...
[ { "role": "user", "content": "Show me all wallet addresses that hold more than 100 of any ERC1155 token, along with the token ID and amount, but only include tokens from collections with a floor price greater than 0.1 ETH." }, { "role": "assistant", "content": "SELECT nh.wallet_address, nh.token...
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": "For each event, display its event_id, the event_id of the previous event in the same transaction (if any), and the log_index of both events." }, { "role": "assistant", "content": "SELECT curr.event_id AS current_event_id,\n prev.event_id AS previous_event_...
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 character varying(64) NOT NULL, contract_id character varying(64) NOT NULL, event_name character...
[ { "role": "user", "content": "Show all insurance plans where the plan name includes the word 'Care'." }, { "role": "assistant", "content": "SELECT plan_id, plan_name, insurance_provider, plan_type\nFROM healthcare.insurance_plans\nWHERE plan_name ILIKE '%Care%';" } ]
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.text, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty...
[ { "role": "user", "content": "Provide the total quantity of items acquired by each player and the most recent acquisition date." }, { "role": "assistant", "content": "SELECT pi.player_id,\n SUM(pi.quantity) AS total_quantity,\n MAX(pi.acquired_at) AS last_acquired_at\nFROM gaming_tec...
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(), title character varying(200) NOT NULL, devel...
[ { "role": "user", "content": "List all doctors who have made more than 10 diagnoses with status 'Active', including their full names and specialties." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, d.specialty, COUNT(di.diagnosis_id) AS active_diagnoses_count FROM health...
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": "What is the total USD value of tokens held by CEXes for tokens belonging to the 'DeFi' narrative on the 'Ethereum' chain? Show the narrative, chain, and total value." }, { "role": "assistant", "content": "SELECT T2.narrative, T1.chain, SUM(T1.usd_value) AS total_usd...
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": "Show me all transactions (transaction_id, amount, transaction_type) where the amount is greater than $5,000 and the status is 'Completed', along with the account_id and transaction_date, sorted by transaction_date in descending order." }, { "role": "assistant", "con...
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.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,...
[ { "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": "Find all users who have at least two wallets with different private keys. Show user_id and the count of distinct private keys for those users." }, { "role": "assistant", "content": "SELECT user_id, COUNT(DISTINCT private_key) AS distinct_private_key_count\nFROM web3...
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": "List smart money addresses with a realized ratio greater than 0.9 and a profit greater than 50000. Show the address, chain, realized ratio, and profit." }, { "role": "assistant", "content": "SELECT address, chain, realized_ratio, profit FROM smart_money_profit 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 cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "Show me the top 3 smart money addresses by profit across all chains, along with their most profitable token and chain information." }, { "role": "assistant", "content": "SELECT address, profit, most_profit_token, chain\nFROM smart_money_profit\nORDER BY profit DESC\...
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, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "What is the average number of game sessions started per hour of the day (0-23), considering all recorded sessions? Show the hour and the average count." }, { "role": "assistant", "content": "SELECT EXTRACT(HOUR FROM start_time) AS session_hour, COUNT(*)::NUMERIC / C...
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, player_id uuid, game_id uuid, server_id uuid, start_time timestamp w...
[ { "role": "user", "content": "Show me the number of approval-for-all events for each ERC1155 contract in the erc1155_approval_for_all table." }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_for_all GROUP BY contract_address;" }, ...
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 NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "Get the usernames of users who have created any public posts, and count how many public posts each user has made. Order the results by the post count in descending order." }, { "role": "assistant", "content": "SELECT u.username, COUNT(p.post_id) AS public_post_count...
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, -- unique identifier for the user username charac...
[ { "role": "user", "content": "Show me the block ID, timestamp, and the timestamp of its previous block for blocks created between '2023-07-01' and '2023-09-30'." }, { "role": "assistant", "content": "SELECT b1.block_id, b1.timestamp, b2.timestamp AS previous_block_timestamp FROM blockchain.block...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, previous_block_id text, timestamp tim...
[ { "role": "user", "content": "List all premium payments that were made using 'credit card' as the payment method." }, { "role": "assistant", "content": "SELECT payment_id, policy_id, customer_id, payment_date, amount_paid, payment_method\nFROM insurance.premium_payments\nWHERE payment_method = '...
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": "For each reservation, can you show the guest's full name, the property name, and the room number?" }, { "role": "assistant", "content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS guest_full_name, p.property_name, rm.room_number\nFROM hospitality...
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": "Show me product_id, product_name, and base_premium for products created after '2023-01-01'." }, { "role": "assistant", "content": "SELECT product_id,\n product_name,\n base_premium\nFROM insurance.insurance_products\nWHERE created_at > '2023-01-01';" }...
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 text PRIMARY KEY, product_name text, product_type text, description text, bas...
[ { "role": "user", "content": "Show me the name of each property and the full name of the staff member assigned as its manager." }, { "role": "assistant", "content": "SELECT T1.property_name, T2.first_name, T2.last_name FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.staf...
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 PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Show me all players who have unlocked a hidden achievement. List the player ID, the name of the achievement, and the date they unlocked it." }, { "role": "assistant", "content": "SELECT pa.player_id, a.name AS achievement_name, pa.unlocked_at FROM gaming_technology....
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": "For each reservation, find the next reservation made by the same guest and calculate the gap in days between them." }, { "role": "assistant", "content": "select r1.reservation_id as current_reservation_id, r2.reservation_id as next_reservation_id, r2.check_in_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 hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r...
[ { "role": "user", "content": "Count the number of claims for each status in the system." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.claims GROUP BY status;" } ]
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.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d...
[ { "role": "user", "content": "List each vehicle that has both Diesel and Gasoline fueling events. Show vehicle_id, the fuel_log_id and log_timestamp for the Diesel event, and the fuel_log_id and log_timestamp for the Gasoline event." }, { "role": "assistant", "content": "SELECT d.vehicle_id,\n ...
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": "Retrieve all pairs of loans for the same account where both loans are active and have different loan types. Show account_id, loan_id as loan_a, loan_type as type_a, loan_id as loan_b, and loan_type as type_b." }, { "role": "assistant", "content": "SELECT a.account_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 financial_services.loans ( loan_id character varying(64) NOT NULL, -- unique identifier for the loan, could be same...
[ { "role": "user", "content": "List all accounts opened in the last 18 months, including the account number, account type, and the full name of the customer." }, { "role": "assistant", "content": "SELECT a.account_number, a.account_type, c.first_name, c.last_name, a.opened_date FROM financial_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 financial_services.accounts ( account_id character varying(64) NOT NULL, -- unique identifier for the account c...
[ { "role": "user", "content": "Show ERC20 tokens with total supply greater than 100,000,000, displaying symbol, name, contract address, and total supply from the token_metas table." }, { "role": "assistant", "content": "SELECT symbol, name, contract_address, total_supply FROM token_metas WHERE to...
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 erc20_balances_historical ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wallet_address varchar NOT...
[ { "role": "user", "content": "Show me all savings accounts (account_id, account_number, balance) with an interest rate above 2.5%, along with the security details (ticker_symbol, issuer_name) for securities in the same currency as the account." }, { "role": "assistant", "content": "SELECT a.acco...
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.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac...
[ { "role": "user", "content": "Find the top 5 employees who have verified the most documents. Display the employee full name and the count of verified documents, ordered by count descending." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS full_name,\n COU...
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": "List the name of NFTs and their contract name, along with the symbol and total supply from the token information table, for NFTs on the 'ethereum' blockchain." }, { "role": "assistant", "content": "SELECT T1.name, T1.contract_name, T2.symbol, T2.total_supply FROM nf...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "Show me the top 3 smart money addresses by PnL in the last month, along with their most profitable token and ROI." }, { "role": "assistant", "content": "SELECT token_address, token_symbol, pnl, roi FROM smart_money_token_performance ORDER BY pnl DESC LIMIT 3;" }, ...
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": "List pairs of overlapping reservations for the same room, including both reservation IDs, room_id, and each reservation's check-in and check-out dates." }, { "role": "assistant", "content": "SELECT r1.reservation_id AS reservation_id_1,\n r2.reservation_id 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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ...
[ { "role": "user", "content": "For each player, count how many unique games they have played." }, { "role": "assistant", "content": "SELECT player_id, COUNT(DISTINCT game_id) AS unique_games_played FROM gaming_technology.game_sessions GROUP BY player_id;" }, { "role": "user", "content...
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, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date...
[ { "role": "user", "content": "List the product_id, product_name, and description of any insurance products created before 2024 whose description contains the word 'theft'." }, { "role": "assistant", "content": "SELECT product_id, product_name, description\nFROM insurance.insurance_products\nWHER...
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.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "For each user, show their user_id, KYC status, and the total count of completed orders they've placed." }, { "role": "assistant", "content": "SELECT k.user_id, k.status, COUNT(o.order_id) AS completed_order_count\nFROM trading_platform.kyc_audit k\nJOIN trading_plat...
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 usernames of players who own at least one item from the game with title 'Game Title X'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username FROM players AS T1 INNER JOIN player_inventory AS T2 ON T1.player_id = T2.player_id INNER JOIN items 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.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, ite...
[ { "role": "user", "content": "For each service location, find the nearest accessible service location. Show the location_id, location_name, nearest_location_id, and the distance." }, { "role": "assistant", "content": "SELECT l.location_id,\n l.location_name,\n nearest.location_id 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 government_services.service_locations ( location_id text PRIMARY KEY, agency_id text, location_name text, address text,...