system stringlengths 315 7.3k | conversations listlengths 2 8 |
|---|---|
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 hospitality_technology.service_orders ( order_id text, reservation_id text, guest_id... | [
{
"role": "user",
"content": "Find guests who ordered the same service more than once on the same reservation and date. Return guest_id, reservation_id, service_id, and the date."
},
{
"role": "assistant",
"content": "SELECT so1.guest_id,\n so1.reservation_id,\n so1.service_id,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id t... | [
{
"role": "user",
"content": "How many insurance policies have 'Group' in their group_number?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM healthcare.patient_insurance WHERE group_number ILIKE '%Group%';"
}
] |
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 character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Show assets of type 'token', including their name, symbol, and any associated metadata key and value."
},
{
"role": "assistant",
"content": "SELECT t1.name, t1.symbol, t2.key, t2.value FROM trading_platform.assets AS t1 LEFT JOIN trading_platform.metadata AS t2 ON t... |
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": "Calculate the average realized_ratio across all addresses."
},
{
"role": "assistant",
"content": "SELECT AVG(realized_ratio) AS average_realized_ratio\nFROM smart_money_profit;"
}
] |
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, -- fundraising reco... | [
{
"role": "user",
"content": "Find projects that completed a fundraising round in 2023 and have a corresponding token listed in the smart money performance data. Show the project name, fundraising amount, token symbol, and the token's smart money ROI."
},
{
"role": "assistant",
"content": "SELEC... |
You are an 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 social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_... | [
{
"role": "user",
"content": "Show me the conversation ID and creation time for all conversations that are not group chats and have a recorded last message time."
},
{
"role": "assistant",
"content": "SELECT conversation_id, created_at FROM social_media.conversations WHERE is_group_chat = FALSE ... |
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 web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show all contracts deployed on 'testnet', including the contract_id, address, deployer_address, and deployed_at."
},
{
"role": "assistant",
"content": "SELECT contract_id, address, deployer_address, deployed_at\nFROM web3.contracts\nWHERE network_id = 'testnet';"
... |
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 web3.token_transfers (
transfer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all token transfers between two distinct addresses, showing transfer_id, from_address, to_address, value, and transaction_id."
},
{
"role": "assistant",
"content": "SELECT transfer_id, from_address, to_address, value, transaction_id\nFROM web3.token_transfers\n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show for every asset the usernames of users who have both bought and sold that asset, along with the asset name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.asset_id, a.name AS asset_name, u.username\nFROM trading_platform.assets a\nJOIN trading_platfor... |
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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "List all posts that contain the word 'festival' in their content, showing the post_id, the author's username, and the post creation time."
},
{
"role": "assistant",
"content": "SELECT p.post_id, u.username, p.created_at\nFROM social_media.posts p\nJOIN social_media.... |
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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "List the employee ID, first name, last name, and hire date for all employees who were hired in the year 2022."
},
{
"role": "assistant",
"content": "SELECT employee_id, first_name, last_name, hire_date FROM government_services.employees WHERE EXTRACT(YEAR FROM hire_... |
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 gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name te... | [
{
"role": "user",
"content": "Show me the average number of current players for each server region."
},
{
"role": "assistant",
"content": "SELECT region, AVG(current_players) AS average_players FROM gaming_technology.servers GROUP BY region;"
},
{
"role": "user",
"content": "Now, onl... |
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 transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"role": "user",
"content": "List all pairs of routes where the origin location of one route is the destination location of the other, showing both route numbers and their types."
},
{
"role": "assistant",
"content": "SELECT r1.route_number AS route_number_1, r1.type AS type_1,\n r2.route... |
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 transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time... | [
{
"role": "user",
"content": "For each vehicle and unit combination, show the total quantity of fuel refueled and the total cost."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, unit, SUM(quantity) AS total_quantity, SUM(total_cost) AS total_cost\nFROM transportation.fuel_logs\nGROUP B... |
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 transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id ... | [
{
"role": "user",
"content": "List the log ID, vehicle ID, service date, and cost for all maintenance logs where the cost exceeds 2000 and the odometer reading is greater than 100,000."
},
{
"role": "assistant",
"content": "SELECT log_id, vehicle_id, service_date, cost FROM transportation.mainte... |
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 character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "How many users registered in 2024?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM trading_platform.users WHERE DATE_PART('year', created_at) = 2024;"
}
] |
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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Show all payments along with the guest's first and last name, and the staff member who processed each payment. Include payment_id, amount, currency_code, payment_timestamp, guest first_name, guest last_name, staff first_name, and staff last_name."
},
{
"role": "assistan... |
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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ... | [
{
"role": "user",
"content": "Get the number of insurance products grouped by product_type and their active status. Return product_type, is_active, and the count of products."
},
{
"role": "assistant",
"content": "SELECT product_type, is_active, COUNT(*) AS product_count\nFROM insurance.insuranc... |
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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "List all services whose eligibility criteria mention 'citizen'."
},
{
"role": "assistant",
"content": "SELECT service_id, service_name, eligibility_criteria FROM government_services.services WHERE eligibility_criteria ILIKE '%citizen%';"
}
] |
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 financial_services.loans ( loan_id character varying(64) NOT NULL, account_id charac... | [
{
"role": "user",
"content": "List all auto loans (loan_id, principal_amount, interest_rate) where the current principal balance is less than 40% of the original principal amount, along with the account_id and the difference between principal_amount and current_principal_balance."
},
{
"role": "assi... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Count the number of maintenance services per service_type and show service_type and service_count."
},
{
"role": "assistant",
"content": "SELECT service_type, COUNT(*) AS service_count\nFROM transportation.maintenance_logs\nGROUP BY service_type;"
},
{
"role... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "How many patients have at least one medical record associated with them?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT patient_id) FROM healthcare.medical_records;"
},
{
"role": "user",
"content": "Now, can you show me the count of patient... |
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 hospitality_technology.reviews (
review_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Show all review IDs, property IDs, and the rating for service given for each review."
},
{
"role": "assistant",
"content": "SELECT review_id, property_id, rating_service\nFROM hospitality_technology.reviews;"
},
{
"role": "user",
"content": "Only display... |
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 healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, gener... | [
{
"role": "user",
"content": "Show me the medication_id, medication_name, and manufacturer for all medications where the generic_name contains the word 'azole'."
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications WHERE generic_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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List each user's username along with the number of posts they've made that include any media attachment, ordering the results by that count descending."
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(p.post_id) AS media_post_count\nFROM social_media.... |
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 gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"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 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Get me a list of upcoming appointments with appointment_id, client full name, case number, and start_time for appointments with status 'scheduled'."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id,\n CONCAT(cl.first_name, ' ', cl.last_name) AS cl... |
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 government_services.employees ( employee_id text, agency_id text, first_name text, l... | [
{
"role": "user",
"content": "List the full names of employees whose direct manager themselves report to another manager. Also show the direct 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_... |
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 gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name te... | [
{
"role": "user",
"content": "Which achievement has the highest point value for each game?"
},
{
"role": "assistant",
"content": "SELECT a1.game_id, a1.achievement_id, a1.name, a1.points FROM gaming_technology.achievements a1 WHERE a1.points = (SELECT MAX(a2.points) FROM gaming_technology.achiev... |
You are an 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 hospitality_technology.services ( service_id.text, property_id.text, service_name.te... | [
{
"role": "user",
"content": "Could you provide a count of services available within each department?"
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) FROM hospitality_technology.services GROUP BY department;"
},
{
"role": "user",
"content": "Now, only list the depa... |
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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"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 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 financial_services.accounts (
account_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Show me all accounts (account_id, account_number, balance) that have a balance greater than $50,000 and are in USD currency, along with the security details (ticker_symbol, security_name) for securities traded on the same exchange as the account's last_updated_at date."
},
... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List each driver's first and last name along with the make and model of the vehicles they have driven, as well as the trip ID."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, v.make, v.model, t.trip_id\nFROM transportation.drivers d\nJOIN tr... |
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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "List the usernames and registration dates for users who registered before the earliest deployed contract."
},
{
"role": "assistant",
"content": "SELECT T1.username, T1.created_at FROM web3.users AS T1 JOIN (SELECT MIN(deployed_at) AS earliest_deploy FROM web3.contra... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. 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
CREA... | [
{
"role": "user",
"content": "What is the performance review score for employee with ID 'EMP456' for the last quarter?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't assist with information about performance review scores as this data is not included in the employees table."
}
] |
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 social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "I need the count of messages each user has sent per conversation, along with the conversation's group_name when it's a group chat."
},
{
"role": "assistant",
"content": "SELECT m.sender_user_id,\n u.username,\n m.conversation_id,\n CASE WHEN c.is_g... |
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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "Show me the usernames and the group names of group chats where each user has posted at least one post containing a hashtag."
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name\nFROM social_media.users u\nJOIN social_media.posts p ON u.user_id = p.... |
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 healthcare.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_pro... | [
{
"role": "user",
"content": "Provide each pair of plans that share the same plan_type but are offered by different providers."
},
{
"role": "assistant",
"content": "SELECT p1.plan_type,\n p1.plan_id AS plan1_id,\n p1.plan_name AS plan1_name,\n p1.insurance_provider AS provider... |
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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "I need to find, for each active agent, the number of active policies they have sold and the average premium_amount of those active policies."
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name || ' ' || a.last_name AS agent_name, COUNT(p.policy_id... |
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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List all hashtags and for each, show how many different users have created posts using that hashtag."
},
{
"role": "assistant",
"content": "SELECT ph.hashtag_id, COUNT(DISTINCT p.user_id) AS unique_user_count\nFROM social_media.post_hashtags ph\nJOIN social_media.po... |
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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "Show me the total billable hours and total billed amount for each lawyer who worked on 'Civil Litigation' cases in 2023, sorted by billed amount descending."
},
{
"role": "assistant",
"content": "SELECT te.lawyer_id,\n SUM(te.hours_spent) AS total_billable_hou... |
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.wallets ( wallet_id text, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "Show me pairs of wallets that belong to the same user, listing the wallet_id, user_id, address, and created_at for the earlier and later wallet in each pair."
},
{
"role": "assistant",
"content": "SELECT w1.user_id,\n w1.wallet_id AS earlier_wallet,\n w1... |
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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "Find narratives with a market cap greater than $500,000,000 and a 7-day price change percentage above 5%. Show the narrative, market_cap, and price_change_percentage_7d."
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap, price_change_percentage_7d ... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. 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
CREA... | [
{
"role": "user",
"content": "What is the maintenance schedule for platform 3 at station DEF for the next month?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the maintenance schedule for platforms. The data I have only includes static information about platform de... |
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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "List the first_name, last_name, and email of all clients whose email domain is 'gmail.com'."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM legal_services.clients WHERE SUBSTRING(email FROM POSITION('@' IN email) + 1) = 'gmail.com';"
... |
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 social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "List all comment IDs and their content for comments made by users who have 'dark' as their theme."
},
{
"role": "assistant",
"content": "SELECT c.comment_id, c.content\nFROM social_media.comments c\nJOIN social_media.user_settings s ON c.user_id = s.user_id\nWHERE s... |
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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "Retrieve the daily total fare collected for bookings with status 'Completed' in March 2024. Display the booking_date and total_fare."
},
{
"role": "assistant",
"content": "SELECT\n DATE(booking_time) AS booking_date,\n SUM(fare) AS total_fare\nFROM transportation.... |
You are an 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 social_media.conversation_participants ( participant_id text, conversation_id text, ... | [
{
"role": "user",
"content": "List the user IDs and the date they joined their most recent conversation."
},
{
"role": "assistant",
"content": "SELECT user_id, MAX(joined_at) AS most_recent_joined_at\nFROM social_media.conversation_participants\nGROUP BY user_id;"
},
{
"role": "user",
... |
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, rank INT, profit numer... | [
{
"role": "user",
"content": "How many smart money addresses are in the top 100 rank?"
},
{
"role": "assistant",
"content": "SELECT count(address) FROM smart_money_profit WHERE rank <= 100"
},
{
"role": "user",
"content": "Okay, can you break that down by `chain`? Show the count for ... |
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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "List each customer along with another customer living at the same address."
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_id_a, a.first_name || ' ' || a.last_name AS full_name_a, b.customer_id AS customer_id_b, b.first_name || ' ' || b.last_... |
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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "I want to see pairs of customers living in the same state but having different risk profiles. Show their customer_ids, states, and risk_profiles."
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_a, a.state, a.risk_profile AS risk_profile_a, b.... |
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": "Show the contract address and total number of approvals for all ERC20 tokens from the erc20_approval table."
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS total_approvals\nFROM erc20_approval\nGROUP BY contract_address;"
},
{
"ro... |
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Show me the first and last names of citizens along with their dates of birth and contact emails for all citizens who registered after January 1, 2023."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth, contact_email FROM government_s... |
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 character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "How many DApps have names that start with the letter 'A'?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS dapp_count\nFROM trading_platform.dapps\nWHERE name LIKE '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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "Get the five most recent public posts that have media_type = 'video', showing post_id, created_at, and the author's username."
},
{
"role": "assistant",
"content": "SELECT\n p.post_id,\n p.created_at,\n u.username\nFROM social_media.posts p\nJOIN social_media.use... |
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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "For all currently active policies, show the policy number, the customer's first and last name, and the total amount paid for that policy across all premium payments."
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T2.first_name, T2.last_name, SUM(T3.... |
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 transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "For each vehicle that appears in both the maintenance logs and fuel logs tables, calculate the total maintenance cost and the total fuel cost. Display the vehicle ID and these two total costs."
},
{
"role": "assistant",
"content": "SELECT T1.vehicle_id , SUM(T1.cos... |
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the first name and last name of each citizen and the scheduled start time for their appointments."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.scheduled_start_time FROM government_services.citizens AS T1 JOIN government_services... |
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 hospitality_technology.reviews (
review_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "How many reviews were posted by each guest? Show the guest ID and the count of reviews."
},
{
"role": "assistant",
"content": "SELECT guest_id, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY guest_id;"
},
{
"role": "user",
"conte... |
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: :Station
// Properties:
// station_id: String (Constraint: UNIQUE)
// station_... | [
{
"role": "user",
"content": "Can you help me find all bookings made by passengers from a specific city, say 'Boston', including the passenger details and the scheduled trip information?"
},
{
"role": "assistant",
"content": "MATCH (p:Passenger)-[:MADE_BOOKING]->(b:Booking)-[:FOR_TRIP]->(st:Sche... |
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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "Show me all time entries where the hours spent is greater than 5."
},
{
"role": "assistant",
"content": "SELECT entry_id, date_worked, hours_spent, description FROM legal_services.time_entries WHERE hours_spent > 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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "What was the total quantity and total cost of 'Gasoline' fuel logged in the year 2023?"
},
{
"role": "assistant",
"content": "SELECT SUM(quantity) , SUM(total_cost) FROM transportation.fuel_logs WHERE fuel_type = 'Gasoline' AND EXTRACT(YEAR FROM log_timestamp) =... |
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.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen ti... | [
{
"role": "user",
"content": "Show me all nodes that were last seen in the past 30 days, along with their IP addresses and ports."
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port, last_seen FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '30 days';"
},
{
... |
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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var... | [
{
"role": "user",
"content": "Which agents, along with their managers' full names, are licensed in 'TX' and are currently active?"
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agent_last_name, m.first_name AS manager_first_name, m.last... |
You are an 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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Show me the first name, last name, and email for all clients registered in January 2023."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM legal_services.clients WHERE EXTRACT(YEAR FROM date_registered) = 2023 AND EXTRACT(MONTH FROM dat... |
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 hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"role": "user",
"content": "Show me all payments made with a credit card (payment_method = 'credit_card') where the amount is greater than $500, including the reservation ID and payment timestamp."
},
{
"role": "assistant",
"content": "SELECT payment_id, reservation_id, amount, payment_timesta... |
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 insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character vary... | [
{
"role": "user",
"content": "List all beneficiaries who hold more than 25% of a policy, showing their beneficiary ID, full name, and contact information."
},
{
"role": "assistant",
"content": "SELECT beneficiary_id, first_name, last_name, contact_info\nFROM insurance.policy_beneficiaries\nWHERE... |
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 gaming_technology.game_sessions (
session_id uuid NOT NULL DEFAULT gen_random_uu... | [
{
"role": "user",
"content": "Can you show me the total score and number of sessions for each player and each game they played?"
},
{
"role": "assistant",
"content": "SELECT player_id, game_id, COUNT(session_id) AS session_count, SUM(score) AS total_score\nFROM gaming_technology.game_sessions\nG... |
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 healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id ch... | [
{
"role": "user",
"content": "Show me the record_id, patient_id, prescription_id, medication_id, start_date, and the systolic blood pressure from the associated medical record for all prescriptions."
},
{
"role": "assistant",
"content": "SELECT p.prescription_id,\n p.medication_id,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies (
agency_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Which agencies offer more than three services? List the agency ID and the total number of services they provide."
},
{
"role": "assistant",
"content": "SELECT agency_id, COUNT(service_id) AS total_services\nFROM government_services.services\nGROUP BY agency_id\nHAVI... |
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 web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_a... | [
{
"role": "user",
"content": "List all pairs of contracts deployed on the same network on the same day, showing network_id, the date, and the two contract IDs."
},
{
"role": "assistant",
"content": "SELECT c1.network_id,\n DATE(c1.deployed_at) AS deploy_date,\n c1.contract_id AS cont... |
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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List the names of properties and the room number for every room at each property."
},
{
"role": "assistant",
"content": "SELECT T1.property_name , T2.room_number FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.rooms AS T2 ON T1.property_id ... |
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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all premium payments along with the customer's first and last name for payments made after July 1, 2023."
},
{
"role": "assistant",
"content": "SELECT pp.payment_id, pp.payment_date, pp.amount_paid, cu.first_name, cu.last_name\nFROM insurance.premium_payments p... |
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 government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "For each notification sent through the 'SMS' channel, list the notification ID, message subject, and the full name of the citizen who received it."
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.message_subject, c.first_name || ' ' || c.last_name ... |
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 hospitality_technology.guests (
guest_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Find guests who have made at least one payment using a 'CreditCard'. List their full name (first and last name) and email address."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.email FROM hospitality_technology.guests AS T1 J... |
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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all documents uploaded for cases handled in the 'District Court' jurisdiction, showing the document name, case number, and upload timestamp."
},
{
"role": "assistant",
"content": "SELECT d.document_name, cs.case_number, d.upload_timestamp\nFROM legal_services.d... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2