conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Show me the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their price and 24-hour price change percentage from the token_dexpool_info table." }, { "role": "assistant", "content": "SELECT token_symbol, price, price_change_percentage_24h, vo...
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_basic_info ( coin_id character varying(100) NOT NULL, token_name character varying(100) NOT NULL, token_symbol ch...
[ { "role": "user", "content": "Show me all active policies with coverage limits above $500,000, along with the customer names and agent names." }, { "role": "assistant", "content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.coverage_limit, c.name AS customer_name, a.name AS agent_name FROM...
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 PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "List the full name of all patients who have no prescriptions recorded in the system." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name FROM healthcare.patients AS T1 LEFT JOIN healthcare.prescriptions AS T2 ON T1.patient_id = T2.patient_id WH...
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, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me the content and ID of all posts that have received a like, along with the username of each user who liked the post." }, { "role": "assistant", "content": "SELECT\n P.post_id,\n P.content,\n U.username\nFROM\n social_media.posts AS P\nJOIN\n so...
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": "Show me the names and websites of all developers whose website contains '.com'." }, { "role": "assistant", "content": "SELECT name, website FROM gaming_technology.developers WHERE website LIKE '%.com%';" }, { "role": "user", "content": "Only include deve...
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.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "List each case_id along with entry_id pairs where one entry is billable and the other is non-billable for the same case." }, { "role": "assistant", "content": "SELECT\n te1.case_id,\n te1.entry_id AS billable_entry,\n te2.entry_id AS non_billable_entry\nFROM 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.time_entries ( entry_id character varying(64) NOT NULL, -- unique identifier for the time entry ...
[ { "role": "user", "content": "For the 'AI' and 'Gaming' narratives, what is the total USD value held by CEXes for tokens listed in their top 3 coins?" }, { "role": "assistant", "content": "SELECT T2.narrative, SUM(T1.usd_value) AS TotalCexUSDValue FROM cex_token_balance AS T1 JOIN narrative_info...
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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume...
[ { "role": "user", "content": "Find pairs of reservations at the same property where the second check-in is within 7 days after the first check-out. Return first_reservation, second_reservation, and gap_days." }, { "role": "assistant", "content": "SELECT r1.reservation_id AS first_reservation,\n ...
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.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ...
[ { "role": "user", "content": "List all services provided by the property named 'Grand Plaza Hotel' and include their category and price." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.category, T1.price FROM hospitality_technology.services AS T1 JOIN hospitality_technology.pro...
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 first name and last name of all policy beneficiaries, along with the name of the insurance product associated with their policy." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.product_name FROM insurance.policy_beneficiaries 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": "Which fundraising projects in 2023 have an associated token, and what are their investment amounts, chain, and token narratives?" }, { "role": "assistant", "content": "SELECT p.project_name, p.investment_value, t.chain, t.narrative\nFROM project_fundraising_record p...
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": "Find pairs of conversations that were created on the same calendar date, showing their IDs and the shared creation date." }, { "role": "assistant", "content": "SELECT c1.conversation_id AS conversation1_id, c2.conversation_id AS conversation2_id, c1.created_at::DATE...
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.conversations ( conversation_id character varying(64) NOT NULL, created_at timestamp NOT NULL DEFAULT CURR...
[ { "role": "user", "content": "I need to identify customers who have two different policies that have overlapping coverage periods. List the customer_id along with the two policy_ids." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_id AS policy1_id,\n p2.poli...
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 character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "Can you help me retrieve inspection records for a specific step ID, including the inspection type, result, timestamp, and the associated build ID?" }, { "role": "assistant", "content": "db.inspections.find({ step_id: 'specific_step_id' }, { inspection_type: 1, resul...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id...
[ { "role": "user", "content": "For each project in project_fundraising_record, show the project's earliest and latest fundraising rounds with their corresponding investment_date and investment_value. Include project_name, earliest_round, earliest_date, earliest_value, latest_round, latest_date, and latest_va...
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": "Show me the top 10 transactions by gas price, including the from_address, to_address, and block_number, sorted in descending order." }, { "role": "assistant", "content": "SELECT from_address, to_address, block_number, gas_price FROM web3.transactions ORDER BY gas_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 web3.transactions ( transaction_id character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add...
[ { "role": "user", "content": "Show me all appointments booked online in April 2024. List their ID, scheduled start time, and purpose." }, { "role": "assistant", "content": "SELECT appointment_id, scheduled_start_time, purpose FROM government_services.appointments WHERE booking_method = 'Online' ...
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.appointments ( appointment_id character varying(64) NOT NULL, citizen_id character varying(64) NOT ...
[ { "role": "user", "content": "I want to see pairs of medications that share the same manufacturer. Show each medication's name and its peer's medication_name along with the manufacturer." }, { "role": "assistant", "content": "SELECT t1.medication_name AS med1_name, t2.medication_name AS med2_nam...
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 text PRIMARY KEY, medication_name text, generic_name text, manufacturer text, nd...
[ { "role": "user", "content": "How many hashtags are there whose tag_name contains 'tech'?" }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM social_media.hashtags\nWHERE tag_name LIKE '%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 social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "List the contract address and creation time for all contracts where the deployer also owns a wallet, and include the wallet address owned by the deployer." }, { "role": "assistant", "content": "SELECT c.address AS contract_address, c.deployed_at, w.address AS wallet...
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.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,...
[ { "role": "user", "content": "Show me all policies and the base premium of the insurance product they are based on. Include policy number, premium amount, and product base premium." }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.premium_amount, T2.base_premium FROM insurance.p...
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": "List all fuel logs for vehicle 'VHCL123', showing the fuel type, quantity, and log timestamp." }, { "role": "assistant", "content": "SELECT fuel_type, quantity, log_timestamp FROM transportation.fuel_logs WHERE vehicle_id = 'VHCL123';" }, { "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 transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_timestamp.timestamp, fuel_type.text, qu...
[ { "role": "user", "content": "Find all pairs of users who registered at exactly the same timestamp, showing both user IDs, usernames, and the shared registration timestamp." }, { "role": "assistant", "content": "SELECT u1.user_id AS user_id_1, u1.username AS username_1, u2.user_id AS user_id_2, ...
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.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
[ { "role": "user", "content": "Show me all maintenance logs for vehicles that had a 'Brake Inspection' service type, along with the mechanic who performed the service." }, { "role": "assistant", "content": "SELECT log_id, vehicle_id, service_date, mechanic_name FROM transportation.maintenance_log...
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": "How many documents of each type exist in the system? Show the document type and the count." }, { "role": "assistant", "content": "SELECT document_type, COUNT(*) AS document_count\nFROM legal_services.documents\ngroup BY document_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 legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad...
[ { "role": "user", "content": "For each application that has at least one failed notification, list the application_id, submitted_at, and the count of failed notifications. Order the results by the count of failed notifications in descending order." }, { "role": "assistant", "content": "SELECT 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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "List all comment IDs that have not received any likes." }, { "role": "assistant", "content": "SELECT T1.comment_id FROM social_media.comments AS T1 LEFT JOIN social_media.likes AS T2 ON T1.comment_id = T2.comment_id WHERE T2.like_id IS NULL;" }, { "role": "u...
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.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "Show me the review_id, review_date, and comment for all non-public reviews along with the guest's first and last name." }, { "role": "assistant", "content": "SELECT r.review_id, r.review_date, r.comment, g.first_name, g.last_name\nFROM hospitality_technology.reviews...
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.reviews ( review_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Which pairs of tokens on the same chain have the greatest difference in 24h trading volume? List the two token symbols, their volumes, the absolute difference, and the chain. Limit to the top 3 pairs." }, { "role": "assistant", "content": "SELECT a.chain,\n 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 token_dexpool_info (", "pair_address character varying(512) NOT NULL, -- the id of dexpool", "token_name cha...
[ { "role": "user", "content": "Could you retrieve the number of appointments each doctor had in March 2024? Return the doctor's ID, full name, and total appointments." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name || ' ' || d.last_name AS doctor_name, COUNT(a.appointment_...
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 character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "Show me the names of all employees along with the names of the agencies they work for, and the number of appointments each employee has scheduled." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, a.agency_name, COUNT(appt.appointment_id) AS 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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "List all pairs of beneficiaries on the same policy, showing policy_id, beneficiary1_id, beneficiary1 first_name, beneficiary1 last_name, beneficiary2_id, beneficiary2 first_name, and beneficiary2 last_name." }, { "role": "assistant", "content": "SELECT b1.policy_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 insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text...
[ { "role": "user", "content": "Find all pairs of events that occurred in the same transaction but at different log indices, showing both event_ids, their event_names, the transaction_id, and each log_index." }, { "role": "assistant", "content": "SELECT a.event_id AS event_id1,\n a.event_nam...
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.events ( event_id character varying(64) NOT NULL, contract_id character varying(64) NOT NULL, event_name character...
[ { "role": "user", "content": "List all guests who have never left a review, including their full name and email." }, { "role": "assistant", "content": "SELECT g.guest_id, g.first_name, g.last_name, g.email \nFROM hospitality_technology.guests g \nLEFT JOIN hospitality_technology.reviews r ON g.g...
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": "Show me a list of all patients and the doctors who have made diagnoses for them. For each, include patient ID, patient full name, doctor ID, and doctor full name." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name AS patient_first_name, p.last_...
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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Get the client ID, full name, and the full name of another client from the same company, only for clients with a company_name specified." }, { "role": "assistant", "content": "SELECT c1.client_id, c1.first_name || ' ' || c1.last_name AS client_name, c2.first_name ||...
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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "Find the diagnosis code and description for all non-chronic diagnoses for patient 'patient_789' made by doctor 'doctor_abc'." }, { "role": "assistant", "content": "SELECT diagnosis_code, description FROM healthcare.diagnoses WHERE patient_id = 'patient_789' AND doct...
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.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry ...
[ { "role": "user", "content": "List each property with its manager's full name and the count of currently available services it offers." }, { "role": "assistant", "content": "SELECT p.property_id,\n p.property_name,\n CONCAT(m.first_name, ' ', m.last_name) AS manager_name,\n COU...
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 total payment amount and payment count made by citizen with national ID number 'A123456789'." }, { "role": "assistant", "content": "SELECT SUM(p.amount) AS total_amount, COUNT(p.payment_id) AS payment_count\nFROM government_services.citizens c\nJOIN governm...
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 text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "List all inactive insurance products along with their creation dates." }, { "role": "assistant", "content": "SELECT product_name, created_at FROM insurance.insurance_products WHERE is_active = false;" }, { "role": "user", "content": "Now order them by th...
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": "Count the number of lawyers in each firm. Show the firm ID and the count." }, { "role": "assistant", "content": "SELECT firm_id, COUNT(*) AS lawyer_count FROM legal_services.lawyers GROUP BY firm_id ORDER BY firm_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 legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text, bar_number text UNIQUE, firm_id t...
[ { "role": "user", "content": "For each user, can you show their username and the length of their email address?" }, { "role": "assistant", "content": "SELECT user_id, username, LENGTH(email) AS email_length FROM web3.users;" } ]
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.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp )
[ { "role": "user", "content": "What is the average price of tokens held by Binance exchange across all chains in the cex_token_balance table?" }, { "role": "assistant", "content": "SELECT AVG(price) AS average_price FROM cex_token_balance WHERE exchange = 'Binance';" } ]
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 ch...
[ { "role": "user", "content": "How many reviews does each staff member respond to, along with their full name and the average response time in hours?" }, { "role": "assistant", "content": "SELECT st.staff_id,\n st.first_name || ' ' || st.last_name AS staff_full_name,\n COUNT(*) AS res...
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": "Show me the top 5 smart money addresses by profit on the Ethereum chain, along with their most profitable token and ROI." }, { "role": "assistant", "content": "SELECT address, most_profit_token, roi FROM smart_money_profit WHERE chain = 'Ethereum' ORDER BY profit DE...
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 smart_money_profit ( address character varying(100) NOT NULL, -- the user's address rank INT, -- the rank of the addres...
[ { "role": "user", "content": "Which employees have an email address with the same domain as any security's issuer name considered as a domain (case-insensitive)? Show their employee_id, email, and the matching issuer_name." }, { "role": "assistant", "content": "SELECT e.employee_id, e.email, s.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.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "List each user along with the number of wallets they own and the number of unique addresses found in their UTXOs." }, { "role": "assistant", "content": "SELECT u.user_id, COUNT(DISTINCT w.wallet_id) as wallet_count, COUNT(DISTINCT ut.address) as unique_utxo_addresse...
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": "What is the total transaction amount for each transaction_type in the last 30 days?" }, { "role": "assistant", "content": "SELECT transaction_type, SUM(amount) AS total_amount FROM financial_services.transactions WHERE transaction_date >= CURRENT_DATE - INTERVAL '30...
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": "List all vehicles with their assigned driver full names, license plates, and scheduled departure times for upcoming trips, ordered by departure time." }, { "role": "assistant", "content": "SELECT v.vehicle_id,\n v.license_plate,\n d.first_name || ' ' || ...
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 all diesel vehicles with a capacity greater than 20, showing their make, model, and year." }, { "role": "assistant", "content": "SELECT make, model, year FROM transportation.vehicles WHERE fuel_type = 'diesel' AND capacity > 20;" }, { "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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "Count the number of users for each location where the location is not empty." }, { "role": "assistant", "content": "SELECT location, COUNT(user_id) FROM social_media.users WHERE location IS NOT NULL AND location != '' GROUP BY location;" } ]
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": "For each Avalanche token, calculate the total transfer volume and the number of distinct senders over the past 7 days. Return tick, total_volume, and distinct_senders, sorted by total_volume descending." }, { "role": "assistant", "content": "SELECT\n tick,\n SUM(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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Find the total number of documents uploaded by each citizen along with their first and last names." }, { "role": "assistant", "content": "SELECT c.citizen_id, c.first_name, c.last_name, COUNT(d.document_id) AS document_count\nFROM government_services.citizens c\nLEF...
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": "For each conversation, how many participants have joined before January 1, 2024?" }, { "role": "assistant", "content": "SELECT conversation_id, COUNT(user_id) AS participant_count\nFROM social_media.conversation_participants\nWHERE joined_at < '2024-01-01'\nGROUP BY...
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.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ...
[ { "role": "user", "content": "How many wallets has each user created since '2024-07-01'?" }, { "role": "assistant", "content": "SELECT user_id,\n COUNT(*) AS wallet_count\nFROM trading_platform.wallets\nWHERE created_at >= '2024-07-01'\nGROUP BY user_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 trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "Show me the average billing rate and total hours spent for each lawyer, grouped by lawyer_id." }, { "role": "assistant", "content": "SELECT lawyer_id, AVG(billing_rate) AS avg_billing_rate, SUM(hours_spent) AS total_hours FROM legal_services.time_entries GROUP BY 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 legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu...
[ { "role": "user", "content": "I want to find pairs of transactions where one transaction’s related_account_id matches the other’s account_id, indicating reciprocal transfers between accounts." }, { "role": "assistant", "content": "SELECT t1.transaction_id AS outgoing_txn, t2.transaction_id AS in...
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 PRIMARY KEY, account_id text, related_account_id text, transactio...
[ { "role": "user", "content": "For each route, show the route_number, origin and destination location names with their cities, and the average departure delay (in minutes) for trips where actual_departure was later than scheduled_departure." }, { "role": "assistant", "content": "SELECT r.route_nu...
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 all service orders, including the service name and quantity, along with the full name of the staff member who placed the order." }, { "role": "assistant", "content": "SELECT so.order_id, s.service_name, so.quantity, st.first_name, st.last_name FROM 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": "For each player, list their username and the total number of unique servers they have played on, only including players who have played on two or more different servers. Also show the titles of all games they've played sessions on." }, { "role": "assistant", "conten...
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": "Show the number of staff members in each position and the average access level, grouping by position." }, { "role": "assistant", "content": "SELECT position,\n COUNT(*) AS staff_count,\n AVG(access_level) AS avg_access_level\nFROM hospitality_technology....
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.staff ( staff_id text, property_id text, first_name text, last_name text, position text, work_em...
[ { "role": "user", "content": "Show me all claim documents uploaded by customers between January 1, 2023 and December 31, 2023. Include document ID, file name, uploaded time, and the customer ID." }, { "role": "assistant", "content": "SELECT T1.document_id, T1.file_name, T1.uploaded_at, T2.custom...
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": "Which drivers have missing contact numbers or email addresses? Show their IDs and names." }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name FROM transportation.drivers WHERE contact_number IS NULL OR email IS NULL;" }, { "role": "...
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 projects that increased their investment in a later round compared to an earlier one. List project_id, project_name, earlier round, earlier investment, later round, and later investment." }, { "role": "assistant", "content": "SELECT p2.project_id,\n p...
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": "Show me all customers (customer_id, first_name, last_name) who have both a checking account (account_type = 'Checking') and a savings account (account_type = 'Savings'), along with their total combined balance." }, { "role": "assistant", "content": "SELECT c.custome...
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.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "Show me all achievements with their name and the total number of players who have unlocked each achievement." }, { "role": "assistant", "content": "SELECT a.achievement_id, a.name, COUNT(pa.player_id) AS players_unlocked\nFROM gaming_technology.achievements a\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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), title character varying(200) NOT NULL, devel...
[ { "role": "user", "content": "List each document name, document_type, the case_number, and case_name for all documents uploaded in the year 2023." }, { "role": "assistant", "content": "SELECT d.document_name, d.document_type, c.case_number, c.case_name\nFROM legal_services.documents d\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, first_name.text, last_name.text, company_name.text, email.text, phone.text, ad...
[ { "role": "user", "content": "Retrieve the number of passengers for each loyalty_program_id." }, { "role": "assistant", "content": "SELECT loyalty_program_id,\n COUNT(*) AS passenger_count\nFROM transportation.passengers\nGROUP BY loyalty_program_id;" }, { "role": "user", "cont...
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": "List all securities along with their latest close price and volume from the market data." }, { "role": "assistant", "content": "SELECT m.security_id, s.security_name, m.close_price, m.volume\nFROM financial_services.market_data m\nJOIN (\n SELECT security_id, MAX(d...
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.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "Show a combination of all chronic diagnoses and all insurance plans of type 'HMO'. Display the diagnosis description and the plan name." }, { "role": "assistant", "content": "SELECT T1.description, T2.plan_name FROM healthcare.diagnoses AS T1 CROSS JOIN healthcare.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 healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, patient_i...
[ { "role": "user", "content": "List all agencies that do not have a website URL specified. Return their agency_id, agency_name, and main_phone_number." }, { "role": "assistant", "content": "SELECT agency_id, agency_name, main_phone_number FROM government_services.agencies WHERE website_url IS NUL...
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.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "How many distinct fundraising round names are recorded in the table?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT rounds_name) FROM project_fundraising_record;" } ]
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": "For each user, count the number of mutual follow relationships they are involved in (users they follow and who also follow them back). List user_id and mutual_count." }, { "role": "assistant", "content": "SELECT\n f1.follower_user_id AS user_id,\n COUNT(*) ...
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.follows ( follow_id character varying(64) NOT NULL, follower_user_id character varying(64) NOT NULL, follo...
[ { "role": "user", "content": "What is the current address of the employee with ID 'EMP234'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the current address of an employee as this information is not stored in the database table." } ]
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 manufacturing.employees ( ...
[ { "role": "user", "content": "Count the number of payments processed by each staff member. Display the staff ID and the count." }, { "role": "assistant", "content": "SELECT staff_id_processed, COUNT(*) FROM hospitality_technology.payments WHERE staff_id_processed IS NOT NULL GROUP BY staff_id_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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil...
[ { "role": "user", "content": "Show me all insurance plans that have more than 5 patients enrolled, along with the provider name and count of patients, sorted by patient count in descending order." }, { "role": "assistant", "content": "SELECT i.plan_name, i.insurance_provider, COUNT(p.patient_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "For each diagnosis, show the diagnosis code, description, and the full name of the doctor who made the diagnosis." }, { "role": "assistant", "content": "SELECT dgn.diagnosis_code, dgn.description, doc.first_name AS doctor_first_name, doc.last_name AS doctor_last_nam...
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 character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "Can you list all replies along with their parent comment content for post_id 'P100'?" }, { "role": "assistant", "content": "SELECT reply.comment_id AS reply_id, parent.content AS parent_content, reply.content AS reply_content FROM comments AS reply JOIN comments 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 social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_id.text, content.text, created_at.t...
[ { "role": "user", "content": "Find pairs of reservations for the same guest at the same property where the check-in date of the second reservation is the same as the check-out date of the first reservation. List guest ID, property ID, and both reservation IDs." }, { "role": "assistant", "content...
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.reservations ( reservation_id.text, property_id.text, guest_id.text, room_id.text, room_type_id....
[ { "role": "user", "content": "Provide every combination of medication name and insurance plan name." }, { "role": "assistant", "content": "SELECT m.medication_name, p.plan_name\nFROM healthcare.medications AS m\nCROSS JOIN healthcare.insurance_plans AS p;" } ]
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.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, patient_i...
[ { "role": "user", "content": "For each claim, show the corresponding product_type of the insurance product for the related policy." }, { "role": "assistant", "content": "SELECT cl.claim_id, ip.product_type\nFROM insurance.claims cl\nJOIN insurance.policies p ON cl.policy_id = p.policy_id\nJOIN 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 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 the appointment_id alongside plan_id and plan_name for all appointments exceeding 30 minutes with plan_type 'PPO'." }, { "role": "assistant", "content": "SELECT a.appointment_id, p.plan_id, p.plan_name FROM healthcare.appointments a CROSS JOIN healthcare.ins...
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 text PRIMARY KEY, patient_id text, doctor_id text, appointment_time timestamp,...
[ { "role": "user", "content": "Find all smart contracts where the code length is greater than 1000 characters." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, LENGTH(code) AS code_length FROM blockchain.smart_contracts WHERE LENGTH(code) > 1000;" }, { "role": "...
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.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "role": "user", "content": "Which hashtags appear on the most posts? Return hashtag_id, tag_name, and the number of posts each hashtag is used in, sorted descending, limited to the top 3." }, { "role": "assistant", "content": "SELECT\n h.hashtag_id,\n h.tag_name,\n COUNT(ph.post_id) AS post...
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": "Show me the appointment ID, start time, and subject for all appointments scheduled with lawyer 'lawyer123'." }, { "role": "assistant", "content": "SELECT appointment_id, start_time, subject FROM legal_services.appointments WHERE lawyer_id = 'lawyer123';" }, { ...
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.appointments ( appointment_id character varying(64) NOT NULL, client_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List the first name, last name, and relationship for all beneficiaries whose percentage share is between 10 and 50, inclusive." }, { "role": "assistant", "content": "SELECT first_name, last_name, relationship FROM insurance.policy_beneficiaries WHERE percentage_shar...
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": "List all properties with a star rating of 5.0, showing their name and city." }, { "role": "assistant", "content": "SELECT property_name, city FROM hospitality_technology.properties WHERE star_rating = 5.0;" }, { "role": "user", "content": "Now, also incl...
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 pairs of drivers whose license expiry dates fall within 30 days of each other. Show both driver_ids, names, and the two expiry dates." }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver1_id, d1.first_name AS driver1_first, d1.last_name AS drive...
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": "Show me all spa service orders in the last month with their guest names and total prices, ordered by total price in descending order." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, so.total_price FROM hospitality_technology.service_orders s...
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": "For each service, show the service name and the total number of applications submitted for it." }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(a.application_id) AS total_applications\nFROM government_services.services s\nLEFT JOIN government_serv...
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.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "How many notifications are there where the sender user ID is not recorded?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.notifications WHERE sender_user_id IS 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 character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Which tokens have the highest liquidity on the Ethereum chain and what are their current prices and 24-hour trading volumes?" }, { "role": "assistant", "content": "SELECT token_symbol, price, liquidity, volume_24h FROM token_dexpool_info WHERE chain = 'Ethereum' ORD...
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_dexpool_info ( pair_address.text, token_name.text, token_symbol.text, chain.text, price.numeric, price_change_per...
[ { "role": "user", "content": "Show me all fuel logs where the fuel type is diesel and the quantity is more than 50 liters, including the vehicle ID and total cost." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, total_cost FROM transportation.fuel_logs WHERE fuel_type = 'd...
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.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "List the policy number, product name, and base premium for all policies sold by agents whose license state is 'TX'." }, { "role": "assistant", "content": "SELECT p.policy_number, ip.product_name, ip.base_premium\nFROM insurance.policies p\nJOIN insurance.insurance_p...
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": "Calculate the total transfer volume and number of transfers for each Avalanche token tick over the past 7 days." }, { "role": "assistant", "content": "SELECT ta.tick,\n SUM(ta.amt) AS total_volume,\n COUNT(*) AS transfer_count\nFROM token_activities_av...
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, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "List pairs of invoice numbers for the same case, including their issue dates." }, { "role": "assistant", "content": "SELECT T1.invoice_number AS invoice1_number, T2.invoice_number AS invoice2_number, T1.case_id, T1.issue_date AS invoice1_issue_date, T2.issue_date 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 legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, client_id text, case_id text, issue_...
[ { "role": "user", "content": "List the contact phone and website for all insurance plans provided by 'Continental Health'." }, { "role": "assistant", "content": "SELECT plan_name, contact_phone, website\nFROM healthcare.insurance_plans\nWHERE insurance_provider = 'Continental Health';" } ]
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, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "For each insurance product, can you list its product name, the number of unique agents who have sold policies for that product, and the total premium paid across those policies?" }, { "role": "assistant", "content": "SELECT ip.product_name, COUNT(DISTINCT a.agent_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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Show all active agents along with their respective managers' full names." }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name || ' ' || a.last_name AS agent_name, m.first_name || ' ' || m.last_name AS manager_name FROM insurance.agents a LEFT 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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name chara...
[ { "role": "user", "content": "Show me all room types with 'King' in the bed_type field, along with their property IDs and base rates." }, { "role": "assistant", "content": "SELECT room_type_id, property_id, base_rate FROM hospitality_technology.room_types WHERE bed_type LIKE '%King%';" }, { ...
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.room_types ( room_type_id text PRIMARY KEY, property_id text, type_name text, description text, ...