conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "Show me all smart contracts created by addresses that have created more than 5 contracts, along with the count of contracts each creator has made."
},
{
"role": "assistant",
"content": "SELECT sc.contract_id, sc.creator_address, COUNT(*) OVER (PARTITION BY sc.creato... | You are an SQL statement expert. Given the table 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": "Which achievement has the highest point value for each game?"
},
{
"role": "assistant",
"content": "SELECT a1.game_id, a1.achievement_id, a1.name, a1.points FROM gaming_technology.achievements a1 WHERE a1.points = (SELECT MAX(a2.points) FROM gaming_technology.achiev... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p... |
[
{
"role": "user",
"content": "Show me all available rooms (status = 'available') with their room numbers and features, along with their property IDs and room type details including base rate and max occupancy."
},
{
"role": "assistant",
"content": "SELECT r.room_number, r.features, r.property_id... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text PRIMARY KEY, property_id text, room_number text, room_type_id text, floor i... |
[
{
"role": "user",
"content": "Show me the list of posts with their content and the usernames of users who commented on them, for posts that are public."
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.content, u.username AS commenter_username\nFROM social_media.posts p\nJOIN social_med... | You are an SQL statement expert. Given the table 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": "Which states have the highest number of customers? Provide the top 5 states along with their customer counts, ordered by count descending."
},
{
"role": "assistant",
"content": "SELECT\n state,\n COUNT(*) AS customer_count\nFROM insurance.customers\nGROUP BY 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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
first_... |
[
{
"role": "user",
"content": "List all trades (trade_id, security_id, quantity) where the settlement_date is within the last 30 days and the trade_type is 'Sell', along with the account_id and total_amount."
},
{
"role": "assistant",
"content": "SELECT trade_id, security_id, quantity, account_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 financial_services.trades ( trade_id.text, account_id.text, security_id.text, order_id.text, trade_type.text, quantity.... |
[
{
"role": "user",
"content": "List all group chats with their conversation ID, group_name, and the total number of likes that occurred after the chat was created."
},
{
"role": "assistant",
"content": "SELECT c.conversation_id,\n c.group_name,\n COUNT(l.like_id) AS total_likes\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 social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, created_at.timestamp )
CREATE TABLE soc... |
[
{
"role": "user",
"content": "List the first names, last names, and work emails of employees who have the same job title as their direct manager."
},
{
"role": "assistant",
"content": "SELECT e1.first_name, e1.last_name, e1.work_email\nFROM government_services.employees e1\nJOIN government_servi... | You are an SQL statement expert. Given the table 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": "Find all patients who have both a primary insurance plan and at least one completed appointment, along with their insurance policy numbers and the count of appointments."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, pi.policy_number, COUNT... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "List all insurance products with their product name and base premium, where the product description contains the word 'accident'."
},
{
"role": "assistant",
"content": "SELECT product_name, base_premium FROM insurance.insurance_products WHERE description ILIKE '%acc... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... |
[
{
"role": "user",
"content": "For each booking, list the booking_id, fare, and the total quantity of fuel consumed on its associated trip."
},
{
"role": "assistant",
"content": "SELECT b.booking_id,\n b.fare,\n SUM(fl.quantity) AS total_fuel_quantity\nFROM transportation.bookings b\n... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text... |
[
{
"role": "user",
"content": "For each property, show the total number of service orders, the total quantity of items ordered, and the total price of those orders."
},
{
"role": "assistant",
"content": "SELECT T2.property_name, COUNT(T1.order_id) AS total_orders, SUM(T1.quantity) AS total_quanti... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.service_orders (
order_id character varying(64) NOT NULL, -- unique identifier for a specifi... |
[
{
"role": "user",
"content": "List all cancelled policies with their cancellation reasons and premium amounts."
},
{
"role": "assistant",
"content": "SELECT policy_id, cancellation_reason, premium_amount FROM insurance.policies 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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d... |
[
{
"role": "user",
"content": "Show me all users whose username contains 'dev', including their user_id and email address."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email FROM web3.users WHERE username ILIKE '%dev%';"
},
{
"role": "user",
"content": "Can you als... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp )
|
[
{
"role": "user",
"content": "How many times is hashtag 'H001' used across all posts?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM social_media.post_hashtags\nWHERE hashtag_id = 'H001';"
}
] | You are an SQL statement expert. Given the table 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 text, post_id text, hashtag_id text )
CREATE TABLE social_media.conversati... |
[
{
"role": "user",
"content": "Find all pairs of partners who share the same specialization but work at different firms."
},
{
"role": "assistant",
"content": "SELECT l1.first_name || ' ' || l1.last_name AS partner_one,\n l2.first_name || ' ' || l2.last_name AS partner_two,\n l1.speci... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph... |
[
{
"role": "user",
"content": "List all pairs of securities that are issued by the same issuer but trade on different exchanges. Show the ticker symbols and exchanges for both securities as symbol_a, exchange_a, symbol_b, exchange_b, and include issuer_name."
},
{
"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 financial_services.securities ( security_id text, ticker_symbol text, isin_code text, cusip_code text, security_name te... |
[
{
"role": "user",
"content": "Show me all appointment IDs and their scheduled start times along with the employee ID and service ID for appointments that have been booked using the 'Kiosk' booking method."
},
{
"role": "assistant",
"content": "SELECT appointment_id, scheduled_start_time, employe... | You are an SQL statement expert. Given the table 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.appointments ( appointment_id text, citizen_id text, employee_id text, location_id text, service_id... |
[
{
"role": "user",
"content": "Show me all reservations with their reservation_id, room_number, room status, and check_in_date."
},
{
"role": "assistant",
"content": "SELECT r.reservation_id,\n rm.room_number,\n rm.status AS room_status,\n r.check_in_date\nFROM hospitality_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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, room... |
[
{
"role": "user",
"content": "List the first name and last name of citizens along with the amount of payments they have made."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.amount FROM government_services.citizens AS T1 JOIN government_services.payments AS T2 ON T1... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "Which managers supervise employees in more than one department? Show the manager's first and last name and the distinct departments."
},
{
"role": "assistant",
"content": "SELECT m.first_name AS manager_first_name, m.last_name AS manager_last_name, COUNT(DISTINCT 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 government_services.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa... |
[
{
"role": "user",
"content": "Show the number of documents uploaded per month in the year 2024."
},
{
"role": "assistant",
"content": "SELECT STRFTIME('%Y-%m', T1.upload_timestamp), COUNT(T1.document_id) FROM government_services.documents AS T1 WHERE STRFTIME('%Y', T1.upload_timestamp) = '2024' ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.documents ( document_id.text, application_id.text, citizen_id.text, document_type.text, file_refere... |
[
{
"role": "user",
"content": "Show each user's earliest wallet and latest wallet with their wallet_id and created_at."
},
{
"role": "assistant",
"content": "SELECT w1.user_id,\n w1.wallet_id AS earliest_wallet,\n w1.created_at AS earliest_date,\n w2.wallet_id AS latest_wallet,\... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"role": "user",
"content": "For each pair of origin and destination location IDs, show the number of completed trips between them."
},
{
"role": "assistant",
"content": "SELECT origin_location_id, destination_location_id, COUNT(*) AS completed_trip_count FROM transportation.trips WHERE 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 transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti... |
[
{
"role": "user",
"content": "Find the username, email, and total number of orders placed by each user."
},
{
"role": "assistant",
"content": "SELECT u.username, u.email, COUNT(o.order_id) AS order_count\nFROM trading_platform.users u\nLEFT JOIN trading_platform.wallets w ON u.user_id = w.user_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 trading_platform.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username ch... |
[
{
"role": "user",
"content": "How many secondary insurance policies are there in the system?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS secondary_policy_count\nFROM healthcare.patient_insurance\nWHERE is_primary = FALSE;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "Which players have played sessions on more than one distinct game? Show their player_id, username, and the number of unique games they've played."
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, COUNT(DISTINCT gs.game_id) AS unique_games_played... | You are an SQL statement expert. Given the table 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": "List service orders placed in the last 7 days, showing order_id, service_name, guest full name, and order_timestamp."
},
{
"role": "assistant",
"content": "SELECT so.order_id, s.service_name, g.first_name || ' ' || g.last_name AS guest_name, so.order_timestamp\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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat... |
[
{
"role": "user",
"content": "List all individual token holdings by CEX addresses on the 'Arbitrum' chain with a USD value greater than $100,000. Show the exchange, token symbol, and USD value."
},
{
"role": "assistant",
"content": "SELECT exchange, token_symbol, usd_value FROM cex_token_balance... | You are an SQL statement expert. Given the table 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.text, token_name.text, token_symbol.text, token_address.text, chain.text, price.numeric, pri... |
[
{
"role": "user",
"content": "List each insurance product's name and type, along with the number of active policies and the total premium_amount collected for those policies. Only include products that have at least one active policy."
},
{
"role": "assistant",
"content": "SELECT p.product_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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,... |
[
{
"role": "user",
"content": "List the object ID, collection type, and owner for all Sui NFTs with status 'exists'."
},
{
"role": "assistant",
"content": "SELECT object_id, collection_type, owner FROM sui_nfts WHERE status = 'exists';"
},
{
"role": "user",
"content": "Now, only inclu... | You are an SQL statement expert. Given the table 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": "Count the number of medications provided by the manufacturer 'Novartis'."
},
{
"role": "assistant",
"content": "SELECT count(*) FROM healthcare.medications WHERE manufacturer = 'Novartis'"
}
] | You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ... |
[
{
"role": "user",
"content": "List each player's most recent achievement unlock, showing the player_id, achievement_id, and unlocked_at timestamp."
},
{
"role": "assistant",
"content": "SELECT pa.player_id, pa.achievement_id, pa.unlocked_at FROM gaming_technology.player_achievements pa INNER JOI... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, achievement_id.uuid, unlocked_at.ti... |
[
{
"role": "user",
"content": "List all available rooms (status = 'available') with their room numbers and features, along with their property IDs."
},
{
"role": "assistant",
"content": "SELECT room_id, property_id, room_number, features FROM hospitality_technology.rooms WHERE status = 'available... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text PRIMARY KEY, property_id text, room_number text, room_type_id text, floor i... |
[
{
"role": "user",
"content": "Show me all transactions where the description contains the word 'fee'."
},
{
"role": "assistant",
"content": "SELECT * FROM financial_services.transactions WHERE description ILIKE '%fee%';"
},
{
"role": "user",
"content": "Limit the results to transacti... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,... |
[
{
"role": "user",
"content": "Show me all active managers along with their property IDs and the number of staff members they supervise, ordered by the number of supervised staff in descending order."
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.property_id, s.first_name, s.last_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 hospitality_technology.staff (
staff_id character varying(64) NOT NULL, -- unique identifier for the staff member
... |
[
{
"role": "user",
"content": "List all active insurance products, including their product name, type, and base premium."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WHERE is_active = TRUE;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... |
[
{
"role": "user",
"content": "Can you provide the number of doctors grouped by their medical specialty?"
},
{
"role": "assistant",
"content": "SELECT specialty, COUNT(*) AS doctor_count\nFROM healthcare.doctors\nGROUP BY specialty;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors (
doctor_id character varying(64) NOT NULL, -- unique identifier for the doctor
first_name ... |
[
{
"role": "user",
"content": "List each booking with its previous booking time for the same passenger."
},
{
"role": "assistant",
"content": "SELECT b.booking_id,\n b.passenger_id,\n b.booking_time,\n LAG(b.booking_time) OVER (PARTITION BY b.passenger_id ORDER BY b.booking_time... | You are an SQL statement expert. Given the table 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 text, passenger_id text, trip_id text, seat_number text, booking_time timestamp, s... |
[
{
"role": "user",
"content": "What is the detailed repair history for train number T5678?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the detailed repair history for train number T5678 as this information is not available in the current database table. The table only in... | 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.t... |
[
{
"role": "user",
"content": "Show the route number and description for routes that have bookings associated with them."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.route_number, T1.description FROM transportation.routes AS T1 JOIN transportation.bookings AS T2 ON T1.route_id = T2.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.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ... |
[
{
"role": "user",
"content": "I'd like to see, for each month, the total number of players who registered and how many of them are active versus inactive."
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', registration_date) AS month,\n COUNT(*) AS total_registrations,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... |
[
{
"role": "user",
"content": "Calculate the average cost_per_unit for each fuel_type from the fuel_logs table."
},
{
"role": "assistant",
"content": "SELECT fuel_type,\n AVG(cost_per_unit) AS avg_cost_per_unit\nFROM transportation.fuel_logs\nGROUP BY fuel_type;"
},
{
"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 transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu... |
[
{
"role": "user",
"content": "For each security issuer, show the count of market data points and the average close price for their securities."
},
{
"role": "assistant",
"content": "SELECT T2.issuer_name, COUNT(T1.*) AS data_point_count, AVG(T1.close_price) AS avg_close_price FROM financial_serv... | You are an SQL statement expert. Given the table 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 bigserial NOT NULL, -- auto-incrementing primary key
security_id... |
[
{
"role": "user",
"content": "For each passenger, show their passenger_id, first_name, last_name, the date and time of their earliest booking, and the date and time of their latest booking."
},
{
"role": "assistant",
"content": "SELECT p.passenger_id,\n p.first_name,\n p.last_name,\n... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"role": "user",
"content": "Retrieve the daily total fare collected for bookings with status 'Completed' in March 2024. Display the booking_date and total_fare."
},
{
"role": "assistant",
"content": "SELECT\n DATE(booking_time) AS booking_date,\n SUM(fare) AS total_fare\nFROM transportation.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t... |
[
{
"role": "user",
"content": "Show me all guests who have not provided their date of birth, along with their email if available, ordered by created date."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM hospitality_technology.guests WHERE date_of_birth IS NULL ORDE... | You are an SQL statement expert. Given the table 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.guests (
guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil... |
[
{
"role": "user",
"content": "Find the top 5 transactions with the highest gas prices that were successful, including the from_address, to_address, and block_number."
},
{
"role": "assistant",
"content": "SELECT from_address, to_address, block_number, gas_price FROM web3.transactions WHERE statu... | You are an SQL statement expert. Given the table 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, from_address character varying(128) NOT NULL, to_add... |
[
{
"role": "user",
"content": "List all tokens with a price below $1 and a 24-hour trading volume over $10 million."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE price < 1 AND CAST(total_volume AS double precision) > 100000... | You are an SQL statement expert. Given the table 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, token_name character varying(100) NOT NULL, token_symbol ch... |
[
{
"role": "user",
"content": "List each property with the total number of active staff members and the average base rate of its room types."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, COUNT(s.staff_id) AS active_staff_count, ROUND(AVG(rt.base_rate), 2) AS avg_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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "For token transfers, list total transfer volume and number of transfers per token tick in the last 7 days."
},
{
"role": "assistant",
"content": "WITH agg AS (\n SELECT tick,\n SUM(amt) AS total_volume,\n COUNT(*) AS transfer_count\n FROM token_act... | You are an SQL statement expert. Given the table 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": "Show the number of reservations and the sum total_amount for each property."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, COUNT(r.reservation_id) AS reservation_count, SUM(r.total_amount) AS total_revenue \nFROM hospitality_technology... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ... |
[
{
"role": "user",
"content": "List all customers in California ('CA'). Show their full name, city, and date of birth."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, city, date_of_birth FROM financial_services.customers WHERE state = 'CA'"
},
{
"role": "user",
"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 financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad... |
[
{
"role": "user",
"content": "Show me all token names and their contract addresses along with the wallet addresses of users who created wallets in the last 30 days, sorted by wallet creation date."
},
{
"role": "assistant",
"content": "SELECT t.token_name, t.contract_address, w.address AS wallet... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha... |
[
{
"role": "user",
"content": "List all pairs of record_id for the same patient that were created on the same day. Show the two record_ids, patient_id, and the date."
},
{
"role": "assistant",
"content": "SELECT\n mr1.patient_id,\n date_trunc('day', mr1.record_date) AS record_day,\n mr1.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- unique identifier for the medical record... |
[
{
"role": "user",
"content": "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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... |
[
{
"role": "user",
"content": "Show me all nodes that haven't been seen in the last 24 hours."
},
{
"role": "assistant",
"content": "SELECT node_id,\n ip_address,\n port,\n last_seen\nFROM blockchain.nodes\nWHERE last_seen < NOW() - INTERVAL '24 hours';"
},
{
"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.nodes ( node_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port integer NOT ... |
[
{
"role": "user",
"content": "List all customers (customer_id, first_name, last_name) who were born before 1990 (date_of_birth < '1990-01-01') and have an email address ending with '@gmail.com', along with their city and state information."
},
{
"role": "assistant",
"content": "SELECT customer_i... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ... |
[
{
"role": "user",
"content": "List all users, showing their user ID, username, and the total number of wallets they have created. Include users who have no wallets."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COUNT(w.wallet_id) AS wallet_count FROM trading_platform.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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac... |
[
{
"role": "user",
"content": "Show customers who have made a premium payment greater than $1000."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.customer_id, T1.first_name, T1.last_name FROM insurance.customers AS T1 JOIN insurance.premium_payments AS T2 ON T1.customer_id = T2.customer... | You are an SQL statement expert. Given the table 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": "List all unique actions that have been logged in the system."
},
{
"role": "assistant",
"content": "SELECT DISTINCT action FROM trading_platform.logs;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp )
CREATE TAB... |
[
{
"role": "user",
"content": "Show me all trades (trade_id, account_id, total_amount) along with the corresponding loan details (loan_type, interest_rate) for accounts that have both trades and loans, where the trade was executed in the last 30 days and the loan has an interest rate above 5%."
},
{
... | You are an SQL statement expert. Given the table 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": "What is the count of customers for each state where the status is 'Active' and the created_at date is within the last 6 months?"
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) as customer_count FROM financial_services.customers WHERE status = 'Active' ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ... |
[
{
"role": "user",
"content": "List all comment IDs that have not received any likes."
},
{
"role": "assistant",
"content": "SELECT T1.comment_id FROM social_media.comments AS T1 LEFT JOIN social_media.likes AS T2 ON T1.comment_id = T2.comment_id WHERE T2.like_id IS NULL;"
},
{
"role": "u... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique identifier for the comment
post_id... |
[
{
"role": "user",
"content": "Can you show the total quantity of all in-game items held by each player?"
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player_id;"
},
{
"role": "user",
"conten... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.player_inventory (
inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for... |
[
{
"role": "user",
"content": "List all assets mentioned in DApp descriptions along with the DApp name and URL."
},
{
"role": "assistant",
"content": "SELECT a.name AS asset_name,\n a.symbol AS asset_symbol,\n d.name AS dapp_name,\n d.url\nFROM trading_platform.assets a\nJOIN tr... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.assets (
asset_id character varying(64) NOT NULL, -- unique identifier for the asset
name cha... |
[
{
"role": "user",
"content": "Show me the first name, last name, and email address for all passengers who are part of the loyalty program with ID 'Gold'."
},
{
"role": "assistant",
"content": "SELECT first_name , last_name , email FROM transportation.passengers WHERE loyalty_program_id = 'Go... | You are an SQL statement expert. Given the table 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": "List all Avalanche tokens by their tick with the total amount currently held across all wallets."
},
{
"role": "assistant",
"content": "SELECT tick, SUM(CAST(amount AS DECIMAL)) AS total_supply FROM token_balances_avalanche GROUP BY tick"
},
{
"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": "Which medications have 'tablet' in their description? Show their medication name and manufacturer."
},
{
"role": "assistant",
"content": "SELECT medication_name, manufacturer FROM healthcare.medications WHERE description ILIKE '%tablet%';"
},
{
"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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number... |
[
{
"role": "user",
"content": "Could you list all pairs of developers that are based in the same country and share the same website domain?"
},
{
"role": "assistant",
"content": "SELECT\n d1.name AS developer1_name,\n d2.name AS developer2_name,\n d1.country,\n d1.website\nFROM\n gaming_tech... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.developers (
developer_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d... |
[
{
"role": "user",
"content": "Show me the total invoice amount and the number of invoices for each client in 2024, and include the earliest and latest invoice issue date for each client."
},
{
"role": "assistant",
"content": "SELECT client_id, SUM(total_amount) AS total_invoice_amount, COUNT(*) ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.invoices (
invoice_id character varying(64) NOT NULL, -- unique identifier for the invoice
invo... |
[
{
"role": "user",
"content": "List each region and the number of servers currently in 'maintenance' status."
},
{
"role": "assistant",
"content": "SELECT region,\n COUNT(*) AS maintenance_count\nFROM gaming_technology.servers\nWHERE status = 'maintenance'\nGROUP BY region;"
},
{
"r... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,... |
[
{
"role": "user",
"content": "Find all wallets created by users in the last 7 days along with any tokens that have a total supply greater than 10 million, showing the wallet address and token details."
},
{
"role": "assistant",
"content": "SELECT w.address AS wallet_address, t.token_name, t.toke... | You are an SQL statement expert. Given the table 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, contract_address character varying(128) NOT NULL, token_name cha... |
[
{
"role": "user",
"content": "Find the full names and emails of citizens who have received notifications with the status 'Sent' related to a document. Also show the document_id for each notification."
},
{
"role": "assistant",
"content": "SELECT c.first_name || ' ' || c.last_name AS full_name, 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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "List all pairs of billable time entries for the same case."
},
{
"role": "assistant",
"content": "SELECT t1.case_id,\n t1.entry_id AS entry_id_1,\n t2.entry_id AS entry_id_2\nFROM legal_services.time_entries t1\nJOIN legal_services.time_entries t2\n 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.time_entries ( entry_id.text, case_id.text, lawyer_id.text, date_worked.date, hours_spent.numeric, billi... |
[
{
"role": "user",
"content": "Which agents, along with their managers' full names, are licensed in 'TX' and are currently active?"
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agent_last_name, m.first_name AS manager_first_name, m.last... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.agents ( agent_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara... |
[
{
"role": "user",
"content": "For each service, show the service name and the total number of applications submitted for it."
},
{
"role": "assistant",
"content": "SELECT s.service_name, COUNT(a.application_id) AS total_applications\nFROM government_services.services s\nLEFT JOIN government_serv... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "List the first name, last name, and creation date for all patients added in the last 6 months."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, created_at FROM healthcare.patients WHERE created_at >= NOW() - INTERVAL '6 months';"
},
{
"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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "List each participant_id along with the total number of participants in their conversation, and include user_id and conversation_id."
},
{
"role": "assistant",
"content": "SELECT cp.participant_id, cp.user_id, cp.conversation_id, counts.participant_count\nFROM socia... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.conversation_participants (
participant_id character varying(64) NOT NULL, -- unique identifier for th... |
[
{
"role": "user",
"content": "I want to see a list of insurance plans along with the full names of all doctors whose hospital affiliation ID matches the plan ID. For each entry, include the plan name, insurance provider, doctor ID, and the doctor's first and last name."
},
{
"role": "assistant",
... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ... |
[
{
"role": "user",
"content": "Show me all appointments scheduled for tomorrow with a duration longer than 45 minutes, including patient_id, doctor_id, and appointment_time."
},
{
"role": "assistant",
"content": "SELECT patient_id, doctor_id, appointment_time FROM healthcare.appointments WHERE DA... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,... |
[
{
"role": "user",
"content": "List the client ID, full name, and the total number of invoices they have received."
},
{
"role": "assistant",
"content": "SELECT c.client_id, c.first_name, c.last_name, COUNT(i.invoice_id) AS invoice_count\nFROM legal_services.clients c\nLEFT JOIN legal_services.in... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "How many service locations do we have in each state?"
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) AS location_count FROM government_services.service_locations GROUP BY state;"
},
{
"role": "user",
"content": "Only show states where there... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.service_locations (
location_id character varying(64) NOT NULL, -- unique identifier for the ph... |
[
{
"role": "user",
"content": "Find all transactions where the from_address is the same as the to_address, indicating self-transactions, and show the transaction_id, value, and gas_used."
},
{
"role": "assistant",
"content": "SELECT transaction_id, value, gas_used FROM web3.transactions WHERE fro... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.transactions (
transaction_id character varying(64) NOT NULL, -- unique identifier for the transaction
fr... |
[
{
"role": "user",
"content": "Show me all securities along with the number of employees per branch that work at a branch matching the security's exchange as their branch_id. Show the ticker symbol, security name, exchange, branch_id, and employee count."
},
{
"role": "assistant",
"content": "SEL... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... |
[
{
"role": "user",
"content": "Find the average session duration in minutes for players from each country."
},
{
"role": "assistant",
"content": "SELECT p.country_code, AVG(gs.duration_seconds) / 60 AS avg_duration_minutes FROM gaming_technology.players p JOIN gaming_technology.game_sessions gs O... | You are an SQL statement expert. Given the table 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(), -- unique identifier for the player
... |
[
{
"role": "user",
"content": "How many distinct fundraising round names are recorded in the table?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT rounds_name) FROM project_fundraising_record;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(... |
[
{
"role": "user",
"content": "For each chain, list the address with the highest ROI, showing the address, ROI, profit, and most profitable token."
},
{
"role": "assistant",
"content": "SELECT t1.chain, t1.address, t1.roi, t1.profit, t1.most_profit_token FROM smart_money_profit t1 INNER JOIN (SEL... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token... |
[
{
"role": "user",
"content": "List each driver's first_name, last_name, and the total number of bookings they have made."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, COUNT(b.booking_id) AS booking_count\nFROM transportation.drivers d\nJOIN transportation.bookings b 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 transportation.drivers (
driver_id character varying(64) NOT NULL, -- unique identifier for the driver
employe... |
[
{
"role": "user",
"content": "How many developers are there in each country?"
},
{
"role": "assistant",
"content": "SELECT\n country,\n COUNT(developer_id) AS developer_count\nFROM\n gaming_technology.developers\nWHERE country IS NOT NULL\nGROUP BY\n country;"
},
{
"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 gaming_technology.developers (
developer_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d... |
[
{
"role": "user",
"content": "Show the number of staff members for each property, along with the property name."
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(s.staff_id) AS staff_count\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.staff s ON p.prop... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... |
[
{
"role": "user",
"content": "List each reservation along with the next reservation for the same guest. Show the original reservation_id, its check_out_date, the next_reservation_id, and the next reservation's check_in_date."
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id text, guest_id text, room_id text, r... |
[
{
"role": "user",
"content": "Show me the average investment value for projects that completed fundraising in the last 6 months, grouped by round name."
},
{
"role": "assistant",
"content": "SELECT rounds_name, AVG(investment_value) as avg_investment FROM project_fundraising_record WHERE investm... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... |
[
{
"role": "user",
"content": "List all developer names and their founded years, ordered from newest to oldest."
},
{
"role": "assistant",
"content": "SELECT name, founded_year FROM gaming_technology.developers ORDER BY founded_year DESC;"
},
{
"role": "user",
"content": "Show only 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 gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ... |
[
{
"role": "user",
"content": "List all bookings with the passenger's full name, booking status, and fare amount, but only for bookings where the fare is greater than 50."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, b.status, b.fare FROM transportation.bookings b 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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
[
{
"role": "user",
"content": "List employees whose transaction effective_date matches their hire_date anniversary. Show full name and count of such transactions."
},
{
"role": "assistant",
"content": "SELECT e.employee_id,\n e.first_name || ' ' || e.last_name AS employee_name,\n 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 financial_services.transactions (
transaction_id character varying(64) NOT NULL, -- unique identifier for the trans... |
[
{
"role": "user",
"content": "For each customer, what is their total premium amount and total deductible across all their policies?"
},
{
"role": "assistant",
"content": "SELECT customer_id, SUM(premium_amount) AS total_premium, SUM(deductible) AS total_deductible FROM insurance.policies GROUP B... | You are an SQL statement expert. Given the table 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": "Which NFTs minted in the past 14 days on Ethereum have a rarity_score above 70? For each, show contract address, token ID, name, and minter."
},
{
"role": "assistant",
"content": "SELECT contract_address, token_id, name, minter\nFROM nft_metadata\nWHERE blockchain =... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE nft_holders ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wallet_address varchar NOT NULL, token_i... |
[
{
"role": "user",
"content": "Show me tokens that have recorded smart money inflows. For these tokens, list the token symbol, the current price from the basic info table, and the total sum of USD values from all smart money inflows recorded for that token."
},
{
"role": "assistant",
"content": "... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id.text, token_name.text, token_symbol.text, token_address.t... |
[
{
"role": "user",
"content": "Which projects had two or more fundraising rounds and what are the latest and earliest rounds with their investment values and dates? Also show the associated token symbol and its chain."
},
{
"role": "assistant",
"content": "WITH rounds AS (\n SELECT\n project_... | You are an SQL statement expert. Given the table 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.