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 government_services.payments ( payment_id.text, application_id.text, citizen_id.text... | [
{
"role": "user",
"content": "List all failed payments with their details.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_id, application_id, citizen_id, service_id, amount, currency, payment_method, payment_provider_reference, payment_timestamp, status, notes FROM 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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "Find all addresses that have only sent tokens (appear in from_address) but have never received any (do not appear in to_address).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT from_address FROM web3.token_transfers WHERE from_address NOT IN... |
You are an expert in writing database language. You can write 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" ... | [
{
"role": "user",
"content": "能否帮我查询特定列车行程(schedule_id 为 'sched_001')的详细信息,包括列车出发和到达时间,以及该行程所属路线的ID和相关乘客信息?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.schedule_id, s.train_id, s.route_id, s.departure_datetime, s.arrival_datetime, s.status, p.passenger_id, p.first_name, p.la... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List all passengers who have made a booking for a trip on a route that covers more than 100 kilometers. Include the passenger's full name, email, the route number, and the distance in km.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Find all patients along with the number of unique diagnoses each has received. Only include patients who have at least two diagnoses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, COUNT(DISTINCT d.diagnosis_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 transportation.routes ( route_id text, route_number text, description text, origin_l... | [
{
"role": "user",
"content": "Find all pairs of different routes where the estimated duration in minutes is identical. For each pair, show both route IDs, their route numbers, and the shared duration.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.route_id AS route1_id, r1.rou... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NU... | [
{
"role": "user",
"content": "List the names and cities of all service locations, along with the agency ID, where the locations are marked as accessible.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT location_name, city, agency_id FROM government_services.service_locations WHERE... |
You are an expert in writing database language. You can write a corresponding 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": "Show all pairs of patients who share the same email domain. Return patient1_id, patient2_id, and the shared domain, but do not pair a patient with themselves.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.patient_id AS patient1_id, p2.patient_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List all fuel refueling events with the refueled vehicle's make and model, the fuel type used, and the fueling location ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fl.fuel_log_id, fl.log_timestamp, v.make, v.model, fl.fuel_type, fl.quantity, 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.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen ti... | [
{
"role": "user",
"content": "Find all pairs of nodes that share the same ip_address but have different port numbers, include both node IDs, their ports, and the ip_address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n1.node_id AS node1_id, n2.node_id AS node2_id, n1.ip_addre... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_... | [
{
"role": "user",
"content": "How many game sessions started on each calendar day?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE(start_time), COUNT(*) FROM gaming_technology.game_sessions GROUP BY DATE(start_time) ORDER BY DATE(start_time);",
"sql": null
},
{
"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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"role": "user",
"content": "I want to list all claims with their claim_id, incident_date, and the customer's full name for claims where estimated_loss is above 10000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cl.claim_id, cl.incident_date, c.first_name || ' ' || c.last_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 government_services.service_locations ( location_id text PRIMARY KEY, agency_id text... | [
{
"role": "user",
"content": "For each service location, find the nearest accessible service location. Show the location_id, location_name, nearest_location_id, and the distance.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.location_id,\n l.location_name,\n neares... |
You are an expert in writing database language. You can write a corresponding 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": "List all SUI NFT objects with the status 'exists', showing the object_id, name, and owner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT object_id, name, owner\nFROM sui_nfts\nWHERE status = 'exists';",
"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 government_services.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List the first name, last name, and job title of each employee, along with the job title of their manager.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, e.job_title AS employee_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text, username text, email text, password_hash text... | [
{
"role": "user",
"content": "List the user ID and username for users who have placed orders for assets of type 'cryptocurrency'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.user_id, T1.username FROM trading_platform.users AS T1 JOIN trading_platform.orders 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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"role": "user",
"content": "Calculate the total payment amount grouped by payment_method.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_method, SUM(amount) AS total_amount\nFROM hospitality_technology.payments\nGROUP BY payment_method;",
"sql": null
},
{
"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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "I want to retrieve all agents along with the number of active policies they've sold and the average premium amount of those active policies. Please include agent_id, first_name, last_name, policy_count, avg_premium. Sort the results by policy_count in descending order.",
"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 social_media.post_hashtags ( post_hashtag_id.text, post_id.text, hashtag_id.text )
| [
{
"role": "user",
"content": "How many distinct posts does each hashtag appear in?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT hashtag_id, COUNT(DISTINCT post_id) AS post_count FROM social_media.post_hashtags GROUP BY hashtag_id;",
"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.rooms ( room_id character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "Show me each staff member and the count of service orders they have delivered.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT st.staff_id, st.first_name, st.last_name, COUNT(so.order_id) AS delivered_orders\nFROM hospitality_technology.staff st\nLEFT... |
You are an expert in writing database language. You can write a corresponding 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": "Could you please list the first and last names of all clients?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name FROM clients;",
"sql": null
},
{
"role": "user",
"content": "Now, only show clients whose status is '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.applications ( application_id text, citizen_id text, service_id ... | [
{
"role": "user",
"content": "List the reference_number and status for all applications assigned to employee 'emp200', along with the submitted_at date of each application.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT reference_number, status, submitted_at FROM government_servi... |
You are an expert in writing database language. You can write a corresponding 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": "List all active SUI coins with their symbol, name, and total balance across all owners.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT scm.coin_type, scm.symbol, scm.name, SUM(CAST(sc.balance AS DECIMAL)) AS total_balance\nFROM sui_coins_metadata scm... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Find the username, email, and total number of orders placed by each user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, u.email, COUNT(o.order_id) AS order_count\nFROM trading_platform.users u\nLEFT JOIN trading_platform.wallets w ON u.u... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "What is the average age of customers by risk_profile for those in status 'Active'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT risk_profile,\n AVG(DATE_PART('year', AGE(CURRENT_DATE, date_of_birth))) AS avg_age\nFROM financial_services.custo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show customers who have made a premium payment greater than $1000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.customer_id, T1.first_name, T1.last_name FROM insurance.customers AS T1 JOIN insurance.premium_payments AS T2 ON T1.customer... |
You are an expert in writing database language. You can write a corresponding 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 property pairs that share the same postal_code, showing each pair's property IDs, names, and the postal_code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.property_id AS property_id_1,\n a.property_name AS property_name_1,\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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_i... | [
{
"role": "user",
"content": "Show me pairs of reservations by the same guest where the next reservation starts within 7 days of the previous check-out. Include both reservation IDs and property IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id AS first_reserv... |
You are an expert in writing database language. You can write a corresponding 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_inflow ( token_address character varying(100) NOT NULL, -- the tok... | [
{
"role": "user",
"content": "Which token symbols have the highest number of addresses buying them on the Ethereum chain? Show the top 3 symbols, their total address_amount, and narrative.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, narrative, SUM(address_amount)... |
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 manufacturing date of the train car with car_id 'CAR789'?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about the manufacturing date of train cars. The data available in the train_cars table onl... |
You are an expert in writing database language. You can write a corresponding 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.... | [
{
"role": "user",
"content": "Show the total number of notifications sent per service category for applications submitted in 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.category, COUNT(n.notification_id) AS notification_count FROM government_services.notifications n 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 financial_services.securities ( security_id.text, ticker_symbol.text, isin_code.text... | [
{
"role": "user",
"content": "List pairs of securities from the same issuer where one security was updated within the last 30 days, and the other was updated more than 90 days ago. Show issuer name, ticker symbols, and last_updated timestamps for both.",
"sql": null
},
{
"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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Can you list all group conversations and the number of participants in each?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id, c.group_name, COUNT(cp.user_id) AS participant_count\nFROM social_media.conversations c\nJOIN social_media.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.appointments ( appointment_id text, client_id text, lawyer_id text, c... | [
{
"role": "user",
"content": "How many appointments have been scheduled on weekends?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS weekend_appointments\nFROM legal_services.appointments\nWHERE EXTRACT(DOW FROM start_time) IN (0,6);",
"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.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "List all active policies, including their policy number, start date, end date, premium amount, and the name of the insurance product.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T1.start_date, T1.end_date, T1.premium_amount, T2.p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, emai... | [
{
"role": "user",
"content": "List all guests who have placed service orders for services in the 'Transportation' department, along with their full names and the service names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.guest_id, g.first_name, g.last_name, s.service_name\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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Show all reviews with the guest's ID, review comment, and the full name of the staff member who responded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.guest_id, r.comment, s.first_name AS response_staff_first_name, s.last_name AS re... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_... | [
{
"role": "user",
"content": "Can you write a query that retrieves each server's name, its region, and the highest current player count observed in that region?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.server_name, s.region, m.max_current_players\nFROM gaming_technology.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 trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "How many users registered in 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM trading_platform.users WHERE DATE_PART('year', created_at) = 2024;",
"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.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "I need a list of patients along with their chronic diagnosis codes and diagnosis dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, d.diagnosis_code, d.diagnosis_date FROM healthcare.patients p JOIN healthcare.diagnoses ... |
You are an expert in writing database language. You can write a corresponding 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 all cases that were opened and subsequently closed in the same calendar year. List the case name, case number, date opened, and date closed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_name, case_number, date_opened, date_closed FROM leg... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List the token symbol, token name, and contract address for all tokens that have no recorded transfers in the token_transfers table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T.token_symbol, T.token_name, T.contract_address FROM web3.tokens AS T... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List all staff members who have a manager, including each staff’s first and last name, position, and their manager’s first and last name, sorted by staff last name ascending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.first_name AS staff_first_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"role": "user",
"content": "How many unique patients have been diagnosed with code_type 'ICD-10'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT patient_id) FROM healthcare.diagnoses WHERE code_type = 'ICD-10';",
"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 trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id characte... | [
{
"role": "user",
"content": "List all trades for asset 'BTC' where the trade quantity is greater than 5.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trade_id, order_id, buyer_id, seller_id, quantity, price, traded_at FROM trading_platform.trades WHERE asset_id = 'BTC' AND qua... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "I want to list all insurance plans along with the number of medical records that have a record_date in 2024. Display plan_id, plan_name, and the total medical records.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.plan_id, ip.plan_name, COUNT(mr.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Show the number of staff members for each property, along with the property name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(s.staff_id) AS staff_count\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "Show all projects that raised funds in February 2022, including their names and investment values.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, investment_value FROM project_fundraising_record WHERE investment_date LIKE '2022-02%';",
... |
You are an expert in writing database language. You can write a corresponding 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": "List the names of active services offered by agencies with at least one accessible service location in the state of 'New York'. Show the service name, category, agency name, and the location name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.ser... |
You are an expert in writing database language. You can write a corresponding 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 bigserial NOT NULL, -- auto-incre... | [
{
"role": "user",
"content": "For each security sector, what is the average volume recorded in the market data?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T2.sector, AVG(T1.volume) FROM financial_services.market_data AS T1 JOIN financial_services.securities AS T2 ON T1.securi... |
You are an expert in writing database language. You can write a corresponding 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, contract_address varchar N... | [
{
"role": "user",
"content": "List collection name, contract address, token count, and floor price for NFT collections on the Ethereum blockchain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, contract_address, token_count, floor_price FROM nft_collections WHERE blockchain... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte... | [
{
"role": "user",
"content": "List all hashtags created in March 2024 along with their creation timestamps.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT hashtag_id, tag_name, created_at\nFROM social_media.hashtags\nWHERE created_at BETWEEN '2024-03-01 00:00:00' AND '2024-03-31 ... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, first_name ... | [
{
"role": "user",
"content": "Find all guests who live in the same city and list each guest's name along with the name of another guest in that city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g1.first_name || ' ' || g1.last_name AS guest_name,\n g2.first_name || ' ' ||... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "List all insurance products that have a base premium greater than 1000 and are currently active, showing product name, type, and base premium.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.insu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "List the route number, origin city, and destination city for all routes that have bookings associated with them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT r.route_number, l_origin.city AS origin_city, l_dest.city AS destination_city\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.routes ( route_id text, route_number text, description text, origin_l... | [
{
"role": "user",
"content": "List the first and last names of all passengers along with their date of birth.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth\nFROM transportation.passengers;",
"sql": null
},
{
"role": "user",
"c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me all cases along with the names and types of documents associated with them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_id, c.case_number, c.case_name, d.document_name, d.document_type\nFROM legal_services.cases c\nLEFT JOIN legal_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List each property and the number of available rooms. Only include properties with more than 10 available rooms.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, COUNT(r.room_id) AS available_rooms\nFROM hospitality_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 social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show the number of followers for each user who is following others, listing their user_id and follower count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT following_user_id AS user_id, COUNT(follower_user_id) AS follower_count\nFROM social_media.fo... |
You are an expert in writing database language. You can write a corresponding 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": "How many users have disabled push notifications?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS disabled_push_count\nFROM social_media.user_settings\nWHERE push_notifications_enabled = false;",
"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 PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Show me the name of each law firm and the full name of its managing partner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.firm_name, T2.first_name, T2.last_name FROM law_firms AS T1 JOIN lawyers AS T2 ON T1.managing_partner_id = T2.lawyer_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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "Show me the policy number, claim ID, document file name, and document type for all policies that have associated claim documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.policy_number, T2.claim_id, T3.file_name, T3.document_type FROM insura... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character vary... | [
{
"role": "user",
"content": "Show me the total estimated loss per claim status, and for each status, include the most recent claim's incident date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, SUM(estimated_loss) AS total_estimated_loss, MAX(incident_date) AS most_rece... |
You are an expert in writing database language. You can write a corresponding 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": "For each policy, list the policy number and the total amount paid in premium payments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, SUM(pay.amount_paid) AS total_paid\nFROM insurance.policies p\nJOIN insurance.premium_payments pay ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all policy beneficiaries, showing their first name, last name, relationship, percentage share, and the first and last name of the customer associated with the beneficiary record.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.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 text PRIMARY KEY, user_id text, content text, media_url... | [
{
"role": "user",
"content": "Show me all conversations that have more than 10 messages, along with the group name and the usernames of their participants.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id, c.group_name, u.username\nFROM social_media.conversations ... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"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.",
"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 gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, ... | [
{
"role": "user",
"content": "Find all pairs of inventory entries where the same player acquired the same item twice. Show the player_id, item_id, the earlier inventory_id as first_inv, and the later inventory_id as second_inv.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.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 gaming_technology.in_game_items ( item_id uuid, game_id uuid, item_name text, item_t... | [
{
"role": "user",
"content": "Can you show me the number of unique item types and the average cost amount for each game?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT game_id, COUNT(DISTINCT item_type) AS unique_item_types, AVG(cost_amount) AS avg_cost_amount FROM gaming_technol... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the first name and last name of employees who were hired in the year 2023, along with the name of the agency they work for.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, a.agency_name FROM government_services.employee... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.orders ( order_id text, user_id text, wallet_id text, asset_id text... | [
{
"role": "user",
"content": "For each asset, show the total quantity ordered with order status 'completed'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT asset_id, SUM(quantity) AS total_completed_quantity FROM trading_platform.orders WHERE status = 'completed' GROUP BY asset_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 legal_services.cases ( case_id text PRIMARY KEY, case_number text UNIQUE, case_name ... | [
{
"role": "user",
"content": "List all 'Evidence' documents uploaded in the last 30 days, including document_name, case_number, case_name, and upload_timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_name, c.case_number, c.case_name, d.upload_timestamp\nFROM le... |
You are an expert in writing database language. You can write a corresponding 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": "Show all bookings with the booking ID, status, and booking time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT booking_id, status, booking_time FROM transportation.bookings;",
"sql": null
},
{
"role": "user",
"content": "Now, only di... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "Show me all items and the total quantity held by players for each item.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.item_id, SUM(pi.quantity) AS total_quantity\nFROM gaming_technology.player_inventory pi\nGROUP BY pi.item_id;",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_... | [
{
"role": "user",
"content": "How many conversations in total are recorded?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT count(*) FROM conversations;",
"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 PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List the names of all law firms along with the names (first and last) of lawyers who are partners in those firms.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lf.firm_name, l.first_name, l.last_name\nFROM legal_services.law_firms lf\nJOIN legal_ser... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "List projects that have raised funds and also have an associated token, showing their name, fundraising amount, and current token price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.project_name, T1.investment_value, T2.price FROM project_fundra... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "Show me all policies that use insurance products of type 'health', and display the policy_number, start_date, and the product's name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.start_date, ip.product_name\nFROM insurance.polici... |
You are an expert in writing database language. You can write a corresponding 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": "I need a list of all documents associated with claims, showing the document ID, file name, document type, and the status of the claim it belongs to.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n cd.document_id,\n cd.file_name,\n cd.document_typ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Show me the content of comments and the username of the author of the post the comment is on.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.content, T3.username FROM social_media.comments AS T1 JOIN social_media.posts AS T2 ON T1.post_id = T2.pos... |
You are an expert in writing database language. You can write a corresponding 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": "How many available services are there per department for each property? Include property_id, department, and the service count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n property_id,\n department,\n COUNT(*) AS available_services_count\nFRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil... | [
{
"role": "user",
"content": "Which claim ID has the highest number of documents associated with it?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id FROM insurance.claim_documents GROUP BY claim_id ORDER BY COUNT(*) DESC LIMIT 1;",
"sql": null
},
{
"role": "us... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medications ( medication_id character varying(64) NOT NULL, medication_na... | [
{
"role": "user",
"content": "Which medications do not have a generic name listed? Show their medication_id, medication_name, and manufacturer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications WHERE generic_na... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri... | [
{
"role": "user",
"content": "List all trips where the origin location is different from the destination location and show the trip ID, origin location ID, destination location ID, and route ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, origin_location_id, destinati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "Find pairs of wallets that were created at the exact same timestamp but are owned by different users. List the IDs of both wallets and the shared creation timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n w1.wallet_id AS wallet1_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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the names of active services and their categories provided by agencies with a 'Federal' jurisdiction level.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T1.category FROM government_services.services AS T1 JOIN government_servi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.users ( user_id text PRIMARY KEY, username text, email text, password_hash text... | [
{
"role": "user",
"content": "Show all users who registered before 2023-01-01, along with their usernames and registration dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, username, created_at\nFROM web3.users\nWHERE created_at < '2023-01-01';",
"sql": null
},... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "Retrieve the agency name and the most recent notification sent date for each agency, considering only notifications related to agencies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agency_name, MAX(n.sent_at) AS last_notification_date\nFROM gove... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "Show each user's username along with their KYC status and the date of their latest KYC review.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, ka.status, ka.reviewed_at AS latest_review\nFROM trading_platform.users u\nJOIN trading_platform... |
You are an expert in writing database language. You can write a corresponding 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 Avalanche token tick, calculate the total transfer volume and transaction count over the past 7 days using token_activities_avalanche. Include the token tick, total_volume, and tx_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n 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
Index 'aircraft_models'. Mapping: { properties: { model_id: { type: 'keyword' }, model_name: { ty... | [
{
"role": "user",
"content": "Can you help me fetch all inspection records for components associated with a specific aircraft build, along with the component names and inspection results?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.inspection_id, i.build_id, i.component_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 transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time... | [
{
"role": "user",
"content": "Calculate the total quantity and average cost_per_unit for each fuel_type in the fuel_logs table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fuel_type,\n SUM(quantity) AS total_quantity,\n AVG(cost_per_unit) AS avg_cost_per... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "List all DApps along with the number of metadata entries linked to each, even if the DApp has no linked metadata.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name, d.url, COUNT(m.metadata_id) AS metadata_count\nFROM trading_platform.dapps d\nLEF... |
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 detailed repair history for train number T5678?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the detailed repair history for train number T5678 as this information is not available in the current database table. ... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, first_name text, last_nam... | [
{
"role": "user",
"content": "List all guests who have provided a phone number, showing their guest ID and phone number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id, phone_number FROM hospitality_technology.guests WHERE phone_number IS NOT NULL AND phone_number <> '';... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text, claim_id text, document_type text, fil... | [
{
"role": "user",
"content": "I want to find all claim IDs that have both an 'Accident Report' and a 'Police Report' document.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.claim_id\nFROM insurance.claim_documents a\nJOIN insurance.claim_documents b\n ON a.claim_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 insurance.claim_documents ( document_id text, claim_id text, document_type text, fil... | [
{
"role": "user",
"content": "For each claim, retrieve the document_id, file_name, and uploaded_at of the earliest and the latest uploaded document.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c1.claim_id,\n c1.document_id AS earliest_document_id,\n c1.file_name 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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List all time entries, showing the date worked, hours spent, description, the first and last name of the lawyer, and the name of the case.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.date_worked, T1.hours_spent, T1.description, T2.first_name, T... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ... | [
{
"role": "user",
"content": "I need to get a list of all patients who had an appointment in the last 30 days, including patient ID, first and last name, appointment_time, and any associated diagnosis description.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_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 web3.users ( user_id text PRIMARY KEY, username text, email text, password_hash text... | [
{
"role": "user",
"content": "Show the user_id, username, and email for users who registered at the same timestamp as another user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u1.user_id, u1.username, u1.email FROM web3.users u1 JOIN web3.users u2 ON u1.created_at = u2.created... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.