system stringlengths 315 17.3k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// PUT /stations
{
"mappings": {
"properties": {
"station_id": { "type": "keyword" },... | [
{
"content": "能否帮我查询特定路线(route_id 为 'RT456')上的所有车站信息,包括车站名称和所在城市,以及该路线上的列车信息?",
"role": "user",
"sql": null
},
{
"content": "SELECT r.route_id, r.route_name, s.station_id, s.station_name, s.city, t.train_id, t.train_number, t.model\nFROM routes r\nJOIN route_stations rs ON r.route_id = rs.route_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a... | [
{
"content": "How many unread notifications does each user have?",
"role": "user",
"sql": null
},
{
"content": "SELECT user_id,\n COUNT(*) AS unread_notifications\nFROM trading_platform.notifications\nWHERE read_at IS NULL\nGROUP BY user_id;",
"role": "assistant",
"sql": 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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"content": "List each user's username along with the number of posts they've made that include any media attachment, ordering the results by that count descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT u.username, COUNT(p.post_id) AS media_post_count\nFROM social_media.users 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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"content": "Can you list all group conversations and the number of participants in each?",
"role": "user",
"sql": null
},
{
"content": "SELECT c.conversation_id, c.group_name, COUNT(cp.user_id) AS participant_count\nFROM social_media.conversations c\nJOIN social_media.conversation_participants... |
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, first_name.text, last_name.text, bar_number... | [
{
"content": "List the first name, last name, and specialization of all lawyers who have uploaded at least one document.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.first_name, T1.last_name, T1.specialization FROM legal_services.lawyers AS T1 JOIN legal_services.documents AS T2 ON T... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"content": "Show me the total quantity of fuel consumed and the total cost for each vehicle that has fuel log entries, including the vehicle's make and model.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.vehicle_id, T2.make, T2.model, SUM(T1.quantity) AS total_fuel_quantity, SUM(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 narrative_info ( narrative character varying(512) NOT NULL, top_3_coins text, price_... | [
{
"content": "Show narratives that have a market cap over 1 billion and a 24-hour volume over 50 million. Display the narrative, market cap, and 24h volume.",
"role": "user",
"sql": null
},
{
"content": "SELECT narrative, market_cap, volume_24h FROM narrative_info WHERE market_cap > 1000000000 A... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"content": "List the full name and firm name for all lawyers who are not partners.",
"role": "user",
"sql": null
},
{
"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.firm_id = T2.firm_id WHERE T1.is_partne... |
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.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"content": "For each client, show the earliest and latest invoice issue_date, along with the total amount invoiced. Include client_id, earliest_issue_date, latest_issue_date, and total_amount.",
"role": "user",
"sql": null
},
{
"content": "SELECT client_id, MIN(issue_date) AS earliest_issue_da... |
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 ... | [
{
"content": "List all vehicles that have no associated fuel logs. Include the vehicle's make, model, and license plate.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.make , T1.model , T1.license_plate FROM transportation.vehicles AS T1 LEFT JOIN transportation.fuel_logs 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 legal_services.documents ( document_id text PRIMARY KEY, case_id text, document_name... | [
{
"content": "Provide a list of all documents and their versions for a specific case, say with case_id = 'CASE789'.",
"role": "user",
"sql": null
},
{
"content": "SELECT document_name, version FROM legal_services.documents WHERE case_id = 'CASE789';",
"role": "assistant",
"sql": 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 government_services.notifications ( notification_id character varying(64) NOT NULL, ... | [
{
"content": "For each notification, list the next notification sent to the same citizen (if any). Show citizen_id, notification_id, sent_at, next_notification_id, and next_sent_at.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n n1.citizen_id,\n n1.notification_id,\n n1.sent_at,\n 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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"content": "List the first name and last name of all policy beneficiaries, along with the name of the insurance product associated with their policy.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.first_name, T1.last_name, T2.product_name FROM insurance.policy_beneficiaries AS T1 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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"content": "Show pairs of customers who live in the same state but different cities. Include their IDs, full names, and state.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.customer_id AS customer_a_id, a.first_name AS customer_a_first_name, a.last_name AS customer_a_last_name, b.cus... |
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, first_name.text, last_name.text, specialty.text... | [
{
"content": "Find all pairs of doctors who share the same specialty. Display d1.doctor_id, d1.first_name, d1.last_name, d2.doctor_id, d2.first_name, d2.last_name, and the specialty.",
"role": "user",
"sql": null
},
{
"content": "SELECT d1.doctor_id AS doctor1_id, d1.first_name AS doctor1_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 government_services.appointments ( appointment_id text, citizen_id text, employee_id... | [
{
"content": "Show me all appointment IDs and their scheduled start times along with the employee ID and service ID for appointments that have been booked using the 'Kiosk' booking method.",
"role": "user",
"sql": null
},
{
"content": "SELECT appointment_id, scheduled_start_time, employee_id, se... |
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.notifications ( notification_id.text, citizen_id.text, applicati... | [
{
"content": "Find the application IDs for applications that have received notifications through both 'Email' and 'SMS' channels.",
"role": "user",
"sql": null
},
{
"content": "SELECT application_id FROM government_services.notifications WHERE channel IN ('Email', 'SMS') GROUP BY application_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 blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp tim... | [
{
"content": "Show me all addresses that have created smart contracts, along with their balance and the count of contracts they've created.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.address_id, a.balance, COUNT(sc.contract_id) AS contract_count FROM blockchain.addresses a JOIN bloc... |
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, first_name charact... | [
{
"content": "List the policy number, premium amount, and the product name for each policy, but only for policies where the associated insurance product is active and has a base premium greater than 1200.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.policy_number, p.premium_amount, ip... |
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... | [
{
"content": "Show me a summary of claims that were handled by each claim handler, including the number of claims per handler and the total settlement amount. Please also include the claim handler IDs.",
"role": "user",
"sql": null
},
{
"content": "SELECT claim_handler_id, COUNT(*) AS claim_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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"content": "For each ERC1155 NFT contract on Ethereum, show the contract address, token_id, and the total amount held across all wallets.",
"role": "user",
"sql": null
},
{
"content": "SELECT nh.contract_address, nh.token_id, SUM(CAST(nh.amount AS NUMERIC)) AS total_amount FROM nft_holder_hist... |
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.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"content": "Show me all invoice numbers and due dates where the amount paid is exactly zero.",
"role": "user",
"sql": null
},
{
"content": "SELECT invoice_number, due_date FROM legal_services.invoices WHERE amount_paid = 0;",
"role": "assistant",
"sql": 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 transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"content": "Find pairs of trip IDs where both trips departed on the same calendar day, shared the same origin and destination locations, but were distinct trips.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n t1.trip_id AS trip_id_1,\n t2.trip_id AS trip_id_2,\n t1.origin_location_... |
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.transactions ( transaction_id text, from_address text, to_address text, value n... | [
{
"content": "For each transaction, find the next transaction by the same sender. Show the original transaction_id as current_tx, the next transaction_id as next_tx, from_address, and the time difference in minutes between them.",
"role": "user",
"sql": null
},
{
"content": "SELECT t1.transactio... |
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,... | [
{
"content": "List the ERC20 tokens (from token_metas) with exactly 6 decimals. Show their symbol, contract_address, and name.",
"role": "user",
"sql": null
},
{
"content": "SELECT symbol, contract_address, name FROM token_metas WHERE is_erc20 = 1 AND decimals = 6;",
"role": "assistant",
... |
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.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address t... | [
{
"content": "List all transactions that have a value less than 0.1 Ether, returning the transaction_id, from_address, to_address, value, and block_number.",
"role": "user",
"sql": null
},
{
"content": "SELECT transaction_id, from_address, to_address, value, block_number\nFROM web3.transactions\... |
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.user_settings ( setting_id text PRIMARY KEY, user_id text, theme text, ... | [
{
"content": "Which users have disabled both email and push notifications? Please provide their user IDs and whether their profiles are private.",
"role": "user",
"sql": null
},
{
"content": "SELECT user_id, private_profile FROM social_media.user_settings WHERE email_notifications_enabled = FALS... |
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... | [
{
"content": "Show a count of drivers per status.",
"role": "user",
"sql": null
},
{
"content": "SELECT status, COUNT(*) AS driver_count\nFROM transportation.drivers\nGROUP BY status;",
"role": "assistant",
"sql": null
},
{
"content": "Can you also list the earliest hire date 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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ... | [
{
"content": "Which token on each chain has the highest ROI and what is its associated PNL and net_flow?",
"role": "user",
"sql": null
},
{
"content": "SELECT a.chain,\n a.token_symbol,\n a.roi,\n a.pnl,\n a.net_flow\nFROM smart_money_token_performance a\nJOIN (\n SELECT... |
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... | [
{
"content": "List the name and type for all insurance products with a base premium over 5000.",
"role": "user",
"sql": null
},
{
"content": "SELECT product_name, product_type FROM insurance.insurance_products WHERE base_premium > 5000;",
"role": "assistant",
"sql": null
},
{
"co... |
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... | [
{
"content": "List all insurance products with a base premium less than 500, ordered by base premium ascending. Show product name, product type, and base premium.",
"role": "user",
"sql": null
},
{
"content": "SELECT product_name, product_type, base_premium FROM insurance.insurance_products WHER... |
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 ... | [
{
"content": "For each trip, provide the trip ID, the name of the vehicle's make and model, and the total quantity of fuel used during that trip.",
"role": "user",
"sql": null
},
{
"content": "SELECT t.trip_id, v.make, v.model, SUM(f.quantity) AS total_fuel_used\nFROM transportation.trips t\nJOI... |
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, player_id uuid, game_id uuid, ser... | [
{
"content": "For each game, which server has hosted the most sessions?",
"role": "user",
"sql": null
},
{
"content": "SELECT game_id, server_id, COUNT(*) AS session_count FROM gaming_technology.game_sessions GROUP BY game_id, server_id;",
"role": "assistant",
"sql": null
},
{
"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 insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"content": "Show the number of claims filed for each distinct status, ordered by the count in descending order.",
"role": "user",
"sql": null
},
{
"content": "SELECT status, COUNT(*) AS claim_count\nFROM insurance.claims\nGROUP BY status\nORDER BY claim_count DESC;",
"role": "assistant",
... |
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 character varying(64) NOT NULL, employee_id chara... | [
{
"content": "For each booking, show the booking ID, passenger's full name, booking status, and the email of the passenger.",
"role": "user",
"sql": null
},
{
"content": "SELECT b.booking_id, p.first_name, p.last_name, b.status, p.email\nFROM transportation.bookings b\nJOIN transportation.passen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"content": "I need a report showing each security's ticker_symbol along with the total sum of trade total_amount and the count of trades executed in the last three months.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.ticker_symbol, SUM(t.total_amount) AS total_trade_amount, 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 token_dexpool_info (",
"pair_address character varying(512) NOT NULL, -- the ... | [
{
"content": "For each chain, find the token with the highest price and the token with the lowest price. List chain, high_price_token, max_price, low_price_token, and min_price.",
"role": "user",
"sql": null
},
{
"content": "WITH max_prices AS (\n SELECT chain,\n token_symbol AS high_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 insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i... | [
{
"content": "What is the total amount paid by each customer? Show the customer_id and the sum of amount_paid.",
"role": "user",
"sql": null
},
{
"content": "SELECT customer_id, SUM(amount_paid) FROM insurance.premium_payments GROUP BY customer_id;",
"role": "assistant",
"sql": 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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"content": "Find all beneficiaries added in the last 7 days, include beneficiary_id, policy_id, and percentage_share, sorted by percentage_share descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT beneficiary_id, policy_id, percentage_share\nFROM insurance.policy_beneficiaries\nW... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... | [
{
"content": "特定の職種の従業員情報を取得したいです。従業員ID、名前、職種、雇用日を表示してください。",
"role": "user",
"sql": null
},
{
"content": "db.employees.find(\n { job_title: '<specific_job_title>' },\n { employee_id: 1, first_name: 1, last_name: 1, job_title: 1, hire_date: 1, _id: 0 }\n).sort({ hire_date: -1 })",
"rol... |
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.wallets (
wallet_id character varying(64) NOT NULL, -- unique identi... | [
{
"content": "Find all users who have wallets with private keys containing the substring 'abc'.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT user_id FROM blockchain.wallets WHERE private_key LIKE '%abc%';",
"role": "assistant",
"sql": null
},
{
"content": "Now 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 legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, first_name charac... | [
{
"content": "Show me the latest uploaded document (name and version) for each invoice that is linked to a case, including the invoice number and total amount.",
"role": "user",
"sql": null
},
{
"content": "SELECT i.invoice_number, i.total_amount, d.document_name, d.version AS latest_version\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 social_media.post_hashtags (
post_hashtag_id character varying(64) NOT NULL, -- ... | [
{
"content": "How many hashtags have been used in all posts linked to private conversations? Please show the conversation_id and hashtag_count for conversations where is_group_chat is false.",
"role": "user",
"sql": null
},
{
"content": "SELECT c.conversation_id, COUNT(DISTINCT ph.hashtag_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 healthcare.medications ( medication_id.text, medication_name.text, generic_name.text... | [
{
"content": "Find all medications whose generic_name matches the medication_name of another entry, displaying the brand medication_id, brand medication_name, generic medication_id, and generic medication_name.",
"role": "user",
"sql": null
},
{
"content": "SELECT b.medication_id AS brand_id, b.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"content": "Could you show me each employee's full name along with their manager's full name?",
"role": "user",
"sql": null
},
{
"content": "SELECT e.employee_id,\n e.first_name || ' ' || e.last_name AS employee_name,\n m.employee_id AS manager_id,\n m.first_name || ' ' || m.... |
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 character varying(64) NOT NULL, route_number charac... | [
{
"content": "I need a report showing each passenger's total number of bookings and the date of their most recent booking.",
"role": "user",
"sql": null
},
{
"content": "SELECT b.passenger_id,\n COUNT(*) AS total_bookings,\n MAX(b.booking_time) AS last_booking_date\nFROM transportati... |
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.trips ( trip_id text, route_id text, vehicle_id text, driver_id text,... | [
{
"content": "Show the number of trips operated by each driver along with the earliest and latest scheduled departure dates for them.",
"role": "user",
"sql": null
},
{
"content": "SELECT driver_id, COUNT(*) AS trip_count, MIN(scheduled_departure) AS first_departure, MAX(scheduled_departure) 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 social_media.posts (
post_id character varying(64) NOT NULL, -- unique identifie... | [
{
"content": "Count the total number of public posts.",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM social_media.posts WHERE visibility = 'public';",
"role": "assistant",
"sql": 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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"content": "For each citizen, list the documents they uploaded and the notifications they received. Show citizen ID, document ID, document type, and notification ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.citizen_id, T1.document_id, T1.document_type, T2.notification_id FROM 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 hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, emai... | [
{
"content": "Find guests born before 1990 who have 'Pet Friendly' in their preferences. List their full name (first and last) and date of birth.",
"role": "user",
"sql": null
},
{
"content": "SELECT first_name, last_name, date_of_birth FROM hospitality_technology.guests WHERE date_of_birth < '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 train_station_management.train_cars (
car_id character varying(64) NOT NULL, -- ... | [
{
"content": "Can you retrieve the total number of tickets sold for each car type?",
"role": "user",
"sql": null
},
{
"content": "SELECT tc.car_type, COUNT(t.ticket_id) AS total_tickets\nFROM train_station_management.train_cars tc\nJOIN train_station_management.tickets t ON tc.car_id = t.car_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 web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"content": "Find all events emitted by contracts that are also associated with token transfers. Show the event id, contract id, event name, emitted_at, transaction id, and also include the corresponding transfer id from token_transfers.",
"role": "user",
"sql": null
},
{
"content": "SELECT e.e... |
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... | [
{
"content": "For each contract, list the contract address, the number of different tokens deployed on that address, and the sum of total_supply of those tokens.",
"role": "user",
"sql": null
},
{
"content": "SELECT c.address AS contract_address, COUNT(DISTINCT t.token_id) AS token_count, COALES... |
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... | [
{
"content": "For each user, show how many users registered after them. Return the user_id, username, and the count of later registrants.",
"role": "user",
"sql": null
},
{
"content": "SELECT u1.user_id, u1.username, COUNT(u2.user_id) AS later_user_count FROM web3.users u1 LEFT JOIN web3.users 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 transportation.routes ( route_id.text, route_number.text, description.text, origin_l... | [
{
"content": "Find all pairs of routes where one starts where the other ends and vice versa. List their route numbers, origin and destination IDs for each.",
"role": "user",
"sql": null
},
{
"content": "SELECT r1.route_number AS route_number_1, r1.origin_location_id AS origin_1, r1.destination_l... |
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... | [
{
"content": "Show me the usernames and full names of all users who have updated their profile after April 1, 2024, and have specified a location.",
"role": "user",
"sql": null
},
{
"content": "SELECT username, full_name FROM social_media.users WHERE updated_at > '2024-04-01' AND location 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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title cha... | [
{
"content": "List all games along with the count of in-game items they have. Only include games with more than 10 items and sort by the item count in descending order.",
"role": "user",
"sql": null
},
{
"content": "SELECT g.game_id, g.title, COUNT(i.item_id) AS item_count\nFROM 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 healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "Show me all prescriptions made by doctors who have issued diagnoses described as 'Hypertension'. Include the doctor's ID, prescription ID, medication ID, and prescription date.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.doctor_id, p.prescription_id, p.medication_id, p.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, is... | [
{
"content": "I’d like to find all pairs of securities that belong to the same sector.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.security_id, a.ticker_symbol, b.security_id AS pair_security_id, b.ticker_symbol AS pair_ticker_symbol, a.sector\nFROM financial_services.securities a\nJ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id character varying(64) NOT NULL, token_id characte... | [
{
"content": "For each token, list the number of distinct sender addresses that have sent that token. Show the token ID and the count of distinct senders.",
"role": "user",
"sql": null
},
{
"content": "SELECT token_id, COUNT(DISTINCT from_address) AS distinct_sender_count FROM web3.token_transfe... |
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
Use Hashes. Key pattern: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_numbe... | [
{
"content": "I need to find all components associated with a specific supplier. Can you help with that?",
"role": "user",
"sql": null
},
{
"content": "HGETALL component:<component_id>\nIF HGET component:<component_id> supplier_id = 'sup:ACME_AERO' THEN INCLUDE",
"role": "assistant",
"sq... |
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... | [
{
"content": "Show me the count of items for each rarity, but only for items with a cost greater than 0.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n rarity,\n COUNT(*) AS item_count\nFROM\n gaming_technology.in_game_items\nWHERE\n cost_amount IS NOT NULL AND cost_amount > 0\nGROU... |
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.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"content": "Can you show me all pairs of trips that use the same vehicle but have different drivers? Please include both trip IDs, vehicle_id, and the driver_id for each trip.",
"role": "user",
"sql": null
},
{
"content": "SELECT t1.trip_id AS trip_id_1, t2.trip_id AS trip_id_2, t1.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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"content": "How many applications are currently in 'Processing' status? Return the total count.",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) AS processing_applications_count\nFROM government_services.applications\nWHERE status = 'Processing';",
"role": "assistant",
"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 government_services.notifications ( notification_id text, citizen_id text, applicati... | [
{
"content": "List all notifications sent through the 'Email' channel, showing all columns.",
"role": "user",
"sql": null
},
{
"content": "SELECT notification_id, citizen_id, application_id, message_subject, message_body, channel, sent_at, status, related_entity_type, related_entity_id FROM gove... |
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... | [
{
"content": "Show me the names and URLs of all DApps, and for each DApp, list the KYC status and last review date for all users who have an audit entry.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.name AS dapp_name, d.url, k.user_id, k.status, k.reviewed_at\nFROM trading_platform.da... |
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... | [
{
"content": "List all law firms that share the same address with another firm, showing both firm names and the address.",
"role": "user",
"sql": null
},
{
"content": "SELECT f1.firm_name AS firm_a, f2.firm_name AS firm_b, f1.address\nFROM law_firms f1\nJOIN law_firms f2\n ON f1.address = f2.ad... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.service_orders (
order_id character varying(64) NOT NULL,... | [
{
"content": "For each guest, show the count of service orders they placed for services in the 'Food & Beverage' department. Include the guest's full name and the order count.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.first_name, T1.last_name, COUNT(T2.order_id) FROM hospitality_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.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"content": "List each genre and the number of games in that genre.",
"role": "user",
"sql": null
},
{
"content": "SELECT genre,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY genre;",
"role": "assistant",
"sql": null
},
{
"content": "Now filter to only 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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"content": "List all players with the games for which they've unlocked achievements, showing username, game title, and count of achievements unlocked per game.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.username, g.title AS game_title, COUNT(pa.achievement_id) AS unlocked_count\nF... |
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, ... | [
{
"content": "Compute for each narrative the average ROI from smart_money_token_performance and the total usd_value of buy transactions (type=1) from smart_money_token_inflow. Show narrative, avg_roi, total_buy_usd_value, and chain.",
"role": "user",
"sql": null
},
{
"content": "SELECT i.narrati... |
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, -- Timestamp of the block ... | [
{
"content": "Find the creator and max supply for the Bitcoin token tick 'ordi'.",
"role": "user",
"sql": null
},
{
"content": "SELECT creator, max_supply FROM token_info_bitcoin WHERE tick = 'ordi';",
"role": "assistant",
"sql": null
},
{
"content": "What is the current balance ... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 7