system stringlengths 315 8.35k | 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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "For each game, find the hidden achievement with the highest points and show the game title, achievement name, and points."
},
{
"role": "assistant",
"content": "SELECT g.title AS game_title,\n a.name AS achievement_name,\n a.points\nFROM gaming_technolo... |
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 full names of users and the total number of likes they have given to comments."
},
{
"role": "assistant",
"content": "SELECT u.full_name, COUNT(l.like_id) AS likes_given_to_comments\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.u... |
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 the first name, last name, and firm name for all lawyers specializing in 'Intellectual Property'."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.firm_name FROM legal_services.lawyers AS T1 JOIN legal_services.law_firms 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "I need to list the top 5 ERC20 tokens by total supply, including symbol, contract_address, and name."
},
{
"role": "assistant",
"content": "SELECT tm.contract_address, tm.symbol, tm.name, CAST(tm.total_supply AS DECIMAL) AS total_supply\nFROM token_metas tm\nWHERE 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 healthcare.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id... | [
{
"role": "user",
"content": "List all chronic and active diagnoses for patient 'patient_456', including diagnosis_code, description, and diagnosis_date."
},
{
"role": "assistant",
"content": "SELECT diagnosis_code, description, diagnosis_date FROM healthcare.diagnoses WHERE patient_id = 'patien... |
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 character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me the product ID, name, and description for insurance products where the description contains the word 'policy'."
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, description FROM insurance.insurance_products WHERE description LIKE '%poli... |
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 the full names and email addresses of all lawyers who have handled at least one appointment for a client from the company 'Innovatech Ltd', along with the company name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT l.first_name, l.last_name, l.email, 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 healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show all patients who have received a prescription for medication ID 'med123' and also have a diagnosis code of 'I10'. Include patient ID, prescription ID, and diagnosis date."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.patient_id, p.prescription_id, 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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "Show me all documents along with the appointment subjects for appointments related to the same case."
},
{
"role": "assistant",
"content": "SELECT d.document_name, d.case_id, a.subject\nFROM legal_services.documents d\nJOIN legal_services.appointments a ON d.case_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 financial_services.transactions ( transaction_id text, account_id text, related_acco... | [
{
"role": "user",
"content": "I want to see the total sum of transaction amounts and their average amount for each transaction_type along with the total number of transactions, grouped by currency."
},
{
"role": "assistant",
"content": "SELECT transaction_type, currency, COUNT(*) AS total_transa... |
You are an 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, contract_address.text, wallet_address.text, am... | [
{
"role": "user",
"content": "Show me the total amount and number of unique holder wallets for each ERC20 token held on Ethereum. Please display contract address, sum of amounts, and holder count."
},
{
"role": "assistant",
"content": "SELECT contract_address, SUM(amount::numeric) AS total_amoun... |
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 PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Provide each developer_id, the number of games they have released, and the total items acquired across all their games."
},
{
"role": "assistant",
"content": "SELECT g.developer_id,\n COUNT(g.game_id) AS game_count,\n SUM(pi.quantity) AS total_items_acqu... |
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 varch... | [
{
"role": "user",
"content": "Show all ERC20 token approvals that happened between block numbers 18000000 and 18500000, including the contract address and number of approvals per contract."
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc20_appro... |
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 character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Retrieve pairs of law firms that share the same managing_partner_id, showing the firm names and the managing_partner_id."
},
{
"role": "assistant",
"content": "SELECT lf1.firm_name AS firm1, lf2.firm_name AS firm2, lf1.managing_partner_id FROM legal_services.law_fir... |
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 active products, showing their product ID, name, and type, ordered by their creation date."
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, product_type FROM insurance.insurance_products WHERE is_active = TRUE ORDER BY 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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "How many patients have provided both a phone_number and emergency_contact_phone?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM healthcare.patients WHERE phone_number IS NOT NULL AND emergency_contact_phone IS NOT NULL;"
}
] |
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.rooms ( room_id text PRIMARY KEY, property_id text, room_numb... | [
{
"role": "user",
"content": "Retrieve review comments and their overall rating for properties that currently have at least one room with a status of 'Available'. Include the review ID, property ID, and review date."
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.comment, r.rating_o... |
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 all employees whose job titles differ from their direct managers. Provide each employee's full name, their job title, the manager's full name, and the manager's job title."
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS emplo... |
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_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"role": "user",
"content": "List all token symbols on the 'Ethereum' chain with a Realized Ratio greater than 0.9. Show the symbol and realized ratio."
},
{
"role": "assistant",
"content": "SELECT token_symbol, realized_ratio FROM smart_money_token_performance WHERE chain = 'Ethereum' AND real... |
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 varch... | [
{
"role": "user",
"content": "Show me the current amount held and wallet address for all wallets holding more than 100,000 units of the ERC20 token with contract address '0xeeee...'."
},
{
"role": "assistant",
"content": "SELECT wallet_address, amount FROM erc20_balances WHERE contract_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 insurance.insurance_products (
product_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "How many insurance products have a base premium greater than 2000?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM insurance.insurance_products\nWHERE base_premium > 2000;"
}
] |
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": "Retrieve the title and release_date of all games on the 'PC' platform."
},
{
"role": "assistant",
"content": "SELECT title, release_date\nFROM gaming_technology.games\nWHERE platform = 'PC';"
},
{
"role": "user",
"content": "Now exclude any games release... |
You are an 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 PRIMARY KEY, username text, email text, passwo... | [
{
"role": "user",
"content": "Show me the usernames and emails of all users who have placed at least one 'buy' order for the asset named 'Bitcoin'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username, T1.email FROM trading_platform.users AS T1 JOIN trading_platform.orders 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 hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "List all payments for reservations made at properties with a star rating of 5.0. Include the payment amount, guest ID, reservation ID, and property name."
},
{
"role": "assistant",
"content": "SELECT T1.amount, T1.guest_id, T1.reservation_id, T3.property_name FROM h... |
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
Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id... | [
{
"role": "user",
"content": "我想查询所有检查结果为'Pass'的记录,包括检查类型、检查时间和检查备注,同时关联到对应的组件信息。"
},
{
"role": "assistant",
"content": "db.inspections.aggregate([\n {\n $match: {\n result: 'Pass'\n }\n },\n {\n $lookup: {\n from: 'components',\n localField: 'component_id',\n 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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "Which projects raised funds in January 2022?"
},
{
"role": "assistant",
"content": "SELECT project_name, rounds_name, investment_value, investment_date FROM project_fundraising_record WHERE investment_date >= '2022-01-01' AND investment_date < '2022-02-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 healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, gener... | [
{
"role": "user",
"content": "Show me each generic_name and the number of medications with that generic_name, sorted by the highest count first."
},
{
"role": "assistant",
"content": "SELECT generic_name, COUNT(*) AS medication_count FROM healthcare.medications GROUP BY generic_name ORDER BY med... |
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 PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List each player along with the number of achievements they have unlocked in game 'SuperQuest'."
},
{
"role": "assistant",
"content": "SELECT p.player_id,\n p.username,\n COUNT(pa.achievement_id) AS achievement_count\nFROM gaming_technology.player_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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "For each citizen who has made at least one payment, list their full name and the total amount they've paid in each currency."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.currency, SUM(T2.amount) FROM government_services.citizens AS 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 insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i... | [
{
"role": "user",
"content": "List all premium payments that have a status of 'pending'. Show the payment_id, policy_id, customer_id, and amount_paid."
},
{
"role": "assistant",
"content": "SELECT payment_id, policy_id, customer_id, amount_paid FROM insurance.premium_payments WHERE status = 'pen... |
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 PRIMARY KEY, address text, abi text, bytecode text... | [
{
"role": "user",
"content": "List all failed transactions along with the from and to addresses, and the gas used."
},
{
"role": "assistant",
"content": "SELECT transaction_id, from_address, to_address, gas_used FROM web3.transactions WHERE status = 'failed';"
},
{
"role": "user",
"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 social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte... | [
{
"role": "user",
"content": "Count the total number of hashtags."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.hashtags;"
}
] |
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.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "List all fundraising rounds where the average investment amount exceeded $10M, and show how many projects participated in each round."
},
{
"role": "assistant",
"content": "SELECT rounds_name, COUNT(DISTINCT project_id) AS project_count, AVG(investment_value) AS avg... |
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.applications ( application_id character varying(64) NOT NULL, ci... | [
{
"role": "user",
"content": "List the reference number and status for all applications, including the registration date of the citizen who submitted it."
},
{
"role": "assistant",
"content": "SELECT a.reference_number, a.status, c.registration_date FROM government_services.applications AS a JOI... |
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.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_t... | [
{
"role": "user",
"content": "Find pairs of items within the same game where the cost of one item is at least 10 times the cost of the other. Show the game ID, the name of the more expensive item, and the name of the less expensive item."
},
{
"role": "assistant",
"content": "SELECT i1.game_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 financial_services.customers (
customer_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List all distinct pairs of customers who live in the same zip_code, without duplicating pairs."
},
{
"role": "assistant",
"content": "SELECT\n c1.customer_id AS customer_a,\n c2.customer_id AS customer_b,\n c1.zip_code\nFROM financial_services.customers c1\nJOIN ... |
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": "For all trips, show the trip ID, the route number, and the make and model of the vehicle used."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, r.route_number, v.make, v.model\nFROM transportation.fuel_logs t\nJOIN transportation.vehicles v ON t.vehicle_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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List the full names and dates of birth of all patients whose emergency contact phone matches the phone number of any doctor."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.first_name, p.last_name, p.date_of_birth\nFROM healthcare.patients p\nJOIN healthcar... |
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.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me the total number of time entries for each case."
},
{
"role": "assistant",
"content": "SELECT case_id, COUNT(*) AS entry_count\nFROM legal_services.time_entries\nGROUP BY case_id;"
},
{
"role": "user",
"content": "Only include cases where the tot... |
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.tokens ( token_id text PRIMARY KEY, contract_address text, token_name text, tok... | [
{
"role": "user",
"content": "Find all pairs of tokens that have the same contract_address but different token_symbols. Show both token_ids, each token's symbol, and the shared contract_address."
},
{
"role": "assistant",
"content": "SELECT t1.token_id AS token_id_1, t2.token_id AS token_id_2, 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 token_basic_info ( coin_id text, token_name text, token_symbol text, token_address t... | [
{
"role": "user",
"content": "Which are the top 3 tokens on BSC by total USD value held by all CEXs, and what is their narrative and current price?"
},
{
"role": "assistant",
"content": "SELECT ctb.token_symbol, tbi.narrative, tbi.price, SUM(ctb.usd_value) AS total_usd_value\nFROM cex_token_bala... |
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.logs ( log_id text PRIMARY KEY, user_id text, action text, details ... | [
{
"role": "user",
"content": "Get the total number of logs per user for July 2024."
},
{
"role": "assistant",
"content": "SELECT user_id,\n COUNT(*) AS log_count\nFROM trading_platform.logs\nWHERE logged_at BETWEEN '2024-07-01' AND '2024-07-31'\nGROUP BY user_id;"
},
{
"role": "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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Please list the full name and status of clients who have not provided a company name."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, status\nFROM legal_services.clients\nWHERE company_name IS NULL;"
}
] |
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_dexpool_info ( pair_address character varying(512) NOT NULL, token_name charac... | [
{
"role": "user",
"content": "What is the average market cap and average 24-hour trading volume for tokens on each chain?"
},
{
"role": "assistant",
"content": "SELECT chain, AVG(market_cap) AS average_market_cap, AVG(volume_24h) AS average_volume_24h FROM token_dexpool_info GROUP BY chain"
},... |
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": "Which games have achievements where the points value is exactly 0? List the game title and the achievement name."
},
{
"role": "assistant",
"content": "SELECT g.title AS game_title, a.name AS achievement_name\nFROM gaming_technology.achievements a\nJOIN gaming_techn... |
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 the invoice number, issue date, total amount, and the client's full name for all invoices, including only those invoices that have not been paid fully."
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, i.issue_date, i.total_amount, c.first_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 gaming_technology.developers (
developer_id uuid NOT NULL DEFAULT gen_random_uui... | [
{
"role": "user",
"content": "Show for each developer and inventory item combination the number of times that item appears in player inventories."
},
{
"role": "assistant",
"content": "SELECT d.developer_id, d.name AS developer_name, pi.item_id, COUNT(pi.inventory_id) AS inventory_count FROM gam... |
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.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "Show me case numbers, names, and related invoice numbers."
},
{
"role": "assistant",
"content": "SELECT T1.case_number, T1.case_name, T2.invoice_number FROM legal_services.cases AS T1 JOIN legal_services.invoices AS T2 ON T1.case_id = T2.case_id;"
},
{
"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 legal_services.appointments ( appointment_id character varying(64) NOT NULL, client_... | [
{
"role": "user",
"content": "Show me the appointment ID, start time, and subject for all appointments scheduled with lawyer 'lawyer123'."
},
{
"role": "assistant",
"content": "SELECT appointment_id, start_time, subject FROM legal_services.appointments WHERE lawyer_id = 'lawyer123';"
},
{
... |
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": "Show me each guest's reservation count and average stay length in days."
},
{
"role": "assistant",
"content": "SELECT guest_id,\n COUNT(*) AS reservation_count,\n AVG(check_out_date - check_in_date) AS avg_stay_days\nFROM hospitality_technology.reservati... |
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 each token_id and the number of transfers recorded for that token."
},
{
"role": "assistant",
"content": "SELECT token_id, COUNT(*) AS transfer_count\nFROM web3.token_transfers\nGROUP BY token_id;"
},
{
"role": "user",
"content": "Actually, only inc... |
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 character varying(64) NOT NULL, tag_name characte... | [
{
"role": "user",
"content": "List all hashtag names and their creation dates."
},
{
"role": "assistant",
"content": "SELECT tag_name, created_at FROM social_media.hashtags;"
},
{
"role": "user",
"content": "Please only include hashtags created in the year 2023."
},
{
"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 transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Show each passenger's name and the total number of trips they have booked."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, COUNT(b.booking_id) AS trip_count\nFROM transportation.passengers p\nJOIN transportation.bookings b ON p.passenger_id ... |
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 are the qualifications or training history of the staff member who performed the maintenance with record_id 'REC123'?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the qualifications or training history of staff members... |
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": "Find all citizens who have both uploaded at least one document and made at least one payment. Show their citizen ID, full name, and contact email."
},
{
"role": "assistant",
"content": "SELECT c.citizen_id, c.first_name || ' ' || c.last_name AS full_name, c.contact_... |
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": "Show me the total traded volume and the average price per security for trades executed last month."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol,\n SUM(t.quantity) AS total_volume,\n AVG(t.price_per_unit) AS avg_price\nFROM financial_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
CREATE TABLE healthcare.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_pro... | [
{
"role": "user",
"content": "Show me all pairs of plans offered by the same insurance provider but of different plan types, including the provider name, first plan ID and type, and second plan ID and type."
},
{
"role": "assistant",
"content": "SELECT a.insurance_provider,\n a.plan_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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List all players and the number of distinct games they have grabbed in-game items from, as well as the name of each game."
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, g.game_id, g.title, COUNT(DISTINCT pi.item_id) AS distinct_items_acquired... |
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 PRIMARY KEY, player_id uuid, game_... | [
{
"role": "user",
"content": "For each player, list the total number of 'Legendary' rarity items they have in their inventory, along with the titles of the respective games those items belong to."
},
{
"role": "assistant",
"content": "SELECT pi.player_id, g.game_id, g.title, COUNT(*) AS legendar... |
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 all properties together with the floor numbers and room numbers of their rooms located in cities with a star rating greater than 4."
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, p.city, p.star_rating, r.floor, r.room_number\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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "List all distinct asset types from the assets table."
},
{
"role": "assistant",
"content": "SELECT DISTINCT type\nFROM trading_platform.assets;"
}
] |
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": "Provide a count of citizens registered per calendar year."
},
{
"role": "assistant",
"content": "SELECT CAST(EXTRACT(YEAR FROM registration_date) AS INTEGER) AS registration_year, COUNT(*) AS citizen_count FROM government_services.citizens GROUP BY 1 ORDER BY 1;"
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.hashtags ( hashtag_id text, tag_name text, created_at timestamp )
| [
{
"role": "user",
"content": "Show me all hashtag IDs and their tag names that were created after June 10, 2024 and whose tag names contain the word 'dev'."
},
{
"role": "assistant",
"content": "SELECT hashtag_id, tag_name FROM social_media.hashtags WHERE created_at > '2024-06-10' AND tag_name 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "List all ERC20 tokens where the total supply is between '1000000000' and '5000000000'. Show the symbol and name."
},
{
"role": "assistant",
"content": "SELECT symbol, name FROM token_metas WHERE is_erc20 = 1 AND total_supply >= '1000000000' AND total_supply <= '5000... |
You are an 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 PRIMARY KEY, property_id text, ser... | [
{
"role": "user",
"content": "Get all pairs of services from the same department where one service is more expensive than another. Show department, service1_name, price1, service2_name, price2."
},
{
"role": "assistant",
"content": "SELECT s1.department, s1.service_name AS service1_name, s1.pric... |
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 claims that have at least one document of type 'INVOICE', including the claim ID, incident date, estimated loss, and the document's file name."
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, c.estimated_loss, d.file_name\nFROM ins... |
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 the subscriber names from patient insurance entries where the group number is not provided (is null)."
},
{
"role": "assistant",
"content": "SELECT subscriber_name FROM healthcare.patient_insurance WHERE group_number IS NULL;"
},
{
"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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Count the number of documents for each document type."
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) FROM government_services.documents GROUP BY document_type;"
},
{
"role": "user",
"content": "Only include document types that have... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2