conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "Can you help me get a list of inspections performed on a specific aircraft build, including the employee who performed them and the inspected component details?"
},
{
"role": "assistant",
"content": "MATCH (ab:AircraftBuild {build_id: 'specific_build_id'})-[:UNDERWE... | 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
Node Label ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St... |
[
{
"role": "user",
"content": "How many users currently have their profile set to private?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.user_settings WHERE private_profile = 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 social_media.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, post_id character varying(64) NOT NULL, ha... |
[
{
"role": "user",
"content": "List the trip ID, route number, vehicle ID, and the total fuel cost associated with each trip."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, r.route_number, t.vehicle_id, SUM(fl.total_cost) AS total_fuel_cost FROM transportation.trips t JOIN transportatio... | You are an SQL statement expert. Given the table 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": "Which document types have been used for more than 100 documents, and what is the total file size across all documents of each such type?"
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) AS document_count, SUM(file_size_bytes) AS total_file_size_... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, claim_id character varying(64) NOT NULL, docume... |
[
{
"role": "user",
"content": "Find pairs of documents in the same case where one document is version 1 and the other is the highest version for that document_name, showing case_id, document_name, version1, latest_version, version1_upload_timestamp, and latest_upload_timestamp."
},
{
"role": "assista... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents (
document_id character varying(64) NOT NULL, -- unique identifier for the document
c... |
[
{
"role": "user",
"content": "Find pairs of claim documents for the same claim where the upload time difference is less than 5 minutes. List the document IDs of the pairs and the claim ID."
},
{
"role": "assistant",
"content": "SELECT a.document_id AS document1_id, b.document_id AS document2_id,... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, file_name.text, file_path.text, file_s... |
[
{
"role": "user",
"content": "Show me the number of direct replies each top-level comment has on post 'P200'."
},
{
"role": "assistant",
"content": "SELECT c.comment_id, COUNT(r.comment_id) AS reply_count FROM comments AS c LEFT JOIN comments AS r ON r.parent_comment_id = c.comment_id WHERE c.po... | You are an SQL statement expert. Given the table 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.text, post_id.text, user_id.text, parent_comment_id.text, content.text, created_at.t... |
[
{
"role": "user",
"content": "List the email and full name of all users whose account was updated in June 2024."
},
{
"role": "assistant",
"content": "SELECT email, full_name\nFROM social_media.users\nWHERE updated_at >= '2024-06-01' AND updated_at < '2024-07-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.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "List all ERC20 tokens (from token_metas) that have 'Governance' in their name."
},
{
"role": "assistant",
"content": "SELECT contract_address, symbol, name FROM token_metas WHERE is_erc20 = 1 AND name ILIKE '%Governance%';"
},
{
"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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"role": "user",
"content": "Which customers have accounts in more than one state? Please show their customer_id, full name, and the list of states where they hold accounts."
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name || ' ' || c.last_name AS full_name, STRING_AGG(... | You are an SQL statement expert. Given the table 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": "What is the average number of game sessions started per hour of the day (0-23), considering all recorded sessions? Show the hour and the average count."
},
{
"role": "assistant",
"content": "SELECT EXTRACT(HOUR FROM start_time) AS session_hour, COUNT(*)::NUMERIC / C... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, server_id uuid, start_time timestamp w... |
[
{
"role": "user",
"content": "List the full names and dates of birth for all patients who do not have a phone number on record."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE phone_number IS NULL OR TRIM(phone_number) = '';"
}
... | You are an SQL statement expert. Given the table 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": "For each user with at least two wallets, calculate the average time difference in hours between consecutive wallet creations. Return user_id and avg_diff_hours."
},
{
"role": "assistant",
"content": "SELECT user_id, AVG(EXTRACT(EPOCH FROM (created_at - prev_created)... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the contract
address cha... |
[
{
"role": "user",
"content": "Retrieve the number of passengers for each loyalty_program_id."
},
{
"role": "assistant",
"content": "SELECT loyalty_program_id,\n COUNT(*) AS passenger_count\nFROM transportation.passengers\nGROUP BY loyalty_program_id;"
},
{
"role": "user",
"cont... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text... |
[
{
"role": "user",
"content": "List all prescriptions with medication details. Return prescription_id, patient full name, medication_name, and prescription_date."
},
{
"role": "assistant",
"content": "SELECT pr.prescription_id,\n p.first_name || ' ' || p.last_name AS patient_name,\n m... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"role": "user",
"content": "List the medication_name and manufacturer for all medications where the description is null or an empty string."
},
{
"role": "assistant",
"content": "SELECT medication_name, manufacturer FROM healthcare.medications WHERE description IS NULL OR description = '';"
... | You are an SQL statement expert. Given the table 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": "Get a list of all policies that have at least two beneficiaries with a percentage_share greater than 20%. Include policy_id, policy_number, and beneficiary_count."
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.policy_number, COUNT(pb.beneficiary_id) AS... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin... |
[
{
"role": "user",
"content": "For all NFT collections on the Ethereum blockchain, show me the collection name and the current floor price. Sort by floor price descending."
},
{
"role": "assistant",
"content": "SELECT name, floor_price FROM nft_collections WHERE blockchain = 'Ethereum' ORDER BY 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t... |
[
{
"role": "user",
"content": "For each application, show the application ID, the full name of the assigned employee, and the number of payments made for that application."
},
{
"role": "assistant",
"content": "SELECT a.application_id, CONCAT(e.first_name, ' ', e.last_name) AS employee_full_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 government_services.applications ( application_id text, citizen_id text, service_id text, submitted_at timestamp, statu... |
[
{
"role": "user",
"content": "Retrieve the most recent log entry for each user, including action and logged_at."
},
{
"role": "assistant",
"content": "SELECT l1.user_id,\n l1.action,\n l1.logged_at\nFROM trading_platform.logs l1\nWHERE l1.logged_at = (\n SELECT MAX(l2.logged_at)\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 trading_platform.users (
user_id character varying(64) NOT NULL, -- unique identifier for the user
username ch... |
[
{
"role": "user",
"content": "List all doctors who have a hospital affiliation and include their specialty and affiliation ID."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, specialty, hospital_affiliation_id FROM healthcare.doctors WHERE hospital_affiliation_id IS NOT NULL... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number... |
[
{
"role": "user",
"content": "For each player, show their username and the total number of achievements they have unlocked in games where they also own at least one item. Only include players who have unlocked at least one achievement."
},
{
"role": "assistant",
"content": "SELECT p.username, CO... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat... |
[
{
"role": "user",
"content": "Show me the top 5 narratives by market cap, along with their top 3 coins and 24-hour trading volume."
},
{
"role": "assistant",
"content": "SELECT narrative, top_3_coins, volume_24h FROM narrative_info ORDER BY market_cap DESC LIMIT 5;"
},
{
"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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... |
[
{
"role": "user",
"content": "List all pairs of properties located in the same city, showing each pair's property IDs and names along with the city."
},
{
"role": "assistant",
"content": "SELECT p1.property_id AS property_id_1,\n p1.property_name AS property_name_1,\n p2.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.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... |
[
{
"role": "user",
"content": "List the number of available services per department for each property, displaying the property name and department along with the count of services."
},
{
"role": "assistant",
"content": "SELECT p.property_name,\n s.department,\n COUNT(*) AS service_cou... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.services (
service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ... |
[
{
"role": "user",
"content": "How many applications are currently in 'Processing' status? Return the total count."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS processing_applications_count\nFROM government_services.applications\nWHERE status = 'Processing';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "Show me the top 5 tokens by USD value held on the Binance Smart Chain, along with their average price and total balance."
},
{
"role": "assistant",
"content": "SELECT token_symbol, AVG(price) as average_price, SUM(balance) as total_balance, SUM(usd_value) as total_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 cex_token_balance ( snapshot_time text, chain text, address text, exchange text, token_address text, token_symbol text,... |
[
{
"role": "user",
"content": "How many reservations does each room_type have, including property_id and room_type_id?"
},
{
"role": "assistant",
"content": "SELECT property_id,\n room_type_id,\n COUNT(*) AS reservation_count\nFROM hospitality_technology.reservations\nGROUP BY propert... | You are an SQL statement expert. Given the table 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": "I would like a list of unread notifications, showing the recipient's username, the sender's full name, the notification_type, and the creation timestamp."
},
{
"role": "assistant",
"content": "```sql\nSELECT\n n.notification_id,\n recipient.username AS recipi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "For the 'AI' and 'Gaming' narratives, what is the total USD value held by CEXes for tokens listed in their top 3 coins?"
},
{
"role": "assistant",
"content": "SELECT T2.narrative, SUM(T1.usd_value) AS TotalCexUSDValue FROM cex_token_balance AS T1 JOIN narrative_info... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume... |
[
{
"role": "user",
"content": "Show me all locations in New York with their type, city, and coordinates, ordered by latitude in descending order."
},
{
"role": "assistant",
"content": "SELECT type, city, latitude, longitude FROM transportation.locations WHERE state_province = 'New York' ORDER BY ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ... |
[
{
"role": "user",
"content": "Show me all pairs of cases led by the same lawyer, including both case names and the lead lawyer ID."
},
{
"role": "assistant",
"content": "SELECT c1.lead_lawyer_id,\n c1.case_name AS case_name_1,\n c2.case_name AS case_name_2\nFROM legal_services.cases ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.cases ( case_id text, case_number text, case_name text, client_id text, lead_lawyer_id text, case_type t... |
[
{
"role": "user",
"content": "List the payment ID, amount paid, and due date for all premium payments with a status of 'overdue'."
},
{
"role": "assistant",
"content": "SELECT payment_id, amount_paid, due_date FROM premium_payments WHERE status = 'overdue'"
}
] | You are an SQL statement expert. Given the table 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": "Show me all ERC20 token transfers where the amount is over 5000, including the sender and receiver addresses."
},
{
"role": "assistant",
"content": "SELECT from_address, to_address, amt, tick, tx_hash FROM token_activities WHERE type = 'transfer' AND CAST(amt AS DEC... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc20_balances ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar )
CR... |
[
{
"role": "user",
"content": "Find the top 5 most recently created users along with their email domains (the part after '@' in their email addresses)."
},
{
"role": "assistant",
"content": "SELECT username, SUBSTRING(email FROM POSITION('@' IN email)+1) AS email_domain FROM web3.users ORDER BY 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 web3.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email character varying(... |
[
{
"role": "user",
"content": "Show me all in-game items with the word 'Sword' in their name along with the total number of sessions in those games."
},
{
"role": "assistant",
"content": "SELECT i.item_id, i.item_name, COUNT(s.session_id) AS session_count\nFROM gaming_technology.in_game_items i\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.developers (
developer_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d... |
[
{
"role": "user",
"content": "I want to calculate the average duration of completed appointments for each doctor, showing the doctor\\u2019s full name."
},
{
"role": "assistant",
"content": "SELECT d.doctor_id, d.first_name || ' ' || d.last_name AS doctor_name, AVG(a.duration_minutes) AS avg_dur... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad... |
[
{
"role": "user",
"content": "Which rooms have not been cleaned in over 14 days? Show the room number, property ID, last cleaned date, and status."
},
{
"role": "assistant",
"content": "SELECT room_number, property_id, last_cleaned_at, status\nFROM hospitality_technology.rooms\nWHERE last_cleane... | You are an SQL statement expert. Given the table 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": "How many prescriptions have been issued per patient?"
},
{
"role": "assistant",
"content": "SELECT patient_id, COUNT(*) AS prescription_count\nFROM healthcare.prescriptions\nGROUP BY patient_id;"
},
{
"role": "user",
"content": "Only show patients who ha... | You are an SQL statement expert. Given the table 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": "Find all peers that haven't been seen in the last 30 days, along with their IP addresses and ports."
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address, port FROM trading_platform.peers WHERE last_seen < CURRENT_DATE - INTERVAL '30 days';"
},
{
... | You are an SQL statement expert. Given the table 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, user_id character varying(64) NOT NULL, address ch... |
[
{
"role": "user",
"content": "List the names of services for which documents are set to expire in the next 90 days."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.service_name FROM government_services.services AS T1 JOIN applications AS T2 ON T1.service_id = T2.service_id JOIN governm... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego... |
[
{
"role": "user",
"content": "Show me all doctors who have prescribed medications along with the count of prescriptions they've made, ordered by the count in descending order."
},
{
"role": "assistant",
"content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(p.prescription_id) AS prescr... | You are an SQL statement expert. Given the table 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, first_name character varying(100) NOT NULL, last_name ch... |
[
{
"role": "user",
"content": "List all pairs of games developed by the same developer, returning developer_id, title of the first game, and title of the second game."
},
{
"role": "assistant",
"content": "SELECT g1.developer_id, g1.title AS game1, g2.title AS game2\nFROM gaming_technology.games ... | You are an SQL statement expert. Given the table 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, for each city, how many notifications have been sent to citizens living in that city."
},
{
"role": "assistant",
"content": "SELECT c.city, COUNT(n.notification_id) AS notification_count\nFROM government_services.citizens c\nJOIN government_services.notific... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen
... |
[
{
"role": "user",
"content": "Show the usernames of users who have liked a comment made by a user they are following."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username FROM social_media.users AS T1 JOIN likes AS T2 ON T1.user_id = T2.user_id JOIN comments AS T3 ON T2.target_enti... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "Show me all completed bookings (status = 'completed') with their passenger_id and fare, ordered by fare in descending order."
},
{
"role": "assistant",
"content": "SELECT passenger_id, fare FROM transportation.bookings WHERE status = 'completed' ORDER BY fare DESC;"... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.maintenance_logs ( log_id text PRIMARY KEY, vehicle_id text, service_date date, odometer_reading int, se... |
[
{
"role": "user",
"content": "For each achievement, show its name, the game_id it belongs to, and the number of distinct players who have played a session for that game."
},
{
"role": "assistant",
"content": "SELECT a.name, a.game_id, COUNT(DISTINCT gs.player_id) AS players_with_sessions\nFROM g... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt... |
[
{
"role": "user",
"content": "Show me the top 3 narratives by trend rank, along with their 7-day price change percentage and total volume."
},
{
"role": "assistant",
"content": "SELECT narrative, price_change_percentage_7d, volume_24h FROM narrative_info ORDER BY trend_rank ASC LIMIT 3;"
},
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri... |
[
{
"role": "user",
"content": "How many smart money addresses are recorded for each chain?"
},
{
"role": "assistant",
"content": "SELECT chain, COUNT(address) FROM smart_money_profit GROUP BY chain;"
},
{
"role": "user",
"content": "Now, only show chains that have more than 100 record... | You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, -- the user's address ... |
[
{
"role": "user",
"content": "List all patients who have primary insurance plans from providers with 'Blue' in their name, showing their policy numbers and expiration dates."
},
{
"role": "assistant",
"content": "SELECT pi.patient_id, pi.policy_number, pi.expiration_date FROM healthcare.patient_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id character varying(64) NOT NULL, doc... |
[
{
"role": "user",
"content": "Show me the total transaction amount sent by each sender_address in the last 30 days, along with the count of transactions for each sender."
},
{
"role": "assistant",
"content": "SELECT sender_address, SUM(amount) AS total_amount, COUNT(*) AS transaction_count FROM ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.transactions ( transaction_id text, block_id text, sender_address text, receiver_address text, amount numeri... |
[
{
"role": "user",
"content": "Show me all pairs of clients that share the same phone area code, including each client’s first name, last name, and phone number."
},
{
"role": "assistant",
"content": "SELECT c1.first_name AS first_name_1,\n c1.last_name AS last_name_1,\n c1.phone ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients (
client_id character varying(64) NOT NULL, -- unique identifier for the client
first_n... |
[
{
"role": "user",
"content": "What is the current market cap and 7-day price change percentage for the top 3 narratives by trend rank?"
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap, price_change_percentage_7d FROM narrative_info ORDER BY trend_rank ASC LIMIT 3;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE token_basic_info (",
"coin_id character varying(100) NOT NULL, -- the id of the token",
"token_name character... |
[
{
"role": "user",
"content": "List all ERC20 tokens where the total supply is between '1000000000' and '5000000000'. Show the symbol and name."
},
{
"role": "assistant",
"content": "SELECT symbol, name FROM token_metas WHERE is_erc20 = 1 AND total_supply >= '1000000000' AND total_supply <= '5000... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t... |
[
{
"role": "user",
"content": "List all food and beverage services (category = 'Food & Beverage') with their names, prices, and units, where the price is less than $20."
},
{
"role": "assistant",
"content": "SELECT service_name, price, unit FROM hospitality_technology.services WHERE category = 'F... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.services (
service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ... |
[
{
"role": "user",
"content": "Show me the usernames and email addresses of users who have used hashtags in their posts along with the hashtag names they have used."
},
{
"role": "assistant",
"content": "SELECT u.username, u.email, h.tag_name \nFROM social_media.users u\nJOIN social_media.posts p... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t... |
[
{
"role": "user",
"content": "Show me each lawyer along with the names of documents they have uploaded."
},
{
"role": "assistant",
"content": "SELECT l.first_name || ' ' || l.last_name AS lawyer_name,\n d.document_name\nFROM legal_services.lawyers l\nLEFT JOIN legal_services.documents d\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.lawyers ( lawyer_id text, first_name text, last_name text, bar_number text, firm_id text, email text, ph... |
[
{
"role": "user",
"content": "List all drivers who have an email address but no contact number recorded in the system."
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name, email FROM transportation.drivers WHERE email IS NOT NULL AND contact_number IS NULL"
},
{
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id character varying(64) NOT NULL UNIQUE, f... |
[
{
"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": "List all partners who were hired in the same year. Show their first name, last name, hire year, and firm ID."
},
{
"role": "assistant",
"content": "SELECT l1.first_name, l1.last_name, EXTRACT(YEAR FROM l1.hire_date) AS hire_year, l1.firm_id FROM legal_services.lawye... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text, bar_number text UNIQUE, firm_id t... |
[
{
"role": "user",
"content": "Show me the total fuel cost for each vehicle, grouped by fuel type."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, fuel_type, SUM(total_cost) AS total_fuel_cost FROM transportation.fuel_logs GROUP BY vehicle_id, 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.locations ( location_id character varying(64) NOT NULL, name character varying(255) NOT NULL, type chara... |
[
{
"role": "user",
"content": "For each chain, show the total token_amount and usd_value for selling transactions (type=2)."
},
{
"role": "assistant",
"content": "SELECT chain, SUM(token_amount) AS total_sold_amount, SUM(usd_value) AS total_sold_usd_value\nFROM smart_money_token_inflow\nWHERE typ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the token's address token_symbol character... |
[
{
"role": "user",
"content": "Show me all appointment times and statuses for appointments scheduled at location 'loc_101' with doctor 'doc_567'."
},
{
"role": "assistant",
"content": "SELECT a.appointment_time, a.status FROM healthcare.appointments a WHERE a.location_id = 'loc_101' AND a.doctor_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id character varying(64) NOT NULL, doc... |
[
{
"role": "user",
"content": "Find all assets that have metadata linking them to a DApp (where metadata value is a DApp ID), showing asset name, symbol, and the linked DApp name. Assume the metadata key used is 'linked_dapp_id'."
},
{
"role": "assistant",
"content": "SELECT a.name AS asset_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 trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch... |
[
{
"role": "user",
"content": "How many bookings were made each day in April 2024?"
},
{
"role": "assistant",
"content": "SELECT DATE(booking_time) AS booking_date, COUNT(*) AS booking_count FROM transportation.bookings WHERE EXTRACT(YEAR FROM booking_time) = 2024 AND EXTRACT(MONTH FROM booking_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, name.text, type.text, address_line1.text, city.text, state_province.text, ... |
[
{
"role": "user",
"content": "Count the number of locations for each state or province and display the state and the count."
},
{
"role": "assistant",
"content": "SELECT state_province, COUNT(*) AS location_count FROM transportation.locations GROUP BY state_province;"
},
{
"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.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro... |
[
{
"role": "user",
"content": "Find all contracts where the deployer address is the same as the contract address, indicating self-deployed contracts, and show their network IDs and deployment timestamps."
},
{
"role": "assistant",
"content": "SELECT address, network_id, deployed_at FROM web3.cont... | You are an SQL statement expert. Given the table 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": "Show me the full name and hire date for all lawyers hired after 2022, along with the name of the law firm they work for."
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, l.hire_date, f.firm_name FROM legal_services.lawyers AS l JOIN legal_ser... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer
first_n... |
[
{
"role": "user",
"content": "List all hashtags created after '2024-06-01', showing hashtag_id and tag_name."
},
{
"role": "assistant",
"content": "SELECT hashtag_id, tag_name\nFROM social_media.hashtags\nWHERE created_at > '2024-06-01';"
},
{
"role": "user",
"content": "Now also inc... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the hashtag
tag_nam... |
[
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 3 different NFTs from any ERC1155 contract. For each wallet, list the contract address and the count of distinct token_ids."
},
{
"role": "assistant",
"content": "SELECT contract_address, wallet_address, COUNT(DISTINC... | You are an SQL statement expert. Given the table 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 are the top 5 smart money addresses with the highest ROI on the BSC chain, and what are their profit, realized ratio, and most profitable token?"
},
{
"role": "assistant",
"content": "SELECT address, profit, roi, realized_ratio, most_profit_token FROM smart_mo... | You are an SQL statement expert. Given the table 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 all beneficiaries added in the last 6 months with a percentage share greater than 25%. Include their beneficiary ID, policy ID, customer ID, first name, last name, relationship, and percentage share. Order the results by the date they were added, oldest 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 insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la... |
[
{
"role": "user",
"content": "List all lawyers who have never had a time entry that was billed, showing lawyer_id, first_name, and last_name."
},
{
"role": "assistant",
"content": "SELECT l.lawyer_id, l.first_name, l.last_name \nFROM legal_services.lawyers l \nLEFT JOIN legal_services.time_ent... | You are an SQL statement expert. Given the table 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 the asset names and symbols for all assets of type 'token'."
},
{
"role": "assistant",
"content": "SELECT name, symbol FROM trading_platform.assets WHERE type = 'token';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
CREATE ... |
[
{
"role": "user",
"content": "For each relationship type among policy beneficiaries, count how many beneficiaries exist of that type. Provide relationship and count, ordered by count descending."
},
{
"role": "assistant",
"content": "SELECT relationship,\n COUNT(*) AS beneficiary_count\nFR... | You are an SQL statement expert. Given the table 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 service category, the service name with the shortest average processing time in that category, and its average processing time."
},
{
"role": "assistant",
"content": "SELECT m.category, s.service_name, s.average_processing_time_days\nFROM (\n SELECT catego... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli... |
[
{
"role": "user",
"content": "Count the total number of invoices issued in each calendar year and month. Show the year, month, and the count, ordered chronologically."
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM issue_date) AS issue_year, EXTRACT(MONTH FROM issue_date) AS issu... | You are an SQL statement expert. Given the table 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": "I want a summary of each asset showing the total number of trades executed and the average trade price, including asset name and symbol."
},
{
"role": "assistant",
"content": "SELECT a.asset_id,\n a.name,\n a.symbol,\n COUNT(t.trade_id) AS trades_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 trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
CREATE ... |
[
{
"role": "user",
"content": "Show me the make and model of vehicles along with the route number and distance for all routes that are serviced by vehicles with a fuel_type of 'Electric'."
},
{
"role": "assistant",
"content": "SELECT v.make, v.model, r.route_number, r.distance_km\nFROM transporta... | You are an SQL statement expert. Given the table 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": "What is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the detailed repair history of equipment used by staff memb... | You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE train_station_management.m... |
[
{
"role": "user",
"content": "List all plan names and their contact numbers for plans of type 'HMO' offered by 'Sunrise Insurance'."
},
{
"role": "assistant",
"content": "SELECT plan_name, contact_phone FROM healthcare.insurance_plans WHERE plan_type = 'HMO' AND insurance_provider = 'Sunrise Ins... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_provider text, plan_type text, contact... |
[
{
"role": "user",
"content": "Show me all securities (security_id, ticker_symbol, security_name, currency) that are denominated in EUR or GBP, along with the employees (employee_id, email) who last updated them (assuming last_updated corresponds to employee actions)."
},
{
"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 financial_services.securities (
security_id character varying(64) NOT NULL, -- unique identifier for the security
... |
[
{
"role": "user",
"content": "For each appointment, show the appointment subject, start time, the client's name, and the lawyer's email."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.subject, a.start_time, c.first_name || ' ' || c.last_name AS client_name, l.email AS lawyer_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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "Which exchanges on the Ethereum chain hold the highest total USD value of tokens, and what are their top 3 tokens by USD value?"
},
{
"role": "assistant",
"content": "SELECT exchange, token_symbol, usd_value FROM cex_token_balance WHERE chain = 'Ethereum' ORDER BY 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 cex_token_balance ( snapshot_time.text, chain.text, address.text, exchange.text, token_address.text, token_symbol.text,... |
[
{
"role": "user",
"content": "I need a report showing each security's ticker_symbol along with the total sum of trade total_amount and the count of trades executed in the last three months."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, SUM(t.total_amount) AS total_trade_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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad... |
[
{
"role": "user",
"content": "What is the total count of game sessions recorded?"
},
{
"role": "assistant",
"content": "SELECT count(*) FROM gaming_technology.game_sessions;"
},
{
"role": "user",
"content": "Now, only count sessions that lasted longer than 1 hour."
},
{
"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 gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "For each loan, calculate the number of days until maturity. Display loan_id, account_id, maturity_date, and days_to_maturity as the difference between maturity_date and CURRENT_DATE."
},
{
"role": "assistant",
"content": "SELECT loan_id,\n account_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.loans (
loan_id character varying(64) NOT NULL, -- unique identifier for the loan, could be same... |
[
{
"role": "user",
"content": "List the vehicle_id, make, model, and total maintenance cost for each vehicle that has undergone maintenance, ordering by total maintenance cost descending."
},
{
"role": "assistant",
"content": "SELECT m.vehicle_id, v.make, v.model, SUM(m.cost) AS total_maintenance... | You are an SQL statement expert. Given the table 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 the number of game servers in each region and the average maximum number of players they can accommodate. Exclude any servers that are currently offline."
},
{
"role": "assistant",
"content": "SELECT region, COUNT(server_id) AS server_count, AVG(max_players)... | You are an SQL statement expert. Given the table 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": "I want to see the total sum of transaction amounts and their average amount for each transaction_type along with the total number of transactions, grouped by currency."
},
{
"role": "assistant",
"content": "SELECT transaction_type, currency, COUNT(*) AS total_transa... | You are an SQL statement expert. Given the table 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 events emitted by contracts where the event name contains 'Approval', along with the contract ID and transaction ID, sorted by emitted timestamp in descending order."
},
{
"role": "assistant",
"content": "SELECT event_id, contract_id, event_name, transac... | You are an SQL statement expert. Given the table 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": "List every booking together with the route number and description for the trip being booked."
},
{
"role": "assistant",
"content": "SELECT b.booking_id, b.passenger_id, b.trip_id, r.route_number, r.description\nFROM transportation.bookings b\nJOIN transportation.rou... | You are an SQL statement expert. Given the table 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": "What is the average balance of all addresses in the database?"
},
{
"role": "assistant",
"content": "SELECT AVG(balance) AS average_balance FROM blockchain.addresses;"
},
{
"role": "user",
"content": "Can you break this down by the first 3 characters of ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.addresses ( address_id text PRIMARY KEY, public_key text, balance numeric )
|
[
{
"role": "user",
"content": "Find the date (calendar day) with the highest total number of game sessions. Show the date and the total session count."
},
{
"role": "assistant",
"content": "SELECT CAST(start_time AS DATE) AS session_date, COUNT(*) AS total_sessions\nFROM gaming_technology.game_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 gaming_technology.game_sessions (
session_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ... |
[
{
"role": "user",
"content": "Show me the balances held by the 'Coinbase' exchange. For each token, list the token symbol, balance, and the current price from the token basic info table."
},
{
"role": "assistant",
"content": "SELECT ctb.token_symbol, ctb.balance, tbi.price FROM cex_token_balance... | 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": "List all room types and available services for each property, showing the property ID, room type name, base rate, service name, and service price."
},
{
"role": "assistant",
"content": "SELECT T1.property_id , T1.type_name , T1.base_rate , T2.service_name , T2.p... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu... |
[
{
"role": "user",
"content": "特定の職種の従業員情報を取得したいです。従業員ID、名前、職種、雇用日を表示してください。"
},
{
"role": "assistant",
"content": "db.employees.find(\n { job_title: '<specific_job_title>' },\n { employee_id: 1, first_name: 1, last_name: 1, job_title: 1, hire_date: 1, _id: 0 }\n).sort({ hire_date: -1 })"
... | 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 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... |
[
{
"role": "user",
"content": "For each player, show their player_id and the number of different games they have played sessions on."
},
{
"role": "assistant",
"content": "SELECT player_id, COUNT(DISTINCT game_id) AS games_played\nFROM gaming_technology.game_sessions\nGROUP BY player_id;"
},
... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "List the plan_id, plan_name, and plan_type for all insurance plans where the insurance_provider is 'Humana'."
},
{
"role": "assistant",
"content": "SELECT\n plan_id,\n plan_name,\n plan_type\nFROM healthcare.insurance_plans\nWHERE\n insurance_provider = 'Humana'... | You are an SQL statement expert. Given the table 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": "Show the name and description for all dapps."
},
{
"role": "assistant",
"content": "SELECT name, description FROM trading_platform.dapps;"
},
{
"role": "user",
"content": "Refine this to show only dapps whose description contains the word 'management'."
... | 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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.