system
stringlengths
288
8.03k
conversations
listlengths
2
8
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 all diesel fuel logs where the quantity is more than 50 liters, including the vehicle ID and total cost." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, trip_id, quantity, total_cost FROM transportation.fuel_logs WHERE fuel_type = 'diesel...
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 PRIMARY KEY, vehicle_id text, service_date date, odometer_reading int, se...
[ { "role": "user", "content": "Show me all vehicles that are due for their next service before the end of this month, along with their last service date and type." }, { "role": "assistant", "content": "SELECT vehicle_id, service_date AS last_service_date, service_type FROM transportation.maintena...
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 all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest tpl ON tm.contract...
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.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ...
[ { "role": "user", "content": "Count the total number of followers each user has, showing following_user_id as user_id and follower_count, for those users with more than 100 followers." }, { "role": "assistant", "content": "SELECT following_user_id AS user_id, COUNT(*) AS follower_count\nFROM soc...
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.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "Show me all claims and the file names of documents uploaded for each claim." }, { "role": "assistant", "content": "SELECT T1.claim_id, T2.file_name FROM insurance.claims AS T1 JOIN insurance.claim_documents AS T2 ON T1.claim_id = T2.claim_id;" }, { "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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan...
[ { "role": "user", "content": "What is the total and average amount of unspent UTXOs per address?" }, { "role": "assistant", "content": "SELECT\n address,\n COUNT(*) AS utxo_count,\n SUM(amount) AS total_unspent_amount,\n AVG(amount) AS average_unspent_amount\nFROM trading_platform.utxos\nWHE...
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": "Retrieve all public posts that have geolocation coordinates specified, showing post_id, user_id, location_lat, location_lon, ordered by created_at descending." }, { "role": "assistant", "content": "SELECT post_id, user_id, location_lat, location_lon\nFROM social_med...
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.passengers ( passenger_id character varying(64) NOT NULL, -- unique identifier for the passenger ...
[ { "role": "user", "content": "Could you please list the first name, last name, and email address for all passengers in the system?" }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM transportation.passengers;" }, { "role": "user", "content": "Now, refine ...
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": "Show me all properties in New York along with their room types and base rates, ordered by property name." }, { "role": "assistant", "content": "SELECT p.property_name, rt.type_name, rt.base_rate FROM hospitality_technology.properties p JOIN hospitality_technology.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.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Show me all active vehicles with their make, model, and depot location details, along with their last maintenance service type and date." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, v.depot_id, ml.service_type, ml.service_date FROM 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Show me the total number of reservations and the sum of total_amount for each booking_source." }, { "role": "assistant", "content": "SELECT r.booking_source,\n COUNT(*) AS reservation_count,\n SUM(r.total_amount) AS total_revenue\nFROM hospitality_techno...
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.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_id character...
[ { "role": "user", "content": "Which user has the largest number of wallets?" }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) as wallet_count FROM web3.wallets GROUP BY user_id ORDER BY wallet_count DESC LIMIT 1;" }, { "role": "user", "content": "Actually, I would like ...
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": "Show the full name and contact email of citizens who have submitted at least one application for services that are currently inactive." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM gover...
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": "Can you give me the total number of appointments grouped by status?" }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS total_appointments\nFROM healthcare.appointments\nGROUP BY status;" }, { "role": "user", "content": "Filter the ...
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, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "Show me all lawyers who are not partners." }, { "role": "assistant", "content": "SELECT T1.lawyer_id, T1.first_name, T1.last_name FROM legal_services.lawyers AS T1 WHERE T1.is_partner = FALSE" }, { "role": "user", "content": "Include their email address ...
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, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "For each state_province, count the number of guests." }, { "role": "assistant", "content": "SELECT state_province,\n COUNT(*) AS guest_count\nFROM guests\nGROUP BY state_province;" }, { "role": "user", "content": "Only include states with more than...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.users ( user_id.text, username.text, email.text, password_hash.text )
[ { "role": "user", "content": "How many users are registered in the system?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM blockchain.users;" }, { "role": "user", "content": "List the user ID and email for users whose email contains the string 'support'." }, { "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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "What is the average balance for each account_type among accounts with status 'Open'?" }, { "role": "assistant", "content": "SELECT account_type, AVG(balance) AS avg_balance FROM financial_services.accounts WHERE status = 'Open' GROUP 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 trading_platform.orders ( order_id.text, user_id.text, wallet_id.text, asset_id.text, order_type.text, quantity.numeric...
[ { "role": "user", "content": "Count the number of orders in each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS order_count\nFROM trading_platform.orders\nGROUP 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 policies that have at least one overdue premium payment, including policy_number, customer full name, agent_id, due_date, and days overdue." }, { "role": "assistant", "content": "SELECT p.policy_number,\n c.first_name || ' ' || c.last_name AS customer_...
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.loans ( loan_id text, account_id text, loan_type text, principal_amount numeric, current_principal_b...
[ { "role": "user", "content": "What is the average interest rate for auto loans (loan_type = 'Auto') with a principal amount between $20,000 and $50,000?" }, { "role": "assistant", "content": "SELECT AVG(interest_rate) AS avg_interest_rate FROM financial_services.loans WHERE loan_type = 'Auto' AN...
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 character varying(64) NOT NULL, -- unique identifier for the staff member ...
[ { "role": "user", "content": "Show me all active managers along with their property IDs and the number of staff members they supervise, ordered by the number of supervised staff in descending order." }, { "role": "assistant", "content": "SELECT s.staff_id, s.property_id, s.first_name, s.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 insurance.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "Show me all customers who have missing contact information (either phone number or email is null), along with their state and city." }, { "role": "assistant", "content": "SELECT first_name, last_name, state, city FROM insurance.customers WHERE phone_number IS NULL O...
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": "List all applications that have at least one document with a verification status of 'Verified'. Show the application reference number and the name of the service associated with the application." }, { "role": "assistant", "content": "SELECT\n T1.reference_number,\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 insurance.claim_documents ( document_id character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "role": "user", "content": "Show me the document ID, file name, document type, and the status of the claim it belongs to, for all documents uploaded by agents whose license state is 'NY'." }, { "role": "assistant", "content": "SELECT cd.document_id, cd.file_name, cd.document_type, c.status FRO...
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": "List all patients who have been prescribed medications with dosage greater than 100mg, including their names and the medication details." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, m.medication_name, m.generic_name, pr.dosage FROM 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 trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "role": "user", "content": "Calculate the total quantity traded for each day in the dataset." }, { "role": "assistant", "content": "SELECT DATE_TRUNC('day', traded_at) AS trade_day, SUM(quantity) AS total_daily_quantity FROM trading_platform.trades GROUP BY DATE_TRUNC('day', traded_at) ORDER B...
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.notifications ( notification_id.text, user_id.text, message.text, sent_at.timestamp, read_at.timestamp...
[ { "role": "user", "content": "For each user, show their username and the timestamp of their most recent notification. Include users who have never received notifications." }, { "role": "assistant", "content": "SELECT T1.username, max(T2.sent_at) FROM users AS T1 LEFT JOIN trading_platform.notifi...
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.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "role": "user", "content": "Find all blocks where the difficulty is between 1000 and 2000." }, { "role": "assistant", "content": "SELECT * FROM blockchain.blocks WHERE difficulty BETWEEN 1000 AND 2000;" }, { "role": "user", "content": "Now filter these results to only show blocks m...
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": "Show me all active policies with coverage limits above $1,000,000, along with the customer names and agent names, sorted by coverage limit in descending order." }, { "role": "assistant", "content": "SELECT p.policy_id, p.customer_id, p.agent_id, p.coverage_limit, 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.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, patient_id character varying(64) NO...
[ { "role": "user", "content": "List pairs of distinct patient insurance entries that share the same subscriber_name. Show patient1_id, patient2_id, and subscriber_name." }, { "role": "assistant", "content": "SELECT\n p1.patient_id AS patient1_id,\n p2.patient_id AS patient2_id,\n p1.subscriber...
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": "Find reservations where the same guest has overlapping stays in the same property." }, { "role": "assistant", "content": "SELECT r1.reservation_id AS res1,\n r2.reservation_id AS res2,\n r1.guest_id,\n r1.property_id\nFROM hospitality_technology.re...
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, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,...
[ { "role": "user", "content": "List each region and the number of servers currently in 'maintenance' status." }, { "role": "assistant", "content": "SELECT region,\n COUNT(*) AS maintenance_count\nFROM gaming_technology.servers\nWHERE status = 'maintenance'\nGROUP BY region;" }, { "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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp ) CREATE TAB...
[ { "role": "user", "content": "Show each wallet address, the user who owns it, and the number of UTXOs associated with that address." }, { "role": "assistant", "content": "SELECT w.address, w.user_id, COUNT(u.utxo_id) AS utxo_count\nFROM trading_platform.wallets w\nLEFT JOIN trading_platform.utxo...
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": "I want to find all patients who have scheduled appointments with a doctor specializing in 'Neurology', including the patient's full name, appointment_time, and the doctor's full name." }, { "role": "assistant", "content": "SELECT p.first_name || ' ' || p.last_name 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 legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case_id text, issue_date date, due_date...
[ { "role": "user", "content": "List all invoice numbers and their total amount for invoices that are overdue. Show the client ID and the due date as well." }, { "role": "assistant", "content": "SELECT invoice_number, total_amount, client_id, due_date FROM legal_services.invoices WHERE due_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.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List all posts that contain a non-empty media_url and show the usernames of their authors." }, { "role": "assistant", "content": "SELECT p.post_id, p.media_url, u.username\nFROM social_media.posts p\nJOIN social_media.users u ON p.user_id = u.user_id\nWHERE p.media_...
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.nodes ( node_id character varying(64) NOT NULL, -- unique identifier for the node ip_address charac...
[ { "role": "user", "content": "Find pairs of distinct nodes that share the same 'last_seen' timestamp but have different port numbers. Show the node IDs, ports, and the shared timestamp for each pair." }, { "role": "assistant", "content": "SELECT T1.node_id AS node1_id , T1.port AS node1_port , ...
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": "Retrieve route_number, description, and distance_km for routes that have a distance greater than the average distance of all routes." }, { "role": "assistant", "content": "SELECT route_number, description, distance_km\nFROM transportation.routes\nWHERE distance_km >...
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 the count of wallets owned by each deployer address that has deployed at least one contract. Display the deployer address and the wallet count." }, { "role": "assistant", "content": "SELECT c.deployer_address, COUNT(w.wallet_id) AS wallet_count\nFROM web3.contr...
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...
[ { "role": "user", "content": "Retrieve the application_id, citizen_id, service_id, and service_name for all applications with status = 'Pending'." }, { "role": "assistant", "content": "SELECT a.application_id, a.citizen_id, a.service_id, s.service_name\nFROM government_services.applications a\nJ...
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": "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 transportation.maintenance_logs ( log_id text PRIMARY KEY, vehicle_id text, service_date date, odometer_reading int, se...
[ { "role": "user", "content": "Show me all completed bookings (status = 'completed') with their passenger_id and fare, ordered by fare in descending order." }, { "role": "assistant", "content": "SELECT passenger_id, fare FROM transportation.bookings WHERE status = 'completed' ORDER BY fare DESC;"...
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 PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "Can you show me the count of players from each country who have unlocked at least one achievement developed by studios based in France?" }, { "role": "assistant", "content": "SELECT p.country_code, COUNT(DISTINCT p.player_id) AS player_count\nFROM gaming_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 government_services.notifications ( notification_id.text, citizen_id.text, application_id.text, message_subject.text, m...
[ { "role": "user", "content": "List the message subjects for all notifications sent via the 'Push' channel that have a 'Sent' status." }, { "role": "assistant", "content": "SELECT message_subject FROM government_services.notifications WHERE channel = 'Push' AND status = 'Sent';" } ]
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": "Can you provide the total investment amount and the number of projects for each fundraising round?" }, { "role": "assistant", "content": "SELECT rounds_name, SUM(investment_value) AS total_investment, COUNT(DISTINCT project_name) AS project_count FROM project_fundra...
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": "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 cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "List all CEX addresses on the BSC chain that hold more than $1 million USD value in total." }, { "role": "assistant", "content": "SELECT address, SUM(usd_value) AS total_usd_value FROM cex_token_balance WHERE chain = 'BSC' GROUP BY address HAVING SUM(usd_value) > 10...
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, case_id.text, lawyer_id.text, date_worked.date, hours_spent.numeric, billi...
[ { "role": "user", "content": "List all pairs of billable time entries for the same case." }, { "role": "assistant", "content": "SELECT t1.case_id,\n t1.entry_id AS entry_id_1,\n t2.entry_id AS entry_id_2\nFROM legal_services.time_entries t1\nJOIN legal_services.time_entries t2\n ON ...
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 text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "List all policy beneficiaries who have a percentage share greater than 50%, along with their policy details." }, { "role": "assistant", "content": "SELECT pb.beneficiary_id, pb.policy_id, pb.customer_id, pb.first_name, pb.last_name, pb.relationship, pb.percentage_sh...