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 hospitality_technology.room_types ( room_type_id text, property_id text, type_name t... | [
{
"role": "user",
"content": "Show me the type name, base rate, and description for all room types together with the property ID, but only for rooms with an area greater than 400 square feet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, type_name, bas... |
You are an expert in writing database language. You can write a corresponding 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": "How many reservations have been booked each month in 2023?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE_TRUNC('month', created_at) AS month,\n COUNT(*) AS reservation_count\nFROM hospitality_technology.reservations\nWHERE created_at >= '... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time... | [
{
"role": "user",
"content": "List all pairs of fuel log entries for the same vehicle that occurred more than 7 days apart, showing vehicle_id, first_log_id, second_log_id, and the time difference in days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.vehicle_id,\n f1.f... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List the full names of patients who have had at least one appointment scheduled with a doctor, along with the medication names they have been prescribed. Please include only patients who have both an appointment and at least one corresponding medication.",
"sql": null
},
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "Give me the vehicle ID, make, model, year, and the total number of trips made by each vehicle.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.make, v.model, v.year, COUNT(t.trip_id) AS total_trips\nFROM transportation.vehicles v\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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "Show the first and last names of citizens along with the total amount of all payments associated with them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , SUM(T2.amount) FROM government_services.citizens AS T1 JOIN go... |
You are an expert in writing database language. You can write a corresponding 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 each insurance provider with the count of primary active policies (is_primary = TRUE and expiration_date IS NULL or expiration_date > CURRENT_DATE). Return the provider and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ip.insurance_p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List the medication_id and medication_name for all medications with a generic name that starts with 'Amox'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name\nFROM healthcare.medications\nWHERE generic_name ILIKE 'Amox%';"... |
You are an expert in writing database language. You can write a corresponding 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 customers who share an address with another customer. Show both customer IDs, their full names, and the shared address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_id_a, a.first_name AS first_name_a, a.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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Get each property's name, manager_staff_id, and the number of rooms with status 'OutOfOrder', including properties with zero OutOfOrder rooms.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, p.manager_staff_id, COUNT(r.room_id) AS out... |
You are an expert in writing database language. You can write a corresponding 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": "For each employee who acts as a manager, please show the number of employees directly reporting to them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.first_name || ' ' || m.last_name AS manager_name, COUNT(e.employee_id) AS direct_report_count FR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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 web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_a... | [
{
"role": "user",
"content": "Count the number of tokens for each contract address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS token_count FROM web3.tokens GROUP BY contract_address;",
"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 gaming_technology.player_inventory (
inventory_id uuid NOT NULL DEFAULT gen_rand... | [
{
"role": "user",
"content": "For each item, can you show the total quantity held by all players and the most recent acquisition date for that item?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_id, SUM(quantity) AS total_quantity, MAX(acquired_at) AS last_acquired_at\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 social_media.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text )
C... | [
{
"role": "user",
"content": "Get all notifications for posts tagged with hashtag 'H123', showing notification_id and created_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.created_at\nFROM social_media.notifications n\nJOIN social_media.post_hashtags ph\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices (
invoice_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Give me a count of invoices issued for each case this year, and show the case ID with the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_id, COUNT(*) AS invoice_count\nFROM legal_services.invoices\nWHERE EXTRACT(YEAR FROM issue_date) = EX... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url... | [
{
"role": "user",
"content": "How many comments does each post have? Return the post_id and number of comments as comment_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT post_id, COUNT(comment_id) AS comment_count\nFROM social_media.comments\nGROUP BY post_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 government_services.agencies ( agency_id text, agency_name text, jurisdiction_level ... | [
{
"role": "user",
"content": "List all employees with the job title 'Analyst'. Show their first name, last name, and department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, department\nFROM government_services.employees\nWHERE job_title = 'Analyst';",
... |
You are an expert in writing database language. You can write a corresponding 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": "List the names of properties and the number of services they offer in the 'Spa' department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT P.property_name, COUNT(S.service_id) AS spa_service_count FROM hospitality_technology.properties AS P JOIN hosp... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each hashtag, show its tag name and the number of unique users who have ever commented on posts associated with that hashtag.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h.tag_name, COUNT(DISTINCT c.user_id) AS unique_commenters\nFROM social_m... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty... | [
{
"role": "user",
"content": "특정 품질 등급 이상의 공급업체를 조회하고 싶습니다. 품질 등급, 공급업체 이름, 국가를 포함해 주세요.",
"sql": null
},
{
"role": "assistant",
"content": "GET suppliers/_search\n{\n \"query\": {\n \"range\": {\n \"quality_rating\": {\n \"gte\": 4.0\n }\n }\n },\n \"_source\": [\"... |
You are an expert in writing database language. You can write a corresponding 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": "Provide each patient's most recent medical-record doctor's full name along with their primary insurance plan name. Return patient_id, first_name, last_name, primary_plan_name, doctor_first_name, doctor_last_name.",
"sql": null
},
{
"role": "assistant",
"content"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "Show the total transfer volume and number of transfers for each Avalanche token in the past 7 days, including token tick and its creator.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ta.tick, ti.creator, SUM(ta.amt) AS total_volume, COUNT(*) AS tra... |
You are an expert in writing database language. You can write a corresponding 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": "List all locations located in the state of 'Florida'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM transportation.locations WHERE state_province = 'Florida';",
"sql": null
},
{
"role": "user",
"content": "Can you only show lo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.staff (
staff_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "List all staff who report directly to a manager with access_level 5. Include staff full name, position, and the name of their manager.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name AS staff_first_name, s.last_name AS staff_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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List all maintenance logs for vehicles acquired in the year 2023. Include log ID, vehicle make, model, service date, and cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ml.log_id, v.make, v.model, ml.service_date, ml.cost FROM transportation.mai... |
You are an expert in writing database language. You can write a corresponding 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": "Find all cities that contain at least one location of type 'Depot' and at least one location of type 'Station'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT city FROM transportation.locations WHERE type IN ('Depot', 'Station') GROUP BY city HAVING ... |
You are an expert in writing database language. You can write a corresponding 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": "Give me the number of securities and the latest update timestamp for each security_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT security_type,\n COUNT(*) AS security_count,\n MAX(last_updated) AS latest_update\nFROM financial_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 legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, c... | [
{
"role": "user",
"content": "Find appointments that are longer than 30 minutes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM legal_services.appointments WHERE end_time IS NOT NULL AND start_time IS NOT NULL AND end_time > start_time + INTERVAL '30 minutes'",
"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 financial_services.securities (
security_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List pairs of securities that trade on different exchanges but belong to the same sector, showing ticker_symbol of both as symbol_a and symbol_b, their exchanges, and the sector.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.ticker_symbol AS symbo... |
You are an expert in writing database language. You can write a corresponding 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": "List the full name and bar number of all lawyers who were hired before 2015.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name || ' ' || last_name AS lawyer_full_name, bar_number\nFROM legal_services.lawyers\nWHERE hire_date < '2015-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 transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri... | [
{
"role": "user",
"content": "Show all trips with their trip ID, route ID, the ID of their origin location, and the ID of their destination location, where the route ID starts with 'EX'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, route_id, origin_location_id, destina... |
You are an expert in writing database language. You can write a corresponding 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 me the different types of routes available and the total number of routes for each type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT type, COUNT(*) AS route_count FROM transportation.routes GROUP BY type;",
"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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "For each ERC20 token contract, show the contract address and the total number of approval events recorded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS approval_count\nFROM erc20_approval\nGROUP BY contract_address;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Count the number of posts that have a media URL but no textual content.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.posts AS T1 WHERE T1.media_url IS NOT NULL AND (T1.content IS NULL OR T1.content = '');",
"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 transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id ... | [
{
"role": "user",
"content": "List the log ID, vehicle ID, service date, and cost for all maintenance logs where the cost exceeds 2000 and the odometer reading is greater than 100,000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT log_id, vehicle_id, service_date, cost 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 social_media.post_hashtags ( post_hashtag_id.text, post_id.text, hashtag_id.text )
| [
{
"role": "user",
"content": "Find all hashtag IDs that have been used on the same posts as hashtag 'h1'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT ph2.hashtag_id FROM social_media.post_hashtags ph1 JOIN social_media.post_hashtags ph2 ON ph1.post_id = ph2.post_id 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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "Find all posts with media_type 'image' and their media_url, along with the number of likes on comments for each post. Only include posts that have at least one like on a comment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.media_url, ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.in_game_items (
item_id uuid NOT NULL DEFAULT gen_random_uuid(... | [
{
"role": "user",
"content": "Can you show me the number of items per rarity and item type combination, along with the minimum and maximum cost for each group?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_type, rarity, COUNT(*) AS num_items, MIN(cost_amount) AS min_cost, M... |
You are an expert in writing database language. You can write a corresponding 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": "I want to identify pairs of games developed by the same developer but available on different platforms. Include the titles and platforms of both games.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g1.game_id AS game1_id,\n g1.title AS game1_t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id.text, property_name.text, address_li... | [
{
"role": "user",
"content": "Show me all spa service orders (service_id LIKE 'SPA%') in the last month with their guest names and total prices, ordered by total price in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT so.order_id, g.first_name, g.last_name, so.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 government_services.documents (
document_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List the full names and job titles of all employees who have not verified any documents.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, e.job_title FROM government_services.employees AS e LEFT JOIN government_services.docum... |
You are an expert in writing database language. You can write a corresponding 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 financial_services.securities ( security_id text, ticker_symbol text, isin_code text... | [
{
"role": "user",
"content": "For each security, find any other security within the same sector that has a later last_updated timestamp. Return a.ticker_symbol, b.ticker_symbol, and b.last_updated.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.ticker_symbol AS symbol_a, b.tick... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id t... | [
{
"role": "user",
"content": "List each unique plan_id and the total number of patients enrolled in that plan.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT plan_id, COUNT(DISTINCT patient_id) AS patient_count FROM healthcare.patient_insurance GROUP BY plan_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.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"role": "user",
"content": "For each payment, list its payment_id, guest_id, payment_timestamp, and the next payment_id and next payment_timestamp made by the same guest.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.payment_id,\n p.guest_id,\n p.payment_timestam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id.text, policy_id.text, customer_id.te... | [
{
"role": "user",
"content": "For each relationship type among policy beneficiaries, show the average percentage_share and the count of unique beneficiaries. Please order the results with the highest average percentage_share first.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "Which claims have at least one document uploaded by an agent located in 'NY'? Show the claim_id, document_type, file_name, uploaded_by, and the agent's first and last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cd.claim_id, cd.document_type,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_na... | [
{
"role": "user",
"content": "List each product_type along with the most expensive active product in that type, showing product_type, product_id, product_name, and base_premium.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_type, product_id, product_name, base_premium\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 healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id ... | [
{
"role": "user",
"content": "List appointments with a duration longer than 45 minutes where the 'reason' includes the word 'follow-up'. Show the appointment ID, patient ID, duration, and reason.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, patient_id, duration_... |
You are an expert in writing database language. You can write a corresponding 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 the count of vehicles for each type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT type, COUNT(*) AS vehicle_count FROM transportation.vehicles GROUP BY type;",
"sql": null
},
{
"role": "user",
"content": "Only include types whe... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "For each block, get the count of failed transactions and the total gas used by these failed transactions. Show block_number, failed_tx_count, and total_failed_gas.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT block_number,\n COUNT(*) FILTER (... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "I need to identify pairs of customers who share the same last name and live in the same city. List customer1_id, customer2_id, last_name, and city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c1.customer_id AS customer1_id,\n c2.customer_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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "Show user_id and post_id for users who have created posts and have a private profile.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.user_id, p.post_id FROM social_media.posts AS p JOIN social_media.user_settings AS us ON p.user_id = us.user_id WHE... |
You are an expert in writing database language. You can write a corresponding 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": "Could you list the route number and the name of the destination location for routes that start at a location of type 'Depot'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.route_number , T2.name FROM transportation.routes AS T1 JOIN transportati... |
You are an expert in writing database language. You can write a corresponding 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": "Find all pairs of lawyers who work for the same firm, showing each lawyer's first_name, last_name, email, and firm_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.first_name AS lawyer1_first_name,\n l1.last_name AS lawyer1_last_name,\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 gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT ... | [
{
"role": "user",
"content": "Generate a report showing the total number of achievement unlocks broken down by the calendar day they occurred. Show the date and the total number of unlocks for that day.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE(unlocked_at) AS unlock_da... |
You are an expert in writing database language. You can write a corresponding 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 the first name, last name, and policy number for all customers who have filed a claim with an estimated loss over $50,000, along with the agent's full name who sold the policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.la... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "I need a list of departments and the number of current employees in each department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department,\n COUNT(*) AS employee_count\nFROM government_services.employees\nWHERE termination_date IS NULL\nGR... |
You are an expert in writing database language. You can write a corresponding 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": "How many events were emitted on each date? List the date and the count of events.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE(emitted_at) AS emit_date,\n COUNT(*) AS event_count\nFROM web3.events\nGROUP BY DATE(emitted_at);",
"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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Display the username and the total number of wallets for each user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(w.wallet_id) AS wallet_count FROM trading_platform.users u LEFT JOIN trading_platform.wallets w ON u.user_id = w.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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a... | [
{
"role": "user",
"content": "For each user, list their order_id, order_type, and any log messages they have generated.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n o.user_id,\n o.order_id,\n o.order_type,\n l.action AS log_message\nFROM trading_platform.orders o\nJOIN 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 healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.t... | [
{
"role": "user",
"content": "List all unique combinations of plan_id and group_number, and show the number of policies for each combination.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT plan_id, group_number, COUNT(*) AS policy_count FROM healthcare.patient_insurance GROUP BY ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te... | [
{
"role": "user",
"content": "Who are the beneficiaries (first and last names) with a percentage_share over 40% for each policy? I would also like the policy_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, first_name, last_name\nFROM insurance.policy_beneficiaries\n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "For each reservation, show the guest's first and last name, the property name, and the names of all services ordered during that reservation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, g.first_name, g.last_name, 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
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "List all item names and their rarity, along with the title of the game they belong to.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.item_name, T1.rarity, T2.title FROM in_game_items AS T1 JOIN games AS T2 ON T1.game_id = T2.game_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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "List the service_id, service_name, and agency_id for all active services that have an online application URL provided.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT service_id,\n service_name,\n agency_id\nFROM government_services.servic... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "List all reservations along with the guest's full name and the property name for reservations made in properties outside the USA.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS guest_full_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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "List the usernames of users who have liked a post and the content of the post they liked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, T2.content FROM social_media.users AS T1 JOIN social_media.likes AS T3 ON T1.user_id = T3.user_id JO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"role": "user",
"content": "Show the total payment amount and the number of payments processed by each staff member, including their staff_id_processed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT staff_id_processed, SUM(amount) AS total_payment_amount, COUNT(payment_id) AS ... |
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 qualifications or training history of the staff member who performed the maintenance with record_id 'REC123'?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the qualifications or training history... |
You are an expert in writing database language. You can write a corresponding 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 the first and last names of clients whose client_id matches a lawyer_id in the time_entries table, along with the corresponding entry_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, te.entry_id FROM legal_services.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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "Which customers have accounts with a balance over 500,000 USD? Please include the customer's first and last name along with the account number and current balance.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, a.account_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 healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "Get the total number of appointments grouped by status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS appointment_count\nFROM healthcare.appointments\nGROUP BY status;",
"sql": null
},
{
"role": "user",
"c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country tex... | [
{
"role": "user",
"content": "For each developer, find the next developer in the same country founded after them, and show both names and their founded years.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.name AS developer,\n d1.founded_year,\n (SELECT d2.name\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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "List all insurance plan names and their associated insurance provider.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT plan_name, insurance_provider FROM healthcare.insurance_plans;",
"sql": null
},
{
"role": "user",
"content": "Only 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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "Which services have the longest average processing times? List the top 5 services by average processing time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n service_name,\n average_processing_time_days\nFROM\n government_services.services\nORDER... |
You are an expert in writing database language. You can write a corresponding 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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "Which month in 2022 saw the highest total fundraising amount, and which project contributed the most to that month's total?",
"sql": null
},
{
"role": "assistant",
"content": "WITH monthly_totals AS (\n SELECT \n to_char(to_date(investment_date, 'YYYY-... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text, user_id text, address text, private_key text, created... | [
{
"role": "user",
"content": "Find pairs of wallet IDs that belong to the same user, showing the user ID and the two wallet IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.user_id, w1.wallet_id AS wallet1_id, w2.wallet_id AS wallet2_id FROM web3.wallets w1 JOIN web3.wallet... |
You are an expert in writing database language. You can write a corresponding 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": "Could you show me all securities traded on the LSE exchange using GBP currency?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT security_id, ticker_symbol, security_name, issuer_name\nFROM financial_services.securities\nWHERE exchange = 'LSE' AND curr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "I want to see a list of followers and the usernames of the users they are following, along with when they followed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u_f.username AS follower_username,\n u_t.username AS following_username,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "I want to see each post along with the user's previous post and the time difference between them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p2.post_id AS current_post, p1.post_id AS previous_post, EXTRACT(EPOCH FROM (p2.created_at - p1.created_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 social_media.follows ( follow_id.text, follower_user_id.text, following_user_id.text... | [
{
"role": "user",
"content": "Find users who followed at least two different people on the same calendar day. For each such user, list their ID, the IDs of the two people they followed, and the creation times of those two follow events.",
"sql": null
},
{
"role": "assistant",
"content": "SEL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "For each narrative, which token has the lowest price in the last 24 hours based on DEX pool data? Show narrative, token symbol, chain, and the lowest 24h price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.narrative, d.token_symbol, d.chain, d.lo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id.text, property_name.text, address_li... | [
{
"role": "user",
"content": "What is the average delivery time in hours for all delivered service orders?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(EXTRACT(EPOCH FROM (so.delivery_timestamp - so.order_timestamp)) / 3600) AS avg_delivery_hours\nFROM hospitality_technolog... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "List all invoices that were paid within 7 days of their issue date. Show invoice number, issue date, payment date, and total amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_number, issue_date, payment_date, total_amount FROM 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 legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"role": "user",
"content": "Now, sort the results by the date opened, oldest first, and show only the top 10.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.appointments ( appointment_id text PRIMARY KEY, client_id text, lawye... | [
{
"role": "user",
"content": "List each appointment along with the start_time of the next appointment for the same lawyer. Include appointment_id and next_start_time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id,\n LEAD(start_time) OVER (PARTITION BY lawyer... |
You are an expert in writing database language. You can write a corresponding 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": "How many tokens had a net positive flow according to smart_money_token_performance, and what is their average ROI?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS token_count, AVG(roi) AS avg_roi\nFROM smart_money_token_performance\nWHERE ... |
You are an expert in writing database language. You can write a corresponding 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": "For each user, show the total amount of unspent UTXOs across all their wallets.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w.user_id, SUM(u.amount) AS total_unspent_amount FROM trading_platform.wallets w JOIN trading_platform.utxos u ON w.address... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_na... | [
{
"role": "user",
"content": "Show the payment_id and amount_paid for all premium payments where the status is 'pending'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_id, amount_paid\nFROM insurance.premium_payments\nWHERE status = 'pending';",
"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.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List each property with the count of rooms that are currently marked as 'Occupied', including the property_name and occupied_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(r.room_id) AS occupied_count\nFROM properties 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 gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Find all in-game items that have a 'mana_cost' attribute in their attributes JSON. Show the item ID, item name, and the value of the 'mana_cost'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_id, item_name, attributes ->> 'mana_cost' AS mana_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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Show me the first name, last name, and position of all staff members, along with the name of the property they work at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.position, T2.property_name FROM 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.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "Find all law firms that share the same address, listing each address and the two firm names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.address, f1.firm_name AS firm1, f2.firm_name AS firm2 FROM law_firms f1 JOIN law_firms f2 ON f1.address = f... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "I want to get the total number of appointments scheduled at each agency in 2024. Please provide the agency name and the appointment count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agency_name,\n COUNT(ap.appointment_id) AS appointment_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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_i... | [
{
"role": "user",
"content": "Find all pairs of overlapping reservations for the same room. Show the two reservation IDs, room_id, and both reservations' check-in and check-out dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id AS reservation1_id, r2.reservat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ... | [
{
"role": "user",
"content": "Find all patients who have never received any diagnoses. Show patient ID, first_name, and last_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id,\n p.first_name,\n p.last_name\nFROM healthcare.patients p\nLEFT JOIN healthc... |
You are an expert in writing database language. You can write a corresponding 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, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.