conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List each service category and the count of services that are currently available." }, { "role": "assistant", "content": "SELECT category,\n COUNT(*) AS available_service_count\nFROM hospitality_technology.services\nWHERE is_available = TRUE\nGROUP BY category...
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": "List the claim ID, incident date, and the file name of any associated document for claims reported after '2024-01-01'." }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.incident_date, T2.file_name FROM insurance.claims AS T1 JOIN insurance.claim_document...
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": "List the application ID and citizen ID for all documents of type 'Proof of Address'." }, { "role": "assistant", "content": "SELECT application_id, citizen_id FROM government_services.documents WHERE document_type = 'Proof of 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 government_services.documents ( document_id text, application_id text, citizen_id text, document_type text, file_refere...
[ { "role": "user", "content": "我想查询所有使用特定材料ID的组件信息,包括组件名称、零件编号和供应商ID,同时还需要获取该材料的名称和规格。" }, { "role": "assistant", "content": "SELECT c.component_id, c.component_name, c.part_number, c.supplier_id, m.material_name, m.specification\nFROM manufacturing.components c\nJOIN manufacturing.materials m ON...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE manufacturing.components ( component_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "I need a list of agents along with their manager's contact email and phone number." }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name, a.last_name, m.contact_email AS manager_email, m.contact_phone AS manager_phone FROM insurance.agents a LEFT JO...
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, first_name text, last_name text, agency_name text, license_number text, license_state...
[ { "role": "user", "content": "List the full names of citizens who have made payments for services that are currently inactive. Also show the service name and payment amount." }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS full_name, s.service_name, p.amount\nF...
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": "Show me all trips along with the city name of their origin and the scheduled departure time." }, { "role": "assistant", "content": "SELECT t.trip_id, l.name AS origin_city, t.scheduled_departure\nFROM transportation.trips t\nJOIN transportation.locations l ON t.orig...
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 wallet addresses that have unspent UTXOs with amounts greater than 100, along with the total unspent amount for each address." }, { "role": "assistant", "content": "SELECT w.address, SUM(u.amount) AS total_unspent FROM trading_platform.wallets w JOIN tradin...
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 PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "Count how many posts have media attachments." }, { "role": "assistant", "content": "SELECT count(*) FROM social_media.posts WHERE media_url IS NOT NULL" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "Which staff members ordered more than 5 service orders in total? List their staff_id, full name, and the total number of orders they've placed." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, COUNT(so.order_id) AS total_orders\nF...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "I need a list of upcoming appointments within the next 7 days for patients whose primary insurance is expiring in the next 30 days. Show the patient's full name, appointment_time, insurance plan_name, and expiration_date." }, { "role": "assistant", "content": "SELEC...
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": "Show me the first and last names of all customers who have filed a claim, along with the claim ID and incident date." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, cl.claim_id, cl.incident_date\nFROM insurance.customers c\nJOIN insurance.cl...
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 players who have unlocked achievements related to items of rarity 'Epic'. Show the player_id, achievement_id, and the item_name associated with the achievement." }, { "role": "assistant", "content": "SELECT pa.player_id, pa.achievement_id, igi.item_name\nFR...
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 PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "List all reviews for properties with a star rating of at least 4.5. Include the property_name, review_id, rating_overall, and review_date." }, { "role": "assistant", "content": "SELECT p.property_name, r.review_id, r.rating_overall, r.review_date\nFROM hospitality_t...
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": "List all locations located in the state of 'Florida'." }, { "role": "assistant", "content": "SELECT * FROM transportation.locations WHERE state_province = 'Florida';" }, { "role": "user", "content": "Can you only show locations of type 'Airport' or 'Hang...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id.text, name.text, type.text, address_line1.text, city.text, state_province.text, ...
[ { "role": "user", "content": "I want to see a list of invoice_number and appointment_id for each invoice that has a scheduled appointment." }, { "role": "assistant", "content": "SELECT i.invoice_number,\n a.appointment_id\nFROM legal_services.invoices i\nJOIN legal_services.appointments 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 character varying(64) NOT NULL, -- unique identifier for the invoice invo...
[ { "role": "user", "content": "Retrieve the product_id, product_name, base_premium, and created_at for all active insurance products with a base_premium greater than 1000, ordered by base_premium descending." }, { "role": "assistant", "content": "SELECT\n product_id,\n product_name,\n base_pre...
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 character varying(64) NOT NULL, -- unique identifier for the insurance pr...
[ { "role": "user", "content": "Show me all users who have both bought and sold the same cryptocurrency asset, along with the asset details and their total buy/sell volumes." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, a.asset_id, a.name AS asset_name, a.symbol, SUM(CASE WHEN ...
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": "Can you list all item names and their types from the in-game items table?" }, { "role": "assistant", "content": "SELECT item_name, item_type FROM gaming_technology.in_game_items;" }, { "role": "user", "content": "Please filter this to only include items ...
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 PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea...
[ { "role": "user", "content": "Show me the number of service orders placed for each service category." }, { "role": "assistant", "content": "SELECT s.category, COUNT(so.order_id) AS order_count\nFROM hospitality_technology.service_orders so\nJOIN hospitality_technology.services s ON so.service_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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te...
[ { "role": "user", "content": "Show me all claim documents that are PDFs and were uploaded in the last 30 days, along with their claim IDs and file sizes." }, { "role": "assistant", "content": "SELECT cd.document_id, cd.claim_id, cd.file_size_bytes, c.policy_id FROM insurance.claim_documents cd J...
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": "Show the subject and start time of appointments, along with the full name of the lawyer assigned to each appointment." }, { "role": "assistant", "content": "SELECT T1.subject, T1.start_time, T2.first_name, T2.last_name FROM legal_services.appointments AS T1 JOIN leg...
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 the top 3 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 narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative top_3_coins text, -- the top 3 token...
[ { "role": "user", "content": "Please provide a list of all driver and passenger pairs who were hired and registered on the same date. Show the driver's full name, the passenger's full name, and the shared date." }, { "role": "assistant", "content": "SELECT d.first_name AS driver_first_name, d.la...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Show me the first name and last name of passengers and the scheduled departure time for their bookings." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T3.scheduled_departure FROM transportation.passengers AS T1 JOIN transportation.booking...
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 PRIMARY KEY, route_number text, description text, origin_location_id text, destin...
[ { "role": "user", "content": "List the usernames and email addresses of users who have participated in any conversation." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM social_media.users AS T1 JOIN social_media.conversation_participants AS T2 ON T1.user_id = T2...
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": "List the username and full name of all users who have set their profile to private." }, { "role": "assistant", "content": "SELECT u.username, u.full_name FROM social_media.users u JOIN social_media.user_settings us ON u.user_id = us.user_id WHERE us.private_profile ...
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 the total number of agents managed by each manager, showing the manager_id and the count." }, { "role": "assistant", "content": "SELECT manager_id, COUNT(*) FROM insurance.agents GROUP BY manager_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.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state...
[ { "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": "Find consecutive pairs of trips for each vehicle based on the scheduled departure time." }, { "role": "assistant", "content": "WITH RankedTrips AS (\n SELECT\n trip_id,\n vehicle_id,\n scheduled_departure,\n origin_location_id,\n destination_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 transportation.trips ( trip_id character varying(64) NOT NULL, route_id character varying(64), vehicle_id character var...
[ { "role": "user", "content": "List all drivers along with their status and license expiry date." }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, status, license_expiry_date\nFROM transportation.drivers;" }, { "role": "user", "content": "Only show driver...
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": "List all pairs of achievements in the same game, returning game_id, the first achievement name as achv1, and the second as achv2." }, { "role": "assistant", "content": "SELECT a1.game_id, a1.name AS achv1, a2.name AS achv2\nFROM achievements a1\nJOIN achievements a2...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name text, description text, icon_url t...
[ { "role": "user", "content": "Which three smart money addresses on the Arbitrum chain have the most recent last_trade_time? Please show address and last_trade_time." }, { "role": "assistant", "content": "SELECT address, last_trade_time FROM smart_money_profit WHERE chain = 'Arbitrum' ORDER 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 smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token...
[ { "role": "user", "content": "Show all claims filed in 2024, including the claim ID, incident date, and the first and last name of the customer." }, { "role": "assistant", "content": "SELECT t1.claim_id, t1.incident_date, t2.first_name, t2.last_name FROM insurance.claims AS t1 JOIN insurance.cus...
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": "特定の職種の従業員情報を取得したいです。従業員ID、名前、職種、雇用日を表示してください。" }, { "role": "assistant", "content": "db.employees.find(\n { job_title: '<specific_job_title>' },\n { employee_id: 1, first_name: 1, last_name: 1, job_title: 1, hire_date: 1, _id: 0 }\n).sort({ hire_date: -1 })" ...
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 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,...
[ { "role": "user", "content": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens with decimals equal to 18." }, { "role": "assistant", "content": "SELECT name, contract_address, total_supply FROM token_metas WHERE ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded ...
[ { "role": "user", "content": "Show me all invoices where the total_amount is more than 2000, including the invoice number, the associated case name, and the full name of the client." }, { "role": "assistant", "content": "SELECT i.invoice_number, c.case_name, cl.first_name || ' ' || cl.last_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": "Return the usernames and emails of users who have bios that mention the word 'travel'." }, { "role": "assistant", "content": "SELECT username, email\nFROM social_media.users\nWHERE bio ILIKE '%travel%';" } ]
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": "List all wallet addresses that hold SUI coins with a balance greater than 1,000,000. Please show the coin_type as well." }, { "role": "assistant", "content": "SELECT owner, coin_type, balance\nFROM sui_coins\nWHERE CAST(balance AS DECIMAL) > 1000000;" }, { "...
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 users who have created wallets in the last 30 days, showing their usernames and wallet addresses." }, { "role": "assistant", "content": "SELECT u.username, w.address FROM web3.users u JOIN web3.wallets w ON u.user_id = w.user_id WHERE w.created_at >= NOW() ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Can you list the number of items for each rarity in the system?" }, { "role": "assistant", "content": "SELECT rarity, COUNT(*) AS item_count\nFROM gaming_technology.in_game_items\nGROUP BY rarity;" }, { "role": "user", "content": "Please only show rariti...
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.in_game_items ( item_id uuid PRIMARY KEY, game_id uuid, item_name text, item_type text, description t...
[ { "role": "user", "content": "List the usernames of users who are following user 'U500', and also show their theme setting." }, { "role": "assistant", "content": "SELECT T1.username, T3.theme FROM social_media.users AS T1 JOIN social_media.follows AS T2 ON T1.user_id = T2.follower_user_id JOIN 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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, full_name.text, profile_picture_url.t...
[ { "role": "user", "content": "List all users who performed more than 10 'view' actions in the logs, along with their action counts." }, { "role": "assistant", "content": "SELECT user_id, COUNT(log_id) AS view_action_count FROM trading_platform.logs WHERE action = 'view' GROUP BY user_id HAVING C...
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.assets ( asset_id text, name text, symbol text, type text ) CREATE TABLE trading_platform.logs ( log_i...
[ { "role": "user", "content": "I need to get the earliest and latest fuel log entries for each vehicle, including their timestamps and the cost difference between those entries." }, { "role": "assistant", "content": "WITH earliest AS (\n SELECT vehicle_id,\n fuel_log_id AS earliest_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.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_timestamp.timestamp, fuel_type.text, qu...
[ { "role": "user", "content": "Which vehicles have made trips along with the total amount of fuel consumed for each trip?" }, { "role": "assistant", "content": "SELECT t.vehicle_id, t.trip_id, SUM(f.quantity) AS total_fuel_consumed\nFROM transportation.trips t\nJOIN transportation.fuel_logs f 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 transportation.trips ( trip_id.text, route_id.text, vehicle_id.text, driver_id.text, scheduled_departure.timestamp, act...
[ { "role": "user", "content": "Show me all users who have both bought and sold the same cryptocurrency asset, along with the asset details and their total buy/sell volumes." }, { "role": "assistant", "content": "SELECT DISTINCT b.user_id, a.asset_id, a.name, a.symbol, b.buy_volume, s.sell_volume ...
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 PRIMARY KEY, user_id text, address text, private_key text, created_at timesta...
[ { "role": "user", "content": "Show the names of group conversations and how many participants they have." }, { "role": "assistant", "content": "SELECT c.group_name, count(cp.user_id) AS participant_count FROM social_media.conversations AS c JOIN social_media.conversation_participants AS cp ON c....
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": "Which law firms were founded in the same year and share the same managing partner? Show the firm names, founding year, and managing partner ID." }, { "role": "assistant", "content": "SELECT f1.firm_name AS firm_name_1, f2.firm_name AS firm_name_2, EXTRACT(YEAR 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 legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, phone text, website text, founded_da...
[ { "role": "user", "content": "How many citizens are marked as not verified?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.citizens WHERE is_verified = FALSE;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show all beneficiaries who were added in 2024 for any policy. List their beneficiary_id, first and last name, relationship, and the policy_id." }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name, last_name, relationship, policy_id\nFROM insuranc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "role": "user", "content": "Could you list users who commented on posts tagged with hashtag 'H202', including each user’s email and the total number of comments they made?" }, { "role": "assistant", "content": "SELECT u.user_id, u.username, u.email, COUNT(c.comment_id) AS comment_count\nFROM 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 social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "For each insurance product type, retrieve the total premium_amount and average coverage_limit for policies under active products. Include product_type, total_premium, and avg_coverage_limit, sorted by total_premium descending." }, { "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 insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "List document names and versions for documents that share the same case_id, showing each pair of versions." }, { "role": "assistant", "content": "SELECT d1.case_id, d1.document_name AS doc_name_v1, d1.version AS version1, d2.document_name AS doc_name_v2, d2.version ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "role": "user", "content": "Count the number of customers grouped by their status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.customers GROUP BY status;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "How many appointments are recorded in the system?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM appointments;" }, { "role": "user", "content": "Show the count of appointments for each status." }, { "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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own." }, { "role": "assistant", "content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.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 blockchain.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonce.integer, merkle_root.text, diffic...
[ { "role": "user", "content": "List all distinct asset types from the assets table." }, { "role": "assistant", "content": "SELECT DISTINCT type\nFROM trading_platform.assets;" } ]
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 for each developer and inventory item combination the number of times that item appears in player inventories." }, { "role": "assistant", "content": "SELECT d.developer_id, d.name AS developer_name, pi.item_id, COUNT(pi.inventory_id) AS inventory_count FROM gam...
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 NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d...
[ { "role": "user", "content": "Show me the count of available rooms for each property." }, { "role": "assistant", "content": "SELECT T1.property_name, count(T2.room_id) FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.rooms AS T2 ON T1.property_id = T2.property_id WHERE T2...
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": "List all doctors who have created at least one medical record in March 2024, including their full name and the count of records." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(m.record_id) AS record_count FROM healthcare....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ch...
[ { "role": "user", "content": "List the make and model of vehicles that have completed a trip, along with the trip ID." }, { "role": "assistant", "content": "SELECT T1.make, T1.model, T2.trip_id FROM transportation.vehicles AS T1 JOIN transportation.trips AS T2 ON T1.vehicle_id = T2.vehicle_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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "Show all loans with a maturity date in the next 60 days, along with their account_id, principal_amount, interest_rate, and maturity_date." }, { "role": "assistant", "content": "SELECT loan_id, account_id, principal_amount, interest_rate, maturity_date FROM financial...
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": "Show me all patients who have been prescribed medications with dosage greater than 200mg, along with their full names and the medication details, including the prescribing doctor's last name." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me all active insurance products that have a base premium less than $100, sorted by product type." }, { "role": "assistant", "content": "SELECT * FROM insurance.insurance_products WHERE is_active = true AND base_premium < 100 ORDER BY product_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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Show me the average number of current players per server for each region." }, { "role": "assistant", "content": "SELECT region, AVG(current_players) AS avg_current_players\nFROM gaming_technology.servers\nGROUP BY region;" }, { "role": "user", "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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "Show me the average difficulty for blocks that have a previous block versus those that don't have a previous block." }, { "role": "assistant", "content": "SELECT CASE WHEN previous_block_id IS NULL THEN 'No Previous Block' ELSE 'Has Previous Block' END AS block_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 blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp timestamp, nonce int, merkle_root text...
[ { "role": "user", "content": "Find pairs of documents in the same case where one document is of type 'Contract' and the other is of type 'Evidence'. Return the case_id, the contract document_name as contract_name, and the evidence document_name as evidence_name." }, { "role": "assistant", "conte...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "List all token symbols on the 'Ethereum' chain with a Realized Ratio greater than 0.9. Show the symbol and realized ratio." }, { "role": "assistant", "content": "SELECT token_symbol, realized_ratio FROM smart_money_token_performance WHERE chain = 'Ethereum' AND real...
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_token_performance ( token_address.text, token_symbol.text, pnl.numeric, net_flow.numeric, avg_cost.numeric,...
[ { "role": "user", "content": "List the patient ID and subscriber name for all patients who have both at least one diagnosis recorded and at least one primary insurance policy." }, { "role": "assistant", "content": "SELECT DISTINCT pi.patient_id, pi.subscriber_name FROM healthcare.patient_insuran...
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": "For each passenger, show their passenger_id, first_name, last_name, the date and time of their earliest booking, and the date and time of their latest booking." }, { "role": "assistant", "content": "SELECT p.passenger_id,\n p.first_name,\n p.last_name,\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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "I want to know how many times each smart contract has been invoked by transactions; also include the contract creator." }, { "role": "assistant", "content": "SELECT sc.contract_id, sc.creator_address, COUNT(t.transaction_id) AS invocation_count\nFROM blockchain.smar...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id text, block_id text, sender_address text, receiver_address text, amount numeri...
[ { "role": "user", "content": "List all insurance plans that have more than 100 distinct patients enrolled. Return plan_id, plan_name, and patient_count." }, { "role": "assistant", "content": "SELECT ip.plan_id,\n ip.plan_name,\n COUNT(DISTINCT pi.patient_id) AS patient_count\nFROM he...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.prescriptions ( prescription_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, pa...
[ { "role": "user", "content": "List all appointments scheduled for clients whose status is 'prospect', showing the client's first name, last name, and the appointment subject." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.subject FROM legal_services.clients AS c 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 legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "Show me all guests who have the same last name and are from the same city, along with how many guests share that last name and city combination." }, { "role": "assistant", "content": "SELECT last_name, city, COUNT(*) as guest_count FROM hospitality_technology.guests...
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.text, first_name.text, last_name.text, email.text, phone_number.text, date_of_...
[ { "role": "user", "content": "For each room, list the room number, property name, and the type name of the room." }, { "role": "assistant", "content": "SELECT r.room_number, p.property_name, rt.type_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.properties p ON r.property...
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 trades (trade_id, security_id, total_amount) where the trade_type is 'Buy' and the execution_venue is 'NYSE', along with the loan details (loan_type, principal_amount) for accounts that have both trades and loans." }, { "role": "assistant", "content": "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 financial_services.trades ( trade_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL, securit...
[ { "role": "user", "content": "Show the number of service orders for each status and the average total_price for each status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS order_count,\n AVG(total_price) AS avg_total_price\nFROM hospitality_technology.service_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 hospitality_technology.service_orders ( order_id.text, reservation_id.text, guest_id.text, service_id.text, staff_id_or...
[ { "role": "user", "content": "List each reservation along with the next reservation for the same guest. Show the original reservation_id, its check_out_date, the next_reservation_id, and the next reservation's check_in_date." }, { "role": "assistant", "content": "SELECT r1.reservation_id,\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 PRIMARY KEY, property_id text, guest_id text, room_id text, r...
[ { "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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ...
[ { "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": "For each doctor, show the doctor ID and the latest record date among all medical records they created." }, { "role": "assistant", "content": "SELECT doctor_id, MAX(record_date) AS latest_record_date\nFROM healthcare.medical_records\nGROUP BY doctor_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.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "role": "user", "content": "How many beneficiaries are there for each relationship type?" }, { "role": "assistant", "content": "SELECT relationship,\n COUNT(*) AS beneficiary_count\nFROM insurance.policy_beneficiaries\nGROUP BY relationship;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id character varying(64) NOT NULL, policy_id character varying(64) NOT NUL...
[ { "role": "user", "content": "List the route_number and description for routes whose origin and destination are in the same state." }, { "role": "assistant", "content": "SELECT r.route_number,\n r.description\nFROM transportation.routes r\nJOIN transportation.locations lo ON r.origin_locat...
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 transfers of the token named 'Wrapped Ether', showing the transfer id, token id, value, and the contract address of the token." }, { "role": "assistant", "content": "SELECT tt.transfer_id, tt.token_id, tt.value, t.contract_address\nFROM web3.token_transfers...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Retrieve all reservations with status 'Cancelled' and show the reservation_id, property_name, and room_type_name." }, { "role": "assistant", "content": "SELECT res.reservation_id,\n p.property_name,\n rt.type_name AS room_type_name\nFROM hospitality_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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show me the block with the earliest timestamp and its corresponding previous block's difficulty level." }, { "role": "assistant", "content": "SELECT b1.block_id, b1.timestamp, b2.difficulty AS previous_block_difficulty FROM blockchain.blocks b1 LEFT JOIN blockchain....
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 character varying(64) NOT NULL, previous_block_id character varying(64), timestamp timesta...
[ { "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, for each game, the player who achieved the highest total score, along with that total score." }, { "role": "assistant", "content": "SELECT game_id, player_id, SUM(score) AS total_score\nFROM gaming_technology.game_sessions\nGROUP BY game_id, player_id\nQUAL...
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.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time...
[ { "role": "user", "content": "I want the number of achievements unlocked per country_code by active players, showing only countries with at least 100 unlocks." }, { "role": "assistant", "content": "SELECT p.country_code, COUNT(*) AS unlock_count\nFROM gaming_technology.players p\nJOIN gaming_tec...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "List all guests who have made at least one reservation. Show their first and last names and the number of reservations they have made." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, COUNT(r.reservation_id) AS reservation_count\nFROM hospita...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, room...
[ { "role": "user", "content": "List all pairs of wallets that were created within 10 minutes of each other, showing both wallet IDs, the user_id, and both creation timestamps." }, { "role": "assistant", "content": "SELECT\n w1.wallet_id AS wallet1_id,\n w2.wallet_id AS wallet2_id,\n w1.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 web3.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "List all pending premium payments made in March 2024, showing payment_id, customer_id, amount_paid, and due_date, ordered by payment_date ascending." }, { "role": "assistant", "content": "SELECT payment_id,\n customer_id,\n amount_paid,\n 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 insurance.premium_payments ( payment_id.text, policy_id.text, customer_id.text, payment_date.timestamp, amount_paid.num...
[ { "role": "user", "content": "Show me all patients who have scheduled appointments with doctors specializing in Pediatrics, along with their appointment times and the doctors' full names." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, a.appointment_time, d.first_name AS...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "Show all trips, including the trip ID, vehicle license plate, and the vehicle's capacity." }, { "role": "assistant", "content": "SELECT t.trip_id, v.license_plate, v.capacity FROM transportation.trips t JOIN vehicles v ON t.vehicle_id = v.vehicle_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.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "Show the total number of transactions for each currency." }, { "role": "assistant", "content": "SELECT currency, COUNT(*) FROM financial_services.transactions GROUP BY currency" }, { "role": "user", "content": "Can you also include the total amount for e...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id text, account_id text, related_account_id text, transaction_type text,...
[ { "role": "user", "content": "For each premium payment, list all previous payments made by the same customer. Show customer_id, previous_payment_id, previous_payment_date, current_payment_id, current_payment_date, and amount difference." }, { "role": "assistant", "content": "SELECT p1.customer_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id text, policy_id text, customer_id text, payment_date timestamp, amount_paid num...
[ { "role": "user", "content": "For each private conversation (is_group_chat = false), list the conversation_id and the usernames of its two participants." }, { "role": "assistant", "content": "SELECT c.conversation_id,\n u1.username AS participant_one,\n u2.username AS participant_two...
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": "Find all pairs of drivers where one driver's license_expiry_date is earlier than another's. Return each pair's driver_ids, full names, and respective expiry dates." }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver1_id, d1.first_name || ' ' || d1.l...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ...
[ { "role": "user", "content": "List the notification message and sent timestamp for all notifications that were sent before '2024-07-01'." }, { "role": "assistant", "content": "SELECT message, sent_at FROM trading_platform.notifications WHERE sent_at < '2024-07-01';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id text, user_id text, message text, sent_at timestamp, read_at timestamp...
[ { "role": "user", "content": "Which are the top 5 smart money addresses with the highest ROI on the BSC chain, and what are their profit, realized ratio, and most profitable token?" }, { "role": "assistant", "content": "SELECT address, profit, roi, realized_ratio, most_profit_token FROM smart_mo...
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 text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token...