conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Find the transaction IDs and timestamps for all transactions that resulted from an emitted event." }, { "role": "assistant", "content": "SELECT t.transaction_id, t.timestamp FROM web3.transactions t JOIN web3.events e ON t.transaction_id = e.transaction_id;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a...
[ { "role": "user", "content": "List each payment's currency_code, total amount paid, and the number of service orders placed by the same guest for the same reservation." }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.currency_code,\n p.amount AS payment_amount,\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 hospitality_technology.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu...
[ { "role": "user", "content": "Find all addresses with a balance greater than 1000, ordered by balance in descending order." }, { "role": "assistant", "content": "SELECT address_id, public_key, balance FROM blockchain.addresses WHERE balance > 1000 ORDER BY balance DESC;" }, { "role": "us...
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.addresses ( address_id text PRIMARY KEY, public_key text, balance numeric )
[ { "role": "user", "content": "For each narrative in smart money token inflow, calculate the total usd_value and list the token symbol that has the highest liquidity from the DEX pool." }, { "role": "assistant", "content": "SELECT i.narrative, SUM(i.usd_value) AS total_usd_inflow,\n (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 token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "role": "user", "content": "Show me the policy number, premium amount, start date, and status for all policies with a deductible of exactly 1000." }, { "role": "assistant", "content": "SELECT policy_number, premium_amount, start_date, status \nFROM insurance.policies \nWHERE deductible = 1000;...
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, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "List all appointments scheduled for '2024-07-25' with a status of 'Scheduled'." }, { "role": "assistant", "content": "SELECT * FROM legal_services.appointments WHERE DATE(start_time) = '2024-07-25' AND status = 'Scheduled'" } ]
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": "Show me all active customers from California who were born before 1980, along with their contact information." }, { "role": "assistant", "content": "SELECT first_name, last_name, phone_number, email, address_line1, address_line2, city, state, zip_code FROM insurance...
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 fuel refueling events with the refueled vehicle's make and model, the fuel type used, and the fueling location ID." }, { "role": "assistant", "content": "SELECT fl.fuel_log_id, fl.log_timestamp, v.make, v.model, fl.fuel_type, fl.quantity, fl.unit, fl.total_...
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": "Find agents whose commission_rate is higher than their manager's commission_rate. Show agent_id, agent first_name, agent last_name, commission_rate, manager_id, and the manager's commission_rate." }, { "role": "assistant", "content": "SELECT a.agent_id,\n a.fi...
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 text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "List the medication names which have never been prescribed to any patient." }, { "role": "assistant", "content": "SELECT m.medication_name\nFROM healthcare.medications m\nLEFT JOIN healthcare.prescriptions p ON m.medication_id = p.medication_id\nWHERE p.prescription...
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": "Which users have disabled both email and push notifications? Please provide their user IDs and whether their profiles are private." }, { "role": "assistant", "content": "SELECT user_id, private_profile FROM social_media.user_settings WHERE email_notifications_enable...
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.user_settings ( setting_id text PRIMARY KEY, user_id text, theme text, email_notifications_enabled bool, p...
[ { "role": "user", "content": "List all routes that have a distance greater than 100 km, showing the route number, origin and destination location IDs." }, { "role": "assistant", "content": "SELECT route_number, origin_location_id, destination_location_id FROM transportation.routes WHERE distance...
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": "List the top 5 tokens by total USD inflow and outflow, including net flow, sorted by net flow descending." }, { "role": "assistant", "content": "WITH inflow AS (\n SELECT token_symbol, chain, SUM(usd_value) AS usd_in\n FROM smart_money_token_inflow\n WHERE type =...
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.text, token_symbol.text, token_amount.numeric, usd_value.numeric, avg_price.nu...
[ { "role": "user", "content": "List the top 3 tokens by net flow on the Binance chain, including their symbol and average cost." }, { "role": "assistant", "content": "SELECT token_symbol, net_flow, avg_cost FROM smart_money_token_performance WHERE chain = 'Binance' ORDER BY net_flow 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 smart_money_token_performance ( token_address character varying(100) NOT NULL, -- the token's address token_symbol char...
[ { "role": "user", "content": "List document names and versions for documents that share the same case_id, showing each pair of versions." }, { "role": "assistant", "content": "SELECT d1.case_id, d1.document_name AS doc_name_v1, d1.version AS version1, d2.document_name AS doc_name_v2, d2.version ...
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 character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "role": "user", "content": "Show me all nodes that were last seen in the past 7 days, along with the count of wallets associated with users who have the same IP address as these nodes." }, { "role": "assistant", "content": "SELECT n.node_id, n.ip_address, n.port, COUNT(w.wallet_id) AS wallet_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 blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "role": "user", "content": "Can you narrow this down to only show cases where the case type is 'Criminal'?" }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Crimin...
You are an 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 trips where the actual arrival was earlier than the scheduled arrival, including the trip ID, scheduled and actual arrival times, and the vehicle make and model used." }, { "role": "assistant", "content": "SELECT T1.trip_id, T1.scheduled_arrival, T1.actual_arri...
You are an 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 character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Show each player's username and the number of distinct games they have played sessions on." }, { "role": "assistant", "content": "SELECT\n p.username,\n COUNT(DISTINCT gs.game_id) AS games_played\nFROM gaming_technology.players p\nJOIN gaming_technology.game_sessi...
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": "List all security_ids that had at least one day where the high_price was more than twice the low_price, along with the maximum price difference (high_price - low_price) observed for each security." }, { "role": "assistant", "content": "SELECT security_id, MAX(high_p...
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.market_data ( data_point_id bigint, security_id text, data_timestamp timestamp, open_price numeric, ...
[ { "role": "user", "content": "For service orders delivered in the last 30 days, show each guest's ID, first and last name, the count of service orders, and total spent." }, { "role": "assistant", "content": "SELECT so.guest_id,\n g.first_name,\n g.last_name,\n COUNT(*) AS 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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat...
[ { "role": "user", "content": "For each insurance product, can you list its product name, the number of unique agents who have sold policies for that product, and the total premium paid across those policies?" }, { "role": "assistant", "content": "SELECT ip.product_name, COUNT(DISTINCT a.agent_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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Find all clients who share the same address, showing both clients' names, emails, and the common address." }, { "role": "assistant", "content": "SELECT c1.first_name AS first_name1, c1.last_name AS last_name1, c1.email AS email1, c2.first_name AS first_name2, c2.las...
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": "Calculate the average number of days cases stay open before being closed, grouped by case type. Only consider cases that have a date closed." }, { "role": "assistant", "content": "SELECT case_type, AVG(DATE_PART('day', date_closed - date_opened)) AS average_duration...
You are an 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": "Show me the top 5 users who have created the most wallets, along with their email addresses and the creation date of their first wallet." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, MIN(w.created_at) AS first_wallet_date, COUNT(w.wallet_id) AS w...
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": "Could you list the trip ID, scheduled and actual arrival times, and the associated vehicle's make and model for all trips where the actual arrival was more than 30 minutes later than scheduled?" }, { "role": "assistant", "content": "SELECT T1.trip_id, T1.scheduled_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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ...
[ { "role": "user", "content": "List, for each passenger and trip combination, the total number of bookings and the total fare paid on that trip by each passenger." }, { "role": "assistant", "content": "SELECT passenger_id, trip_id, COUNT(*) AS booking_count, SUM(fare) AS total_fare\nFROM transpor...
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.bookings ( booking_id character varying(64) NOT NULL, -- unique identifier for the booking pass...
[ { "role": "user", "content": "Show me all electric vehicles along with their depot location details, including the depot's timezone." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, v.year, l.name AS depot_name, l.city, l.timezone FROM transportation.vehicles v JOIN 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.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Show the count of applications assigned to employees, grouped by the job title of the assigned employee." }, { "role": "assistant", "content": "SELECT e.job_title, COUNT(a.application_id) AS application_count FROM government_services.applications AS a JOIN governmen...
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": "What is the overall average ROI and average PNL for all smart money token performance records?" }, { "role": "assistant", "content": "SELECT AVG(roi) AS overall_average_roi, AVG(pnl) AS overall_average_pnl FROM smart_money_token_performance;" } ]
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_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,...
[ { "role": "user", "content": "Show me all rooms on floor 4 or above together with their room number, features, and current status." }, { "role": "assistant", "content": "SELECT room_id, room_number, features, status\nFROM hospitality_technology.rooms\nWHERE floor >= 4;" }, { "role": "use...
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, property_id text, room_number text, room_type_id text, floor integer, stat...
[ { "role": "user", "content": "Show me all insurance plans that have more than 3 patients enrolled as their primary insurance, along with the provider name and count of patients, sorted by patient count in descending order." }, { "role": "assistant", "content": "SELECT ip.insurance_provider, COUN...
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": "For each vehicle, show the vehicle_id, license_plate, the date of its most recent actual_arrival, and the total number of bookings across all its trips. Only include vehicles that have made at least one trip." }, { "role": "assistant", "content": "SELECT v.vehicle_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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List all ERC20 tokens from the sui_coins_metadata table where the decimals are 18, including their names and symbols." }, { "role": "assistant", "content": "SELECT name, symbol FROM sui_coins_metadata WHERE decimals = 18;" }, { "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 erc20_balances_historical ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk i...
[ { "role": "user", "content": "Find all route numbers for routes where the distance is exactly equal to the estimated duration in minutes." }, { "role": "assistant", "content": "SELECT route_number\nFROM transportation.routes\nWHERE distance_km = estimated_duration_minutes;" } ]
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 PRIMARY KEY, route_number text, description text, origin_location_id text, destin...
[ { "role": "user", "content": "Show me the names and providers of all insurance plans, along with their plan type." }, { "role": "assistant", "content": "SELECT plan_name, insurance_provider, plan_type FROM healthcare.insurance_plans;" }, { "role": "user", "content": "Only include tho...
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.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_provider text, plan_type text, contact...
[ { "role": "user", "content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount, sorted by amount in descending order." }, { "role": "assistant", "content": "SELECT b.wallet_address, t.symbol, b.amount FROM erc20_balances b JOIN sui_coin...
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": "List projects that raised funds in 2023 and have an associated token in token_basic_info. Show project_name, rounds_name, investment_value, token_symbol, and chain." }, { "role": "assistant", "content": "SELECT p.project_name, p.rounds_name, p.investment_value, t.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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "List all room types showing their type name, base rate, and the name of the property where they are offered." }, { "role": "assistant", "content": "SELECT T1.type_name, T1.base_rate, T2.property_name FROM hospitality_technology.room_types AS T1 JOIN hospitality_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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "Show me the average star rating for each property type in the USA." }, { "role": "assistant", "content": "SELECT property_type, AVG(star_rating) as avg_rating FROM hospitality_technology.properties WHERE country_code = 'US' GROUP BY property_type;" }, { "rol...
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 the top 3 fundraising rounds by investment value in the last 6 months, including project name and valuation." }, { "role": "assistant", "content": "SELECT project_name, rounds_name, investment_value, valuation\nFROM project_fundraising_record\nWHERE investme...
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 the full name of each lawyer along with the location and status of their appointments." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.location, T2.status FROM legal_services.lawyers AS T1 JOIN legal_services.appointments AS T2 ON ...
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 PRIMARY KEY, first_name text, last_name text, bar_number text UNIQUE, firm_id t...
[ { "role": "user", "content": "Show me the names and URLs of all DApps where the description contains the word 'wallet'." }, { "role": "assistant", "content": "SELECT name, url FROM trading_platform.dapps WHERE description ILIKE '%wallet%';" }, { "role": "user", "content": "I also wan...
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.dapps ( dapp_id.text, name.text, description.text, url.text )
[ { "role": "user", "content": "How many trips are there for each driver?" }, { "role": "assistant", "content": "SELECT driver_id, COUNT(*) AS trip_count FROM transportation.trips GROUP BY driver_id;" }, { "role": "user", "content": "Can you also show the total number of completed trip...
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.trips ( trip_id character varying(64) NOT NULL, -- unique identifier for a specific trip instance ...
[ { "role": "user", "content": "List all pairs of users who follow each other, including their usernames." }, { "role": "assistant", "content": "SELECT\n u1.username AS user_a,\n u2.username AS user_b\nFROM\n social_media.follows f1\n JOIN social_media.follows f2\n ON f1.follower_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 PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List each document name, document_type, the case_number, and case_name for all documents uploaded in the year 2023." }, { "role": "assistant", "content": "SELECT d.document_name, d.document_type, c.case_number, c.case_name\nFROM legal_services.documents d\nJOIN lega...
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 all cancelled trips along with their scheduled departure times and vehicle IDs." }, { "role": "assistant", "content": "SELECT trip_id, scheduled_departure, vehicle_id FROM transportation.trips WHERE status = 'Cancelled';" }, { "role": "user", "conte...
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.trips ( trip_id character varying(64) NOT NULL, -- unique identifier for a specific trip instance ...
[ { "role": "user", "content": "Show me all locations in California that are of type 'gas station', including their name, city, and postal code." }, { "role": "assistant", "content": "SELECT name, city, postal_code FROM transportation.locations WHERE state_province = 'California' AND type = 'gas 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 transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ...
[ { "role": "user", "content": "List payment records in USD including guest names and processing staff names." }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.amount,\n p.currency_code,\n g.guest_name,\n s.staff_name\nFROM hospitality_technology.payments p\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 hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "role": "user", "content": "List the usernames and emails of users who have set a location in their profile." }, { "role": "assistant", "content": "SELECT username, email\nFROM social_media.users\nWHERE location IS NOT NULL AND 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 social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Find all ERC20 tokens (from token_metas) currently held by wallet '0xfoo...' with a balance over 1000. Show the contract address and amount." }, { "role": "assistant", "content": "SELECT contract_address, amount\nFROM erc20_balances\nWHERE wallet_address = '0xfoo......
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": "For each game, find the next game released by the same developer. Return game_id, title, next_game_id, and next_game_title." }, { "role": "assistant", "content": "SELECT g1.game_id, g1.title, g2.game_id AS next_game_id, g2.title AS next_game_title\nFROM gaming_techn...
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": "For each guest, list each review and its immediately following review, including guest_id, first_review_id, first_review_date, second_review_id, and second_review_date." }, { "role": "assistant", "content": "SELECT r1.guest_id, r1.review_id AS first_review_id, r1.re...
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.text, property_id.text, reservation_id.text, guest_id.text, rating_overall.i...
[ { "role": "user", "content": "List all bookings with special requests, showing booking_id, passenger_id, and the special_requests." }, { "role": "assistant", "content": "SELECT booking_id, passenger_id, special_requests FROM transportation.bookings WHERE special_requests 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 transportation.maintenance_logs ( log_id text PRIMARY KEY, vehicle_id text, service_date date, odometer_reading int, se...
[ { "role": "user", "content": "List all ERC20 tokens from the metadata table. Show their symbol, name, contract address, and total supply." }, { "role": "assistant", "content": "SELECT symbol, name, contract_address, total_supply FROM token_metas WHERE is_erc20 = 1" }, { "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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "List the first name, last name, and date of birth for all citizens born before January 1, 1995." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM government_services.citizens WHERE date_of_birth < '1995-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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "What is the current job satisfaction level or feedback from staff members working at a specific train station?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on job satisfaction levels or feedback from staff members as this data is...
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.s...
[ { "role": "user", "content": "Show me all documents uploaded by lawyers from the 'Smith Legal Group' firm, including document_name, upload_timestamp, and the lawyer's first and last name." }, { "role": "assistant", "content": "SELECT d.document_name, d.upload_timestamp, l.first_name, l.last_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 character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "Find users who have enabled email notifications and have received at least one 'message' notification. Show their username and the creation time of the notification." }, { "role": "assistant", "content": "SELECT T1.username, T2.created_at FROM social_media.users 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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "List all pairs of tokens that are deployed on the same contract address and have the same number of decimals. Show both token IDs, the shared contract_address, and the decimals value." }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id_1, t2.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 web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "List all documents, including their document_id, document_type, upload_timestamp, and the reference number of the associated application." }, { "role": "assistant", "content": "SELECT d.document_id, d.document_type, d.upload_timestamp, a.reference_number\nFROM gover...
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 pairs of developers located in the same country but founded in different years." }, { "role": "assistant", "content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.country, d1.founded_year, d2.founded_year\nFROM gaming_technology.developers d1\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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "Show all fuel refueling logs with the fuel_log_id, fuel_type, total_cost, and the name and city of the location where the fueling occurred." }, { "role": "assistant", "content": "SELECT f.fuel_log_id,\n f.fuel_type,\n f.total_cost,\n l.name AS loca...
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": "For each block, compute the total number of transactions and the average gas_price." }, { "role": "assistant", "content": "SELECT block_number, COUNT(*) AS total_txs, AVG(gas_price) AS avg_gas_price FROM web3.transactions GROUP BY block_number;" }, { "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 web3.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address text, value numeric, gas_used int, g...
[ { "role": "user", "content": "List all unspent UTXOs with an amount greater than 10." }, { "role": "assistant", "content": "SELECT utxo_id, transaction_id, address, amount FROM utxos WHERE spent = FALSE AND amount > 10;" } ]
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": "How many distinct tokens did smart money buy on the 'BSC' chain in 2023?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT token_address) AS distinct_tokens_bought\nFROM smart_money_token_inflow\nWHERE type = 1\n AND chain = 'BSC'\n AND to_char(cast(tok...
You are an 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": "Find all pairs of doctors who have prescribed medications to the same patient. Return doctor1_id, doctor2_id, and patient_id." }, { "role": "assistant", "content": "SELECT p1.doctor_id AS doctor1_id,\n p2.doctor_id AS doctor2_id,\n p1.patient_id\nFROM he...
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.prescriptions ( prescription_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, pa...
[ { "role": "user", "content": "Count how many medications each manufacturer provides." }, { "role": "assistant", "content": "SELECT manufacturer, COUNT(*) FROM healthcare.medications GROUP BY manufacturer;" } ]
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.medications ( medication_id character varying(64) NOT NULL, medication_name character varying(255) NOT NULL,...
[ { "role": "user", "content": "What is the total USD value of smart money token inflows for each chain?" }, { "role": "assistant", "content": "SELECT chain, SUM(usd_value) AS total_usd_inflow FROM smart_money_token_inflow GROUP BY chain ORDER BY total_usd_inflow DESC;" }, { "role": "user"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE smart_money_token_inflow ( token_address text, token_symbol text, token_amount numer...
[ { "role": "user", "content": "Find pairs of reservations for the same guest at the same property where the check-in date of the second reservation is the same as the check-out date of the first reservation. List guest ID, property ID, and both reservation IDs." }, { "role": "assistant", "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 hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_id.text, room_id.text, room_type_id....
[ { "role": "user", "content": "Can you give me the count of players grouped by their status?" }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS player_count\nFROM gaming_technology.players\nGROUP BY status;" }, { "role": "user", "content": "Actually, include the...
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": "Show me the earliest created smart contract for each creator address." }, { "role": "assistant", "content": "SELECT sc1.contract_id, sc1.creator_address, sc1.timestamp FROM blockchain.smart_contracts sc1 WHERE sc1.timestamp = (SELECT MIN(sc2.timestamp) FROM blockcha...
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.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "role": "user", "content": "Show me all routes where the estimated duration in minutes is exactly twice the distance in kilometers. Include the route number and both the distance and duration." }, { "role": "assistant", "content": "SELECT route_number, distance_km, estimated_duration_minutes F...
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": "Show me all appointments scheduled to last exactly 60 minutes." }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, doctor_id, appointment_time, duration_minutes, status\nFROM healthcare.appointments\nWHERE duration_minutes = 60;" } ]
You are an 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.appointments ( appointment_id character varying(64) NOT NULL, -- unique identifier for the appointment ...
[ { "role": "user", "content": "I want the number of achievements unlocked per country_code by active players, showing only countries with at least 100 unlocks." }, { "role": "assistant", "content": "SELECT p.country_code, COUNT(*) AS unlock_count\nFROM gaming_technology.players p\nJOIN 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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "I need to know the total USD value of all ERC-20 holdings by each wallet. Calculate the sum of (amount * price) using the latest token prices from token_prices_latest, grouped by wallet_address." }, { "role": "assistant", "content": "SELECT eb.wallet_address,\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 erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, amount.text, pk.text ) CREATE TABLE n...
[ { "role": "user", "content": "What is the reason behind the cost variation for maintenance of asset_id 'ASSET456' over the past year?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the reasons behind cost variations for maintenance. The data in the maintenan...
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.m...
[ { "role": "user", "content": "Show a list of cases, displaying the case number, the case name, and the law firm associated with the case's lead attorney, specifically when the lead attorney is the firm's managing partner." }, { "role": "assistant", "content": "SELECT T1.case_number, T1.case_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.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, phone text, website text, founded_da...
[ { "role": "user", "content": "List the top 5 largest PDF documents in claim_documents, showing document_id, claim_id, file_name, and file_size_bytes." }, { "role": "assistant", "content": "SELECT document_id,\n claim_id,\n file_name,\n file_size_bytes\nFROM insurance.claim_docu...
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 the total traded amount and total commission for each security, including the security name." }, { "role": "assistant", "content": "SELECT s.security_id, s.security_name, SUM(t.total_amount) AS total_traded_amount, SUM(t.commission) AS total_commission\nFROM fi...
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.trades ( trade_id character varying(64) NOT NULL, -- unique identifier for the trade account...
[ { "role": "user", "content": "Show the total fare collected from bookings, grouped by the state/province of the destination location of the trip, for bookings made in May 2024." }, { "role": "assistant", "content": "SELECT\n l.state_province,\n SUM(b.fare) AS total_fare_collected\nFROM transpo...
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": "Give me the number of appointments for each active service. Show the service name and appointment count." }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(a.appointment_id) AS appointment_count\nFROM government_services.services s\nLEFT JOIN govern...
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 character varying(64) NOT NULL, -- unique identifier for the service ...
[ { "role": "user", "content": "Show me all maintenance logs for vehicles of make 'Toyota' performed after January 1, 2024. Include the log ID, vehicle ID, service date, and service type." }, { "role": "assistant", "content": "SELECT ml.log_id, ml.vehicle_id, ml.service_date, ml.service_type\nFROM...
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": "I want to see a list of invoice_number and appointment_id for each invoice that has a scheduled appointment." }, { "role": "assistant", "content": "SELECT i.invoice_number,\n a.appointment_id\nFROM legal_services.invoices i\nJOIN legal_services.appointments 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 legal_services.invoices ( invoice_id character varying(64) NOT NULL, -- unique identifier for the invoice invo...
[ { "role": "user", "content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest tpl ON tm.contract...
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": "For each medical record, display the record date, doctor full name, and medication name for any prescription linked to that record." }, { "role": "assistant", "content": "SELECT mr.record_date, d.first_name || ' ' || d.last_name AS doctor_full_name, m.medication_nam...
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": "List each patient_id along with the policy_number of their primary plan and the policy_number of any secondary (non-primary) plan they hold." }, { "role": "assistant", "content": "SELECT p_primary.patient_id,\n p_primary.policy_number AS primary_policy,\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 healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, patient_id character varying(64) NO...
[ { "role": "user", "content": "Show the distribution of total supply for tokens, grouped into ranges like < 1 million, 1 million to 1 billion, and > 1 billion. Count how many tokens fall into each range." }, { "role": "assistant", "content": "SELECT CASE WHEN total_supply < 1000000 THEN '< 1 mill...
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": "Find narratives with a market cap greater than $500,000,000 and a 7-day price change percentage above 5%. Show the narrative, market_cap, and price_change_percentage_7d." }, { "role": "assistant", "content": "SELECT narrative, market_cap, price_change_percentage_7d ...
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": "Find all appointments at location_id 'LOC123' where the reason contains 'follow-up' and the status is 'Scheduled', showing appointment_time and patient_id." }, { "role": "assistant", "content": "SELECT appointment_time, patient_id FROM healthcare.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 healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,...
[ { "role": "user", "content": "Show the full name and contact email of citizens who have submitted at least one application for services that are currently inactive." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM gover...
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 text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "List all agents who have a commission rate above 0.1, showing their full names and agency names." }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, agency_name, commission_rate FROM insurance.agents WHERE commission_rate > 0.1 AND 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.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "List the top 5 most used services across all properties. Show service_name and total quantity ordered, ordered by quantity descending." }, { "role": "assistant", "content": "SELECT s.service_name,\n SUM(o.quantity) AS total_quantity\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.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses." }, { "role": "assistant", "content": "SELECT name, contract_address, total_supply FROM token_metas WHERE is_erc20 = 1 ORDER BY CAST(total_supply AS decimal)...
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(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "For each trip, provide the trip ID, the name of the vehicle's make and model, and the total quantity of fuel used during that trip." }, { "role": "assistant", "content": "SELECT t.trip_id, v.make, v.model, SUM(f.quantity) AS total_fuel_used\nFROM transportation.trip...
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 character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List the medication_id, medication_name, and description for all medications whose generic_name starts with 'A'." }, { "role": "assistant", "content": "SELECT medication_id, medication_name, description\nFROM healthcare.medications\nWHERE generic_name LIKE '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 healthcare.medications ( medication_id character varying(64) NOT NULL, -- unique identifier for the medication type...
[ { "role": "user", "content": "How many documents have been uploaded by each lawyer? Show the lawyer ID and the count." }, { "role": "assistant", "content": "SELECT uploaded_by_lawyer_id, COUNT(*) AS document_count FROM legal_services.documents GROUP BY uploaded_by_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 each player's ID and the number of different achievement IDs they have unlocked." }, { "role": "assistant", "content": "SELECT player_id, COUNT(DISTINCT achievement_id) AS achievement_count\nFROM gaming_technology.player_achievements\ngroup by player_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.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "Show me the top 5 smart money addresses by profit on the Ethereum chain, along with their most profitable token and ROI." }, { "role": "assistant", "content": "SELECT address, most_profit_token, roi FROM smart_money_profit WHERE chain = 'Ethereum' ORDER BY profit DE...
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 character varying(100) NOT NULL, -- the user's address rank INT, -- the rank of the addres...
[ { "role": "user", "content": "List the first and last names of all doctors whose email address ends with '@hospital.org'." }, { "role": "assistant", "content": "SELECT first_name, last_name FROM healthcare.doctors WHERE email LIKE '%@hospital.org';" } ]
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...