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
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"content": "Retrieve the first and last names of all doctors who specialize in Cardiology.",
"role": "user",
"sql": null
},
{
"content": "SELECT first_name, last_name\nFROM healthcare.doctors\nWHERE specialty = 'Cardiology';",
"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 financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"content": "Can you give me a breakdown of the number of customers in each country and their average age? I want the result to also show the total number of unique states per country.",
"role": "user",
"sql": null
},
{
"content": "SELECT country, COUNT(*) AS customer_count, AVG(EXTRACT(YEAR FR... |
You are an expert in writing database language. You can write a corresponding 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 all maintenance records, can you show the vehicle's make, model, the odometer reading, and the mechanic's name?",
"role": "user",
"sql": null
},
{
"content": "SELECT v.make, v.model, m.odometer_reading, m.mechanic_name FROM transportation.maintenance_logs m JOIN transportation.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"content": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan.",
"role": "user",
"sql": null
},
{
"content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) AS enrolled_patient_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 gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"content": "List all pairs of servers in the same region that are both 'online', showing server1_name, server2_name, and the absolute difference in current_players.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n s1.server_name AS server1_name,\n s2.server_name AS server2_name,\n AB... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"content": "Show all token transfers including the token symbol and the address of the contract that created each token. List the transfer id, token id, value, transaction id, the contract address, and the token symbol.",
"role": "user",
"sql": null
},
{
"content": "SELECT tt.transfer_id, tt.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 financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"content": "List all employees who are currently active and were hired before 2022. Show employee_id, first_name, last_name, job_title, department, and hire_date.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n employee_id,\n first_name,\n last_name,\n job_title,\n department,\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 social_media.posts ( post_id text, user_id text, content text, media_url text, media... | [
{
"content": "What are the top 5 posts by number of likes, showing post_id, media_type and like_count, ordered by like_count descending?",
"role": "user",
"sql": null
},
{
"content": "SELECT p.post_id, p.media_type, COUNT(l.like_id) AS like_count\nFROM social_media.posts p\nJOIN social_media.lik... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"content": "How many users registered in 2024?",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM trading_platform.users WHERE DATE_PART('year', created_at) = 2024;",
"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 gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ... | [
{
"content": "I want to identify pairs of players who unlocked the same achievement within one hour of each other. List player1_id, player2_id, achievement_id, and the time difference in minutes.",
"role": "user",
"sql": null
},
{
"content": "SELECT pa1.player_id AS player1_id,\n pa2.playe... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"content": "How many citizens registered in each year?",
"role": "user",
"sql": null
},
{
"content": "SELECT DATE_PART('year', registration_date) AS year,\n COUNT(*) AS registration_count\nFROM government_services.citizens\nGROUP BY DATE_PART('year', registration_date)\nORDER BY year;",
... |
You are an expert in writing database language. You can write a corresponding 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.policy_beneficiaries (
beneficiary_id character varying(64) NOT NULL, ... | [
{
"content": "List all beneficiaries who have a percentage share greater than 50% on a policy. Please include the beneficiary's first name, last name, relationship, the policy ID, and the policy's start date.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.first_name, T1.last_name, T1.r... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"content": "How many citizens are marked as not verified?",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM government_services.citizens WHERE is_verified = FALSE;",
"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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"content": "Find the total number of distinct lawyers and distinct documents in the database.",
"role": "user",
"sql": null
},
{
"content": "SELECT (SELECT COUNT(DISTINCT lawyer_id) FROM legal_services.lawyers) AS distinct_lawyer_count, (SELECT COUNT(DISTINCT document_id) FROM legal_services.d... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.documents (
document_id character varying(64) NOT NULL, -- u... | [
{
"content": "Show the document type, verification status, and the full name of the citizen who uploaded each document.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.document_type, d.verification_status, CONCAT(c.first_name, ' ', c.last_name) AS citizen_full_name FROM government_servic... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"content": "Which staff members are managing properties, and what are the names and email addresses of those properties?",
"role": "user",
"sql": null
},
{
"content": "SELECT s.staff_id, s.first_name, s.last_name, p.property_name, p.email_address FROM hospitality_technology.staff s INNER JOIN ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"content": "Get me a list of upcoming appointments with appointment_id, client full name, case number, and start_time for appointments with status 'scheduled'.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.appointment_id,\n CONCAT(cl.first_name, ' ', cl.last_name) AS client_nam... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show the medication_id, medication_name, and manufacturer for all medication entries.",
"role": "user",
"sql": null
},
{
"content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications;",
"role": "assistant",
"sql": null
},
{
"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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"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.",
"role": "user",
"sql": null
},
{
"content": "SELECT first_name, last_name, created_at\nFROM transportation.passengers\nWHERE email 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 gaming_technology.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uuid()... | [
{
"content": "Can you provide the total number of sessions and the average session duration in seconds for each game_id and server_id pair?",
"role": "user",
"sql": null
},
{
"content": "SELECT game_id, server_id, COUNT(*) AS total_sessions, AVG(duration_seconds) AS avg_duration_seconds\nFROM ga... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List the medication IDs and names for all entries where the description is missing or empty.",
"role": "user",
"sql": null
},
{
"content": "SELECT medication_id, medication_name FROM healthcare.medications WHERE description IS NULL OR description = '';",
"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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"content": "List all rooms with their numbers, property names, and the full name of the property manager.",
"role": "user",
"sql": null
},
{
"content": "SELECT r.room_number, p.property_name, s.first_name || ' ' || s.last_name AS manager_full_name\nFROM hospitality_technology.rooms r\nJOIN hos... |
You are an expert in writing database language. You can write a corresponding 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.smart_contracts ( contract_id text, creator_address text, code text, time... | [
{
"content": "Show me all smart contracts created by addresses that have created more than 3 contracts, along with the total number of contracts each creator has made.",
"role": "user",
"sql": null
},
{
"content": "SELECT sc.contract_id, sc.creator_address, COUNT(*) OVER (PARTITION BY sc.creator... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NU... | [
{
"content": "List all patients who have insurance plans with group numbers, showing their patient IDs and the count of such plans per patient.",
"role": "user",
"sql": null
},
{
"content": "SELECT patient_id, COUNT(*) AS plan_count FROM healthcare.patient_insurance WHERE group_number IS NOT NUL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"content": "List all users who commented on posts tagged with hashtag 'spring', showing user_id, comment_id, content, and tag_name.",
"role": "user",
"sql": null
},
{
"content": "SELECT c.user_id, c.comment_id, c.content, h.tag_name\nFROM social_media.comments c\nJOIN social_media.post_hashtag... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"content": "Find patients who currently have both a primary and a secondary insurance policy. For each, show patient_id, full name, primary policy_number, and secondary policy_number.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.patient_id,\n p.first_name || ' ' || p.last_name... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir... | [
{
"content": "What is the minimum, maximum, and average commission rate among all agents?",
"role": "user",
"sql": null
},
{
"content": "SELECT MIN(commission_rate) AS min_commission_rate, MAX(commission_rate) AS max_commission_rate, AVG(commission_rate) AS average_commission_rate FROM insurance... |
You are an expert in writing database language. You can write a corresponding 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 top 5 games by number of online servers in European regions. I want the game title and the server count.",
"role": "user",
"sql": null
},
{
"content": "SELECT g.title, COUNT(s.server_id) AS server_count\nFROM gaming_technology.games g\nJOIN gaming_technology.servers s 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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"content": "Which hashtags appear on the most posts? Return hashtag_id, tag_name, and the number of posts each hashtag is used in, sorted descending, limited to the top 3.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n h.hashtag_id,\n h.tag_name,\n COUNT(ph.post_id) AS post_count\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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"content": "Show me all pairs of usernames for users located in the same city along with their shared location.",
"role": "user",
"sql": null
},
{
"content": "SELECT u1.username AS user1, u2.username AS user2, u1.location\nFROM social_media.users u1\nJOIN social_media.users u2\n ON u1.locatio... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"content": "Show the total number of maintenance logs for each vehicle along with the vehicle's make and model.",
"role": "user",
"sql": null
},
{
"content": "SELECT v.vehicle_id, v.make, v.model, COUNT(m.log_id) AS maintenance_count\nFROM transportation.vehicles v\nLEFT JOIN transportation.ma... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc20_balances_historical (
block_number bigint NOT NULL, -- Block number contai... | [
{
"content": "Show me the total historical ERC20 balances for wallet '0xAAA...' and include each token's symbol and latest price.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n h.contract_address,\n SUM(CAST(h.amount AS numeric)) AS total_balance,\n p.symbol,\n p.price\nFROM erc20_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 hospitality_technology.services (
service_id character varying(64) NOT NULL, -- ... | [
{
"content": "List payment records in USD including guest names and processing staff names.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.payment_id,\n p.amount,\n p.currency_code,\n g.guest_name,\n s.staff_name\nFROM hospitality_technology.payments p\nJOIN hosp... |
You are an expert in writing database language. You can write 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 /schedules
{
"mappings": {
"properties": {
"schedule_id": { "type": "keyword" ... | [
{
"content": "能否帮我统计数据库中所有乘客的数量,按忠诚计划ID分组?",
"role": "user",
"sql": null
},
{
"content": "SELECT loyalty_program_id, COUNT(*) as passenger_count\nFROM passengers\nGROUP BY loyalty_program_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 hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id ... | [
{
"content": "List all staff members along with their direct manager's first and last names.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.staff_id,\n s.first_name AS staff_first_name,\n s.last_name AS staff_last_name,\n m.first_name AS manager_first_name,\n m.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.posts (
post_id character varying(64) NOT NULL, -- unique identifie... | [
{
"content": "How many users have email_notifications_enabled set to false and private_profile set to true? Return the count.",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) AS user_count\nFROM social_media.user_settings\nWHERE email_notifications_enabled = false\n AND private_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 government_services.service_locations ( location_id.text, agency_id.text, location_n... | [
{
"content": "Could you retrieve pairs of accessible service locations in the same city but with different postal codes?",
"role": "user",
"sql": null
},
{
"content": "SELECT sl1.location_id AS location1_id,\n sl2.location_id AS location2_id,\n sl1.city\nFROM government_services.serv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo... | [
{
"content": "Show the username and the total number of log entries for each user who has logged any action.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.username, COUNT(T2.log_id) FROM users AS T1 JOIN logs AS T2 ON T1.user_id = T2.user_id GROUP BY T1.username;",
"role": "assist... |
You are an expert in writing database language. You can write a corresponding 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.room_types ( room_type_id character varying(64) NOT NULL, pro... | [
{
"content": "Show me all reservations with more than 2 adults that are confirmed (status = 'Confirmed'), including their check-in dates and total amounts.",
"role": "user",
"sql": null
},
{
"content": "SELECT r.reservation_id, r.property_id, r.guest_id, r.check_in_date, r.total_amount FROM hosp... |
You are an expert in writing database language. You can write a corresponding 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": "Which routes have their origin and destination in the same city? Show the route number, description, and the origin and destination location IDs.",
"role": "user",
"sql": null
},
{
"content": "SELECT r.route_number, r.description, r.origin_location_id, r.destination_location_id\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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"content": "List each vehicle's ID, make, and model along with the count of trips scheduled to depart in the next 7 days.",
"role": "user",
"sql": null
},
{
"content": "SELECT v.vehicle_id, v.make, v.model, COUNT(t.trip_id) AS trip_count\nFROM transportation.vehicles v\nJOIN transportation.tri... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"content": "For each fundraising round in 2022 and 2023, list the round name, the year, the total investment_value, and the count of distinct projects. Also include the average market_cap of associated tokens by matching project_name to token_symbol in token_basic_info.",
"role": "user",
"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 text, first_name text, last_name text, date_of_bir... | [
{
"content": "What is the total amount paid across all premium payments for payments marked as 'Failed'?",
"role": "user",
"sql": null
},
{
"content": "SELECT sum(amount_paid) FROM insurance.premium_payments WHERE status = 'Failed';",
"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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"content": "Can you show me the number of unique doctors by specialty who were created after January 1st, 2024?",
"role": "user",
"sql": null
},
{
"content": "SELECT specialty, COUNT(DISTINCT doctor_id) AS doctor_count\nFROM healthcare.doctors\nWHERE created_at > '2024-01-01'\nGROUP BY special... |
You are an expert in writing database language. You can write a corresponding 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": "List each doctor and the total number of unique patients for appointments that have been completed. Return doctor_id, first_name, last_name, and patient_count.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.doctor_id,\n d.first_name,\n d.last_name,\n COUN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w... | [
{
"content": "What is the total sum of amounts paid for all invoices?",
"role": "user",
"sql": null
},
{
"content": "SELECT SUM(amount_paid) FROM invoices;",
"role": "assistant",
"sql": null
},
{
"content": "Group this total by the status of the invoice.",
"role": "user",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.appointments ( appointment_id text PRIMARY KEY, citizen_id text,... | [
{
"content": "List the names of service locations that have had more than 10 appointments with a status of 'Cancelled'.",
"role": "user",
"sql": null
},
{
"content": "SELECT T2.location_name FROM government_services.appointments AS T1 JOIN government_services.service_locations AS T2 ON T1.locati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"content": "Show me all players who do not have a last_login recorded. List their player_id, username, and registration_date.",
"role": "user",
"sql": null
},
{
"content": "SELECT player_id, username, registration_date FROM gaming_technology.players WHERE last_login IS NULL;",
"role": "ass... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show all messages that include a media attachment, along with the sender's user ID and the conversation ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT message_id, sender_user_id, conversation_id, media_url, media_type, sent_at FROM social_media.messages WHERE media_url I... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"content": "List all service orders along with the quantity, unit price, and total price for each order. Filter for orders placed on or after the start of the year 2023.",
"role": "user",
"sql": null
},
{
"content": "SELECT order_id, quantity, unit_price, total_price FROM hospitality_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 project_fundraising_record ( id text, project_id text, project_name text, rounds_nam... | [
{
"content": "Which projects raised more than 10 million in their fundraising rounds, and what are their round names and valuations?",
"role": "user",
"sql": null
},
{
"content": "SELECT project_name, rounds_name, investment_value, valuation FROM project_fundraising_record WHERE investment_value... |
You are an expert in writing database language. You can write a corresponding 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 prescriptions for patients who have at least one appointment scheduled in the future. Show the prescription ID, patient ID, medication name, and the earliest future appointment time for that patient.",
"role": "user",
"sql": null
},
{
"content": "SELECT pr.prescription_id,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.documents ( document_id character varying(64) NOT NULL, case_id chara... | [
{
"content": "I need to find all pairs of documents that were uploaded by the same lawyer within 7 days of each other.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.uploaded_by_lawyer_id,\n a.document_id AS doc1_id,\n b.document_id AS doc2_id,\n a.upload_timestamp 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 government_services.payments ( payment_id character varying(64) NOT NULL, applicatio... | [
{
"content": "Show me the total payment amount and number of payments for each service.",
"role": "user",
"sql": null
},
{
"content": "SELECT service_id, SUM(amount) AS total_amount, COUNT(*) AS payment_count FROM government_services.payments GROUP BY service_id;",
"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 government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ... | [
{
"content": "Which service locations are not accessible and belong to agencies with a jurisdiction level of 'Local'? Show the location name and city.",
"role": "user",
"sql": null
},
{
"content": "SELECT sl.location_name, sl.city\nFROM government_services.service_locations sl\nINNER JOIN govern... |
You are an expert in writing database language. You can write a corresponding 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_rand... | [
{
"content": "Can you show me the total number of each item acquired by every player, along with their player_id and item_id?",
"role": "user",
"sql": null
},
{
"content": "SELECT player_id, item_id, SUM(quantity) AS total_acquired FROM gaming_technology.player_inventory GROUP BY player_id, item... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"content": "Show me all wallet addresses that hold more than 3 different NFTs from any ERC1155 contract. For each wallet, list the contract address and the count of distinct token_ids.",
"role": "user",
"sql": null
},
{
"content": "SELECT contract_address, wallet_address, COUNT(DISTINCT 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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"content": "For each chain, what is the average price of tokens recorded in the smart_money_token_performance table?",
"role": "user",
"sql": null
},
{
"content": "SELECT chain, AVG(price) AS average_token_price FROM smart_money_token_performance GROUP BY chain;",
"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 gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser... | [
{
"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.",
"role": "user",
"sql": null
},
{
"content": "SELECT i.item_name, i.rarity, SUM(pi.quantity) AS total_acquired\nFROM gaming_technology.in_game_... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NO... | [
{
"content": "List each participant_id along with the total number of participants in their conversation, and include user_id and conversation_id.",
"role": "user",
"sql": null
},
{
"content": "SELECT cp.participant_id, cp.user_id, cp.conversation_id, counts.participant_count\nFROM social_media.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"content": "For the 'AI' and 'Gaming' narratives, what is the total USD value held by CEXes for tokens listed in their top 3 coins?",
"role": "user",
"sql": null
},
{
"content": "SELECT T2.narrative, SUM(T1.usd_value) AS TotalCexUSDValue FROM cex_token_balance AS T1 JOIN narrative_info AS T2 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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"content": "For projects that have completed more than one fundraising round, calculate the average investment value across all their recorded rounds. Display the project name and this average value.",
"role": "user",
"sql": null
},
{
"content": "SELECT project_name, AVG(investment_value) AS 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 government_services.agencies (
agency_id character varying(64) NOT NULL, -- uniq... | [
{
"content": "Show me a list of all agencies and the number of distinct citizens who have submitted documents to each agency.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.agency_name, COUNT(DISTINCT d.citizen_id) AS citizen_count\nFROM government_services.documents d\nJOIN government_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"content": "Find all contracts deployed by users who have also conducted transactions with a value greater than 1 ETH (where 1 ETH = 1e18 wei).",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT c.contract_id, c.address, c.deployer_address FROM web3.contracts c JOIN web3.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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"content": "For Avalanche tokens, show me the token `tick`, `creator`, and `max_supply` from the `token_info_avalanche` table.",
"role": "user",
"sql": null
},
{
"content": "SELECT tick, creator, max_supply FROM token_info_avalanche",
"role": "assistant",
"sql": null
},
{
"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 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 transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time... | [
{
"content": "Calculate the monthly total quantity of fuel consumed and the average cost_per_unit for each fuel_type in 2023.",
"role": "user",
"sql": null
},
{
"content": "SELECT date_trunc('month', log_timestamp) AS month,\n fuel_type,\n SUM(quantity) AS total_quantity,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"content": "Show me all time entries, including the case name they are associated with.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.*, T2.case_name FROM time_entries AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id",
"role": "assistant",
"sql": null
},
{
"content"... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 1