system stringlengths 315 7.62k | conversations listlengths 2 8 |
|---|---|
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 schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not included in the platfo... |
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 character varying(64) NOT NULL, first_nam... | [
{
"role": "user",
"content": "List each security and the total amount traded for it, with ticker symbol and security name. Only include trades from the last 90 days."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, SUM(t.total_amount) AS total_traded_amount\nFROM f... |
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.diagnoses ( diagnosis_id text PRIMARY KEY, record_id text, patient_id tex... | [
{
"role": "user",
"content": "Show me a list of prescriptions, including the prescription ID, medication ID, and start date, for prescriptions linked to any diagnosis that is marked as chronic."
},
{
"role": "assistant",
"content": "SELECT T1.prescription_id, T1.medication_id, T1.start_date FROM... |
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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number contain... | [
{
"role": "user",
"content": "List all ERC20 tokens with their names and symbols where the price is greater than $10, sorted by price in descending order."
},
{
"role": "assistant",
"content": "SELECT t.symbol, t.name, p.price FROM sui_coins_metadata t JOIN token_prices_latest p ON t.coin_type =... |
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.dapps (
dapp_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "How many unique users have a KYC audit record with status 'pending'?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT user_id) AS pending_kyc_users\nFROM trading_platform.kyc_audit\nWHERE status = 'pending';"
}
] |
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.appointments ( appointment_id.text, client_id.text, lawyer_id.text, c... | [
{
"role": "user",
"content": "Find all pairs of appointments that are scheduled for the same case and overlap in time. Show the IDs of the two overlapping appointments and the shared case ID."
},
{
"role": "assistant",
"content": "SELECT t1.appointment_id AS appointment1_id, t2.appointment_id AS... |
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.staff ( staff_id text PRIMARY KEY, property_id text, first_na... | [
{
"role": "user",
"content": "List staff members who were hired in the last calendar year, showing their full name, position, and hire date."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, position, hire_date FROM hospitality_technology.staff WHERE hire_date >= date_trunc('y... |
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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "I want the number of achievements unlocked per country_code by active players, showing only countries with at least 100 unlocks."
},
{
"role": "assistant",
"content": "SELECT p.country_code, COUNT(*) AS unlock_count\nFROM gaming_technology.players p\nJOIN gaming_tec... |
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 erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transacti... | [
{
"role": "user",
"content": "Show me the top 5 Sui NFT collections with the highest number of unique owners, along with their names and collection types."
},
{
"role": "assistant",
"content": "SELECT name, collection_type, COUNT(DISTINCT owner) AS unique_owners FROM sui_nfts WHERE owner IS NOT ... |
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.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(6... | [
{
"role": "user",
"content": "Can you show me all wallet address pairs that are owned by the same user but have different private keys, along with their wallet_ids and user_id?"
},
{
"role": "assistant",
"content": "SELECT w1.user_id, w1.wallet_id AS wallet_id_1, w1.address AS address_1, w1.priv... |
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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"role": "user",
"content": "How many 'ApprovalForAll' events are recorded for each ERC1155 contract address in the `erc1155_approval_for_all` table?"
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_for_all GROUP BY contract_addres... |
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 text, account_id text, loan_type text, principal_... | [
{
"role": "user",
"content": "For each loan type, show the total outstanding principal balance and the number of active loans."
},
{
"role": "assistant",
"content": "SELECT loan_type, SUM(current_principal_balance) AS total_outstanding_balance, COUNT(*) AS active_loan_count FROM financial_servic... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "Show each user's username and the total number of notifications they have received."
},
{
"role": "assistant",
"content": "SELECT T1.username, count(T2.notification_id) FROM users AS T1 LEFT JOIN notifications AS T2 ON T1.user_id = T2.user_id GROUP BY T1.user_id, T1... |
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 erc20_balances ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wa... | [
{
"role": "user",
"content": "For each wallet that currently holds more than 5000 units of any ERC20 token, show the wallet address and contract address."
},
{
"role": "assistant",
"content": "SELECT contract_address, wallet_address, CAST(amount AS numeric) AS amount\nFROM erc20_balances\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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List all documents, including their name and upload timestamp, along with the first and last name of the client associated with the case they belong to."
},
{
"role": "assistant",
"content": "SELECT d.document_name, d.upload_timestamp, c.first_name AS client_first_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 legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w... | [
{
"role": "user",
"content": "Show me the names and websites of all law firms founded before 2000, along with their managing partner IDs."
},
{
"role": "assistant",
"content": "SELECT firm_name, website, managing_partner_id FROM legal_services.law_firms WHERE founded_date < '2000-01-01';"
}
] |
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, product_name text, product_type text... | [
{
"role": "user",
"content": "List the name and type for all insurance products with a base premium over 5000."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type FROM insurance.insurance_products WHERE base_premium > 5000;"
},
{
"role": "user",
"content": "Can y... |
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 policy beneficiaries, showing their first name, last name, relationship, percentage share, and the first and last name of the customer associated with the beneficiary record."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.rela... |
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 character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List the content and comment ID for all comments made by users with private profiles."
},
{
"role": "assistant",
"content": "SELECT c.comment_id, c.content FROM social_media.comments AS c JOIN social_media.user_settings AS us ON c.user_id = us.user_id WHERE us.priva... |
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 narratives from the narrative_info table where the top 3 coins list contains either 'BTC' or 'ETH'."
},
{
"role": "assistant",
"content": "SELECT narrative FROM narrative_info WHERE top_3_coins LIKE '%BTC%' OR top_3_coins LIKE '%ETH%';"
},
{
"role": "us... |
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 character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the service names and the count of completed payments for each service."
},
{
"role": "assistant",
"content": "SELECT s.service_id, s.service_name, COUNT(p.payment_id) AS completed_payment_count\nFROM government_services.services s\nLEFT JOIN government_service... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Node Label ':Component'. Properties: { component_id: String (Constraint: UNIQUE), part_number: St... | [
{
"role": "user",
"content": "I need to check the inventory status of components, including their batch details and warehouse location."
},
{
"role": "assistant",
"content": "MATCH (i:InventoryBatch)-[:IS_INSTANCE_OF]->(c:Component)\nRETURN c.component_id, c.component_name, i.inventory_record_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.likes ( like_id text PRIMARY KEY, user_id text, post_id text, comment_i... | [
{
"role": "user",
"content": "Show me all users who have liked both a post and a comment. Please include their user IDs, the post IDs, and the comment IDs."
},
{
"role": "assistant",
"content": "SELECT DISTINCT l1.user_id, l1.post_id, l2.comment_id\nFROM social_media.likes l1\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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Show the names of group conversations and how many participants they have."
},
{
"role": "assistant",
"content": "SELECT c.group_name, count(cp.user_id) AS participant_count FROM social_media.conversations AS c JOIN social_media.conversation_participants AS cp ON c.... |
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.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List all partners who were hired in the same year. Show their first name, last name, hire year, and firm ID."
},
{
"role": "assistant",
"content": "SELECT l1.first_name, l1.last_name, EXTRACT(YEAR FROM l1.hire_date) AS hire_year, l1.firm_id FROM legal_services.lawye... |
You are an 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.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "Show me a list of all policy numbers that have a deductible exactly equal to 0."
},
{
"role": "assistant",
"content": "SELECT policy_number\nFROM insurance.policies\nWHERE deductible = 0;"
}
] |
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.text, property_id.text, reservation_id.te... | [
{
"role": "user",
"content": "Count reviews with an overall rating of 5 for each property."
},
{
"role": "assistant",
"content": "SELECT property_id, COUNT(*) AS five_star_review_count FROM hospitality_technology.reviews WHERE rating_overall = 5 GROUP BY property_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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "List all premium payments with status 'Completed', showing the payment ID, payment date, amount paid, and the first and last name of the customer who made the payment."
},
{
"role": "assistant",
"content": "SELECT T1.payment_id, T1.payment_date, T1.amount_paid, T2.f... |
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 all depots (location type 'Depot') and the number of vehicles assigned to each. Include the depot name and city."
},
{
"role": "assistant",
"content": "SELECT T1.name , T1.city , COUNT(T2.vehicle_id) FROM transportation.locations AS T1 LEFT JOIN transportatio... |
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 current market price of a Boeing 737 MAX aircraft?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and general information ab... |
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.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Display the name and type of each location, as well as the earliest and latest maintenance service_date for vehicles assigned to that location (assuming vehicle_id matches location_id)."
},
{
"role": "assistant",
"content": "SELECT l.name, l.type,\n MIN(m.serv... |
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 ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str... | [
{
"role": "user",
"content": "I need to get a list of employees assigned to a specific assembly line, including their job title and hire date."
},
{
"role": "assistant",
"content": "MATCH (e:Employee)-[:ASSIGNED_TO]->(al:AssemblyLine {line_id: 'specific_line_id'})\nRETURN e.employee_id, e.first_... |
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 character varying(100) NOT NULL, -- the id of the token t... | [
{
"role": "user",
"content": "For each chain, which token has the lowest average cost as reported by smart money, and what is its current price and ROI?"
},
{
"role": "assistant",
"content": "SELECT smtp.chain, smtp.token_symbol, MIN(smtp.avg_cost) AS lowest_avg_cost, smtp.price, smtp.roi\nFROM ... |
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.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List lawyers who have any unbilled time entries. Show their first name, last name, and the count of their unbilled entries."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, COUNT(T2.entry_id) FROM lawyers AS T1 JOIN time_entries AS T2 ON T1... |
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 each property with the count of rooms that are currently marked as 'Occupied', including the property_name and occupied_count."
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(r.room_id) AS occupied_count\nFROM properties p\nJOIN rooms r ON ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id... | [
{
"role": "user",
"content": "Can you help me retrieve inspection records for a specific step ID, including the inspection type, result, timestamp, and the associated build ID?"
},
{
"role": "assistant",
"content": "db.inspections.find({ step_id: 'specific_step_id' }, { inspection_type: 1, resul... |
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": "List the order ID, type, and quantity for all orders placed using the wallet with ID 'wallet123'."
},
{
"role": "assistant",
"content": "SELECT order_id, order_type, quantity FROM orders WHERE wallet_id = 'wallet123'"
},
{
"role": "user",
"content": "Als... |
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.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "List the doctor ID, last name, and the date they were updated, for all doctors updated in the year 2024."
},
{
"role": "assistant",
"content": "SELECT doctor_id, last_name, updated_at FROM healthcare.doctors WHERE updated_at >= '2024-01-01' AND updated_at < '2025-01... |
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 text PRIMARY KEY, policy_id text, customer_id text, inci... | [
{
"role": "user",
"content": "List all active insurance products, including their product name, type, and base premium."
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WHERE is_active = TRUE;"
}
] |
You are an 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": "List all pairs of narratives where the first narrative has a higher market_cap than the second. Display narrative1, narrative2, cap1, cap2."
},
{
"role": "assistant",
"content": "SELECT n1.narrative AS narrative1, n2.narrative AS narrative2, n1.market_cap AS cap1, 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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Show me the count of game servers available for each game platform. Include the platform name and the server count."
},
{
"role": "assistant",
"content": "SELECT g.platform, COUNT(s.server_id) AS server_count FROM gaming_technology.servers AS s JOIN gaming_technolog... |
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 users who created a wallet on the same day they registered. Show user ID, username, and the wallet address."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, w.address FROM web3.users AS u JOIN web3.wallets AS w ON u.user_id = w.user_id W... |
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": "Which month in 2022 saw the highest total fundraising amount, and which project contributed the most to that month's total?"
},
{
"role": "assistant",
"content": "WITH monthly_totals AS (\n SELECT \n to_char(to_date(investment_date, 'YYYY-MM-DD'), 'YYYY-MM... |
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 PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "List the first and last names of all drivers with status 'Active' along with the route number and type of all Express routes."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, r.route_number, r.type\nFROM transportation.drivers d\nCROSS JOIN 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
Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty... | [
{
"role": "user",
"content": "특정 국가의 모든 공급업체 정보를 조회하고 싶습니다. 국가 이름, 공급업체 이름, 주소, 품질 등급을 포함해 주세요."
},
{
"role": "assistant",
"content": "GET suppliers/_search\n{\n \"query\": {\n \"term\": {\n \"country\": \"Korea\"\n }\n },\n \"_source\": [\"supplier_name\", \"address\", \"country\"... |
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.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "Show me the incident date, estimated loss, and the associated product name for all claims with an estimated loss greater than 20000."
},
{
"role": "assistant",
"content": "SELECT c.incident_date, c.estimated_loss, p.product_name\nFROM insurance.claims c\nJOIN insura... |
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 character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "Show me all pairs of medications that share the same manufacturer. Include each medication's medication_id, medication_name, and the manufacturer."
},
{
"role": "assistant",
"content": "SELECT m1.medication_id AS med1_id, m1.medication_name AS med1_name, m2.medicati... |
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.users ( user_id text, username text, email text, password_hash text, created_at... | [
{
"role": "user",
"content": "Find pairs of users who registered on the same weekday but in different years. List the user ID and registration date for both users, and the weekday name."
},
{
"role": "assistant",
"content": "SELECT u1.user_id, u1.created_at AS user1_created_at, u2.user_id, u2.cr... |
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.assets ( asset_id text PRIMARY KEY, name text, symbol text, type te... | [
{
"role": "user",
"content": "Show the number of UTXOs associated with each unique address in the system."
},
{
"role": "assistant",
"content": "SELECT address, COUNT(utxo_id) FROM trading_platform.utxos GROUP BY address;"
}
] |
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, property_name text, address_li... | [
{
"role": "user",
"content": "Calculate the average star rating for each property type."
},
{
"role": "assistant",
"content": "SELECT property_type, AVG(star_rating) AS average_star_rating FROM hospitality_technology.properties GROUP BY property_type;"
}
] |
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": "For each property, compute the average price and count of available services grouped by department."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, s.department, COUNT(*) AS service_count, AVG(s.price) AS avg_price\nFROM hospitality_tec... |
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.follows ( follow_id character varying(64) NOT NULL, follower_user_id ch... | [
{
"role": "user",
"content": "How many users is each user following? Provide follower_user_id and the count of followings."
},
{
"role": "assistant",
"content": "SELECT follower_user_id, COUNT(*) AS following_count\nFROM social_media.follows\nGROUP BY follower_user_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 trading_platform.notifications ( notification_id.text, user_id.text, message.text, s... | [
{
"role": "user",
"content": "Find all notifications that were sent more than 24 hours ago and are still unread. Show the notification ID, user ID, and sent_at timestamp."
},
{
"role": "assistant",
"content": "SELECT notification_id, user_id, sent_at FROM notifications WHERE read_at IS NULL AND ... |
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": "Could you provide the number of customers in each state who currently have at least one active policy? Return the state and customer_count."
},
{
"role": "assistant",
"content": "SELECT c.state, COUNT(DISTINCT c.customer_id) AS customer_count\nFROM insurance.custome... |
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.transactions ( transaction_id text, block_id text, sender_address text, r... | [
{
"role": "user",
"content": "List all address IDs with a balance under 50, along with the count of transactions they have received."
},
{
"role": "assistant",
"content": "SELECT a.address_id, a.balance, COUNT(t.transaction_id) AS received_count\nFROM blockchain.addresses a\nLEFT JOIN blockchain... |
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 erc20_balances_historical (
block_number bigint NOT NULL, -- Block number contai... | [
{
"role": "user",
"content": "For each Avalanche token tick, find its total transfer volume and transfer count in the last 7 days."
},
{
"role": "assistant",
"content": "SELECT\n a.tick,\n SUM(a.amt) AS total_volume,\n COUNT(*) AS transfer_count\nFROM token_activities_avalanche a\nWHERE a.blo... |
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.prescriptions ( prescription_id text, record_id text, patient_id text, do... | [
{
"role": "user",
"content": "Can you show me all prescriptions along with each patient's policy number and insurance plan ID?"
},
{
"role": "assistant",
"content": "SELECT p.prescription_id, p.patient_id, p.medication_id, pi.policy_number, pi.plan_id\nFROM healthcare.prescriptions p\nJOIN healt... |
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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "For each player, list their username together with the titles of games they have any items from in their inventory."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.username, g.title\nFROM gaming_technology.players p\nJOIN gaming_technology.player_inventory ... |
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": "List narratives with a market cap over $1,000,000,000, ordered by market cap descending."
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap FROM narrative_info WHERE market_cap > 1000000000 ORDER BY market_cap DESC;"
},
{
"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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "Show the number of wallets created for each user. Return user_id and wallet_count."
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(*) AS wallet_count\nFROM web3.wallets\nGROUP BY user_id;"
},
{
"role": "user",
"content": "Now, can you only 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 gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ... | [
{
"role": "user",
"content": "Show total session duration and average score for each player across all their sessions. Display the player ID, total duration, and average score."
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(duration_seconds) AS total_duration, AVG(score) AS average... |
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": "Show me the driver_id and full name for all drivers."
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name FROM transportation.drivers;"
},
{
"role": "user",
"content": "Only show drivers whose status is 'Inactive'."
},
{
... |
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.orders ( order_id character varying(64) NOT NULL, user_id character... | [
{
"role": "user",
"content": "I need the total traded value (quantity * price) for each buyer and asset symbol for trades after '2024-06-01'. List buyer_id, asset symbol, and total_value."
},
{
"role": "assistant",
"content": "SELECT t.buyer_id, m.value AS asset_symbol, SUM(t.quantity * t.price)... |
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": "List each vehicle along with the city of the station where it had its most recent fueling and the timestamp of that fueling."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id,\n v.license_plate,\n l.city AS last_fuel_city,\n MAX(f.log_time... |
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 PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "For each relationship type among policy beneficiaries, count how many beneficiaries exist of that type. Provide relationship and count, ordered by count descending."
},
{
"role": "assistant",
"content": "SELECT relationship,\n COUNT(*) AS beneficiary_count\nFR... |
You are an 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 erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transacti... | [
{
"role": "user",
"content": "Which wallets currently hold more than 100 units of any ERC1155 NFT on Ethereum? Please show contract address, token id, wallet address, and amount."
},
{
"role": "assistant",
"content": "SELECT contract_address, token_id, wallet_address, CAST(amount AS NUMERIC) AS ... |
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 character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Get a list of all patients and all medications they could potentially take. Include patient_id, full name, medication_id, and medication_name."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name || ' ' || p.last_name AS full_name, m.medication_i... |
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, prop... | [
{
"role": "user",
"content": "For each guest, show their full name and the total quantity of services they have ordered in the last 30 days."
},
{
"role": "assistant",
"content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n SUM(so.quantity) AS total_quanti... |
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.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT ... | [
{
"role": "user",
"content": "For each player who has unlocked at least two achievements, find the time difference in minutes between their first and last achievement unlock. Show player_id and the difference labeled last_minus_first_minutes."
},
{
"role": "assistant",
"content": "SELECT player_... |
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.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"role": "user",
"content": "Count how many prescriptions exist for each medication_id and order the results by the highest count first."
},
{
"role": "assistant",
"content": "SELECT medication_id, COUNT(*) AS prescription_count\nFROM healthcare.prescriptions\nGROUP BY medication_id\nORDER 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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "List all insurance plans and the doctors whose hospital affiliation ID matches the plan ID. Include plan_name, insurance_provider, doctor first_name, and last_name."
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, ip.insurance_provider, d.first_name, d.la... |
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, project_id character... | [
{
"role": "user",
"content": "Show all tokens on the 'Arbitrum' chain from DEX pools that have a 24-hour trading volume between $100,000 and $500,000. Display token symbol, price, and volume_24h."
},
{
"role": "assistant",
"content": "SELECT\n token_symbol,\n price,\n volume_24h\nFROM token_d... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "Show each wallet address, the user who owns it, and the number of UTXOs associated with that address."
},
{
"role": "assistant",
"content": "SELECT w.address, w.user_id, COUNT(u.utxo_id) AS utxo_count\nFROM trading_platform.wallets w\nLEFT JOIN trading_platform.utxo... |
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.hashtags ( hashtag_id.text, tag_name.text, created_at.timestamp )
CREAT... | [
{
"role": "user",
"content": "List all group conversations that were created after January 1st, 2023, and for each, show the names of hashtags that were created within the same month as the conversation."
},
{
"role": "assistant",
"content": "SELECT c.conversation_id, c.group_name, c.created_at ... |
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 employee, find their first and last name along with the number of applications they've been assigned. Only include employees with at least 5 assigned applications."
},
{
"role": "assistant",
"content": "SELECT e.first_name,\n e.last_name,\n COUN... |
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.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_ty... | [
{
"role": "user",
"content": "List pairs of documents uploaded by the same user for the same claim. Return uploaded_by, claim_id, document_id AS doc1_id, and the paired document_id AS doc2_id."
},
{
"role": "assistant",
"content": "SELECT cd1.uploaded_by,\n cd1.claim_id,\n cd1.docume... |
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": "List all guests who have a loyalty_member_id, showing their guest_id, first_name, last_name, and loyalty_member_id."
},
{
"role": "assistant",
"content": "SELECT guest_id,\n first_name,\n last_name,\n loyalty_member_id\nFROM hospitality_technology.... |
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.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me all cases along with the names and types of documents associated with them."
},
{
"role": "assistant",
"content": "SELECT c.case_id, c.case_number, c.case_name, d.document_name, d.document_type\nFROM legal_services.cases c\nLEFT JOIN legal_services.documents... |
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 character varying(512) NOT NULL, -- the id of narrative t... | [
{
"role": "user",
"content": "Show me the top 3 narratives by 24-hour trading volume, along with their 1-hour and 24-hour price change percentages."
},
{
"role": "assistant",
"content": "SELECT narrative, volume_24h, price_change_percentage_1h, price_change_percentage_24h FROM narrative_info ORD... |
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, -- uni... | [
{
"role": "user",
"content": "Show me all maintenance logs for 'Oil Change' services performed in the last 6 months, including the vehicle ID, service date, and cost."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE service_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 gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "Show me all servers where current_players is 0, and include their server_id, server_name, and region."
},
{
"role": "assistant",
"content": "SELECT server_id, server_name, region FROM gaming_technology.servers WHERE current_players = 0;"
},
{
"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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List the number of trips and the average passenger count per vehicle."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, COUNT(t.trip_id) AS trip_count, AVG(t.passenger_count) AS avg_passenger_count\nFROM transportation.vehicles v\nLEFT JOIN 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 financial_services.securities ( security_id.text, ticker_symbol.text, isin_code.text... | [
{
"role": "user",
"content": "List pairs of securities from the same issuer where one security was updated within the last 30 days, and the other was updated more than 90 days ago. Show issuer name, ticker symbols, and last_updated timestamps for both."
},
{
"role": "assistant",
"content": "SELE... |
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": "Show me all male patients who have received more than one prescription, including their full name, date of birth, and the total number of prescriptions."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, p.date_of_birth, COUNT(pr.... |
You are an 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, -- unique identifi... | [
{
"role": "user",
"content": "List all group chats created in 2024, showing the group_name, conversation_id, and creation time."
},
{
"role": "assistant",
"content": "SELECT conversation_id, group_name, created_at\nFROM social_media.conversations\nWHERE is_group_chat = true AND created_at >= '20... |
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 vehicle make, model, maintenance service date, and cost for all maintenance logs."
},
{
"role": "assistant",
"content": "SELECT v.make, v.model, ml.service_date, ml.cost FROM transportation.vehicles AS v JOIN transportation.maintenance_logs AS ml ON v.vehicle_i... |
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 PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "Show each policy number and the total amount paid for it across all premium payments received so far."
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, SUM(T2.amount_paid) FROM insurance.policies AS T1 JOIN insurance.premium_payments AS T2 ON T1.policy... |
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": "I want to know the usernames of users who have followed more than three different people, along with the date they created their accounts."
},
{
"role": "assistant",
"content": "SELECT u.username, u.created_at, COUNT(DISTINCT f.following_user_id) AS following_count\... |
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, product_name.text, product_type.text... | [
{
"role": "user",
"content": "List all claim documents along with the beneficiary first and last names and their relationship for policies where a document of type 'MEDICAL_REPORT' exists."
},
{
"role": "assistant",
"content": "SELECT cd.document_id, cd.claim_id, cd.file_name, cd.document_type, ... |
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.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "List the case number, case name, and the full name of the client for cases that have uploaded documents."
},
{
"role": "assistant",
"content": "SELECT T1.case_number , T1.case_name , T2.full_name FROM legal_services.cases AS T1 JOIN legal_services.clients AS T2 ON... |
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.players ( player_id.uuid, username.text, email.text, password_hash... | [
{
"role": "user",
"content": "For each player, show their player_id and the number of unique games they have played sessions on."
},
{
"role": "assistant",
"content": "SELECT player_id, COUNT(DISTINCT game_id) AS unique_games\nFROM gaming_technology.game_sessions\nGROUP BY player_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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "List the latest version of each document (identified by case_id and document_name), showing the version number and its upload_timestamp."
},
{
"role": "assistant",
"content": "SELECT d.case_id,\n d.document_name,\n d.version AS latest_version,\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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Display all invoices along with the associated case name and the full name of the client."
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, cs.case_name, c.first_name || ' ' || c.last_name AS client_full_name\nFROM legal_services.invoices i\nLEFT JOIN ... |
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.reservations ( reservation_id text, property_id text, guest_i... | [
{
"role": "user",
"content": "Find reservations where the same guest has overlapping stays in the same property."
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id AS res1,\n r2.reservation_id AS res2,\n r1.guest_id,\n r1.property_id\nFROM hospitality_technology.re... |
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 NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "Show me all items and the total quantity held by players for each item."
},
{
"role": "assistant",
"content": "SELECT pi.item_id, SUM(pi.quantity) AS total_quantity\nFROM gaming_technology.player_inventory pi\nGROUP BY pi.item_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 hospitality_technology.reviews (
review_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "For each review, show me the comment, the review date, and the full name of the staff member who responded to the review, if there is a response."
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.comment, r.review_date, s.first_name || ' ' || s.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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "List policy_number, customer_id, and product_name for policies that are currently active."
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.customer_id, ip.product_name\nFROM insurance.policies p\nJOIN insurance.insurance_products ip ON p.product_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 gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"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 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": "List all pairs of patients who have the same emergency contact name and phone number. Show the IDs and full names of both patients and the shared emergency contact details (name and phone)."
},
{
"role": "assistant",
"content": "SELECT p1.patient_id AS patient1_id, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.