system stringlengths 315 8.44k | 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 web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "List all transactions along with the user_id of the sender when the sender’s address matches a wallet. Return transaction_id, from_address, and user_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.from_address, w.user_id FROM 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 social_media.conversation_participants ( participant_id text, conversation_id text, ... | [
{
"role": "user",
"content": "Show me the usernames of users who have joined more than one conversation, and list the conversation IDs for each user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, ARRAY_AGG(conversation_id) AS conversation_ids\nFROM social_media.conversa... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id text, property_id text, service_name te... | [
{
"role": "user",
"content": "List all food and beverage services (category = 'Food & Beverage') with their names, prices, and units, where the price is less than $20.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_name, price, unit FROM hospitality_technology.services WH... |
You are an expert in writing database language. You can write a corresponding 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": "Could you provide the firm_id, firm_name, total number of lawyers, and number of partners per firm?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lf.firm_id,\n lf.firm_name,\n COUNT(lw.lawyer_id) AS total_lawyers,\n SUM(CASE WHEN 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 legal_services.clients (
client_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Get me a list of all clients along with the website of their law firm, matching on company_name = firm_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.client_id, c.first_name, c.last_name, f.firm_name, f.website\nFROM legal_services.clients 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 train_station_management.train_cars (
car_id character varying(64) NOT NULL, -- ... | [
{
"role": "user",
"content": "Can you help me find the total passenger capacity for each train car on a specific route with route_id 'RT123'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tc.train_id, tc.car_id, tc.car_number, tc.capacity\nFROM train_station_management.train_car... |
You are an expert in writing database language. You can write a corresponding 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": "Show the total file size in bytes for all documents uploaded with a MIME type of 'application/pdf'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(file_size_bytes) FROM insurance.claim_documents WHERE mime_type = 'application/pdf'",
"sql": nu... |
You are an expert in writing database language. You can write a corresponding 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 conversation IDs and user IDs for participants who have email notifications enabled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cp.conversation_id, cp.user_id FROM social_media.conversation_participants AS cp JOIN social_media.user_setti... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uuid(... | [
{
"role": "user",
"content": "List the names and rarity of all items with a cost above 50.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_name, rarity\nFROM gaming_technology.in_game_items\nWHERE cost_amount > 50;",
"sql": null
},
{
"role": "user",
"content":... |
You are an expert in writing database language. You can write a corresponding 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": "Which employees are managers themselves? Show their employee ID, full name, and job title.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT m.employee_id, m.first_name || ' ' || m.last_name AS full_name, m.job_title\nFROM government_services.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 financial_services.securities ( security_id text, ticker_symbol text, isin_code text... | [
{
"role": "user",
"content": "Show me the number of employees in each job title and department, for only employees whose status is 'Active'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT job_title, department, COUNT(employee_id) AS employee_count\nFROM financial_services.employe... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve each citizen's first_name, last_name, and their most recent notification's message_subject and sent_at, only for notifications sent via 'Email'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name,\n c.last_name,\n n.mess... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, client_id text, lawye... | [
{
"role": "user",
"content": "I want to find all appointment pairs where two appointments are scheduled for the same client at overlapping times. Provide the appointment_id from both overlapping appointments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a1.appointment_id AS app... |
You are an expert in writing database language. You can write a corresponding 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": "Find pairs of documents within the same case that were uploaded on the same day but by different lawyers. Show the case_id, upload_date, document_id and uploader_id for both documents in the pair.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.cas... |
You are an expert in writing database language. You can write a corresponding 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": "List all ERC20 tokens with their contract address, symbol, name, and latest USD price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tm.contract_address, tm.symbol, tm.name, tpl.price\nFROM token_metas tm\nJOIN token_prices_latest tpl ON tm.contract... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Show the subject and start time of appointments, along with the full name of the lawyer assigned to each appointment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.subject, T1.start_time, T2.first_name, T2.last_name FROM legal_services.appointmen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "I need a summary of fueling events grouped by fuel_type: count of events and total quantity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n fuel_type,\n COUNT(*) AS event_count,\n SUM(quantity) AS total_quantity\nFROM transportation.fuel_logs\nG... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a... | [
{
"role": "user",
"content": "Show the top 5 contracts by number of events emitted, including contract_id and event_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_id,\n COUNT(event_id) AS event_count\nFROM web3.events\nGROUP BY contract_id\nORDER BY event_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 healthcare.medications ( medication_id character varying(64) NOT NULL, medication_na... | [
{
"role": "user",
"content": "How many medications does each manufacturer have?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT manufacturer, COUNT(*) AS med_count\nFROM healthcare.medications\nGROUP BY manufacturer;",
"sql": null
},
{
"role": "user",
"content": "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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "For each doctor, how many appointments did they have with female patients in the year 2024? Show doctor ID, first name, last name, and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(a.appointme... |
You are an expert in writing database language. You can write a corresponding 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, user_id character varyi... | [
{
"role": "user",
"content": "List all notifications of type 'like' where the target_entity_type is 'post'. For each notification, return notification_id, sender_user_id, target_entity_id (as post_id), and the notification creation time.",
"sql": null
},
{
"role": "assistant",
"content": "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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "Show the usernames and their profile picture URLs for users who have a profile picture set and are also verified.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, profile_picture_url FROM social_media.users WHERE profile_picture_url IS NOT NU... |
You are an expert in writing database language. You can write a corresponding 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 drivers who have operated trips using Electric vehicles. Include driver ID, full name, and the number of Electric trips they've operated.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.driver_id, d.first_name || ' ' || d.last_name AS full_... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, record_id text, patient... | [
{
"role": "user",
"content": "Show me all prescriptions, including the prescription ID, medication ID, prescription date, and the prescribing doctor's ID, for patients who have received more than 2 prescriptions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT prescription_id, 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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Find all vehicles that have at least one fuel log and at least one maintenance log. For each vehicle, show vehicle_id, make, model, the date of its most recent maintenance, and the timestamp of its earliest fuel log.",
"sql": null
},
{
"role": "assistant",
"cont... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t... | [
{
"role": "user",
"content": "List patient insurance details, including patient ID, policy number, and subscriber name, along with the corresponding plan name for each entry.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.patient_id, T1.policy_number, T1.subscriber_name, T2.pl... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, firm_name text, address text, p... | [
{
"role": "user",
"content": "Find law firms that share the same managing partner. Show the names of both firms and the managing_partner_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.firm_name AS firm1, b.firm_name AS firm2, a.managing_partner_id\nFROM legal_services.law_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 blockchain.blocks (
block_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Retrieve the block ID, timestamp, current block's difficulty, and the difficulty of the *previous* block for all blocks where the current block's difficulty is strictly greater than the previous block's difficulty.",
"sql": null
},
{
"role": "assistant",
"conten... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show the contract address and total number of approvals for all ERC20 tokens from the erc20_approval table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS total_approvals\nFROM erc20_approval\nGROUP BY 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 gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser... | [
{
"role": "user",
"content": "Which items have been acquired by players in the last 7 days? Show the item name, rarity, and total quantity acquired across all players.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.item_name, i.rarity, SUM(pi.quantity) AS total_acquired\nFROM 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 legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"role": "user",
"content": "Show me all invoice numbers and due dates where the amount paid is exactly zero.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_number, due_date FROM legal_services.invoices WHERE amount_paid = 0;",
"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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title cha... | [
{
"role": "user",
"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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.game_id, g.title, COUNT(i.item_id) AS item_cou... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "For each room type, show the total number of completed reservations and the total amount paid, considering only reservations with status 'CheckedOut'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rt.type_name, COUNT(r.reservation_id) AS reservation... |
You are an expert in writing database language. You can write a corresponding 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, player_id uuid, ... | [
{
"role": "user",
"content": "How many achievements has each player unlocked and what's the earliest unlocked timestamp for each?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id,\n COUNT(*) AS total_unlocked,\n MIN(unlocked_at) AS first_unlocked\nFROM gaming_... |
You are an expert in writing database language. You can write 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 for platform details. Key format: platform:<platform_id>
// HSET platform:plat_123 ... | [
{
"role": "user",
"content": "Can you provide the total number of cars associated with a specific train with train_id 'train_789'?",
"sql": null
},
{
"role": "assistant",
"content": "SCARD train:train_789:cars",
"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 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, i.issue_date, i.total_amount... |
You are an expert in writing database language. You can write a corresponding 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": "Find all pairs of law firms founded in the same year, showing both firm names and the shared founding year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.firm_name AS firm1, f2.firm_name AS firm2, EXTRACT(YEAR FROM f1.founded_date) AS founding_ye... |
You are an expert in writing database language. You can write a corresponding 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": "Show the average close price and total volume for market data, grouped by source.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT source, AVG(close_price), SUM(volume) FROM financial_services.market_data GROUP BY source;",
"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 gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_t... | [
{
"role": "user",
"content": "I want to see pairs of items from the same game that share the same rarity but are of different types. Show each pair's names and types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.game_id,\n a.item_name AS item1_name,\n a.item_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 gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country tex... | [
{
"role": "user",
"content": "List the total number of items acquired by each player, grouped by rarity, for items that have been acquired at least twice.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.player_id, igi.rarity, SUM(pi.quantity) AS total_acquired\nFROM gaming_tech... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, user_id text, address text, p... | [
{
"role": "user",
"content": "Show me the top 5 users who have the highest total trade volume (quantity * price) as buyers, along with their wallet addresses and the number of distinct assets they traded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.buyer_id, w.address, 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 web3.users ( user_id character varying(64) NOT NULL, username character varying(128)... | [
{
"role": "user",
"content": "List all pairs of users who share the same email domain, showing each pair’s user_id, username, and the common domain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u1.user_id AS user1_id,\n u1.username AS user1_name,\n u2.user_id AS 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.law_firms (
firm_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "For each lead_lawyer_id, list the case_number along with the total unbilled hours and the total unbilled amount for that case.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c.lead_lawyer_id,\n c.case_number,\n SUM(te.hours_spent) AS total_unbil... |
You are an expert in writing database language. You can write a corresponding 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, user_id.text, theme.text, email_notifi... | [
{
"role": "user",
"content": "List the user IDs, theme, and updated_at for users who have disabled email notifications, enabled push notifications, and have a private profile.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, theme, updated_at FROM social_media.user_setting... |
You are an expert in writing database language. You can write a corresponding 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": "List the appointment ID, subject, location, and lawyer ID for all appointments where there is at least one other appointment with the same location and lawyer assigned.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, subject, 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.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show all contracts along with the number of events each contract has emitted. Include the contract address and the event count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.address, COUNT(e.event_id) AS event_count\nFROM web3.contracts c\nLEFT JO... |
You are an expert in writing database language. You can write a corresponding 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": "List all guests currently checked in, showing their full name, room number, property name, and check-in date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.first_name || ' ' || g.last_name AS guest_name,\n r.room_number,\n p.property_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 web3.transactions (
transaction_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Find all pairs of transactions where both transactions have the same nonce and from_address, but different transaction_id. Show both transaction IDs, the shared from_address, shared nonce, and their block numbers.",
"sql": null
},
{
"role": "assistant",
"content... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List all users who have never followed anyone, showing their username, full name, email, and account creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username,\n u.full_name,\n u.email,\n u.created_at\nFROM social_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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "For each user, list their user_id, username, the count of log entries in the last 30 days, and the count of unread notifications.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id,\n u.username,\n COUNT(l.log_id) FILTER (WHERE l.lo... |
You are an expert in writing database language. You can write a corresponding 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": "What is the average number of refills allowed across all prescriptions?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(refills_allowed) FROM healthcare.prescriptions;",
"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.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "Give me a list of all passengers with an email address on file, showing their first name, last name, and the date their record was created.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, created_at\nFROM transportation.passenge... |
You are an expert in writing database language. You can write a corresponding 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 state, show the total number of service locations and the number of employees working at agencies within those states.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sl.state, COUNT(DISTINCT sl.location_id) AS location_count, COUNT(DISTINCT ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "List the username and the total number of notifications each user has received, and also count how many of those are still unread.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username,\n COUNT(n.notification_id) AS total_notifications,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.services ( service_id.text, agency_id.text, service_name.text, d... | [
{
"role": "user",
"content": "Find pairs of active services from the same agency where one service's average processing time is longer than the other's. Display the agency_id, the slower service name with its processing time, and the faster service name with its processing time.",
"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 manufacturing.materials (
material_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "特定のラインIDに関連する組み立て手順と、使用されている材料の情報を取得したいです。ラインID、ステップ名、材料名、材料の説明を含めてください。",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.line_id, s.step_name, m.material_name, m.description\nFROM manufacturing.assembly_steps s\nJOIN manufacturing.materials m ON s.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 smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "Which token on the Ethereum chain had the highest realized ratio last quarter? Show the symbol, realized ratio, and ROI.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, realized_ratio, roi FROM smart_money_token_performance WHERE 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 government_services.applications ( application_id text, citizen_id text, service_id ... | [
{
"role": "user",
"content": "Show all applications for citizen 'cit789' that were last updated in March 2024, including their reference_number, status, and last_updated_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT reference_number, status, last_updated_at FROM government_s... |
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 fuel efficiency of the train car with car_id 'TC456'?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about the fuel efficiency of specific train cars. The data available in the train_cars table 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 gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Could you provide a report showing each in-game item's name and the total quantity currently held in player inventories?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ii.item_name, SUM(pi.quantity) AS total_held FROM gaming_technology.player_invento... |
You are an expert in writing database language. You can write a corresponding 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 the medication ID, medication name, and manufacturer for all entries where the generic name is not listed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications WHERE generic_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 financial_services.market_data ( data_point_id bigint, security_id text, data_timest... | [
{
"role": "user",
"content": "I need to compare consecutive daily close_prices for each security to find when the close_price increased compared to the previous day.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.security_id, b.data_timestamp AS prev_date, b.close_price AS prev... |
You are an expert in writing database language. You can write a corresponding 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 are still pending (status = 'pending') and were reported more than 30 days ago.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id, policy_id, customer_id, reported_date FROM insurance.claims WHERE status = 'pending' AND rep... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t... | [
{
"role": "user",
"content": "Show me a list of all insurance policies along with the subscriber's name and the effective and expiration dates for each policy, including the associated plan ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_number, subscriber_name, effecti... |
You are an expert in writing database language. You can write a corresponding 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": "For each contract address and contract type in the `nft_holders` table, count the number of distinct `token_id`s.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, contract_type, COUNT(DISTINCT token_id) AS distinct_token_count FROM 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 government_services.appointments ( appointment_id text, citizen_id text, employee_id... | [
{
"role": "user",
"content": "How many appointments have a status of 'Cancelled' for each service?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_id, COUNT(*) AS cancelled_appointments FROM government_services.appointments WHERE status = 'Cancelled' GROUP BY service_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.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Find employees who work in the same department as their manager. Display the employee's full name, the manager's full name, and the department they share.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS employee_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.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "I want to know the average fuel quantity refueled per vehicle, grouped by vehicle_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fl.vehicle_id, AVG(fl.quantity) AS avg_quantity\nFROM transportation.fuel_logs fl\nGROUP BY fl.vehicle_id;",
"sql... |
You are an expert in writing database language. You can write a corresponding 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 vehicles that have no associated fuel logs. Include the vehicle's make, model, and license plate.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.make , T1.model , T1.license_plate FROM transportation.vehicles AS T1 LEFT JOIN transportat... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve all prescriptions for patient 'patient_007', showing prescription_id, medication_id, start_date, and end_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT prescription_id, medication_id, start_date, end_date\nFROM healthcare.prescriptions... |
You are an expert in writing database language. You can write a corresponding 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 the first and last names, email, and phone number of all customers whose status is not 'Active'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email, phone_number\nFROM insurance.customers\nWHERE status <> 'Active';",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id... | [
{
"role": "user",
"content": "What is the total balance for each currency in the accounts table?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT currency, SUM(balance) AS total_balance FROM financial_services.accounts GROUP BY currency;",
"sql": 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 legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w... | [
{
"role": "user",
"content": "Retrieve each managing partner who oversees more than one firm, showing the managing_partner_id and the count of firms they manage.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT managing_partner_id, COUNT(*) AS firm_count\nFROM legal_services.law_fi... |
You are an expert in writing database language. You can write a corresponding 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": "Could you show me the usernames of users who have received likes on their posts, along with the total number of likes each user's posts have received?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, count(T3.like_id) AS total_likes_receiv... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the names of all employees along with the names of the agencies they work for, and the number of appointments each employee has scheduled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, a.agency_name, COUNT(appt.app... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, ticker_s... | [
{
"role": "user",
"content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector, along with their last_updated timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT security_id, tick... |
You are an expert in writing database language. You can write a corresponding 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.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name... | [
{
"role": "user",
"content": "Retrieve each game_id alongside the achievement with the highest points, showing its name and points.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.game_id,\n a.name,\n a.points\nFROM achievements a\nJOIN (\n SELECT game_id,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var... | [
{
"role": "user",
"content": "List all tokens with a price below $1 and a 24-hour trading volume over $5 million.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE price < 1 AND total_volume::numeric > 5000000... |
You are an expert in writing database language. You can write a corresponding 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": "Can you give me all locations in Los Angeles?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT location_id, name, type, address_line1, city, state_province, postal_code, country, latitude, longitude, timezone\nFROM transportation.locations\nWHERE city ... |
You are an expert in writing database language. You can write a corresponding 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": "Show the total number of documents uploaded for each lawyer. Display the lawyer's first and last name and the document count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, COUNT(d.document_id) AS document_count\nFROM legal... |
You are an expert in writing database language. You can write a corresponding 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, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "I want to see the total fare and number of bookings for each passenger.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.passenger_id, COUNT(b.booking_id) AS booking_count, SUM(b.fare) AS total_fare\nFROM transportation.bookings b\nGROUP BY b.passeng... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Show me the invoice number, total amount, and due date for all invoices, along with the corresponding client ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_number, total_amount, due_date, client_id FROM legal_services.invoices;",
"sql... |
You are an expert in writing database language. You can write a corresponding 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.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,... | [
{
"role": "user",
"content": "List all notifications that are related to group conversations, showing notification ID, recipient user ID, and the associated group name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.recipient_user_id, c.group_name FROM social... |
You are an expert in writing database language. You can write a corresponding 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": "Give me the total transfer volume and number of transfers for each token on Avalanche in the last 7 days. Show tick as token, SUM(amt) as total_volume, and COUNT(*) as transfer_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n a.tick AS token,... |
You are an expert in writing database language. You can write a corresponding 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": "List each username with how many users they follow and how many users follow them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username,\n COALESCE(following.following_count, 0) AS following_count,\n COALESCE(followers.followers_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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"role": "user",
"content": "List documents uploaded for applications that have received payments. Display the document ID, document type, associated application ID, and the payment amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.document_id, T1.document_type, T1.appli... |
You are an expert in writing database language. You can write a corresponding 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, name text, type text, address_line1 tex... | [
{
"role": "user",
"content": "Please show me the first name, last name, and date of birth for all passengers born between 1990 and 1999, inclusive.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth FROM transportation.passengers WHERE date_of_bir... |
You are an expert in writing database language. You can write a corresponding 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.messages ( message_id text PRIMARY KEY, conversation_id text, sender_us... | [
{
"role": "user",
"content": "How many messages in total have been sent that do not contain any media attachment?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS non_media_message_count\nFROM social_media.messages\nWHERE media_url IS NULL OR media_url = '';",
"sql"... |
You are an expert in writing database language. You can write a corresponding 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, license_plate c... | [
{
"role": "user",
"content": "List the name, city, and country of all locations where at least one vehicle is currently assigned (i.e., depot_id matches location_id).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.name, l.city, l.country\nFROM transportation.locations l\nJOIN 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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"role": "user",
"content": "List all guests who have made reservations for rooms located on floor 1 along with the property name and the room number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.guest_id, g.first_name, g.last_name, r.property_id, ro.room_number\nFROM hospit... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List the first and last names of guests residing in California who are loyalty members.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name FROM hospitality_technology.guests WHERE state_province = 'California' AND loyalty_member_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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "Which project had the largest single fundraising in each investment round, along with the round's name and introduction?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.project_name, t1.rounds_name, t1.investment_value, t1.introduction FROM project... |
You are an expert in writing database language. You can write a corresponding 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?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ctb.token_symbol, tbi.narrative, tbi.price, SUM(ctb.usd_value) AS total_usd_value\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 hospitality_technology.services ( service_id text PRIMARY KEY, property_id text, ser... | [
{
"role": "user",
"content": "For each department, what is the highest priced available service? Please show department, service_name, and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, service_name, price FROM hospitality_technology.services WHERE is_available... |
You are an expert in writing database language. You can write a corresponding 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, firm_name charact... | [
{
"role": "user",
"content": "List pairs of law firms that are located at the same address. Display the names of both firms and the shared address, ensuring the address is not null.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n t1.firm_name AS firm1_name,\n t2.firm_name AS 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Give me a list of all specializations available at each law firm.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT firm_id, specialization\nFROM legal_services.lawyers;",
"sql": null
},
{
"role": "user",
"content": "For each sp... |
You are an expert in writing database language. You can write a corresponding 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": "Find all active policies with a coverage limit of at least 1,000,000. List the policy_id, policy_number, and coverage_limit.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number, coverage_limit\nFROM insurance.policies\nWHERE statu... |
You are an expert in writing database language. You can write a corresponding 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": "For each document_name in each case, retrieve the latest version number and its document_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_id,\n document_name,\n MAX(version) AS latest_version\nFROM legal_services.documents\nGROUP B... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.securities (
security_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List the ticker_symbol and average close price for all securities of type 'ETF'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, AVG(md.close_price) AS avg_close_price\nFROM financial_services.securities s\nJOIN financial_services.mar... |
You are an expert in writing database language. You can write a corresponding 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_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_u... | [
{
"role": "user",
"content": "Find players who own items with rarity 'Rare' or higher ('Epic', 'Legendary') and list their usernames.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username FROM players AS T1 INNER JOIN player_inventory AS T2 ON T1.player_id = T2.play... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.