conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "Retrieve the title and release_date of all games on the 'PC' platform."
},
{
"role": "assistant",
"content": "SELECT title, release_date\nFROM gaming_technology.games\nWHERE platform = 'PC';"
},
{
"role": "user",
"content": "Now exclude any games release... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"role": "user",
"content": "Which games have the highest average item cost for Legendary rarity items? Please show the game title, genre, and the average cost of those items."
},
{
"role": "assistant",
"content": "SELECT g.title, g.genre, AVG(igi.cost_amount) AS avg_legendary_cost\nFROM gaming... | You are an SQL statement expert. Given the table 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 pairs of distinct routes where the origin of one route is the destination of the other, and the destination of the first route is the origin of the second. Include the route IDs and numbers for both routes in each pair."
},
{
"role": "assistant",
"content": "SE... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id.text, route_number.text, description.text, origin_location_id.text, destination_locati... |
[
{
"role": "user",
"content": "Show me all notifications sent in the last 7 days, including the user ID and message."
},
{
"role": "assistant",
"content": "SELECT user_id, message, sent_at FROM trading_platform.notifications WHERE sent_at >= NOW() - INTERVAL '7 days';"
},
{
"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 trading_platform.notifications ( notification_id text, user_id text, message text, sent_at timestamp, read_at timestamp... |
[
{
"role": "user",
"content": "What is the average investment value for projects that completed Series A funding rounds?"
},
{
"role": "assistant",
"content": "SELECT AVG(investment_value) as avg_investment FROM project_fundraising_record WHERE rounds_name = 'Series A';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... |
[
{
"role": "user",
"content": "Show me the top 5 hashtags by number of distinct public posts they're used in. Return tag_name and post_count."
},
{
"role": "assistant",
"content": "SELECT h.tag_name,\n COUNT(DISTINCT ph.post_id) AS post_count\nFROM social_media.hashtags AS h\nJOIN social_me... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "List all customers who reside in New York and were created in the system before 2023."
},
{
"role": "assistant",
"content": "SELECT customer_id, first_name, last_name, created_at FROM insurance.customers WHERE state = 'NY' AND created_at < '2023-01-01';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin... |
[
{
"role": "user",
"content": "Show all transactions over 10,000 USD that are not marked as 'REVERSED'."
},
{
"role": "assistant",
"content": "SELECT transaction_id, account_id, amount, currency, status, transaction_date\nFROM financial_services.transactions\nWHERE amount > 10000 AND currency = '... | You are an SQL statement expert. Given the table 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": "List all bookings along with the booking time, fare, and the route number for the associated trip."
},
{
"role": "assistant",
"content": "SELECT b.booking_id, b.booking_time, b.fare, r.route_number\nFROM transportation.bookings b\nJOIN transportation.fuel_logs f 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.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text... |
[
{
"role": "user",
"content": "Show all customers who have policies managed by more than one agent. For each customer, show the customer_id and the number of unique agents."
},
{
"role": "assistant",
"content": "SELECT customer_id, COUNT(DISTINCT agent_id) AS unique_agents FROM insurance.policies... | You are an SQL statement expert. Given the table 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 all reviews with the guest's ID, review comment, and the full name of the staff member who responded."
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.guest_id, r.comment, s.first_name AS response_staff_first_name, s.last_name AS response_staff_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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... |
[
{
"role": "user",
"content": "For each client, what is the total number of unique case IDs they have invoices for, and the sum of amounts invoiced? Show the client_id, case count, and total amount."
},
{
"role": "assistant",
"content": "SELECT client_id, COUNT(DISTINCT case_id) AS case_count, SU... | You are an SQL statement expert. Given the table 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 text, invoice_number text, client_id text, case_id text, issue_date date, due_date... |
[
{
"role": "user",
"content": "List all games and the servers hosting them, showing the game title, server name, region, and status."
},
{
"role": "assistant",
"content": "SELECT g.title, s.server_name, s.region, s.status FROM gaming_technology.games g JOIN gaming_technology.servers s ON g.game_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.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "Could you provide a list of each diagnosis, the full name of the doctor who made it, and the name of the insurance plan whose contact phone number matches the doctor's phone number? Please include diagnosis_id, description, doctor full name, and insurance plan 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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ... |
[
{
"role": "user",
"content": "Find projects that completed a fundraising round in 2023 and have a corresponding token listed in the smart money performance data. Show the project name, fundraising amount, token symbol, and the token's smart money ROI."
},
{
"role": "assistant",
"content": "SELEC... | You are an SQL statement expert. Given the table 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": "How many notifications are there for each distinct notification type?"
},
{
"role": "assistant",
"content": "SELECT notification_type, COUNT(*) FROM social_media.notifications GROUP BY notification_type;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.hashtags ( hashtag_id.text, tag_name.text, created_at.timestamp )
CREATE TABLE social_media.notifications ... |
[
{
"role": "user",
"content": "For each account type, show the average balance and the number of completed trades associated with accounts of that type."
},
{
"role": "assistant",
"content": "SELECT a.account_type, AVG(a.balance) AS average_balance, COUNT(t.trade_id) AS completed_trade_count\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 financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad... |
[
{
"role": "user",
"content": "List the transaction IDs and gas used for transactions where gas used is greater than 500000."
},
{
"role": "assistant",
"content": "SELECT transaction_id, gas_used FROM web3.transactions WHERE gas_used > 500000;"
},
{
"role": "user",
"content": "Order t... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... |
[
{
"role": "user",
"content": "For each game, which server has hosted the most sessions?"
},
{
"role": "assistant",
"content": "SELECT game_id, server_id, COUNT(*) AS session_count FROM gaming_technology.game_sessions GROUP BY game_id, server_id;"
},
{
"role": "user",
"content": "I wa... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, server_id uuid, start_time timestamp w... |
[
{
"role": "user",
"content": "Show me the 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 from_address, to_address, block_number, gas_price FROM web3.t... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.transactions ( transaction_id text, from_address text, to_address text, value numeric, gas_used integer, gas_price... |
[
{
"role": "user",
"content": "Show me the wallet addresses that have both sent and received tokens in the same transaction."
},
{
"role": "assistant",
"content": "SELECT DISTINCT w.address FROM web3.wallets w JOIN web3.token_transfers tt1 ON w.address = tt1.from_address JOIN web3.token_transfers... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for the event
contract_id characte... |
[
{
"role": "user",
"content": "For each doctor specialty, count the total number of prescriptions issued by doctors in that specialty. Show the specialty and the prescription count."
},
{
"role": "assistant",
"content": "SELECT T2.specialty, COUNT(T1.prescription_id) FROM healthcare.prescriptions... | You are an SQL statement expert. Given the table 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": "Show me the first name, last name, and license number for all doctors whose specialty is 'Pediatrics'."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, license_number FROM healthcare.doctors WHERE specialty = 'Pediatrics';"
},
{
"role": "... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number... |
[
{
"role": "user",
"content": "List all booking IDs and their status for bookings that have a special request recorded."
},
{
"role": "assistant",
"content": "SELECT booking_id, status\nFROM transportation.bookings\nWHERE special_requests IS NOT NULL;"
},
{
"role": "user",
"content": ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.bookings ( booking_id character varying(64) NOT NULL, passenger_id character varying(64) NOT NULL, trip_... |
[
{
"role": "user",
"content": "For each booking, show the booking ID, the passenger ID, the trip ID, and indicate if a special request was made."
},
{
"role": "assistant",
"content": "SELECT booking_id, passenger_id, trip_id, \n CASE WHEN special_requests IS NOT NULL AND special_requests <>... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.bookings (
booking_id character varying(64) NOT NULL, -- unique identifier for the booking
pass... |
[
{
"role": "user",
"content": "Show all appointments with subject containing 'Review' and their corresponding case_id."
},
{
"role": "assistant",
"content": "SELECT appointment_id, subject, case_id\nFROM legal_services.appointments\nWHERE subject ILIKE '%Review%';"
}
] | You are an SQL statement expert. Given the table 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.text, invoice_number.text, client_id.text, case_id.text, issue_date.date, due_date... |
[
{
"role": "user",
"content": "Retrieve each gender and the count of verified citizens born before 1990."
},
{
"role": "assistant",
"content": "SELECT gender,\n COUNT(*) AS citizen_count\nFROM government_services.citizens\nWHERE is_verified = TRUE\n AND date_of_birth < '1990-01-01'\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 government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth... |
[
{
"role": "user",
"content": "I need to get the total trading volume for each asset along with the asset name."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, SUM(t.quantity * t.price) AS total_volume\nFROM trading_platform.trades t\nJOIN trading_platform.assets a ON t.asset_id... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet
user_... |
[
{
"role": "user",
"content": "Find all nodes that were last seen in the last 30 days and have port numbers between 8000 and 9000."
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '30 days' AND port BETWEEN 8000 AND ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.transactions ( transaction_id text, block_id text, sender_address text, receiver_address text, amount numeri... |
[
{
"role": "user",
"content": "Count the total number of cases that are currently marked as 'Open'."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM cases WHERE status = 'Open'"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t... |
[
{
"role": "user",
"content": "What is the average overall rating grouped by review_source?"
},
{
"role": "assistant",
"content": "SELECT review_source, AVG(rating_overall) AS avg_overall_rating, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY review_source;"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.text, guest_id.text, rating_overall.i... |
[
{
"role": "user",
"content": "Which three smart money addresses on the Arbitrum chain have the most recent last_trade_time? Please show address and last_trade_time."
},
{
"role": "assistant",
"content": "SELECT address, last_trade_time FROM smart_money_profit WHERE chain = 'Arbitrum' ORDER BY la... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token... |
[
{
"role": "user",
"content": "For 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": "Show policy number, cancellation date, and the customer's first and last name for policies cancelled due to 'Non-Payment'."
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T1.cancellation_date, T2.first_name, T2.last_name FROM policies AS T1 JOIN cust... | You are an SQL statement expert. Given the table 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, first_name character varying(100) NOT NULL, last_name... |
[
{
"role": "user",
"content": "I need the full names of guests who have checked out in June 2023. Show reservation_id, guest first and last name, property_id and actual_check_out_ts."
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS full_name, 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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat... |
[
{
"role": "user",
"content": "Show the number of law firms founded each year, with the founding year and the count of firms, ordered by year in descending order."
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM founded_date) AS founding_year, COUNT(*) AS firm_count FROM legal_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 legal_services.law_firms (
firm_id character varying(64) NOT NULL, -- unique identifier for the law firm
firm_... |
[
{
"role": "user",
"content": "List the user IDs of users who are following user 'U300' and have also created a public post, showing their follower_user_id and the post_id."
},
{
"role": "assistant",
"content": "SELECT T1.follower_user_id, T2.post_id FROM social_media.follows AS T1 JOIN social_me... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id text, user_id text, content text, media_url text, media_type text, created_at timestamp, u... |
[
{
"role": "user",
"content": "Which vehicles are assigned to each depot? Display the depot ID, vehicle's license_plate, make, and model."
},
{
"role": "assistant",
"content": "SELECT depot_id, license_plate, make, model\nFROM transportation.vehicles\nWHERE depot_id IS NOT NULL;"
},
{
"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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
[
{
"role": "user",
"content": "Show the first 5 games released before 2015, displaying game_id and title."
},
{
"role": "assistant",
"content": "SELECT game_id, title\nFROM gaming_technology.games\nWHERE release_date < '2015-01-01'\nLIMIT 5;"
},
{
"role": "user",
"content": "Actually ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title character varying(200) NOT NULL, devel... |
[
{
"role": "user",
"content": "What is the total commission earned from all trades executed in the 'NYSE' venue by employees in the 'Trading' department?"
},
{
"role": "assistant",
"content": "SELECT SUM(t.commission) AS total_commission FROM financial_services.trades t JOIN financial_services.em... | You are an SQL statement expert. Given the table 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": "Show me all doctors whose first name contains 'an'. Return their doctor ID, full name, and hospital affiliation ID."
},
{
"role": "assistant",
"content": "SELECT doctor_id, first_name, last_name, hospital_affiliation_id\nFROM healthcare.doctors\nWHERE first_name ILI... | You are an SQL statement expert. Given the table 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": "Which law firms have the same address? Show the names and addresses of those firms."
},
{
"role": "assistant",
"content": "SELECT f1.firm_name AS firm1_name, f2.firm_name AS firm2_name, f1.address\nFROM legal_services.law_firms f1\nJOIN legal_services.law_firms f2\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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name character varying(200) NOT NULL, address t... |
[
{
"role": "user",
"content": "Show me the total count of 'approval for all' events for each ERC1155 collection on Ethereum. I need contract_address, collection name, and approval_count, sorted by approval_count descending."
},
{
"role": "assistant",
"content": "SELECT e.contract_address,\n ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_... |
[
{
"role": "user",
"content": "List the names and types of all in-game items that have a rarity of 'Epic'."
},
{
"role": "assistant",
"content": "SELECT item_name, item_type FROM gaming_technology.in_game_items WHERE rarity = 'Epic';"
},
{
"role": "user",
"content": "Further restrict ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ... |
[
{
"role": "user",
"content": "Show me all doctors specializing in Pediatrics along with their upcoming appointments, including the patient ID and appointment time."
},
{
"role": "assistant",
"content": "SELECT d.doctor_id, d.first_name, d.last_name, a.patient_id, a.appointment_time FROM healthca... | You are an SQL statement expert. Given the table 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": "Give me a list of all developers and how many achievements exist for each developer's games."
},
{
"role": "assistant",
"content": "SELECT d.name AS developer_name, COUNT(a.achievement_id) AS num_achievements\nFROM gaming_technology.developers d\nLEFT JOIN gaming_te... | You are an SQL statement expert. Given the table 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(), name character varying(150) NOT NU... |
[
{
"role": "user",
"content": "Show me all properties in California with a star rating above 4.0, along with their room types and base rates, ordered by star rating in descending order."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, p.star_rating, rt.type_name, rt.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 hospitality_technology.properties ( property_id.text, property_name.text, address_line1.text, address_line2.text, city.... |
[
{
"role": "user",
"content": "Show me all male patients who have received more than one prescription, including their full name, date of birth, and the total number of prescriptions."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, p.date_of_birth, COUNT(pr.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ... |
[
{
"role": "user",
"content": "List all in-game items of type 'Consumable', showing for each item the item name, cost amount, and the total number of players who have that item in their inventory."
},
{
"role": "assistant",
"content": "SELECT i.item_name, i.cost_amount, COUNT(DISTINCT pi.player_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 NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"role": "user",
"content": "List all servers that are currently marked with a 'offline' status."
},
{
"role": "assistant",
"content": "SELECT server_id, server_name, region FROM gaming_technology.servers WHERE status = 'offline';"
},
{
"role": "user",
"content": "For those offline ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region text, ip_address text, port integer,... |
[
{
"role": "user",
"content": "Show me each comment ID and the total number of likes it has received."
},
{
"role": "assistant",
"content": "SELECT c.comment_id,\n COUNT(l.like_id) AS likes_count\nFROM social_media.comments c\nLEFT JOIN social_media.likes l ON c.comment_id = l.comment_id\nG... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char... |
[
{
"role": "user",
"content": "Find all non-smoking rooms that have not been cleaned in the last 7 days."
},
{
"role": "assistant",
"content": "SELECT room_id, room_number, last_cleaned_at\nFROM hospitality_technology.rooms\nWHERE is_smoking = false\n AND last_cleaned_at < NOW() - INTERVAL '7 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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... |
[
{
"role": "user",
"content": "For each transaction, list the total value transferred and the number of different addresses involved (either as sender or receiver)."
},
{
"role": "assistant",
"content": "SELECT transaction_id, SUM(value) AS total_value_transferred, COUNT(DISTINCT addr) AS num_add... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text, token_id text, from_address text, to_address text, value numeric, transaction_... |
[
{
"role": "user",
"content": "List all DApps along with the number of metadata entries linked to each, even if the DApp has no linked metadata."
},
{
"role": "assistant",
"content": "SELECT d.name, d.url, COUNT(m.metadata_id) AS metadata_count\nFROM trading_platform.dapps d\nLEFT JOIN trading_pl... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp )
CREATE TAB... |
[
{
"role": "user",
"content": "What is the number of active staff members in each position?"
},
{
"role": "assistant",
"content": "SELECT position,\n COUNT(*) AS staff_count\nFROM hospitality_technology.staff\nWHERE is_active = true\nGROUP BY position;"
},
{
"role": "user",
"con... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, fir... |
[
{
"role": "user",
"content": "Show me all nodes that were last seen after January 1, 2023, along with their IP addresses and ports."
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port FROM blockchain.nodes WHERE last_seen > '2023-01-01 00:00:00';"
},
{
"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 blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
|
[
{
"role": "user",
"content": "Show me all users who have placed buy orders but never sell orders, along with their total buy order quantity and average price."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, u.email, SUM(o.quantity) AS total_buy_quantity, AVG(o.price) AS avg_... | You are an SQL statement expert. Given the table 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": "Show me all properties in California with their star ratings and the count of active staff members at each property, ordered by staff count in descending order."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, p.star_rating, COUNT(s.staf... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"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": "List all staff members along with their manager's full name."
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name\nFROM hospitality_technology.staff s\nLEFT JOIN hos... | You are an SQL statement expert. Given the table 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": "How many servers are in each region, and what's the average number of current players for those servers?"
},
{
"role": "assistant",
"content": "SELECT\n region,\n COUNT(server_id) AS server_count,\n AVG(current_players) AS average_current_players\nFROM gaming_tec... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id.uuid, player_id.uuid, game_id.uuid, server_id.uuid, start_time.timestamptz... |
[
{
"role": "user",
"content": "For each chain, retrieve the token_symbol and roi of the token with the highest roi."
},
{
"role": "assistant",
"content": "SELECT t.chain, t.token_symbol, t.roi\nFROM smart_money_token_performance t\nJOIN (\n SELECT chain, MAX(roi) AS max_roi\n FROM smart_money_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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, net_flow.numeric, avg_cost.numeric,... |
[
{
"role": "user",
"content": "List all claim documents where the file name contains 'invoice' (case insensitive), showing the document ID, claim ID, file name, and uploaded_at."
},
{
"role": "assistant",
"content": "SELECT document_id, claim_id, file_name, uploaded_at\nFROM insurance.claim_docum... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d... |
[
{
"role": "user",
"content": "For each payment status, how many payments were made and what was the total amount paid? Order the results by the total amount paid in descending order."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS payment_count, SUM(amount_paid) AS total_amount... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, custo... |
[
{
"role": "user",
"content": "List the first and last names of all doctors whose email address ends with '@hospital.org'."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name FROM healthcare.doctors WHERE email LIKE '%@hospital.org';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number... |
[
{
"role": "user",
"content": "For each premium payment, show payment_id, amount_paid, payment_date, and the policy number for the associated policy."
},
{
"role": "assistant",
"content": "SELECT pp.payment_id, pp.amount_paid, pp.payment_date, p.policy_number\nFROM insurance.premium_payments pp\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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name... |
[
{
"role": "user",
"content": "What is the average cost per unit for fuel at each location type? Show the location type and the average cost."
},
{
"role": "assistant",
"content": "SELECT T2.type , AVG(T1.cost_per_unit) FROM transportation.fuel_logs AS T1 JOIN transportation.locations AS T2 ON T... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro... |
[
{
"role": "user",
"content": "For each developer, find the next developer in the same country founded after them, and show both names and their founded years."
},
{
"role": "assistant",
"content": "SELECT d1.name AS developer,\n d1.founded_year,\n (SELECT d2.name\n FROM gaming... | You are an SQL statement expert. Given the table 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": "Find all pairs of customers who live in the same state but have different risk profiles."
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_id_a, a.first_name || ' ' || a.last_name AS full_name_a, a.risk_profile AS risk_profile_a, b.customer_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.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... |
[
{
"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": "Find pairs of prescriptions for the same patient with overlapping periods. Show p1.prescription_id, p2.prescription_id, patient_id, and the overlap duration in days where the overlap is greater than 15 days."
},
{
"role": "assistant",
"content": "SELECT p1.prescript... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.prescriptions ( prescription_id.text, record_id.text, patient_id.text, doctor_id.text, medication_id.text, d... |
[
{
"role": "user",
"content": "List all token transfers, showing the transfer ID, value, and the symbol of the token transferred."
},
{
"role": "assistant",
"content": "SELECT T1.transfer_id, T1.value, T2.token_symbol FROM web3.token_transfers AS T1 JOIN web3.tokens AS T2 ON T1.token_id = T2.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.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_at.timestamp, transaction_id.text, l... |
[
{
"role": "user",
"content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 6 months, along with their narrative information if available."
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.valuation, pfr.investment_date, ni.narrative, ni.... | You are an SQL statement expert. Given the table 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": "List all staff members who have an access level greater than 3, showing their staff ID, first name, and last name."
},
{
"role": "assistant",
"content": "SELECT staff_id, first_name, last_name FROM hospitality_technology.staff WHERE access_level > 3;"
},
{
"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, room_type_id text, floor integer, stat... |
[
{
"role": "user",
"content": "Show me all properties in California with a star rating above 4.0, along with the count of available rooms at each property."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, p.city, p.star_rating, COUNT(r.room_id) AS available_rooms_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "List the ticker symbol and security name for all securities that had a volume greater than 100000 on '2023-10-27'."
},
{
"role": "assistant",
"content": "SELECT T2.ticker_symbol, T2.security_name FROM financial_services.market_data AS T1 JOIN financial_services.secu... | You are an SQL statement expert. Given the table 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": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs."
},
{
"role": "assistant",
"content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS case_id_2 FROM lega... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u... |
[
{
"role": "user",
"content": "Show me a list of all appointments and the number of prescriptions that were issued on the same day for each appointment."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.appointment_time::date AS appointment_date,\n COUNT(pr.prescription_id) ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"role": "user",
"content": "Provide a count of documents grouped by their current verification status."
},
{
"role": "assistant",
"content": "SELECT verification_status, COUNT(*) FROM government_services.documents GROUP BY verification_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 government_services.applications ( application_id character varying(64) NOT NULL, citizen_id character varying(64) NOT ... |
[
{
"role": "user",
"content": "List diagnoses and the name of any medication mentioned in the treatment plan of the associated medical record. Show diagnosis ID, diagnosis description, medication name, and record ID."
},
{
"role": "assistant",
"content": "SELECT T1.diagnosis_id, T1.description, 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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"role": "user",
"content": "我想查看所有检查记录中检查员的ID和检查结果,同时统计每个检查员的检查次数。"
},
{
"role": "assistant",
"content": "db.inspections.aggregate([\n {\n $group: {\n _id: '$inspector_employee_id',\n total_inspections: { $count: {} },\n results: { $push: '$result' }\n }\n },\n {\n $... | 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
Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id... |
[
{
"role": "user",
"content": "I want to see for each security the ticker_symbol, security_name, and the highest single-day close_price from the market_data."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, MAX(m.close_price) AS highest_close_price\nFROM financial_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 financial_services.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,... |
[
{
"role": "user",
"content": "How many hashtags have been created before May 2024?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.hashtags WHERE created_at < '2024-05-01';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.hashtags ( hashtag_id text, tag_name text, created_at timestamp )
|
[
{
"role": "user",
"content": "Show all projects that have raised funds and have a matching token in the token_basic_info table, listing their project name, fundraising round, investment_value, as well as the token symbol, chain, and narrative."
},
{
"role": "assistant",
"content": "SELECT p.proj... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id text, project_id text, project_name text, rounds_name text, investment_value numeric, i... |
[
{
"role": "user",
"content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts."
},
{
"role": "assistant",
"content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE status = 'expired' AND end_date >= CURRENT_DATE... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ... |
[
{
"role": "user",
"content": "List all pairs of clients who registered in the same year. Show each client's first_name, last_name, and the registration year."
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first_name_1, c1.last_name AS last_name_1, c2.first_name AS first_name_2, 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 legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad... |
[
{
"role": "user",
"content": "Find all wallets that have deployed contracts on both 'ethereum' and 'polygon' networks, showing the wallet address and the count of contracts deployed on each network."
},
{
"role": "assistant",
"content": "SELECT w.address, SUM(CASE WHEN c.network_id = 'ethereum' ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,... |
[
{
"role": "user",
"content": "Find all pairs of policies for the same customer where their coverage periods overlap. Return customer_id, the two policy numbers, and their start and end dates."
},
{
"role": "assistant",
"content": "SELECT p1.customer_id,\n p1.policy_number AS policy_number1... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identifier for the policy
customer_id ... |
[
{
"role": "user",
"content": "List all 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 blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text )
CREATE TABLE blockchain.users ( ... |
[
{
"role": "user",
"content": "List all customer-employee pairs where they share the same email domain, showing customer_id, customer email, employee_id, and employee email."
},
{
"role": "assistant",
"content": "SELECT c.customer_id,\n c.email AS customer_email,\n e.employee_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h... |
[
{
"role": "user",
"content": "Show me the total quantity and total price for each service ordered by each guest."
},
{
"role": "assistant",
"content": "SELECT guest_id, service_id, SUM(quantity) AS total_quantity, SUM(total_price) AS total_price FROM hospitality_technology.service_orders 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 hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id text, guest_id text, service_id text,... |
[
{
"role": "user",
"content": "Show me the wallet addresses and their creation dates for wallets created in the last 30 days, sorted by creation date in descending order."
},
{
"role": "assistant",
"content": "SELECT address, created_at FROM web3.wallets WHERE created_at >= NOW() - INTERVAL '30 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.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
|
[
{
"role": "user",
"content": "Get the total trading volume and average close_price for each data source over the last quarter."
},
{
"role": "assistant",
"content": "SELECT source,\n SUM(volume) AS total_volume,\n AVG(close_price) AS avg_close_price\nFROM financial_services.market_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 financial_services.market_data ( data_point_id bigint, security_id text, data_timestamp timestamp, open_price numeric, ... |
[
{
"role": "user",
"content": "Show all token symbols along with the contract address where the token was created."
},
{
"role": "assistant",
"content": "SELECT token_symbol, contract_address FROM web3.tokens;"
},
{
"role": "user",
"content": "Can you also include the deployer address... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,... |
[
{
"role": "user",
"content": "Find pairs of distinct locations in the same city that have different types. Include location IDs, names, city, and type for both locations."
},
{
"role": "assistant",
"content": "SELECT l1.location_id AS location1_id, l1.name AS location1_name, l1.city, l1.type 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 transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ... |
[
{
"role": "user",
"content": "List all diagnoses made in the last month including diagnosis_date, patient full name, doctor's full name, and description."
},
{
"role": "assistant",
"content": "SELECT d.diagnosis_date,\n p.first_name || ' ' || p.last_name AS patient_name,\n doc.first_... | You are an SQL statement expert. Given the table 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 the claim_id and the total number of documents uploaded for each claim, but only include claims with between 3 and 7 documents."
},
{
"role": "assistant",
"content": "SELECT claim_id, COUNT(*) AS document_count FROM insurance.claim_documents GROUP BY claim_id H... | You are an SQL statement expert. Given the table 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": "Find all DApps that have been interacted with by users who have wallets with more than 1000 in their order quantities."
},
{
"role": "assistant",
"content": "SELECT DISTINCT d.dapp_id, d.name, d.description FROM trading_platform.dapps d JOIN trading_platform.orders ... | You are an SQL statement expert. Given the table 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": "Could you list each player and the title of the games for which they have acquired items?"
},
{
"role": "assistant",
"content": "SELECT DISTINCT pi.player_id, g.title FROM gaming_technology.player_inventory pi JOIN gaming_technology.games g ON pi.item_id = g.game_id... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date... |
[
{
"role": "user",
"content": "Show me all trips that were delayed by more than 30 minutes, along with their vehicle and driver details, and include the origin and destination city names."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, t.vehicle_id, t.driver_id, t.scheduled_departure, 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.trips ( trip_id character varying(64) NOT NULL, route_id character varying(64), vehicle_id character var... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.