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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "List all claim documents along with the beneficiary first and last names and their relationship for policies where a document of type 'MEDICAL_REPORT' exists.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cd.document_id, cd.claim_id, cd.file_name, 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.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "List the case number, case name, and the full name of the client for cases that have uploaded documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.case_number , T1.case_name , T2.full_name FROM legal_services.cases AS T1 JOIN 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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash... | [
{
"role": "user",
"content": "For each player, show their player_id and the number of unique games they have played sessions on.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, COUNT(DISTINCT game_id) AS unique_games\nFROM gaming_technology.game_sessions\nGROUP BY playe... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "List the latest version of each document (identified by case_id and document_name), showing the version number and its upload_timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.case_id,\n d.document_name,\n d.version AS latest_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Display all invoices along with the associated case name and the full name of the client.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, cs.case_name, c.first_name || ' ' || c.last_name AS client_full_name\nFROM legal_services.invoi... |
You are an expert in writing database language. You can write a corresponding 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": "Find reservations where the same guest has overlapping stays in the same property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id AS res1,\n r2.reservation_id AS res2,\n r1.guest_id,\n r1.property_id\nFROM hospital... |
You are an expert in writing database language. You can write a corresponding 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 hospitality_technology.reviews (
review_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "For each review, show me the comment, the review date, and the full name of the staff member who responded to the review, if there is a response.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.comment, r.review_date, s.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 policy_number, customer_id, and product_name for policies that are currently active.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.customer_id, ip.product_name\nFROM insurance.policies p\nJOIN insurance.insurance_products ip ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "Which games have at least one achievement worth exactly 75 points, and what are the names and descriptions of those achievements?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, a.name AS achievement_name, a.description\nFROM gaming_technolog... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List all pairs of patients who have the same emergency contact name and phone number. Show the IDs and full names of both patients and the shared emergency contact details (name and phone).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "List each client's first and last name along with the number of cases they have, alias the count as case_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cl.first_name, cl.last_name, COUNT(c.case_id) AS case_count\nFROM legal_services.clients cl... |
You are an expert in writing database language. You can write a corresponding 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": "List each document_name along with the count of its versions, but only include those document_names that have more than 3 versions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name,\n COUNT(version) AS version_count\nFROM legal_serv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.diagnoses (
diagnosis_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List the patient ID and subscriber name for all patients who have both at least one diagnosis recorded and at least one primary insurance policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT pi.patient_id, pi.subscriber_name FROM healthcar... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the names of all properties that have listed room types, along with the name of each room type available at that property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.property_name, t2.type_name FROM hospitality_technology.properties 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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List all passengers who have never made a booking, showing their passenger_id, first_name, last_name, and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n p.passenger_id,\n p.first_name,\n p.last_name,\n p.email\nFROM transportatio... |
You are an expert in writing database language. You can write a corresponding 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": "Show the content of comments and the content of the posts they belong to, for comments made by users whose location is 'New York'. Also include the username of the commenter.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.content AS comment_content... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Show the names of all services and the names of their corresponding agencies that are offered at accessible locations in 'Chicago'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_name, sl.agency_id \nFROM government_services.service_locatio... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "Show me the count of law firms grouped by the year they were founded. Include the founding year and the number of firms.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n EXTRACT(YEAR FROM founded_date) AS founding_year,\n COUNT(firm_id) AS firm_cou... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.messages (
message_id character varying(64) NOT NULL, -- unique ide... | [
{
"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 T1.username , COUNT(DISTINCT T2.conversation_id) 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 social_media.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name characte... | [
{
"role": "user",
"content": "List all pairs of hashtags that were created on the same date. Show both tag names and the creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.tag_name AS tag1, b.tag_name AS tag2, a.created_at::date AS created_date\nFROM social_media.has... |
You are an expert in writing database language. You can write a corresponding 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 along with the date and amount of their most recent premium payment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.policy_number, pp.payment_date AS most_recent_payment_date, pp.amount_paid AS most_recent_payment_... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "What is the average processing time in days for active services?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(average_processing_time_days) FROM government_services.services WHERE is_active = TRUE",
"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 financial_services.market_data (
data_point_id bigserial NOT NULL, -- auto-incre... | [
{
"role": "user",
"content": "For each security exchange, what is the average daily high price and the total volume recorded in market data for securities listed on that exchange over the past 6 months? Include the exchange name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T2.... |
You are an expert in writing database language. You can write a corresponding 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 all posts created between '2024-03-01' and '2024-03-31', show the post_id, content, and the author's full_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.content, u.full_name\nFROM social_media.posts p\nJOIN social_media.users u... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List all active staff members who are managers, along with their hire dates and email addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT staff_id, first_name, last_name, position, work_email, hire_date FROM hospitality_technology.staff WHERE 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 financial_services.loans ( loan_id.text, account_id.text, loan_type.text, principal_... | [
{
"role": "user",
"content": "Show me the total principal amount for each loan type, along with the count of loans and average monthly payment, but only for loans originated in the last 5 years.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loan_type, SUM(principal_amount) AS to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "Show the number of claims filed for each distinct status, ordered by the count in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS claim_count\nFROM insurance.claims\nGROUP BY status\nORDER BY claim_count DESC;",
... |
You are an expert in writing database language. You can write a corresponding 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": "Which games have the highest average item cost for Legendary rarity items? Please show the game title, genre, and the average cost of those items.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, g.genre, AVG(igi.cost_amount) AS avg_legendary_... |
You are an expert in writing database language. You can write a corresponding 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 text, tag_name text, created_at timestamp )
| [
{
"role": "user",
"content": "List the tag names and creation dates for all hashtags created on June 12, 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tag_name, created_at FROM social_media.hashtags WHERE created_at::date = '2024-06-12';",
"sql": null
},
{
"rol... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Show the first name, last name, and email for all guests created in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM guests WHERE created_at >= '2023-01-01' AND created_at < '2024-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 transportation.locations ( location_id.text, name.text, type.text, address_line1.tex... | [
{
"role": "user",
"content": "How many locations are there in each city?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n city,\n COUNT(*)\nFROM transportation.locations\nGROUP BY\n city;",
"sql": null
},
{
"role": "user",
"content": "Filter this to only includ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Show all pairs of players who share the same email domain. Return player1, player2, and the domain.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.username AS player1,\n p2.username AS player2,\n SPLIT_PART(p1.email, '@', 2) AS domain\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Give me a list of all specializations available at each law firm.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT firm_id, specialization\nFROM legal_services.lawyers;",
"sql": null
},
{
"role": "user",
"content": "For each sp... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE manufacturing.components (
component_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "我想了解某个组件的库存情况,包括库存数量、仓库位置和接收日期。",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ci.quantity, ci.location_warehouse, ci.received_date\nFROM manufacturing.component_inventory ci\nWHERE ci.component_id = 'specific_component_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 insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "List policy pairs for the same customer where one policy was cancelled and another active policy started within 30 days after the cancellation. Show customer_id, cancelled policy_number, cancellation_date, active policy_number, start_date.",
"sql": null
},
{
"role":... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve each gender and the count of verified citizens born before 1990.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT gender,\n COUNT(*) AS citizen_count\nFROM government_services.citizens\nWHERE is_verified = TRUE\n AND date_of_birth < '19... |
You are an expert in writing database language. You can write a corresponding 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": "List all distinct plan types available in the insurance_plans table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT plan_type FROM healthcare.insurance_plans;",
"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": "List the name of each agency and the number of appointments associated with services from that agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.agency_name, COUNT(T2.appointment_id) FROM agencies AS T1 JOIN appointments AS T2 ON T1.agency_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 financial_services.securities ( security_id character varying(64) NOT NULL, ticker_s... | [
{
"role": "user",
"content": "List all securities (security_id, ticker_symbol, issuer_name) where the currency is 'EUR' and the security_type is 'Equity', along with their exchange information.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, issuer_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 transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Show the booking ID and seat number for all bookings that have a fare equal to 50.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT booking_id, seat_number\nFROM transportation.bookings\nWHERE fare = 50;",
"sql": null
},
{
"role": "user",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms (
firm_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all law firms that have not provided a website.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_id, firm_name FROM legal_services.law_firms WHERE website IS NULL;",
"sql": null
},
{
"role": "user",
"content": "Please include ... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the case number, client ID, and total amount for each case that has at least one invoice.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number, c.client_id, SUM(i.total_amount) AS total_invoice_amount\nFROM legal_services.cases c\nJOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Which lawyers have not yet been assigned to any appointments? Show their first name, last name, and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, l.email\nFROM legal_services.lawyers l\nLEFT JOIN legal_services.appo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id text, first_name text, last_name text, bar_number... | [
{
"role": "user",
"content": "Show me each lawyer along with the names of documents they have uploaded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name || ' ' || l.last_name AS lawyer_name,\n d.document_name\nFROM legal_services.lawyers l\nLEFT JOIN legal_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 legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case... | [
{
"role": "user",
"content": "List all invoices where the amount paid is less than the total amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_number, client_id, total_amount, amount_paid, status FROM legal_services.invoices WHERE amount_paid < total_amount",
"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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ... | [
{
"role": "user",
"content": "Which insurance products have 'comprehensive' in their coverage details? Show the product_id and product_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name FROM insurance.insurance_products WHERE coverage_details ILIKE '%co... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "List the first name, last name, and specialty for all doctors whose last name begins with the letter 'M'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, specialty FROM healthcare.doctors WHERE last_name LIKE 'M%';",
"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.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List the full names and dates of birth of all patients whose emergency contact phone matches the phone number of any doctor.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.first_name, p.last_name, p.date_of_birth\nFROM healthcare.patients ... |
You are an expert in writing database language. You can write a corresponding 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": "Show for each player the total score achieved in sessions on each server, and the number of sessions per server.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, server_id, SUM(score) AS total_score, COUNT(*) AS session_count\nFROM gaming_te... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "How many posts are marked with 'unlisted' visibility?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.posts WHERE visibility = 'unlisted';",
"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 smart_money_token_performance ( token_address character varying(100) NOT NULL, -- th... | [
{
"role": "user",
"content": "What is the average ROI for tokens with a realized ratio above 50% across all chains?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(roi) AS average_roi FROM smart_money_token_performance WHERE realized_ratio > 50;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, route_id character va... | [
{
"role": "user",
"content": "Show me the total number of passengers transported by each vehicle in the last week, along with the vehicle ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, SUM(passenger_count) AS total_passengers FROM transportation.trips WHERE 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 financial_services.securities ( security_id text, ticker_symbol text, isin_code text... | [
{
"role": "user",
"content": "List every employee and the total number of trades executed for securities where the security sector matches the employee department. Show the employee full name, department, and total_trade_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.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 web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char... | [
{
"role": "user",
"content": "Find all transactions where the from_address is the same as the to_address, indicating self-transactions, and show the transaction_id, value, and gas_used.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, value, gas_used FROM web3.trans... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id.text, customer_id.text, account_number.text... | [
{
"role": "user",
"content": "List each security’s ticker symbol and the total number of trades executed for it, along with the sum of quantities traded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, COUNT(t.trade_id) AS total_trades, SUM(t.quantity) AS total_qu... |
You are an expert in writing database language. You can write a corresponding 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": "List the license number and specialty for all doctors who have a phone number on record.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT license_number, specialty FROM healthcare.doctors WHERE phone_number IS NOT NULL;",
"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.appointments ( appointment_id character varying(64) NOT NULL, client_... | [
{
"role": "user",
"content": "Show me the subject and start times of all appointments along with the corresponding lawyer IDs for each client.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT client_id, lawyer_id, subject, start_time FROM legal_services.appointments;",
"sql": n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List the first name, last name, email, and the name of the law firm for all lawyers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , T1.email , T2.firm_name FROM legal_services.lawyers AS T1 JOIN law_firms AS T2 ON T1... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.notifications ( notification_id.text, citizen_id.text, applicati... | [
{
"role": "user",
"content": "For each citizen, find the timestamp of their first 'SMS' notification and their first 'Email' notification. Show citizen_id, first_sms_at, and first_email_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT citizen_id,\n MIN(sent_at) FILTER (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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "Show me all player usernames and their country code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, country_code FROM gaming_technology.players;",
"sql": null
},
{
"role": "user",
"content": "Now, only include players whose ... |
You are an expert in writing database language. You can write a corresponding 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": "For each fundraising round, what is the average valuation of the participating projects? Show the round name and the average valuation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rounds_name, AVG(valuation) AS avg_valuation FROM project_fundraisi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "Which tokens on BSC and Polygon have a ROI higher than 2 this year? Show their symbols, ROI, and average cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, roi, avg_cost, chain FROM smart_money_token_performance WHERE (chain = 'BSC' 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.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all reservations made by guests from the 'CAN' country code. Include the reservation ID, guest's first name, last name, and the guest's country code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.reservation_id, T2.first_name, T2.last_name, ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "List each doctor's full name and the total number of medical records they have created.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, COUNT(T2.record_id) FROM healthcare.doctors AS T1 JOIN healthcare.medical_records 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 healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "List each patient's active insurance policy and the number of prescriptions they have during that policy. Show patient_id, plan_id, policy_number, and prescription_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.patient_id, pi.plan_id, pi.po... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, ... | [
{
"role": "user",
"content": "Please provide the passenger_id, first_name, last_name, booking_id, and booking_time for all bookings where seat_number is 'A1'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.passenger_id, p.first_name, p.last_name, b.booking_id, b.booking_time\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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "For each document_name in each case, retrieve the latest version number and its document_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_id,\n document_name,\n MAX(version) AS latest_version\nFROM legal_services.documents\nGROUP B... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Show the subject and start time of appointments, along with the full name of the lawyer assigned to each appointment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.subject, T1.start_time, T2.first_name, T2.last_name FROM legal_services.appointmen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// Use Hashes for platform details. Key format: platform:<platform_id>
// HSET platform:plat_123 ... | [
{
"role": "user",
"content": "Can you provide the total number of cars associated with a specific train with train_id 'train_789'?",
"sql": null
},
{
"role": "assistant",
"content": "SCARD train:train_789:cars",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a... | [
{
"role": "user",
"content": "For each contract, can you list the token symbols and total supply of all tokens created by that contract, along with the contract's current status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.contract_id, c.address AS contract_address, c.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 hospitality_technology.services ( service_id text, property_id text, service_name te... | [
{
"role": "user",
"content": "Can you give me the number of available services and their average price for each department?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS available_services_count, AVG(price) AS average_price\nFROM hospitality_technology.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 blockchain.wallets ( wallet_id character varying(64) NOT NULL, user_id character var... | [
{
"role": "user",
"content": "I want to find all pairs of wallets that belong to the same user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet1, w2.wallet_id AS wallet2, w1.user_id\nFROM blockchain.wallets w1\nJOIN blockchain.wallets w2\n ON w1.user_id = w... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "List the name and location ID for all locations where the postal code is missing.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, location_id FROM transportation.locations WHERE postal_code IS NULL;",
"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 hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "Get a list of all guests who have at least one review for a property with a star_rating greater than 4. Include the guest's full name, email, property_name, and review_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, g.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "Show me the claim ID, status, and the policy number for all claims with an estimated loss greater than 5000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.claim_id, T1.status, T2.policy_number FROM insurance.claims AS T1 JOIN insurance.policies 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.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Find all pairs of citizens who share the same first name and gender but have different last names. Display the shared first name, gender, the full name of the first citizen in the pair, and the full name of the second citizen.",
"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 transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me all bookings with the passenger's full name and the booking status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name || ' ' || p.last_name AS passenger_full_name, b.status\nFROM transportation.bookings b\nJOIN transpo... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, plan_name chara... | [
{
"role": "user",
"content": "List the plan ID, plan name, and insurance provider for all plans whose plan type is 'EPO' and have a contact phone number specified.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT plan_id, plan_name, insurance_provider FROM healthcare.insurance_plan... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL, -- Block number contain... | [
{
"role": "user",
"content": "I want to find the top 5 wallets by USD value of their ERC20 holdings. Show wallet_address, token symbol, and USD value based on the latest price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.wallet_address, p.symbol, SUM(CAST(b.amount AS numeric... |
You are an expert in writing database language. You can write a corresponding 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": "Get the property name, room type name, base rate, and star rating for all room types with a base_rate above 200 in properties located in the USA, sorted by base_rate in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_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
Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id... | [
{
"role": "user",
"content": "我想查询某个构建ID下的所有检查记录,包括检查类型、检查结果和检查时间,同时关联到对应的步骤信息。",
"sql": null
},
{
"role": "assistant",
"content": "db.inspections.aggregate([\n {\n $match: {\n build_id: 'specific_build_id'\n }\n },\n {\n $lookup: {\n from: 'steps',\n localField: '... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "How many items in total has each player acquired according to player_inventory?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n player_id,\n SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player_id;",
"sql":... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexp... | [
{
"role": "user",
"content": "Find tokens on the 'Ethereum' chain with a 6-hour price increase above 5%, and include their net_flow and roi from smart money performance.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.token_symbol, d.chain, d.price_change_percentage_6h, p.net_fl... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "List all locations that serve as either an origin or a destination in any route, including the location name, city, number of routes starting there (origin_count), and number of routes ending there (destination_count).",
"sql": null
},
{
"role": "assistant",
"co... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments (
appointment_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "List all appointments with a non-empty notes field. Return appointment_id, appointment_time, and doctor_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, appointment_time, doctor_id\nFROM healthcare.appointments\nWHERE notes IS NOT N... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "For each ERC1155 NFT contract on Ethereum, show the contract address, token_id, and the total amount held across all wallets.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nh.contract_address, nh.token_id, SUM(CAST(nh.amount AS NUMERIC)) AS total_am... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "Show me the number of notifications sent by each sender in March 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sender_user_id, COUNT(notification_id) AS notification_count\nFROM social_media.notifications\nWHERE created_at >= '2024-03-01'::tim... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "Give me the max supply, creator, and current supply for all Avalanche tokens by their tick.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tia.tick, tia.max_supply, tia.creator, tb.total_supply\nFROM token_info_avalanche tia\nLEFT JOIN token_balances... |
You are an expert in writing database language. You can write a corresponding 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 all servers, showing their name, region, and current number of players.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_name, region, current_players FROM gaming_technology.servers;",
"sql": null
},
{
"role": "user",
"conte... |
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 average delay time for trains departing from platform 4 at station LMN during the past year?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on train delay times as this data is not stored in the platfor... |
You are an expert in writing database language. You can write a corresponding 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": "For every customer, show their first name, last name, and the policy number of any policies they own.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.policy_number FROM insurance.customers AS T1 JOIN insurance.policies ... |
You are an expert in writing database language. You can write a corresponding 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 claims along with the corresponding policy number and the full names of all beneficiaries associated with each policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.policy_id, p.policy_number, b.first_name || ' ' || b.last_nam... |
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 current number of passengers waiting at platform 2B at station ABC?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the current number of passengers at a specific platform. The data in the platforms t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "For each reservation, show the guest's full name, the room number booked, and the status of that room.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS guest_full_name, rm.room_number, rm.status 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 healthcare.medications (
medication_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "List the names of manufacturers that produce at least one medication with a description and at least one medication without a description.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT manufacturer FROM healthcare.medications m1 WHERE manuf... |
You are an expert in writing database language. You can write a corresponding 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": "List all prescriptions with the corresponding patient's emergency contact name and phone number. Show prescription ID, patient full name, emergency contact name, and emergency contact phone.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pr.prescript... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id... | [
{
"role": "user",
"content": "How many appointments have a status of 'Cancelled' for each service?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_id, COUNT(*) AS cancelled_appointments FROM government_services.appointments WHERE status = 'Cancelled' GROUP BY service_id;",... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id... | [
{
"role": "user",
"content": "Show me all loans and the type of account each loan is associated with. Include the loan ID and the account type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.loan_id, a.account_type FROM financial_services.loans l JOIN financial_services.account... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, p... | [
{
"role": "user",
"content": "Show the names and phone numbers of all law firms whose website ends with '.org'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_name, phone\nFROM legal_services.law_firms\nWHERE website LIKE '%.org';",
"sql": null
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.