system stringlengths 290 8.23k | conversations listlengths 2 8 |
|---|---|
You are an SQL statement expert. Given the table 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": "List all staff members showing their full name and position."
},
{
"role": "assistant",
"content": "SELECT first_name || ' ' || last_name AS staff_full_name, position FROM hospitality_technology.staff;"
},
{
"role": "user",
"content": "Now only include 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... | [
{
"role": "user",
"content": "Which ERC1155 NFT contracts on Ethereum have more than 25 approval-for-all events? List their contract addresses and approval counts."
},
{
"role": "assistant",
"content": "SELECT ea.contract_address, COUNT(*) AS approval_count\nFROM erc1155_approval_for_all ea\nGRO... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... | [
{
"role": "user",
"content": "List all staff members, the property name they work for, and the number of services offered at their property."
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, p.property_name, COUNT(sv.service_id) AS service_count\nFROM hospitali... |
You are an SQL statement expert. Given the table 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": "For each Bitcoin token tick, show me the creator address from the token_info_bitcoin table and the number of unique wallets currently holding that token."
},
{
"role": "assistant",
"content": "SELECT ti.tick, ti.creator, COUNT(DISTINCT tb.wallet_address) AS unique_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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d... | [
{
"role": "user",
"content": "List all customers who have two policies with overlapping coverage periods and show both policy numbers along with the overlap start and end dates."
},
{
"role": "assistant",
"content": "SELECT p1.customer_id, p1.policy_number AS policy_number1, p2.policy_number 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 PRIMARY KEY, property_id text, guest_id text, room_id text, r... | [
{
"role": "user",
"content": "List all reservations with their guest IDs and room IDs where the total amount is greater than $300, ordered by check-in date."
},
{
"role": "assistant",
"content": "SELECT reservation_id, guest_id, room_id, check_in_date FROM hospitality_technology.reservations WHE... |
You are an SQL statement expert. Given the table 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": "For each vehicle, find the vehicle in the same depot that was acquired immediately before it. Display the current vehicle_id, acquisition_date, previous vehicle_id, and its acquisition_date."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.acquisition_d... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the contract
address cha... | [
{
"role": "user",
"content": "List all users and the total value of all transactions they have initiated. Show user_id, username, and total_transaction_value."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COALESCE(SUM(t.value), 0) AS total_transaction_value\nFROM web3.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 healthcare.diagnoses (
diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry
... | [
{
"role": "user",
"content": "I need to find all pairs of diagnoses for the same patient where one diagnosis is chronic and the other is non-chronic. Show patient_id, chronic diagnosis_id as chronic_id, non-chronic diagnosis_id as acute_id, chronic diagnosis_date, and acute diagnosis_date."
},
{
"ro... |
You are an SQL statement expert. Given the table 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 )
| [
{
"role": "user",
"content": "For each user, show their user ID and the count of unique wallet addresses they own."
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(DISTINCT address) FROM wallets GROUP BY 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 gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, ite... | [
{
"role": "user",
"content": "Find players who own items with rarity 'Rare' or higher ('Epic', 'Legendary') and list their usernames."
},
{
"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 ... |
You are an SQL statement expert. Given the table 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.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan... | [
{
"role": "user",
"content": "Show a list of all DApps together with the total number of unique assets linked to each via the metadata table."
},
{
"role": "assistant",
"content": "SELECT d.dapp_id, d.name, d.url, COUNT(DISTINCT m.asset_id) AS unique_asset_count\nFROM trading_platform.dapps d\nL... |
You are an SQL statement expert. Given the table 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.messages ( message_id character varying(64) NOT NULL, conversation_id character varying(64) NOT NULL, send... | [
{
"role": "user",
"content": "List `user_id` and `conversation_id` for participants who are in conversations where there is at least one message sent by *another* user that they have not read."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.user_id, T1.conversation_id FROM social_media... |
You are an SQL statement expert. Given the table 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.conversations ( conversation_id text PRIMARY KEY, created_at timestamp, last_message_at timestamp, is_grou... | [
{
"role": "user",
"content": "List the group chat names and the creation dates for all group chats that have a last message sent in 2024."
},
{
"role": "assistant",
"content": "SELECT group_name, created_at FROM social_media.conversations WHERE is_group_chat = TRUE AND last_message_at >= '2024-0... |
You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... | [
{
"role": "user",
"content": "Show me a list of appointments, including their subject and start time, along with the case number for the related case."
},
{
"role": "assistant",
"content": "SELECT T1.subject, T1.start_time, T2.case_number FROM appointments AS T1 JOIN cases AS T2 ON T1.case_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.appointments ( appointment_id text PRIMARY KEY, client_id text, lawyer_id text, case_id text, start_time... | [
{
"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 token_dexpool_info ( pair_address.text, token_name.text, token_symbol.text, chain.text, price.numeric, price_change_per... | [
{
"role": "user",
"content": "For the Arbitrum chain, which three tokens have the greatest positive change in price over the last 1 hour? Please show their symbol, name, price, and 1-hour price change percentage."
},
{
"role": "assistant",
"content": "SELECT token_symbol, token_name, price, pric... |
You are an SQL statement expert. Given the table 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": "Show the count of patients residing in each unique address, excluding any entries with no address listed."
},
{
"role": "assistant",
"content": "SELECT address, COUNT(patient_id) AS patient_count FROM healthcare.patients WHERE address IS NOT NULL AND address != '' G... |
You are an SQL statement expert. Given the table 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, account_id character varying(64) NOT NULL, securit... | [
{
"role": "user",
"content": "Find pairs of BUY and SELL trades from the trades table for the same account that occurred on the same settlement_date and had matching quantities."
},
{
"role": "assistant",
"content": "SELECT\n a.trade_id AS buy_trade_id,\n b.trade_id AS sell_trade_id,\n a.acco... |
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": "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 SQL statement expert. Given the table 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, case_number character varying(100) UNIQUE, case_name tex... | [
{
"role": "user",
"content": "Which cases have at least one document uploaded, and what are the names and case numbers of those cases along with the most recent document name for each?"
},
{
"role": "assistant",
"content": "SELECT c.case_id, c.case_name, c.case_number, d.document_name AS latest_... |
You are an SQL statement expert. Given the table 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 all female patients born before 1990 who have a phone number listed, showing their full names and contact information."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, phone_number, email, emergency_contact_name, emergency_contact_phone FROM... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text )
CREATE TABLE blockchain.users ( ... | [
{
"role": "user",
"content": "List all users whose password hash contains the substring 'abc'."
},
{
"role": "assistant",
"content": "SELECT user_id, username, password_hash FROM blockchain.users WHERE password_hash LIKE '%abc%';"
},
{
"role": "user",
"content": "Also include their 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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
first_... | [
{
"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, city, zip_code FROM insurance.customers WHERE state... |
You are an SQL statement expert. Given the table 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.employees ( employee_id text, agency_id text, first_name text, last_name text, job_title text, depa... | [
{
"role": "user",
"content": "Show the full names and job titles of employees who work in the same department as at least one other employee."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, job_title\nFROM government_services.employees\nWHERE department IN (\n SELECT depa... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.diagnoses (
diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry
... | [
{
"role": "user",
"content": "List the patient ID and subscriber name for all patients who have both at least one diagnosis recorded and at least one primary insurance policy."
},
{
"role": "assistant",
"content": "SELECT DISTINCT pi.patient_id, pi.subscriber_name FROM healthcare.patient_insuran... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... | [
{
"role": "user",
"content": "What is the total investment_value per fundraising round for the year 2023? Order by total investment descending."
},
{
"role": "assistant",
"content": "SELECT\n substr(investment_date,1,7) AS month,\n rounds_name,\n SUM(investment_value) AS total_investment\nFRO... |
You are an SQL statement expert. Given the table 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 all terminated agents who worked for more than 5 years, showing their full names and termination dates."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, termination_date FROM insurance.agents WHERE termination_date IS NOT NULL AND (terminati... |
You are an SQL statement expert. Given the table 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, license_plate character varying(32) NOT NULL UNIQU... | [
{
"role": "user",
"content": "List all trips that originated from locations in California, showing the trip ID, vehicle make and model, and origin location details."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, v.make, v.model, l.name AS origin_name, l.city AS origin_city FROM 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 legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer
first_n... | [
{
"role": "user",
"content": "List the first name, last name, and firm name for all lawyers who are partners."
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , T2.firm_name FROM legal_services.lawyers AS T1 JOIN law_firms AS T2 ON T1.firm_id = T2.firm_id WHERE T1.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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... | [
{
"role": "user",
"content": "Show me the top 3 servers by the number of game sessions they've hosted, including server_name, region, and session_count."
},
{
"role": "assistant",
"content": "SELECT\n s.server_name,\n s.region,\n COUNT(gs.session_id) AS session_count\nFROM gaming_technology.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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... | [
{
"role": "user",
"content": "Which developers have at least one player who unlocked an achievement on a game they developed?"
},
{
"role": "assistant",
"content": "SELECT DISTINCT d.developer_id, d.name\nFROM gaming_technology.developers d\nJOIN gaming_technology.games g ON d.developer_id = g.d... |
You are an SQL statement expert. Given the table 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 PRIMARY KEY, policy_id text, customer_id text, payment_date timestamp, amo... | [
{
"role": "user",
"content": "Show me all premium payments made via credit card in the last 30 days, along with their policy IDs and payment amounts."
},
{
"role": "assistant",
"content": "SELECT payment_id, policy_id, amount_paid FROM insurance.premium_payments WHERE payment_method = 'credit_ca... |
You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... | [
{
"role": "user",
"content": "Give me a list of all unpaid invoices along with the first and last names of the clients and the issue date of each invoice."
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, i.issue_date, c.first_name, c.last_name\nFROM legal_services.invoices i\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 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 medical report documents with their claim IDs and descriptions, sorted by upload date."
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, description, uploaded_at FROM insurance.claim_documents WHERE document_type = 'medical_report' ORD... |
You are an SQL statement expert. Given the table 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, national_id_number character varying(128) NOT... | [
{
"role": "user",
"content": "List each employee's first and last name along with the count of active services offered by their agency."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS active_service_count\nFROM government_services.employees e\nJOIN... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id character varying(64) NOT NULL, ser... | [
{
"role": "user",
"content": "For each trip, list the trip ID, its scheduled departure time, and the total fare from all bookings associated with that trip."
},
{
"role": "assistant",
"content": "SELECT T2.trip_id , T2.scheduled_departure , SUM(T1.fare) FROM transportation.bookings AS T1 JOIN ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the contract
address cha... | [
{
"role": "user",
"content": "List all transactions along with the user_id of the sender when the sender’s address matches a wallet. Return transaction_id, from_address, and user_id."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.from_address, w.user_id FROM web3.transactions ... |
You are an SQL statement expert. Given the table 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 games released in 2023 along with their titles, platforms, and the names of their developers."
},
{
"role": "assistant",
"content": "SELECT g.game_id, g.title, g.platform, d.name AS developer_name\nFROM gaming_technology.games g\nJOIN gaming_technology.deve... |
You are an SQL statement expert. Given the table 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": "For each player, list their username together with the titles of games they have any items from in their inventory."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.username, g.title\nFROM gaming_technology.players p\nJOIN gaming_technology.player_inventory ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token token_name character varying(100) NO... | [
{
"role": "user",
"content": "For each narrative in smart_money_token_inflow, calculate the total usd_value and avg_price from buy transactions (type=1) and include the narrative's token count from narrative_info. Show narrative, chain, total_usd_value, avg_price, and token_num, ordered by total_usd_value d... |
You are an SQL statement expert. Given the table 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": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own."
},
{
"role": "assistant",
"content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.users ... |
You are an SQL statement expert. Given the table 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": "How many games are there per platform, and what is the earliest release_date for each platform?"
},
{
"role": "assistant",
"content": "SELECT platform,\n COUNT(*) AS game_count,\n MIN(release_date) AS earliest_release\nFROM gaming_technology.games\nGROUP... |
You are an SQL statement expert. Given the table 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 vehicles whose capacity is greater than the average capacity for their type. Show the vehicle_id, type, and capacity."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.type, v.capacity FROM transportation.vehicles v JOIN (SELECT type, AVG(capacity) ... |
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the transaction
fr... | [
{
"role": "user",
"content": "Find the top 5 transactions with the highest gas prices, including the from_address, to_address, and block_number, sorted by gas_price in descending order."
},
{
"role": "assistant",
"content": "SELECT transaction_id, from_address, to_address, block_number, gas_pric... |
You are an SQL statement expert. Given the table 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 text PRIMARY KEY, contract_address text, token_name text, token_symbol text, decimals int, total... | [
{
"role": "user",
"content": "List all tokens along with the contract addresses for symbols that appear more than once."
},
{
"role": "assistant",
"content": "SELECT t.token_id, t.token_symbol, t.contract_address\nFROM web3.tokens t\nJOIN (\n SELECT token_symbol\n FROM web3.tokens\n GROUP BY ... |
You are an SQL statement expert. Given the table 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.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id character varying(64) NOT NULL, ha... | [
{
"role": "user",
"content": "List all distinct pairs of hashtag_id that are applied to the same post_id."
},
{
"role": "assistant",
"content": "SELECT ph1.post_id, ph1.hashtag_id AS hashtag1_id, ph2.hashtag_id AS hashtag2_id\nFROM social_media.post_hashtags ph1\nJOIN social_media.post_hashtags ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients (
client_id character varying(64) NOT NULL, -- unique identifier for the client
first_n... | [
{
"role": "user",
"content": "List all pairs of clients who registered in the same month and year. Show both clients’ first and last names, plus the month and year they share."
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first_name_1,\n c1.last_name AS last_name_1,... |
You are an SQL statement expert. Given the table 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 text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti... | [
{
"role": "user",
"content": "Show me all trips that were completed with a passenger count greater than 15, including their route and vehicle details."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, t.route_id, t.vehicle_id, t.driver_id, t.scheduled_departure, t.actual_departure, t.sche... |
You are an SQL statement expert. Given the table 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, property_id character varying(64) NOT NULL... | [
{
"role": "user",
"content": "Show me each department in each property, along with the total number of available services and their combined price."
},
{
"role": "assistant",
"content": "SELECT property_id, department, COUNT(*) AS service_count, SUM(price) AS total_price FROM hospitality_technol... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.