conversations listlengths 2 8 | system stringlengths 276 8.4k |
|---|---|
[
{
"role": "user",
"content": "For each department, list the top 3 most expensive services along with their service_name, price, and property_name."
},
{
"role": "assistant",
"content": "SELECT department, service_name, price, property_name\nFROM (\n SELECT s.department,\n s.service_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 hospitality_technology.services ( service_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL... |
[
{
"role": "user",
"content": "Count the number of securities by exchange."
},
{
"role": "assistant",
"content": "SELECT exchange, COUNT(*) AS security_count\nFROM financial_services.securities\nGROUP BY exchange;"
},
{
"role": "user",
"content": "Now group the count by sector instead... | You are an SQL statement expert. Given the table 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.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba... |
[
{
"role": "user",
"content": "How many lawyers are there per specialization?"
},
{
"role": "assistant",
"content": "SELECT specialization, COUNT(*) AS lawyer_count\nFROM legal_services.lawyers\nGROUP BY specialization;"
},
{
"role": "user",
"content": "Please exclude specializations ... | You are an SQL statement expert. Given the table 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, first_name character varying(100) NOT NULL, last_nam... |
[
{
"role": "user",
"content": "List all claim documents that are police reports and were uploaded in the last 30 days, along with their file sizes."
},
{
"role": "assistant",
"content": "SELECT cd.document_id, cd.claim_id, cd.file_size_bytes FROM insurance.claim_documents cd WHERE cd.document_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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c... |
[
{
"role": "user",
"content": "List all pairs of token transfers where the sender is the same but the recipients differ. Show both transfer IDs and the common sender address."
},
{
"role": "assistant",
"content": "SELECT t1.transfer_id AS transfer_id_1, t2.transfer_id AS transfer_id_2, t1.from_ad... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the transfer
token... |
[
{
"role": "user",
"content": "List the names of employees and the agency they work for who have scheduled at least one appointment. Show the employee's first name, last name, and agency_id."
},
{
"role": "assistant",
"content": "SELECT DISTINCT e.first_name, e.last_name, e.agency_id\nFROM govern... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli... |
[
{
"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": "How many smart contracts were created in the year 2023?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM blockchain.smart_contracts WHERE timestamp >= '2023-01-01' AND timestamp < '2024-01-01';"
},
{
"role": "user",
"content": "List the top 5 ... | 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 blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, time... |
[
{
"role": "user",
"content": "Which room types have the highest average base_rate? Return type_name and avg_rate, sorted descending, limit 5."
},
{
"role": "assistant",
"content": "SELECT rt.type_name,\n AVG(rt.base_rate) AS avg_rate\nFROM hospitality_technology.room_types rt\nGROUP BY rt.... | You are an SQL statement expert. Given the table 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 all NFTs on the 'Ethereum' blockchain, showing their name, contract address, token ID, and the name of the collection they belong to."
},
{
"role": "assistant",
"content": "SELECT t1.name, t1.contract_address, t1.token_id, t2.name AS collection_name FROM nft_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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ... |
[
{
"role": "user",
"content": "Could you list the top 5 narratives by their 7-day price change percentage, including the number of tokens and their top 3 coins?"
},
{
"role": "assistant",
"content": "SELECT narrative, price_change_percentage_7d, token_num, top_3_coins FROM narrative_info 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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name... |
[
{
"role": "user",
"content": "Find all pairs of users who signed up on the same day. Return both usernames and the signup date."
},
{
"role": "assistant",
"content": "SELECT u1.username AS user1, u2.username AS user2, DATE(u1.created_at) AS signup_date\nFROM social_media.users u1\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 PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p... |
[
{
"role": "user",
"content": "Show me the historical balance entries for wallet address '0xabc...' and contract address '0xdef...', including the block number and amount."
},
{
"role": "assistant",
"content": "SELECT block_number, amount FROM erc20_balances_historical WHERE wallet_address = '0xa... | You are an SQL statement expert. Given the table 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": "Show all active customers who live in the same zip_code."
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS cust1,\n b.customer_id AS cust2,\n a.zip_code\nFROM financial_services.customers a\nJOIN financial_services.customers b\n ON a.zip_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h... |
[
{
"role": "user",
"content": "List all diesel fuel logs where the quantity is more than 50 liters, including the vehicle ID and total cost."
},
{
"role": "assistant",
"content": "SELECT fuel_log_id, vehicle_id, trip_id, quantity, total_cost FROM transportation.fuel_logs WHERE fuel_type = 'diesel... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ... |
[
{
"role": "user",
"content": "List all insurance providers along with the total number of plans they offer."
},
{
"role": "assistant",
"content": "SELECT insurance_provider, COUNT(*) AS plan_count\nFROM healthcare.insurance_plans\nGROUP BY insurance_provider;"
},
{
"role": "user",
"c... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, plan_type.text, contact_phone.text,... |
[
{
"role": "user",
"content": "Could you provide the firm_id, firm_name, total number of lawyers, and number of partners per firm?"
},
{
"role": "assistant",
"content": "SELECT lf.firm_id,\n lf.firm_name,\n COUNT(lw.lawyer_id) AS total_lawyers,\n SUM(CASE WHEN lw.is_partner THEN... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI... |
[
{
"role": "user",
"content": "Show the route number and description for routes that have bookings associated with them."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.route_number, T1.description FROM transportation.routes AS T1 JOIN transportation.bookings AS T2 ON T1.route_id = T2.t... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ... |
[
{
"role": "user",
"content": "Show me a list of all bus routes, including their route numbers, type, and the names of both the origin and destination locations."
},
{
"role": "assistant",
"content": "SELECT r.route_number, r.type, lo.name AS origin_name, ld.name AS destination_name\nFROM transpo... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati... |
[
{
"role": "user",
"content": "List the trip ID, scheduled departure time, route number, and route type for all trips."
},
{
"role": "assistant",
"content": "SELECT T1.trip_id, T1.scheduled_departure, T2.route_number, T2.type FROM transportation.trips AS T1 JOIN transportation.routes AS T2 ON T1.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description text, origin_location_id text, destin... |
[
{
"role": "user",
"content": "Show me policies that have at least one overdue premium payment, including policy_number, customer full name, agent_id, due_date, and days overdue."
},
{
"role": "assistant",
"content": "SELECT p.policy_number,\n c.first_name || ' ' || c.last_name AS customer_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... |
[
{
"role": "user",
"content": "Show the symbol and current balance for all ERC20 tokens held by wallet '0x...abc'."
},
{
"role": "assistant",
"content": "SELECT T2.symbol, T1.amount FROM erc20_balances AS T1 INNER JOIN token_metas AS T2 ON T1.contract_address = T2.contract_address WHERE T1.wallet... | 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_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... |
[
{
"role": "user",
"content": "List all trips that were completed and experienced a significant delay in actual arrival compared to the scheduled arrival (more than 45 minutes)."
},
{
"role": "assistant",
"content": "SELECT\n trip_id,\n vehicle_id,\n driver_id,\n scheduled_arrival,\n actual_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identifier for a specific trip instance
... |
[
{
"role": "user",
"content": "I need to get the total quantity of components in inventory for a specific warehouse location. Can you help with that?"
},
{
"role": "assistant",
"content": "SELECT location_warehouse, SUM(quantity) AS total_quantity\nFROM component_inventory\nWHERE location_warehou... | 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
Index 'aircraft_models'. Mapping: { properties: { model_id: { type: 'keyword' }, model_name: { ty... |
[
{
"role": "user",
"content": "For each NFT collection on Ethereum, calculate the number of unique tokens and the average rarity_score. Show contract_address, token_count, and avg_rarity."
},
{
"role": "assistant",
"content": "SELECT nm.contract_address,\n COUNT(DISTINCT nm.token_id) AS tok... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... |
[
{
"role": "user",
"content": "List each achievement name, the number of players who unlocked it, and the latest unlock time."
},
{
"role": "assistant",
"content": "SELECT a.name,\n COUNT(pa.player_id) AS unlock_count,\n MAX(pa.unlocked_at) AS latest_unlocked_at\nFROM gaming_techn... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id.uuid, name.text, country.text, founded_year.integer, website.text, created_... |
[
{
"role": "user",
"content": "List the license number and specialty for all doctors who have a phone number on record."
},
{
"role": "assistant",
"content": "SELECT license_number, specialty FROM healthcare.doctors WHERE phone_number 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.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ... |
[
{
"role": "user",
"content": "List all transactions along with the user ID and username of the sender, if available. Show transaction id, from_address, user id, and username."
},
{
"role": "assistant",
"content": "SELECT tx.transaction_id, tx.from_address, w.user_id, u.username\nFROM web3.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 web3.events ( event_id character varying(64) NOT NULL, contract_id character varying(64) NOT NULL, event_name character... |
[
{
"role": "user",
"content": "Can you provide a list of all medical records created by doctors for patients who are associated with 'PPO' type insurance plans? I need the record ID, patient ID, doctor ID, record date, and insurance plan name."
},
{
"role": "assistant",
"content": "SELECT mr.reco... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- unique identifier for the medical record... |
[
{
"role": "user",
"content": "How many unique user_ids are there in the wallets table?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT user_id) AS unique_users FROM blockchain.wallets;"
},
{
"role": "user",
"content": "Now, show me the top 5 user_ids with the highest num... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the wallet
user_id cha... |
[
{
"role": "user",
"content": "Find consecutive image messages in each conversation: return conversation_id, first_image_id, next_image_id, and time_diff in seconds."
},
{
"role": "assistant",
"content": "SELECT m1.conversation_id,\n m1.message_id AS first_image_id,\n m2.message_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 social_media.messages (
message_id character varying(64) NOT NULL, -- unique identifier for the message
convers... |
[
{
"role": "user",
"content": "Show me the security_id, open_price, close_price, and volume for all market data points where the adjusted_close_price increased by more than 5% compared to the previous day's close, along with the data_timestamp."
},
{
"role": "assistant",
"content": "SELECT m1.sec... | You are an SQL statement expert. Given the table 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": "List all available services along with the property name where they are offered."
},
{
"role": "assistant",
"content": "SELECT s.service_id, s.service_name, p.property_name\nFROM hospitality_technology.services s\nJOIN hospitality_technology.properties p ON s.proper... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL... |
[
{
"role": "user",
"content": "Find all pairs of distinct tokens that have the exact same total supply, showing both token IDs and the total supply value."
},
{
"role": "assistant",
"content": "SELECT t1.token_id AS token_id1, t2.token_id AS token_id2, t1.total_supply FROM web3.tokens AS t1 JOIN ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha... |
[
{
"role": "user",
"content": "Find all pairs of doctors who share the same specialty. Display d1.doctor_id, d1.first_name, d1.last_name, d2.doctor_id, d2.first_name, d2.last_name, and the specialty."
},
{
"role": "assistant",
"content": "SELECT d1.doctor_id AS doctor1_id, d1.first_name AS 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.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number... |
[
{
"role": "user",
"content": "Count the number of completed premium payments grouped by payment_method."
},
{
"role": "assistant",
"content": "SELECT payment_method,\n COUNT(*) AS payment_count\nFROM insurance.premium_payments\nWHERE status = 'Completed'\nGROUP BY payment_method;"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_id text, payment_date timestamp, amo... |
[
{
"role": "user",
"content": "List each participant_id along with the total number of participants in their conversation, and include user_id and conversation_id."
},
{
"role": "assistant",
"content": "SELECT cp.participant_id, cp.user_id, cp.conversation_id, counts.participant_count\nFROM socia... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.conversation_participants (
participant_id character varying(64) NOT NULL, -- unique identifier for th... |
[
{
"role": "user",
"content": "What are the distinct categories of services offered by agencies within the 'State' jurisdiction level?"
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.category FROM government_services.services AS T1 JOIN government_services.agencies AS T2 ON T1.agency_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 government_services.agencies (
agency_id character varying(64) NOT NULL, -- unique identifier for the agency
ag... |
[
{
"role": "user",
"content": "Find pairs of diagnoses for the same patient and diagnosis code, but where the 'status' is different between the two diagnoses. Show patient_id, diagnosis_code, the status of the first diagnosis (status1), and the status of the second diagnosis (status2)."
},
{
"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.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id text, diagnosis_code text, code_ty... |
[
{
"role": "user",
"content": "For each player and game pair, please show the total number of achievements unlocked by the player in that game."
},
{
"role": "assistant",
"content": "SELECT gs.player_id, gs.game_id, COUNT(pa.achievement_id) AS achievements_unlocked\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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... |
[
{
"role": "user",
"content": "Calculate the total and average cost per service_type in maintenance_logs."
},
{
"role": "assistant",
"content": "SELECT\n service_type,\n SUM(cost) AS total_cost,\n AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nGROUP BY service_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 transportation.maintenance_logs ( log_id text, vehicle_id text, service_date date, odometer_reading integer, service_ty... |
[
{
"role": "user",
"content": "List all posts along with the number of comments each post has received."
},
{
"role": "assistant",
"content": "SELECT p.post_id, COUNT(c.comment_id) AS comment_count\nFROM social_media.posts p\nLEFT JOIN social_media.comments c ON p.post_id = c.post_id\nGROUP BY 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": "List all premium payments made after April 1, 2024, including the payment_id, policy_id, customer_id, and amount_paid."
},
{
"role": "assistant",
"content": "SELECT payment_id, policy_id, customer_id, amount_paid\nFROM insurance.premium_payments\nWHERE payment_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.premium_payments ( payment_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, custo... |
[
{
"role": "user",
"content": "Show me all accounts (account_id, account_number, balance) that have a balance greater than $50,000 and were opened in the last year, along with the market data (security_id, close_price, volume) for securities traded on the same day as the account was last updated."
},
{
... | You are an SQL statement expert. Given the table 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.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac... |
[
{
"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": "For each diagnosis, show the diagnosis code, description, and the full name of the doctor who made the diagnosis."
},
{
"role": "assistant",
"content": "SELECT dgn.diagnosis_code, dgn.description, doc.first_name AS doctor_first_name, doc.last_name AS doctor_last_nam... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... |
[
{
"role": "user",
"content": "List all agents who have a commission rate above 0.1, showing their full names and agency names."
},
{
"role": "assistant",
"content": "SELECT agent_id, first_name || ' ' || last_name AS full_name, agency_name, commission_rate FROM insurance.agents WHERE commission_... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique identifier for the customer
first_... |
[
{
"role": "user",
"content": "List all medications along with the length of their description, but only include those with descriptions longer than 100 characters. Show medication_id, medication_name, and description length."
},
{
"role": "assistant",
"content": "SELECT medication_id, medication... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.medications ( medication_id.text, medication_name.text, generic_name.text, manufacturer.text, ndc_code.text,... |
[
{
"role": "user",
"content": "List all DApps that have 'wallet' in their description, along with their URLs."
},
{
"role": "assistant",
"content": "SELECT name, url FROM trading_platform.dapps WHERE description LIKE '%wallet%';"
},
{
"role": "user",
"content": "Now show only DApps cr... | You are an SQL statement expert. Given the table 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": "Which games have at least one achievement worth exactly 75 points, and what are the names and descriptions of those achievements?"
},
{
"role": "assistant",
"content": "SELECT g.title, a.name AS achievement_name, a.description\nFROM gaming_technology.games g\nJOIN 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.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game
ti... |
[
{
"role": "user",
"content": "List each agency's name and primary contact email along with the total number of notifications related to that agency."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, a.primary_contact_email, COUNT(n.notification_id) AS notification_count\nFROM governme... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "Get me a list of all clients along with the website of their law firm, matching on company_name = firm_name."
},
{
"role": "assistant",
"content": "SELECT c.client_id, c.first_name, c.last_name, f.firm_name, f.website\nFROM legal_services.clients AS c\nJOIN legal_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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique identifier for the client
first_n... |
[
{
"role": "user",
"content": "List all distinct project names found in the fundraising records."
},
{
"role": "assistant",
"content": "SELECT DISTINCT project_name FROM project_fundraising_record;"
},
{
"role": "user",
"content": "For each project, count how many fundraising rounds a... | 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 project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... |
[
{
"role": "user",
"content": "Retrieve all appointments for doctor 'doc123' scheduled in April 2024, showing appointment ID, patient ID, time, and status."
},
{
"role": "assistant",
"content": "SELECT appointment_id, patient_id, appointment_time, status FROM healthcare.appointments WHERE 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": "Show me prescriptions with a route of 'Intravenous' and a frequency of 'Once Daily'. I need the prescription ID, medication ID, route, and frequency."
},
{
"role": "assistant",
"content": "SELECT prescription_id , medication_id , route , frequency FROM healthcare... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appointment_time timestamp, duration_mi... |
[
{
"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 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": "For each property, show the count of rooms and the count of active staff members working at that property. Display the property ID, room count, and active staff count."
},
{
"role": "assistant",
"content": "SELECT r.property_id, COUNT(DISTINCT r.room_id) AS room_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.rooms ( room_id text, property_id text, room_number text, room_type_id text, floor integer, stat... |
[
{
"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 application that has pending documents, list the application's reference_number and the corresponding service_name. Only include documents with verification_status = 'Pending'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.reference_number, s.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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j... |
[
{
"role": "user",
"content": "Show employees hired before 2020 along with their manager's full name."
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name FROM financial_services.employees AS e LEFT JOIN fina... | You are an SQL statement expert. Given the table 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.employees (
employee_id character varying(64) NOT NULL, -- unique identifier for the employee
... |
[
{
"role": "user",
"content": "List all addresses that have created smart contracts, showing the address ID and its current balance."
},
{
"role": "assistant",
"content": "SELECT T1.address_id, T1.balance FROM blockchain.addresses AS T1 JOIN blockchain.smart_contracts AS T2 ON T1.address_id = T2.... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE blockchain.blocks (
block_id character varying(64) NOT NULL, -- unique identifier for the block
previous_block... |
[
{
"role": "user",
"content": "Show me the top 3 tokens by trend rank in the 'NFT' narrative, along with their price and 24-hour trading volume."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE narrative = 'NFT' ORDER BY trend... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character varying(100) NOT NULL, token_symbol ch... |
[
{
"role": "user",
"content": "Show me all non-smoking rooms on the first floor, including their room number and the property name."
},
{
"role": "assistant",
"content": "SELECT r.room_number, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.properties p ON r.prop... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... |
[
{
"role": "user",
"content": "Show a list of all fuel refueling events for each trip, including the trip ID, fuel type, quantity, total cost, and the name of the refueling location."
},
{
"role": "assistant",
"content": "SELECT fl.trip_id, fl.fuel_type, fl.quantity, fl.total_cost, l.name AS loca... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text... |
[
{
"role": "user",
"content": "List all developers along with the total number of achievements available in games that they have developed."
},
{
"role": "assistant",
"content": "SELECT d.name, COUNT(a.achievement_id) AS total_achievements\nFROM gaming_technology.developers d\nJOIN gaming_technol... | You are an SQL statement expert. Given the table 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 each user's username along with their KYC status and the date of their latest KYC review."
},
{
"role": "assistant",
"content": "SELECT u.username, ka.status, ka.reviewed_at AS latest_review\nFROM trading_platform.users u\nJOIN trading_platform.kyc_audit ka 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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp )
CREATE TAB... |
[
{
"role": "user",
"content": "What is the average ROI for all smart money addresses on the Binance chain?"
},
{
"role": "assistant",
"content": "SELECT AVG(roi) FROM smart_money_profit WHERE chain = 'Binance';"
}
] | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, -- the user's address rank INT, -- the rank of the addres... |
[
{
"role": "user",
"content": "Find the total amount of payments and the number of payments for each status."
},
{
"role": "assistant",
"content": "SELECT status, SUM(amount) AS total_amount, COUNT(*) AS payment_count\nFROM hospitality_technology.payments\nGROUP BY status;"
},
{
"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 hospitality_technology.payments ( payment_id text PRIMARY KEY, reservation_id text, guest_id text, bill_id text, amount... |
[
{
"role": "user",
"content": "Find pairs of products that share the same product_type but have different is_active statuses. Return the product_type, active product_id, active product_name, inactive product_id, and inactive product_name."
},
{
"role": "assistant",
"content": "SELECT a.product_ty... | You are an SQL statement expert. Given the table 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.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu... |
[
{
"role": "user",
"content": "List the names and rarity of all items with a cost above 50."
},
{
"role": "assistant",
"content": "SELECT item_name, rarity\nFROM gaming_technology.in_game_items\nWHERE cost_amount > 50;"
},
{
"role": "user",
"content": "Now, only include items where th... | You are an SQL statement expert. Given the table 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.in_game_items (
item_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ite... |
[
{
"role": "user",
"content": "List all user IDs and the number of posts each has made where the post includes a media file (media_url is not null), along with whether their profile is private."
},
{
"role": "assistant",
"content": "SELECT p.user_id, COUNT(*) AS media_post_count, us.private_profi... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ... |
[
{
"role": "user",
"content": "List the names of active services offered by agencies with at least one accessible service location in the state of 'New York'. Show the service name, category, agency name, and the location name."
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T1.cat... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... |
[
{
"role": "user",
"content": "List the document name, upload timestamp, and the full name of the lawyer who uploaded it, for all documents associated with case number 'CASE123'."
},
{
"role": "assistant",
"content": "SELECT T1.document_name , T1.upload_timestamp , T2.full_name FROM legal_servi... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u... |
[
{
"role": "user",
"content": "How many available rooms and available services are there for each property?"
},
{
"role": "assistant",
"content": "SELECT\n r.property_id,\n SUM(CASE WHEN r.status = 'Available' THEN 1 ELSE 0 END) AS available_rooms_count,\n SUM(CASE WHEN s.is_available = TRUE 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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat... |
[
{
"role": "user",
"content": "For each token_id, what is the average value of transfers? Show token_id and avg_value."
},
{
"role": "assistant",
"content": "SELECT token_id, AVG(value) AS avg_value\nFROM web3.token_transfers\nGROUP BY token_id;"
},
{
"role": "user",
"content": "Actua... | You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the transfer
token... |
[
{
"role": "user",
"content": "List all users whose email contains the word 'block', along with their username and registration timestamp."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, created_at\nFROM web3.users\nWHERE email ILIKE '%block%';"
},
{
"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 web3.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
|
[
{
"role": "user",
"content": "List all events and any token transfers that occurred in the same transaction, showing event_id, event_name, transfer_id, and token_symbol."
},
{
"role": "assistant",
"content": "SELECT\n e.event_id,\n e.event_name,\n tt.transfer_id,\n tk.token_symbol\nFROM web3... | You are an SQL statement expert. Given the table 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": "Which pairs of tokens on the same chain have the greatest difference in 24h trading volume? List the two token symbols, their volumes, the absolute difference, and the chain. Limit to the top 3 pairs."
},
{
"role": "assistant",
"content": "SELECT a.chain,\n 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 token_dexpool_info (",
"pair_address character varying(512) NOT NULL, -- the id of dexpool",
"token_name cha... |
[
{
"role": "user",
"content": "How many premium payments were made using 'Credit Card' as the payment method?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS credit_card_payments\nFROM insurance.premium_payments\nWHERE payment_method = 'Credit Card';"
}
] | You are an SQL statement expert. Given the table 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": "List all dental insurance plans, sorted by plan name."
},
{
"role": "assistant",
"content": "SELECT * FROM healthcare.insurance_plans WHERE plan_type = 'dental' ORDER BY plan_name;"
},
{
"role": "user",
"content": "Actually, I only need plans from provid... | You are an SQL statement expert. Given the table 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, plan_name text, insurance_provider text, plan_type text, contact_phone text,... |
[
{
"role": "user",
"content": "Show a list of patients along with their most recent diagnoses, including patient ID, diagnosis description, and the diagnosis date."
},
{
"role": "assistant",
"content": "SELECT d.patient_id, d.description AS diagnosis_description, d.diagnosis_date FROM healthcare.... | You are an SQL statement expert. Given the table 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 post IDs and their corresponding hashtag names for posts that include media."
},
{
"role": "assistant",
"content": "SELECT ph.post_id, h.tag_name\nFROM social_media.post_hashtags ph\nJOIN social_media.hashtags h ON ph.hashtag_id = h.hashtag_id\nJOIN social_... | You are an SQL statement expert. Given the table 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 PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ... |
[
{
"role": "user",
"content": "Find pairs of products with the same product_type but different is_active statuses. Include product_type, active product_id, active product_name, inactive product_id, and inactive product_name."
},
{
"role": "assistant",
"content": "SELECT\n p_active.product_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 insurance.insurance_products (
product_id character varying(64) NOT NULL, -- unique identifier for the insurance pr... |
[
{
"role": "user",
"content": "List all trips scheduled on '2023-11-01' along with the license plate of the assigned vehicle and the driver's full name."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, t.route_id, t.scheduled_departure, v.license_plate, d.first_name || ' ' || d.last_name ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... |
[
{
"role": "user",
"content": "For claims reported after January 1st, 2024, show the claim ID, incident date, the policy number associated, and the full name of the agent who handled each claim."
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, p.policy_id AS policy_numbe... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ... |
[
{
"role": "user",
"content": "Show me all policies where the total percentage share of beneficiaries exceeds 100%, along with the policy IDs and the sum of percentage shares."
},
{
"role": "assistant",
"content": "SELECT policy_id, SUM(percentage_share) AS total_percentage FROM insurance.policy_... | You are an SQL statement expert. Given the table 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, policy_id text, customer_id text, first_name text, last_name text... |
[
{
"role": "user",
"content": "Show me, for each item, the total number of times it has been acquired and the earliest date it was acquired. Also, show the number of unique players who have acquired each item."
},
{
"role": "assistant",
"content": "SELECT item_id, COUNT(*) AS total_acquisitions, ... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, ite... |
[
{
"role": "user",
"content": "Show me all drivers hired in 2023, including their full name and email address."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM transportation.drivers WHERE hire_date >= '2023-01-01' AND hire_date < '2024-01-01';"
},
{
"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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens... |
[
{
"role": "user",
"content": "Show me all services and their associated property names where the service is available and the price is below 40."
},
{
"role": "assistant",
"content": "SELECT s.service_id, s.service_name, s.price, p.property_name\nFROM hospitality_technology.services s\nJOIN hosp... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, -- unique identifier for the prope... |
[
{
"role": "user",
"content": "List all pairs of contracts deployed on the same day by the same deployer. Show deployer_address, deployment date, and both contract IDs."
},
{
"role": "assistant",
"content": "SELECT\n c1.deployer_address,\n DATE(c1.deployed_at) AS deployment_date,\n c1.contract... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifier for the contract
address cha... |
[
{
"role": "user",
"content": "Show me the name of each narrative and its 24-hour price change percentage."
},
{
"role": "assistant",
"content": "SELECT narrative, price_change_percentage_24h FROM narrative_info"
},
{
"role": "user",
"content": "Now, filter the list to only include na... | 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 guests with their loyalty_member_id and communication consent status."
},
{
"role": "assistant",
"content": "SELECT guest_id,\n first_name,\n last_name,\n loyalty_member_id,\n communication_consent\nFROM hospitality_technology.guests... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la... |
[
{
"role": "user",
"content": "List all prescriptions where the dosage text contains the word 'unit'. Show the prescription ID, medication ID, and dosage."
},
{
"role": "assistant",
"content": "SELECT prescription_id, medication_id, dosage FROM healthcare.prescriptions WHERE dosage LIKE '%unit%';... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.diagnoses ( diagnosis_id text PRIMARY KEY, record_id text, patient_id text, doctor_id text, diagnosis_code t... |
[
{
"role": "user",
"content": "I want to get the total number of appointments scheduled at each agency in 2024. Please provide the agency name and the appointment count."
},
{
"role": "assistant",
"content": "SELECT a.agency_name,\n COUNT(ap.appointment_id) AS appointment_count\nFROM govern... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d... |
[
{
"role": "user",
"content": "List all staff members showing their full name and position."
},
{
"role": "assistant",
"content": "SELECT first_name || ' ' || last_name AS staff_full_name, position FROM hospitality_technology.staff;"
},
{
"role": "user",
"content": "Now only include s... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, room_type_id text, floor integer, stat... |
[
{
"role": "user",
"content": "List all guests who have stayed in rooms that allow smoking, including their full name and the relevant room number."
},
{
"role": "assistant",
"content": "SELECT DISTINCT g.guest_id, g.first_name, g.last_name, r.room_number\nFROM hospitality_technology.guests g\nJO... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... |
[
{
"role": "user",
"content": "Show me all policies where the total percentage share of beneficiaries exceeds 100%, along with the policy IDs and the sum of percentage shares."
},
{
"role": "assistant",
"content": "SELECT policy_id, SUM(percentage_share) AS total_percentage FROM insurance.policy_... | You are an SQL statement expert. Given the table 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, policy_id text, customer_id text, first_name text, last_name text... |
[
{
"role": "user",
"content": "List each driver's first_name, last_name, and the total number of bookings they have made."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, COUNT(b.booking_id) AS booking_count\nFROM transportation.drivers d\nJOIN transportation.bookings b ON... | You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.drivers (
driver_id character varying(64) NOT NULL, -- unique identifier for the driver
employe... |
[
{
"role": "user",
"content": "For wallet '0x...', list the token IDs of the NFTs currently held, the name of their collection, and that collection's floor price."
},
{
"role": "assistant",
"content": "SELECT T1.token_id, T2.name, T2.floor_price FROM nft_holders AS T1 INNER JOIN nft_collections A... | 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_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.