Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
298
7.86k
[ { "role": "user", "content": "List the names of service locations and the names of the agencies they belong to, specifically for locations situated in the state of 'Texas' that are marked as accessible." }, { "role": "assistant", "content": "SELECT t1.location_name, t2.agency_name FROM governmen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show me, for each item, the total number of times it has been acquired and the earliest date it was acquired. Also, show the number of unique players who have acquired each item." }, { "role": "assistant", "content": "SELECT item_id, COUNT(*) AS total_acquisitions, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, ite...
[ { "role": "user", "content": "Count how many users have not specified a value for their bio." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.users WHERE bio IS NULL OR bio = '';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List the full names and email addresses of users who have liked any comment." }, { "role": "assistant", "content": "SELECT DISTINCT u.full_name, u.email\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.user_id\nWHERE l.comment_id IS NOT NULL;" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "For each trade, show the buyer's and seller's usernames, the name and symbol of the traded asset, trade quantity, and trade price." }, { "role": "assistant", "content": "SELECT t.trade_id, ub.username AS buyer_username, us.username AS seller_username, a.name AS asse...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "List the names and types of all properties, along with the full names and positions of their managers." }, { "role": "assistant", "content": "SELECT p.property_name, p.property_type, s.first_name || ' ' || s.last_name AS manager_full_name, s.position AS manager_posi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "Get the average price of all services for each category." }, { "role": "assistant", "content": "SELECT category, AVG(price) AS avg_price\nFROM hospitality_technology.services\nGROUP BY category;" }, { "role": "user", "content": "Only include categories w...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL...
[ { "role": "user", "content": "List the document ID, file name, document type, and uploaded timestamp for all documents uploaded by 'Alice Johnson' between '2023-01-01' and '2023-12-31'." }, { "role": "assistant", "content": "SELECT document_id, file_name, document_type, uploaded_at FROM insuranc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, file_name.text, file_path.text, file_s...
[ { "role": "user", "content": "List all non-primary insurance plans for patients, including their policy numbers and effective dates, sorted by expiration date." }, { "role": "assistant", "content": "SELECT patient_id, policy_number, effective_date FROM healthcare.patient_insurance WHERE is_prima...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, patient_id character varying(64) NO...
[ { "role": "user", "content": "List the customer ID, first_name, last_name, city, and the number of active policies each customer has, but only include customers who live in 'CA' and have at least 2 active policies." }, { "role": "assistant", "content": "SELECT cu.customer_id, cu.first_name, cu.l...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "role": "user", "content": "For projects that have completed more than one fundraising round, calculate the average investment value across all their recorded rounds. Display the project name and this average value." }, { "role": "assistant", "content": "SELECT project_name, AVG(investment_val...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "Show me a list of insurance providers and the number of patient insurance policies they have." }, { "role": "assistant", "content": "SELECT p.insurance_provider,\n COUNT(pi.patient_insurance_id) AS policy_count\nFROM healthcare.insurance_plans p\nLEFT JOIN hea...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "List all active drivers with their license expiry dates and contact information." }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, license_number, license_expiry_date, contact_number, email FROM transportation.drivers WHERE status = 'ac...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ...
[ { "role": "user", "content": "List for each fuel type the number of unique vehicle models available. Show the fuel_type and the model count." }, { "role": "assistant", "content": "SELECT fuel_type, COUNT(DISTINCT model) AS model_count FROM transportation.vehicles GROUP BY fuel_type ORDER BY fuel...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Count the number of agents for each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.agents GROUP BY status;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Show me all savings accounts (account_id, account_number, balance) with an interest rate above 2.5%, along with the security details (ticker_symbol, issuer_name) for securities in the same currency as the account." }, { "role": "assistant", "content": "SELECT a.acco...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac...
[ { "role": "user", "content": "I need a list of all chronic diagnoses marked as 'Active', showing diagnosis_id, diagnosis_date, doctor_id, and the associated chief_complaint from medical_records." }, { "role": "assistant", "content": "SELECT d.diagnosis_id,\n d.diagnosis_date,\n d.doc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointment_id text, doctor_id text, record_d...
[ { "role": "user", "content": "Show me all appointments for doctor 'doctor_100' in June 2024, including the appointment time and the patient ID." }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, appointment_time\nFROM healthcare.appointments\nWHERE doctor_id = 'doctor_100'...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, -- unique identifier for the appointment ...
[ { "role": "user", "content": "For each city that has a fueling location, show the city name and the total quantity of fuel refueled." }, { "role": "assistant", "content": "SELECT T2.city , SUM(T1.quantity) FROM transportation.fuel_logs AS T1 JOIN transportation.locations AS T2 ON T1.location_id...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "For each snapshot_time in cex_token_balance, calculate the total usd_value across all exchanges and order by snapshot_time ascending." }, { "role": "assistant", "content": "SELECT snapshot_time,\n SUM(usd_value) AS total_usd_value\nFROM cex_token_balance\nGROU...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "Find all transactions where the amount is greater than 1000 and the receiver_address starts with '0x1'." }, { "role": "assistant", "content": "SELECT * FROM blockchain.transactions WHERE amount > 1000 AND receiver_address LIKE '0x1%';" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id text PRIMARY KEY, block_id text, sender_address text, receiver_address text, a...
[ { "role": "user", "content": "List all combinations of manufacturers and generic names. For each combination, display the manufacturer, generic_name, and the number of medications." }, { "role": "assistant", "content": "SELECT manufacturer, generic_name, COUNT(*) AS medication_count FROM healthc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medications ( medication_id character varying(64) NOT NULL, medication_name character varying(255) NOT NULL,...
[ { "role": "user", "content": "List each vehicle and the date of its most recent maintenance, including the service type and cost." }, { "role": "assistant", "content": "SELECT vehicle_id, service_type, cost, service_date FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY vehicle_id ORDER BY service...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.maintenance_logs ( log_id text, vehicle_id text, service_date date, odometer_reading integer, service_ty...
[ { "role": "user", "content": "Show me all staff members who are currently active, along with their property name and position." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name \nFROM hospitality_technology.staff s \nJOIN hospitality...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Find the top 3 drivers by their average number of passengers per trip, including driver_id, first_name, last_name, and avg_passengers, ordered by avg_passengers descending." }, { "role": "assistant", "content": "SELECT d.driver_id,\n d.first_name,\n d.la...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "role": "user", "content": "Show me the total quantity of each item each player currently has in their inventory." }, { "role": "assistant", "content": "SELECT player_id, item_id, SUM(quantity) AS total_quantity FROM gaming_technology.player_inventory GROUP BY player_id, item_id" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p...
[ { "role": "user", "content": "Retrieve the name and city of all locations that act as both origin and destination for any route." }, { "role": "assistant", "content": "SELECT l.name, l.city\nFROM transportation.locations l\nWHERE l.location_id IN (SELECT origin_location_id FROM transportation.ro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "Show me a list of all appointments with the subject and full name of the assigned lawyer." }, { "role": "assistant", "content": "SELECT a.appointment_id, a.subject, l.first_name || ' ' || l.last_name AS lawyer_full_name\nFROM legal_services.appointments a\nJOIN lega...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "Show me all rooms on floor 4 or above together with their room number, features, and current status." }, { "role": "assistant", "content": "SELECT room_id, room_number, features, status\nFROM hospitality_technology.rooms\nWHERE floor >= 4;" }, { "role": "use...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, room_type_id text, floor integer, stat...
[ { "role": "user", "content": "List all locations of type 'depot' in the United States, showing their name, state, and city." }, { "role": "assistant", "content": "SELECT name, state_province, city FROM transportation.locations WHERE country = 'United States' AND type = 'depot';" }, { "ro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ...
[ { "role": "user", "content": "List each wallet with its corresponding user_id and the total number of notifications that user has received." }, { "role": "assistant", "content": "SELECT w.wallet_id, w.user_id, COUNT(n.notification_id) as total_notifications\nFROM trading_platform.wallets w\nLEFT...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Show me the top 5 players by their average game session score, including their username and calculated average score." }, { "role": "assistant", "content": "SELECT p.username,\n AVG(gs.score) AS average_score\nFROM gaming_technology.players p\nJOIN gaming_tech...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player ...
[ { "role": "user", "content": "List all documents along with the document type and the case name they are associated with." }, { "role": "assistant", "content": "SELECT d.document_name, d.document_type, c.case_name\nFROM legal_services.documents d\nJOIN legal_services.cases c ON d.case_id = c.cas...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "List all transfers of the token named 'Wrapped Ether', showing the transfer id, token id, value, and the contract address of the token." }, { "role": "assistant", "content": "SELECT tt.transfer_id, tt.token_id, tt.value, t.contract_address\nFROM web3.token_transfers...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Can you show me a list of all players along with all in-game items they have access to, including the player_id, username, and item_name?" }, { "role": "assistant", "content": "SELECT p.player_id, p.username, i.item_name\nFROM gaming_technology.players p\nCROSS JOIN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "Find pairs of documents within the same case that were uploaded on the same day but by different lawyers. Show the case_id, upload_date, document_id and uploader_id for both documents in the pair." }, { "role": "assistant", "content": "SELECT d1.case_id, DATE(d1.upl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "Find the security name and ticker symbol for all securities that have a market data entry with a trading volume greater than 5,000,000." }, { "role": "assistant", "content": "SELECT DISTINCT T1.security_name, T1.ticker_symbol FROM financial_services.securities AS T1...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,...
[ { "role": "user", "content": "Can you help me find all bookings made by passengers from a specific city, say 'Boston', including the passenger details and the scheduled trip information?" }, { "role": "assistant", "content": "MATCH (p:Passenger)-[:MADE_BOOKING]->(b:Booking)-[:FOR_TRIP]->(st:Sche...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_...
[ { "role": "user", "content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT t.name, t.symbol, t.address FROM token_prices_latest t WHERE t.price BETWEEN 1 AND 10;" }, { "r...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transaction_index.integer, transaction_hash....
[ { "role": "user", "content": "Show me all intercity routes with their origin and destination cities, along with the average passenger count for completed trips on these routes." }, { "role": "assistant", "content": "SELECT r.route_id, lo.city AS origin_city, ld.city AS destination_city, AVG(t.pa...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "Find all peers that haven't been seen in the last 30 days, along with their IP addresses and ports." }, { "role": "assistant", "content": "SELECT peer_id, ip_address, port FROM trading_platform.peers WHERE last_seen < CURRENT_DATE - INTERVAL '30 days';" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch...
[ { "role": "user", "content": "List all customers (customer_id, first_name, last_name) who were born before 1990 (date_of_birth < '1990-01-01') and have an email address ending with '@gmail.com', along with their city and state information." }, { "role": "assistant", "content": "SELECT customer_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ...
[ { "role": "user", "content": "For each account type and status, can you show the total number of accounts and their combined balance per currency?" }, { "role": "assistant", "content": "SELECT account_type, status, currency, COUNT(*) AS total_accounts, SUM(balance) AS total_balance\nFROM financi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac...
[ { "role": "user", "content": "Show me all doctors specializing in Pediatrics along with their upcoming appointments, including the patient ID and appointment time." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, a.patient_id, a.appointment_time FROM healthca...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "Show me the top 5 users by the total number of trades they participated in as buyers, along with their email addresses." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, u.email, COUNT(t.trade_id) AS total_trades FROM trading_platform.users u JOIN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "Give me the number of patient insurance policies for each plan where the policy is currently active. Return plan_id and policy_count." }, { "role": "assistant", "content": "SELECT\n plan_id,\n COUNT(*) AS policy_count\nFROM healthcare.patient_insurance\nWHERE (exp...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, patient_id character varying(64) NO...
[ { "role": "user", "content": "Show all beneficiaries assigned to policy ID 'POL67890', with their first and last names, relationship, and the date they were added." }, { "role": "assistant", "content": "SELECT first_name, last_name, relationship, added_at\nFROM insurance.policy_beneficiaries\nWH...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id.text, policy_id.text, customer_id.text, first_name.text, last_name.text...
[ { "role": "user", "content": "Retrieve each completed booking's booking_id, passenger full name, trip_id, scheduled_departure, and fare for bookings where the trip's passenger_count is at least 10." }, { "role": "assistant", "content": "SELECT b.booking_id, p.first_name || ' ' || p.last_name AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List the full names and hire dates of all employees who report directly to a manager with the job title 'Director'." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, e.hire_date\nFROM government_services.employees e\nJOIN government_services.e...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa...
[ { "role": "user", "content": "List the first name, last name, and job title of each employee, along with the job title of their manager." }, { "role": "assistant", "content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, e.job_title AS employee_job_title, m.job_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.employees ( employee_id character varying(64) NOT NULL, -- unique identifier for the government...
[ { "role": "user", "content": "List all pairs of insurance products that share the same product_type but have different base premiums, showing both product_ids, their product_type, and their base_premiums." }, { "role": "assistant", "content": "SELECT p1.product_id AS product1_id, p2.product_id A...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "List all service orders with service name, guest's full name, order timestamp and status for orders with status 'Delivered'." }, { "role": "assistant", "content": "SELECT so.order_id, s.service_name, g.first_name || ' ' || g.last_name AS guest_full_name, so.order_ti...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Show all peers whose last_seen timestamp is before '2023-01-01' and whose port number is less than 1000, listing their peer_id and ip_address." }, { "role": "assistant", "content": "SELECT peer_id, ip_address FROM trading_platform.peers WHERE last_seen < '2023-01-01...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.peers ( peer_id character varying(64) NOT NULL, ip_address character varying(15) NOT NULL, port intege...
[ { "role": "user", "content": "List each property along with the count of available rooms grouped by bed type." }, { "role": "assistant", "content": "SELECT rt.property_id, p.property_name, rt.bed_type, COUNT(r.room_id) AS available_count\nFROM hospitality_technology.rooms r\nJOIN hospitality_tec...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "For each service ID, show the average and maximum payment amount for payments made in the last 90 days." }, { "role": "assistant", "content": "SELECT service_id, AVG(amount), MAX(amount) FROM government_services.payments WHERE payment_timestamp >= NOW() - INTERVAL '...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.payments ( payment_id.text, application_id.text, citizen_id.text, service_id.text, amount.numeric, ...
[ { "role": "user", "content": "For each ERC1155 contract in erc1155_approval_for_all, show contract_address, the count of approval-for-all events, and the number of unique current holders from nft_holders. Order by holder_count descending and limit to 5." }, { "role": "assistant", "content": "SEL...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "List all beneficiaries who have a percentage share greater than 50% on a policy. Please include the beneficiary's first name, last name, relationship, the policy ID, and the policy's start date." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_na...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id character varying(64) NOT NULL, -- unique identifier for the benefi...
[ { "role": "user", "content": "List all tokens with a market cap rank under 50 that have negative price changes in both the last 24 hours and last 7 days." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price_change_percentage_24h, price_change_percentage_7d, market_cap_ra...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "能否帮我查询特定路线(route_id 为 'RT001')的所有行程信息,并关联到乘客的联系方式?" }, { "role": "assistant", "content": "SELECT s.schedule_id, s.train_id, s.route_id, s.departure_datetime, s.arrival_datetime, s.status, p.passenger_id, p.first_name, p.last_name, p.phone_number, p.email\nFROM sched...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // PUT /schedules { "mappings": { "properties": { "schedule_id": { "type": "keyword" ...
[ { "role": "user", "content": "For each completed trip, list the trip ID, the driver's full name, and the name of the origin location." }, { "role": "assistant", "content": "SELECT t.trip_id, d.first_name || ' ' || d.last_name AS driver_name, l.name AS origin_location_name\nFROM transportation.tr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "For each prescription, find the next prescription for the same patient. Return current prescription_id, next_prescription_id, patient_id, and days between start dates." }, { "role": "assistant", "content": "SELECT p1.patient_id,\n p1.prescription_id AS current...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.prescriptions ( prescription_id.text, record_id.text, patient_id.text, doctor_id.text, medication_id.text, d...
[ { "role": "user", "content": "For Avalanche tokens, show me the token `tick`, `creator`, and `max_supply` from the `token_info_avalanche` table." }, { "role": "assistant", "content": "SELECT tick, creator, max_supply FROM token_info_avalanche" }, { "role": "user", "content": "Now, fo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "List all insurance policies along with the product name and product type for each policy." }, { "role": "assistant", "content": "SELECT p.policy_id, p.policy_number, p.start_date, p.end_date, p.premium_amount, ip.product_name, ip.product_type\nFROM insurance.policie...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "What is the average investment_value and total number of projects for each rounds_name in project_fundraising_record?" }, { "role": "assistant", "content": "SELECT rounds_name,\n AVG(investment_value) AS avg_investment,\n COUNT(DISTINCT project_id) AS pr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id text, project_id text, project_name text, rounds_name text, investment_value numeric, i...
[ { "role": "user", "content": "For each game, count how many achievements it has and calculate the average points." }, { "role": "assistant", "content": "SELECT game_id,\n COUNT(*) AS total_achievements,\n AVG(points) AS avg_points\nFROM achievements\nGROUP BY game_id;" }, { "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name text, description text, icon_url t...
[ { "role": "user", "content": "List the vehicle_id, make, model, and total maintenance cost for each vehicle that has undergone maintenance, ordering by total maintenance cost descending." }, { "role": "assistant", "content": "SELECT m.vehicle_id, v.make, v.model, SUM(m.cost) AS total_maintenance...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "List each wallet that has received tokens of more than one distinct token type. Show wallet_id, address, the number of distinct tokens received as distinct_token_count, and the total received value, ordered by total_received_value descending." }, { "role": "assistant", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "Can you provide the total number of accounts and the average balance for each account_type?" }, { "role": "assistant", "content": "SELECT account_type, COUNT(*) AS total_accounts, AVG(balance) AS avg_balance\nFROM financial_services.accounts\nGROUP BY account_type;"...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id.text, customer_id.text, account_number.text, account_type.text, balance.numeri...
[ { "role": "user", "content": "Please list the first name, last name, and date of birth for all female patients who were created in the year 2023." }, { "role": "assistant", "content": "SELECT first_name, last_name, date_of_birth FROM healthcare.patients WHERE gender = 'Female' AND created_at >= ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "List all spa services available at properties in New York, along with their prices and property names." }, { "role": "assistant", "content": "SELECT s.service_name, s.price, p.property_name FROM hospitality_technology.services s JOIN hospitality_technology.propertie...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id.text, property_name.text, address_line1.text, address_line2.text, city....
[ { "role": "user", "content": "List all invoices, showing the invoice number, issue date, total amount, and the payment status." }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, total_amount, status FROM invoices" }, { "role": "user", "content": "Only include i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "List the names of employees and the agency they work for who have scheduled at least one appointment. Show the employee's first name, last name, and agency_id." }, { "role": "assistant", "content": "SELECT DISTINCT e.first_name, e.last_name, e.agency_id\nFROM govern...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
1