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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "List the first name, last name, prescription ID, diagnosis code, and diagnosis description for patients who have both an ongoing prescription and an active chronic diagnosis.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT 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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "I need a list of unique company names and the number of clients in each company.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT company_name, COUNT(*) AS client_count\nFROM legal_services.clients\nWHERE company_name IS NOT NULL\nGROUP BY company_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 trading_platform.orders ( order_id character varying(64) NOT NULL, user_id character... | [
{
"role": "user",
"content": "I want the number of peers per port, but only ports with more than 5 peers. List port and peer_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT port, COUNT(*) AS peer_count\nFROM trading_platform.peers\nGROUP BY port\nHAVING COUNT(*) > 5;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me all in-progress trips with their current locations (origin_location_id) and destinations, along with the scheduled vs actual departure time difference in minutes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, origin_location_id, des... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id charact... | [
{
"role": "user",
"content": "List all peers with their IP addresses who have not been seen in the last 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT peer_id, ip_address, port, last_seen\nFROM trading_platform.peers\nWHERE last_seen < NOW() - INTERVAL '7 days';",
"sq... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Show me the first and last names of citizens along with their dates of birth and contact emails for all citizens who registered after January 1, 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth, contact_email ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_us... | [
{
"role": "user",
"content": "How many messages in total have been sent that do not contain any media attachment?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS non_media_message_count\nFROM social_media.messages\nWHERE media_url IS NULL OR media_url = '';",
"sql"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "Show a list of diagnoses along with the chief complaint noted in the corresponding medical record. Display diagnosis description, diagnosis date, and the chief complaint.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.description, T1.diagnosis_dat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.logs ( log_id character varying(64) NOT NULL, user_id character var... | [
{
"role": "user",
"content": "Show the earliest and latest timestamp recorded in the logs table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT MIN(logged_at), MAX(logged_at) FROM trading_platform.logs;",
"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 blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character vary... | [
{
"role": "user",
"content": "List each port along with the count of distinct IP addresses observed on that port.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT port, COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes GROUP BY port;",
"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.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "Give me a list of employees (first and last name) along with the count of appointments they have scheduled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(a.appointment_id) AS appointment_count\nFROM 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 token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var... | [
{
"role": "user",
"content": "Show me the top 3 tokens by trend rank in the 'NFT' narrative, along with their price and 24-hour trading volume.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE narrative = '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
// PUT /schedules
{
"mappings": {
"properties": {
"schedule_id": { "type": "keyword" ... | [
{
"role": "user",
"content": "能否帮我查询特定路线(route_id 为 'RT001')的所有行程信息,并关联到乘客的联系方式?",
"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.last_name, p.phone_number, 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 insurance.insurance_products (
product_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "List all insurance products with a base premium greater than 1000 and less than 5000. Show the product name, product type, and base premium.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, base_premium FROM insurance.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 blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text... | [
{
"role": "user",
"content": "List all users whose password hash contains the substring 'abc'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, username, password_hash FROM blockchain.users WHERE password_hash LIKE '%abc%';",
"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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "How many patients have at least one medical record associated with them?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT patient_id) FROM healthcare.medical_records;",
"sql": null
},
{
"role": "user",
"content": "Now, ca... |
You are an expert in writing database language. You can write a corresponding 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.reviews ( review_id character varying(64) NOT NULL, property_... | [
{
"role": "user",
"content": "Show me the review_id, review_date, and comment for all non-public reviews along with the guest's first and last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.review_date, r.comment, g.first_name, g.last_name\nFROM hospitality_t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id text, case_number text, case_name text, client_id tex... | [
{
"role": "user",
"content": "List the appointment ID, start time, and the case number for all appointments that are linked to a case.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.appointment_id, T1.start_time, T2.case_number FROM legal_services.appointments AS T1 JOIN legal... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "For each employee, show their first and last name and the number of documents they have verified.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(d.document_id) AS verified_documents_count\nFROM government_services.emp... |
You are an expert in writing database language. You can write a corresponding 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, description, and the name of both the origin and destination locations for all routes where the origin and destination are in different countries.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number, r.description, l1... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id text, first_name text, last_name text, bar_number... | [
{
"role": "user",
"content": "List all lawyers along with the full name of another lawyer from the same firm.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.lawyer_id,\n CONCAT(a.first_name, ' ', a.last_name) AS full_name,\n CONCAT(b.first_name, ' ', b.last_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 hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "Show me staff members who were hired after the property they work at was created. List their first name, last name, hire date, the property name, and the property creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_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.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "Show me all active electric vehicles along with their make, model, and license plate, ordered by acquisition date with the newest first.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, make, model, license_plate, acquisition_date FROM tran... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, user_id character varying(6... | [
{
"role": "user",
"content": "For each user, can you list all their wallet addresses and the creation timestamps of those wallets?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, address, created_at FROM web3.wallets ORDER BY user_id, created_at;",
"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 text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE status = 'expired' AND end_dat... |
You are an expert in writing database language. You can write a corresponding 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": "Show me all customers whose last name starts with 'M' and who were created in the system after July 1, 2022.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, first_name, last_name, email, created_at\nFROM insurance.customers\nWHERE last_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 hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_i... | [
{
"role": "user",
"content": "Show me each guest's reservation count and average stay length in days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id,\n COUNT(*) AS reservation_count,\n AVG(check_out_date - check_in_date) AS avg_stay_days\nFROM hospitality_tec... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_t... | [
{
"role": "user",
"content": "Find pairs of items from the same game, where one item is of type 'Weapon' and the other is of type 'Consumable'. List the game ID, the name of the weapon, and the name of the consumable.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i1.game_id, i1.... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What are the personal contact details of the staff member associated with staff_id 'STAFF789' who worked on a specific maintenance record?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide personal contact details of staff member... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, docum... | [
{
"role": "user",
"content": "Show me the document name, upload timestamp, time entry date worked, and hours spent for all entries related to case 'CASE_XYZ'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.document_name , T1.upload_timestamp , T2.date_worked , T2.hours_spen... |
You are an expert in writing database language. You can write a corresponding 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.follows ( follow_id text, follower_user_id text, following_user_id text... | [
{
"role": "user",
"content": "How many users does each user follow? Show the follower user ID and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT follower_user_id, count(*) FROM social_media.follows GROUP BY follower_user_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 gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"role": "user",
"content": "List all game titles and corresponding server names for servers that are located in the same region as 'us-central-1'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, s.server_name\nFROM gaming_technology.servers s\nJOIN gaming_technology.gam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List the usernames and registration dates for all players from Germany ('DE') who are currently 'online'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, registration_date FROM gaming_technology.players WHERE country_code = 'DE' AND status =... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the full names and contact emails of citizens who have received notifications via 'SMS'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name, c.last_name, c.contact_email\nFROM government_services.citizens c\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 healthcare.prescriptions ( prescription_id text PRIMARY KEY, record_id text, patient... | [
{
"role": "user",
"content": "Find pairs of prescriptions issued to the same patient but for different medications, issued on the same date. Show the patient ID, the prescription IDs of the two prescriptions, and their medication IDs and prescription dates.",
"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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "I'd like to see, for each month, the total number of players who registered and how many of them are active versus inactive.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', registration_date) AS month,\n COUNT(*) AS total_reg... |
You are an expert in writing database language. You can write a corresponding 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 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 maintenance schedule for the platforms at the station with ID 'ST234' for the next month?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the maintenance schedule for the platforms at any station. The data I ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), g... | [
{
"role": "user",
"content": "Can you list all item names along with their type, rarity, and cost amount for every item in the database?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_name, item_type, rarity, cost_amount FROM gaming_technology.in_game_items;",
"sql": 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 text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me the usernames and email addresses of all users who are participants in conversations where user 'U333' has sent at least one message.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, u.email\nFROM social_media.conversation_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List all guests currently checked in, showing their full name, room number, property name, and check-in date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.first_name || ' ' || g.last_name AS guest_name,\n r.room_number,\n p.property_n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "Could you list all agencies along with the name of their parent agency?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT child.agency_name AS agency_name, parent.agency_name AS parent_agency_name FROM government_services.agencies AS child LEFT JOIN gov... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE manufacturing.components (
component_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "我想查询某个特定组件ID的详细信息,包括组件名称、材料名称、材料密度以及供应商ID,同时还需要知道该组件在哪个装配线上的飞机型号ID。",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.component_id, c.component_name, m.material_name, m.density_kg_m3, c.supplier_id, al.aircraft_model_id\nFROM manufacturing.components ... |
You are an expert in writing database language. You can write a corresponding 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": "For each user, show their username and how many unique conversations they have sent at least one message in where the conversation is a group chat.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(DISTINCT m.conversation_id) AS group_... |
You are an expert in writing database language. You can write a corresponding 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": "List all employees hired in 2023 along with their job title and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT employee_id, first_name, last_name, job_title, email\nFROM financial_services.employees\nWHERE EXTRACT(YEAR FROM hire_date) = 2023;"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "Show the usernames of users who have followers and the total count of followers for each.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, COUNT(T2.follower_user_id) AS follower_count FROM social_media.users AS T1 JOIN social_media.follows... |
You are an expert in writing database language. You can write a corresponding 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": "Which fundraising projects in 2023 have an associated token, and what are their investment amounts, chain, and token narratives?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.project_name, p.investment_value, t.chain, t.narrative\nFROM project_fun... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "List all orders, showing order ID, type, quantity, and price, that were placed using a wallet created after '2024-01-01'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.order_id, T1.order_type, T1.quantity, T1.price FROM orders AS T1 JOIN wallets ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Can you show me all pairs of trips that use the same vehicle but have different drivers? Please include both trip IDs, vehicle_id, and the driver_id for each trip.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.trip_id AS trip_id_1, t2.trip_id AS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Can you give me a count of players for each player status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(player_id) FROM gaming_technology.players GROUP BY status;",
"sql": null
},
{
"role": "user",
"content": "Now, 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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_nam... | [
{
"role": "user",
"content": "Show me the number of service orders placed for each service category.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.category, COUNT(so.order_id) AS order_count\nFROM hospitality_technology.service_orders so\nJOIN hospitality_technology.services 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.user_settings ( setting_id.text, user_id.text, theme.text, email_notifi... | [
{
"role": "user",
"content": "Count the total number of users who have enabled email notifications but disabled push notifications.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.user_settings WHERE email_notifications_enabled = TRUE AND push_notificati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.transactions ( transaction_id text, from_address text, to_address text, value n... | [
{
"role": "user",
"content": "For each transaction, find the next transaction initiated by the same sender. List the original transaction_id, the next transaction_id, the sender address, and the time difference in hours between them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.service_locations ( location_id text, agency_id text, location_n... | [
{
"role": "user",
"content": "Find the service locations that are not accessible and located in the state of 'California'. List their name, address, and city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT location_name , address , city FROM government_services.service_location... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character vary... | [
{
"role": "user",
"content": "List all claim IDs, policy IDs, and incident dates for claims reported after February 1st, 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id, policy_id, incident_date\nFROM insurance.claims\nWHERE reported_date > '2024-02-01';",
"sql"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "List pairs of token transfers within the same transaction and for the same token_id where the transfer values are different. Show the transaction ID, token ID, and both transfer IDs and their values.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me the total hours and total billed amount for each lawyer and each case, including the lawyer_id and case_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lawyer_id, case_id, SUM(hours_spent) AS total_hours, SUM(hours_spent * billing_rate) 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.appointments ( appointment_id text, client_id text, lawyer_id text, c... | [
{
"role": "user",
"content": "Show me all appointments with their subjects and the names of the lawyers who handled them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.subject, l.first_name, l.last_name\nFROM legal_services.appointments a\nJOIN legal_services... |
You are an expert in writing database language. You can write a corresponding 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 financial_services.securities ( security_id text PRIMARY KEY, ticker_symbol text, is... | [
{
"role": "user",
"content": "List all securities issued by 'Morgan Stanley' along with their ticker_symbol, security_name, and exchange. Then also show the sector for each.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ticker_symbol, security_name, exchange, sector FROM financi... |
You are an expert in writing database language. You can write a corresponding 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.loans ( loan_id text, account_id text, loan_type text, principal_... | [
{
"role": "user",
"content": "What is the average interest rate for auto loans (loan_type = 'Auto') with a principal amount between $20,000 and $50,000?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(interest_rate) AS avg_interest_rate FROM financial_services.loans WHERE loan... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Show me the usernames and registration dates for players who registered between '2023-01-01' and '2023-12-31'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, registration_date FROM gaming_technology.players WHERE registration_date >= '2023-... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations (
location_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Which locations lack a postal code? For each, display the name, type, city, and state_province.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, type, city, state_province\nFROM transportation.locations\nWHERE postal_code IS NULL;",
"sql": nu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "List the names and prices of all services available in the 'Food & Beverage' department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_name, price\nFROM hospitality_technology.services\nWHERE department = 'Food & Beverage' AND is_available =... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "Find pairs of servers that are currently 'online' and share the same game_id, listing their server names and the shared game_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1_name, s2.server_name AS server2_name, s1.game_id... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "List all transactions along with the user ID and username of the sender, if available. Show transaction id, from_address, user id, and username.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tx.transaction_id, tx.from_address, w.user_id, u.username\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp... | [
{
"role": "user",
"content": "What is the total market cap for all tokens listed on the 'Polygon' chain?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(market_cap) FROM token_dexpool_info WHERE chain = 'Polygon';",
"sql": null
},
{
"role": "user",
"content": "... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "Show me all trades where the traded quantity is less than 2, including the trade_id, quantity, and the buyer and seller IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trade_id, quantity, buyer_id, seller_id\nFROM trading_platform.trades\nWHERE q... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a... | [
{
"role": "user",
"content": "Find token transfers that correspond directly to an event log (same transaction and log index). List the transfer ID, value, and the event name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.transfer_id, T1.value, T2.event_name FROM web3.token_tr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List each asset's name and symbol along with the total number of open orders for that asset.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.name,\n a.symbol,\n COUNT(o.order_id) AS open_order_count\nFROM trading_platform.assets a\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 healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "Show me prescriptions with a route of 'Intravenous' and a frequency of 'Once Daily'. I need the prescription ID, medication ID, route, and frequency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT prescription_id , medication_id , route , frequenc... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, ... | [
{
"role": "user",
"content": "List all insurance providers along with the total number of plans they offer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT insurance_provider, COUNT(*) AS plan_count\nFROM healthcare.insurance_plans\nGROUP BY insurance_provider;",
"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 character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show each insurance plan name along with the number of doctors whose phone number matches the plan's contact_phone.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.plan_name, COUNT(d.doctor_id) AS matching_doctors\nFROM healthcare.insurance_plans 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show the contract address, symbol, and current total supply for all Avalanche tokens from token_balances_avalanche.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tick AS contract_address, tick AS symbol, SUM(total_supply) AS current_total_supply\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 gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), g... | [
{
"role": "user",
"content": "Provide each game_id with the item_name of its cheapest item and its most expensive item.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT min_items.game_id,\n min_items.item_name AS cheapest_item,\n max_items.item_name AS most_expensive_it... |
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 purchase price of the components in a specific batch with batch_number 'BATCH123'?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the purchase price of components as this data is not stored in the co... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.service_locations (
location_id character varying(64) NOT NU... | [
{
"role": "user",
"content": "Find all service locations whose postal code starts with '75' and display their names, cities, and operating hours, including the agency ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT location_name, city, operating_hours, agency_id FROM governmen... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the average smart money ROI and the total PNL for each narrative category, based on the `smart_money_token_performance` and `token_basic_info` tables.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tbi.narrative, AVG(smp.roi) AS average_roi, ... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Show me the total balance for each SUI coin type for coins with status 'exists'. Include the coin type and the sum of balances.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT coin_type, SUM(CAST(balance AS DECIMAL)) AS total_balance FROM sui_coins WH... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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 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 hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, emai... | [
{
"role": "user",
"content": "List the first and last names of guests residing in California who are loyalty members.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name FROM hospitality_technology.guests WHERE state_province = 'California' AND loyalty_member_id ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Find all pairs of origin and destination cities, along with their route_number and distance, where the estimated duration is less than 90 minutes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT route_number, origin_location_id, destination_location_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 erc20_balances_historical ( block_number bigint NOT NULL, contract_address varchar N... | [
{
"role": "user",
"content": "Show ERC20 tokens with total supply greater than 100,000,000, displaying symbol, name, contract address, and total supply from the token_metas table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT symbol, name, contract_address, total_supply FROM tok... |
You are an expert in writing database language. You can write a corresponding 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": "Could you list projects that have completed more than one fundraising round, showing the project name and the number of rounds?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, COUNT(*) AS round_count FROM project_fundraising_record GROUP... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve each customer_id, first_name, last_name, and close_price for market_data entries that occurred on the day of their account creation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name, c.last_name, md.close_price FROM... |
You are an expert in writing database language. You can write a corresponding 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 the total number of customers in each state.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n state,\n COUNT(customer_id)\nFROM insurance.customers\nGROUP BY\n state;",
"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.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t... | [
{
"role": "user",
"content": "I need a list showing each patient along with their current primary insurance policy number and their immediately previous primary policy number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ci.patient_id,\n ci.policy_number AS current_policy... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.services ( service_id.text, agency_id.text, service_name.text, d... | [
{
"role": "user",
"content": "Can you show me a list of all active services along with their agency IDs and categories?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_id, agency_id, service_name, category FROM government_services.services WHERE is_active = TRUE;",
"sq... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "How many games are available on each platform?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT platform, COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY platform;",
"sql": null
},
{
"role": "user",
"content": "Exclude 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 government_services.applications ( application_id text, citizen_id text, service_id ... | [
{
"role": "user",
"content": "Show the count of applications submitted per day for the last 7 days. Include the date and application_count, ordered by date ascending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT CAST(submitted_at AS date) AS date,\n COUNT(*) AS applicatio... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "Show me all drivers hired in 2023, including their full name and email address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM transportation.drivers WHERE hire_date >= '2023-01-01' AND hire_date < '2024-01-01';",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "Show me all reservations with their reservation_id, room_number, room status, and check_in_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id,\n rm.room_number,\n rm.status AS room_status,\n r.check_in_date\nFROM ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.achievements (
achievement_id uuid NOT NULL DEFAULT gen_random... | [
{
"role": "user",
"content": "Show me the count of achievements that are hidden versus those that are not hidden.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT hidden, COUNT(*) FROM achievements GROUP BY hidden;",
"sql": null
},
{
"role": "user",
"content": "Incl... |
You are an expert in writing database language. You can write a corresponding 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": "Which properties offer services in the 'Business Center' department, and what are the names and prices of those services?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, s.service_name, s.price\nFROM hospitality_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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Could you provide the firm_id, firm_name, total number of lawyers, and number of partners per firm?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lf.firm_id,\n lf.firm_name,\n COUNT(lw.lawyer_id) AS total_lawyers,\n SUM(CASE WHEN l... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the number of applications submitted by each citizen.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.citizen_id, c.first_name, c.last_name, COUNT(a.application_id) AS application_count\nFROM government_services.citizens c\nLEFT JOIN 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 government_services.agencies (
agency_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Show me all document types that have been submitted by citizens to agencies with a jurisdiction level of 'Federal'. Also include the name of the agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT d.document_type, a.agency_name\nFROM gove... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.