conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List all developer names and their countries." }, { "role": "assistant", "content": "SELECT name, country FROM gaming_technology.developers;" }, { "role": "user", "content": "Filter the list to only include developers from countries that start with 'U'."...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "能否帮我统计数据库中所有乘客的数量,按忠诚计划ID分组?" }, { "role": "assistant", "content": "SELECT loyalty_program_id, COUNT(*) as passenger_count\nFROM passengers\nGROUP BY loyalty_program_id;" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // PUT /schedules { "mappings": { "properties": { "schedule_id": { "type": "keyword" ...
[ { "role": "user", "content": "Find all pairs of policies for the same customer where their coverage periods overlap. Return customer_id, the two policy numbers, and their start and end dates." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n p1.policy_number AS policy_number1...
You are an SQL statement expert. Given the table 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": "Find the top 3 tokens by total supply that have a token symbol starting with 'T', showing their token names, contract addresses, and total supply." }, { "role": "assistant", "content": "SELECT token_name, contract_address, total_supply FROM web3.tokens WHERE token_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 web3.tokens ( token_id.text, contract_address.text, token_name.text, token_symbol.text, decimals.integer, total_supply....
[ { "role": "user", "content": "List all active products, showing their product ID, name, and type, ordered by their creation date." }, { "role": "assistant", "content": "SELECT product_id, product_name, product_type FROM insurance.insurance_products WHERE is_active = TRUE ORDER BY created_at;" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text, product_name text, product_type text, description text, base_premium nu...
[ { "role": "user", "content": "I want to find all notifications for messages containing the word 'holiday' in their content; include notification_id, message content, and notification created_at." }, { "role": "assistant", "content": "SELECT n.notification_id, m.content, n.created_at\nFROM social...
You are an SQL statement expert. Given the table 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.messages ( message_id.text, conversation_id.text, sender_user_id.text, content.text, media_url.text, media...
[ { "role": "user", "content": "Show me all claims with police reports that were filed in the last 3 months, along with their policy details and estimated loss amounts." }, { "role": "assistant", "content": "SELECT cl.claim_id, cl.policy_id, cl.estimated_loss, cl.incident_date, cl.reported_date, p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text, policy_number.text, start_date.d...
[ { "role": "user", "content": "List the token symbol and name for all tokens whose associated contract address has emitted at least one event. Also include the contract address." }, { "role": "assistant", "content": "SELECT T.token_symbol, T.token_name, T.contract_address FROM web3.tokens AS T 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 web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "How many prescriptions have been issued per patient?" }, { "role": "assistant", "content": "SELECT patient_id, COUNT(*) AS prescription_count\nFROM healthcare.prescriptions\nGROUP BY patient_id;" }, { "role": "user", "content": "Only show patients who ha...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.prescriptions ( prescription_id text, record_id text, patient_id text, doctor_id text, medication_id text, d...
[ { "role": "user", "content": "Show me all diagnoses that correspond to a medication based on matching the diagnosis_code with the medication's NDC code, and include diagnosis_id, patient_id, diagnosis_date, medication_name, and status." }, { "role": "assistant", "content": "SELECT d.diagnosis_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.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, patient_i...
[ { "role": "user", "content": "Calculate the average cost_per_unit for each fuel_type from the fuel_logs table." }, { "role": "assistant", "content": "SELECT fuel_type,\n AVG(cost_per_unit) AS avg_cost_per_unit\nFROM transportation.fuel_logs\nGROUP BY fuel_type;" }, { "role": "user"...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "List the first name, last name, and hire date of all lawyers who are partners." }, { "role": "assistant", "content": "SELECT first_name , last_name , hire_date FROM legal_services.lawyers WHERE is_partner = TRUE" } ]
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the lawyer first_n...
[ { "role": "user", "content": "Show me the top 5 tokens by PnL on the Ethereum chain, along with their token symbol and ROI." }, { "role": "assistant", "content": "SELECT token_symbol, pnl, roi FROM smart_money_token_performance WHERE chain = 'Ethereum' ORDER BY pnl DESC LIMIT 5;" }, { "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 smart_money_token_performance ( token_address character varying(100) NOT NULL, -- the token's address token_symbol char...
[ { "role": "user", "content": "What is the average number of appointments assigned per employee for each job title?" }, { "role": "assistant", "content": "SELECT e.job_title, CAST(COUNT(a.appointment_id) AS REAL) / COUNT(DISTINCT e.employee_id) AS average_appointments_per_employee FROM government...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, agency_id text, service_name text, description text, catego...
[ { "role": "user", "content": "Get the five most recent public posts that have media_type = 'video', showing post_id, created_at, and the author's username." }, { "role": "assistant", "content": "SELECT\n p.post_id,\n p.created_at,\n u.username\nFROM social_media.posts p\nJOIN social_media.use...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, full_name.text, profile_picture_url.t...
[ { "role": "user", "content": "Show the number of law firms founded each year, with the founding year and the count of firms, ordered by year in descending order." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM founded_date) AS founding_year, COUNT(*) AS firm_count FROM legal_serv...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, -- unique identifier for the law firm firm_...
[ { "role": "user", "content": "For each customer with at least one open claim, list the customer_id, first_name, last_name, policy_number, claim_id, and incident_date." }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_number, cl.claim_id, cl.incident...
You are an SQL statement expert. Given the table 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": "List all pairs of tokens that are deployed on the same contract address and have the same number of decimals. Show both token IDs, the shared contract_address, and the decimals value." }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id_1, t2.token_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "Retrieve each prescription's id, patient's full name, medication_name, and prescription_date for prescriptions where dosage contains 'tablet'." }, { "role": "assistant", "content": "SELECT pr.prescription_id, CONCAT(p.first_name, ' ', p.last_name) AS patient_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 the first and last names of all customers with policies having a premium amount greater than 3000, along with their policy number and policy status." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, p.policy_number, p.status\nFROM insu...
You are an SQL statement expert. Given the table 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": "Show the usernames and email addresses of all users who have never created a post." }, { "role": "assistant", "content": "SELECT u.username, u.email\nFROM social_media.users u\nLEFT JOIN social_media.posts p ON u.user_id = p.user_id\nWHERE p.post_id IS NULL;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "What is the fuel efficiency of the train car with car_id 'TC456'?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the fuel efficiency of specific train cars. The data available in the train_cars table only includes deta...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "role": "user", "content": "Retrieve all transactions where the total value of token transfers in that transaction exceeds the Ether value of the transaction itself. Include transaction_id, ether_value, and total_token_value." }, { "role": "assistant", "content": "SELECT\n t.transaction_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 web3.transactions ( transaction_id character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add...
[ { "role": "user", "content": "我想查询某个飞机构建的所有检查记录,包括检查类型、检查结果、检查时间以及被检查的组件名称。" }, { "role": "assistant", "content": "MATCH (ab:AircraftBuild)-[:UNDERWENT]->(i:Inspection)-[:INSPECTED_COMPONENT]->(c:Component)\nWHERE ab.build_id = 'specific_build_id'\nRETURN i.inspection_type, i.result, i.inspectio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str...
[ { "role": "user", "content": "For each service category, find the total number of notifications sent related to applications of services in that category." }, { "role": "assistant", "content": "SELECT s.category, COUNT(n.notification_id) AS notification_count\nFROM government_services.notificati...
You are an SQL statement expert. Given the table 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, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Find all pairs of different insurance records that share the same group_number, and show group_number, the patient_insurance_id of both records, and their corresponding patient_ids." }, { "role": "assistant", "content": "SELECT a.group_number,\n a.patient_insu...
You are an SQL statement expert. Given the table 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 text, patient_id text, plan_id text, policy_number text, group_numb...
[ { "role": "user", "content": "Find pairs of players who unlocked the same achievement within 1 minute of each other. Show the achievement ID, the two player IDs (labeled player1_id, player2_id), and the unlock timestamps (labeled unlock1_at, unlock2_at)." }, { "role": "assistant", "content": "SE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid N...
[ { "role": "user", "content": "List all staff members who have responded to at least one review in the last 6 months, including their first and last names and the count of responses." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, COUNT(r.review_id) AS respons...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "Show the agency names and the number of active services they currently offer. List only those agencies with more than 2 active services." }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(s.service_id) AS active_service_count\nFROM government_service...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "Which achievement has the highest point value for each game?" }, { "role": "assistant", "content": "SELECT a1.game_id, a1.achievement_id, a1.name, a1.points FROM gaming_technology.achievements a1 WHERE a1.points = (SELECT MAX(a2.points) FROM gaming_technology.achiev...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p...
[ { "role": "user", "content": "Show me all users who have wallets but have never placed any orders, along with their wallet addresses and creation dates." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, w.address AS wallet_address, w.created_at FROM trading_platform.users u JOIN ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "Retrieve all service orders including order_id, service_name, guest full name, order_timestamp, and status for orders placed in the 'Spa' category." }, { "role": "assistant", "content": "SELECT so.order_id, s.service_name, CONCAT(g.first_name, ' ', g.last_name) AS g...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id text PRIMARY KEY, property_id text, room_number text, room_type_id text, floor i...
[ { "role": "user", "content": "List each patient and the number of different insurance plans they have had. Include patient_id and plan_count." }, { "role": "assistant", "content": "SELECT patient_id, COUNT(DISTINCT plan_id) AS plan_count\nFROM healthcare.patient_insurance\nGROUP BY patient_id;" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id text PRIMARY KEY, record_id text, patient_id text, doctor_id text, diagnosis_code t...
[ { "role": "user", "content": "Return the count of comments for each hashtag." }, { "role": "assistant", "content": "SELECT ph.hashtag_id,\n h.tag_name,\n COUNT(c.comment_id) AS comment_count\nFROM social_media.post_hashtags ph\nJOIN social_media.hashtags h\n ON ph.hashtag_id = h.has...
You are an SQL statement expert. Given the table 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": "Could you provide a list of each diagnosis, the full name of the doctor who made it, and the name of the insurance plan whose contact phone number matches the doctor's phone number? Please include diagnosis_id, description, doctor full name, and insurance plan 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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "List all pairs of token IDs that share the same decimals value, and show the shared decimals." }, { "role": "assistant", "content": "SELECT t1.token_id AS token1_id,\n t2.token_id AS token2_id,\n t1.decimals\nFROM web3.tokens t1\nJOIN web3.tokens t2\n 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 web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "Find the claim ID and the total number of documents associated with each claim ID that has more than 10 documents." }, { "role": "assistant", "content": "SELECT claim_id, COUNT(*) FROM insurance.claim_documents GROUP BY claim_id HAVING COUNT(*) > 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 insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id character varying(64) NOT NULL, docume...
[ { "role": "user", "content": "List all wallet addresses holding NFT contract '0xbbbb...' and token ID '99'." }, { "role": "assistant", "content": "SELECT wallet_address, amount\nFROM nft_holders\nWHERE contract_address = '0xbbbb...'\n AND token_id = '99';" }, { "role": "user", "cont...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "List all NFT collections from the sui_nfts table where the owner is not null, including their name and collection_type." }, { "role": "assistant", "content": "SELECT name, collection_type FROM sui_nfts WHERE owner IS NOT NULL;" }, { "role": "user", "cont...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "List the order ID, type, and quantity for all orders placed using the wallet with ID 'wallet123'." }, { "role": "assistant", "content": "SELECT order_id, order_type, quantity FROM orders WHERE wallet_id = 'wallet123'" }, { "role": "user", "content": "Als...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "For each case, show its name, case number, the total hours worked by all lawyers, and the name of the client associated with the case." }, { "role": "assistant", "content": "SELECT c.case_name, c.case_number, SUM(te.hours_spent) AS total_hours, cl.first_name || ' ' ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "Find the average percentage share among all beneficiaries for each distinct relationship type." }, { "role": "assistant", "content": "SELECT relationship, AVG(percentage_share) FROM insurance.policy_beneficiaries GROUP BY relationship ORDER 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.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Find all non-smoking rooms that have not been cleaned in the last 7 days." }, { "role": "assistant", "content": "SELECT room_id, room_number, last_cleaned_at\nFROM hospitality_technology.rooms\nWHERE is_smoking = false\n AND last_cleaned_at < NOW() - INTERVAL '7 da...
You are an SQL statement expert. Given the table 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": "Get all documents uploaded by lawyers who are partners." }, { "role": "assistant", "content": "SELECT d.document_id, d.document_name, d.case_id, d.upload_timestamp\nFROM legal_services.documents d\nJOIN legal_services.lawyers l ON d.uploaded_by_lawyer_id = l.lawyer_...
You are an SQL statement expert. Given the table 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": "For all bookings, can you provide the booking ID, the passenger ID, and the make and model of the vehicle used for the associated trip?" }, { "role": "assistant", "content": "SELECT b.booking_id, b.passenger_id, v.make, v.model\nFROM transportation.bookings b\nJOIN ...
You are an SQL statement expert. Given the table 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": "Which insurance agents have handled claims for policies they personally sold? Show the agent_id, agent's first and last name, the claim_id, and the policy_number." }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name, a.last_name, c.claim_id, p.poli...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "Count the number of appointments that have a status of 'Cancelled'." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.appointments WHERE status = 'Cancelled';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id text, location_id text, service_id...
[ { "role": "user", "content": "Show each wallet address that has received token transfers of more than one type of token, along with the count of token types received." }, { "role": "assistant", "content": "SELECT tt.to_address, COUNT(DISTINCT tt.token_id) AS token_type_count\nFROM web3.token_tra...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, address text, abi text, bytecode text, deployer_address text, deployed_a...
[ { "role": "user", "content": "List all claims, showing the claim ID, incident date, and the associated policy number." }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.incident_date, T2.policy_number FROM insurance.claims AS T1 JOIN insurance.policies AS T2 ON T1.policy_id = T2.polic...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Retrieve review comments with their reservation's check-in and check-out dates." }, { "role": "assistant", "content": "SELECT rv.comment, r.check_in_date, r.check_out_date\nFROM hospitality_technology.reviews rv\nJOIN hospitality_technology.reservations r ON rv.rese...
You are an SQL statement expert. Given the table 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": "What is the average total_supply for each decimals value?" }, { "role": "assistant", "content": "SELECT decimals, AVG(total_supply) AS avg_supply\nFROM web3.tokens\nGROUP BY decimals;" }, { "role": "user", "content": "Actually, I only want to include tok...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id text PRIMARY KEY, contract_address text, token_name text, token_symbol text, decimals int, total...
[ { "role": "user", "content": "List all pairs of vehicles from the same depot that have different fuel types. Include vehicle1_id, fuel_type1, vehicle2_id, fuel_type2, and the depot_id." }, { "role": "assistant", "content": "SELECT v1.vehicle_id AS vehicle1_id, v1.fuel_type AS fuel_type1, v2.vehi...
You are an SQL statement expert. Given the table 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": "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 blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "role": "user", "content": "List the appointment ID, subject, location, and lawyer ID for all appointments where there is at least one other appointment with the same location and lawyer assigned." }, { "role": "assistant", "content": "SELECT appointment_id, subject, location, lawyer_id FROM 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 legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "content": "Show me the top 5 transactions by value along with the token names transferred in those transactions." }, { "role": "assistant", "content": "SELECT t.transaction_id, t.value, tok.token_name FROM web3.transactions t JOIN web3.token_transfers tt ON t.transaction_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.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "List all medication names, their manufacturers, and NDC codes." }, { "role": "assistant", "content": "SELECT medication_name, manufacturer, ndc_code\nFROM healthcare.medications;" }, { "role": "user", "content": "Now restrict to only those entries 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 healthcare.medications ( medication_id character varying(64) NOT NULL, medication_name character varying(255) NOT NULL,...
[ { "role": "user", "content": "List the message_id, content, sender's username, and group_name for all messages in group chats." }, { "role": "assistant", "content": "SELECT m.message_id, m.content, u.username, c.group_name\nFROM social_media.messages m\nJOIN social_media.conversations c ON m.con...
You are an SQL statement expert. Given the table 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 case numbers and names, along with the full name of the client associated with each case." }, { "role": "assistant", "content": "SELECT T1.case_number, T1.case_name, T2.first_name, T2.last_name FROM cases AS T1 JOIN clients AS T2 ON T1.client_id = T2.client...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "For each maintenance log, find the upcoming scheduled service by joining on next_service_due_date matching another log's service_date. Show l1.log_id, l1.vehicle_id, l1.service_date, l2.log_id AS upcoming_log_id, and l2.service_date AS upcoming_service_date." }, { "role...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.maintenance_logs ( log_id text, vehicle_id text, service_date date, odometer_reading integer, service_ty...
[ { "role": "user", "content": "List the total traded amount and total commission for each security, including the security name." }, { "role": "assistant", "content": "SELECT s.security_id, s.security_name, SUM(t.total_amount) AS total_traded_amount, SUM(t.commission) AS total_commission\nFROM fi...
You are an SQL statement expert. Given the table 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, -- unique identifier for the trade account...
[ { "role": "user", "content": "Count the number of smart contracts deployed for each unique creator address." }, { "role": "assistant", "content": "SELECT creator_address, COUNT(*) FROM blockchain.smart_contracts GROUP BY creator_address;" }, { "role": "user", "content": "Show me only...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "role": "user", "content": "Show me all messages sent in the system, along with their sender's username and the time they were sent." }, { "role": "assistant", "content": "SELECT m.message_id, m.content, u.username, m.sent_at\nFROM social_media.messages m\nJOIN social_media.users u ON m.sender...
You are an SQL statement expert. Given the table 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 smart money addresses with a realized ratio greater than 0.9 and a profit greater than 50000. Show the address, chain, realized ratio, and profit." }, { "role": "assistant", "content": "SELECT address, chain, realized_ratio, profit FROM smart_money_profit 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 cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "Can you provide the total number of fuel refueling events and the sum of total_cost at each fueling location, including the location name and city?" }, { "role": "assistant", "content": "SELECT l.location_id, l.name, l.city, COUNT(fl.fuel_log_id) AS num_refuels, SUM...
You are an SQL statement expert. Given the table 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": "Which lawyers were hired in 2024 and have not handled any appointments yet? Please show their first and last names, hire date, and specialization." }, { "role": "assistant", "content": "SELECT l.first_name, l.last_name, l.hire_date, l.specialization\nFROM legal_serv...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "Get the number of agents grouped by status. Return status and agent_count." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS agent_count\n FROM insurance.agents\n 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.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "Get the total number of logs per user for July 2024." }, { "role": "assistant", "content": "SELECT user_id,\n COUNT(*) AS log_count\nFROM trading_platform.logs\nWHERE logged_at BETWEEN '2024-07-01' AND '2024-07-31'\nGROUP BY user_id;" }, { "role": "use...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.logs ( log_id text PRIMARY KEY, user_id text, action text, details text, logged_at timestamp )
[ { "role": "user", "content": "Compute for each narrative the average ROI from smart_money_token_performance and the total usd_value of buy transactions (type=1) from smart_money_token_inflow. Show narrative, avg_roi, total_buy_usd_value, and chain." }, { "role": "assistant", "content": "SELECT 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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,...
[ { "role": "user", "content": "List all patients who have insurance plans with group numbers, showing their patient IDs and the count of such plans per patient." }, { "role": "assistant", "content": "SELECT patient_id, COUNT(*) AS plan_count FROM healthcare.patient_insurance WHERE group_number IS...
You are an SQL statement expert. Given the table 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, -- unique identifier for this p...
[ { "role": "user", "content": "I want a list of all claims where at least one document is larger than 2 megabytes. Include the claim ID, incident date, and the file name of such documents." }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, d.file_name\nFROM insurance.claim...
You are an SQL statement expert. Given the table 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, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "Show me all guests who have not provided their date of birth, along with their email if available, ordered by created date." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM hospitality_technology.guests WHERE date_of_birth IS NULL ORDE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil...
[ { "role": "user", "content": "Show me invoices where the total amount is greater than 5000. Display the invoice number, total amount, and client ID." }, { "role": "assistant", "content": "SELECT invoice_number, total_amount, client_id FROM invoices WHERE total_amount > 5000;" }, { "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 legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case_id.text, issue_date.date, due_date...
[ { "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 hospitality_technology.staff ( staff_id character varying(64) NOT NULL, -- unique identifier for the staff member ...
[ { "role": "user", "content": "For each service category, count the number of appointments scheduled in the next 7 days. Return the category and appointment count." }, { "role": "assistant", "content": "SELECT s.category, COUNT(a.appointment_id) AS upcoming_appointments\nFROM government_services....
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, agency_id character varying(64) NOT NULL, ser...
[ { "role": "user", "content": "Show me the total transaction amount sent by each user (based on user_id) in the last 30 days, along with their username." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, SUM(t.amount) AS total_amount_sent FROM blockchain.users u 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.transactions ( transaction_id.text, block_id.text, sender_address.text, receiver_address.text, amount.numeri...
[ { "role": "user", "content": "Count the number of hashtags associated with each post." }, { "role": "assistant", "content": "SELECT post_id,\n COUNT(hashtag_id) AS hashtag_count\nFROM social_media.post_hashtags\nGROUP BY post_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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Count the number of posts that have received at least one comment." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT post_id) FROM social_media.comments" } ]
You are an SQL statement expert. Given the table 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": "Show the count of patients residing in each unique address, excluding any entries with no address listed." }, { "role": "assistant", "content": "SELECT address, COUNT(patient_id) AS patient_count FROM healthcare.patients WHERE address IS NOT NULL AND address != '' G...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "Show me all doctors whose first name contains 'an'. Return their doctor ID, full name, and hospital affiliation ID." }, { "role": "assistant", "content": "SELECT doctor_id, first_name, last_name, hospital_affiliation_id\nFROM healthcare.doctors\nWHERE first_name ILI...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "Show me the first name and last name of citizens who have scheduled appointments for services offered by agencies whose agency_id starts with 'AG'. Also include the service name." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, s.service_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 government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli...
[ { "role": "user", "content": "For each Sui coin type with status 'exists' in both sui_coins and sui_coins_metadata, calculate the average balance per owner. Include coin_type, symbol, name, description, and avg_balance. Sort by avg_balance descending." }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "List all cryptocurrency assets that have wallet addresses associated with them." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name, a.symbol FROM trading_platform.assets a JOIN trading_platform.wallets w ON a.asset_id = w.asset_id WHERE a.type = 'crypt...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp ) CREATE ...
[ { "role": "user", "content": "I would like to get the total number of sessions and the average score for each game, showing game_id and title." }, { "role": "assistant", "content": "SELECT g.game_id, g.title, COUNT(gs.session_id) AS total_sessions, AVG(gs.score) AS average_score\nFROM 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.games ( game_id uuid, title text, developer_id uuid, publisher_id uuid, genre text, release_date date...
[ { "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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Find all users who registered with a Yahoo email address, along with their registration dates." }, { "role": "assistant", "content": "SELECT user_id, username, email, password_hash FROM blockchain.users WHERE email LIKE '%@yahoo.com';" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "role": "user", "content": "Show me all invoices, displaying their invoice number and the payment date, for invoices that have been fully paid." }, { "role": "assistant", "content": "SELECT invoice_number, payment_date FROM legal_services.invoices WHERE status = 'Paid';" } ]
You are an SQL statement expert. Given the table 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": "What is the ticket price for a journey on train number T4321?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about ticket prices for specific trains. The data I have is limited to train details such as model, manufacturer, c...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "role": "user", "content": "Show the number of UTXOs associated with each unique address in the system." }, { "role": "assistant", "content": "SELECT address, COUNT(utxo_id) FROM trading_platform.utxos GROUP BY 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 trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type text ) CREATE TABLE trading_platform....
[ { "role": "user", "content": "List the application ID, citizen ID, assigned employee's full name, and total amount paid for each approved application." }, { "role": "assistant", "content": "SELECT a.application_id,\n a.citizen_id,\n e.first_name || ' ' || e.last_name AS employee_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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "List all servers that have zero current players. Show their server name, region, and status." }, { "role": "assistant", "content": "SELECT server_name, region, status FROM gaming_technology.servers WHERE current_players = 0;" }, { "role": "user", "conten...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p...
[ { "role": "user", "content": "Which available services in the 'Wellness' category are offered by each property? Please show property_id, service_name, and price." }, { "role": "assistant", "content": "SELECT property_id, service_name, price FROM hospitality_technology.services WHERE 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.services ( service_id text PRIMARY KEY, property_id text, service_name text, description text, c...
[ { "role": "user", "content": "Show me all maintenance logs for 'Oil Change' services performed in the last 6 months, including the vehicle ID, service date, and cost." }, { "role": "assistant", "content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE service_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 transportation.maintenance_logs ( log_id character varying(64) NOT NULL, -- unique identifier for the maintenance ...
[ { "role": "user", "content": "Which staff members have never been assigned a manager? List their full names and property IDs." }, { "role": "assistant", "content": "SELECT staff_id, first_name, last_name, property_id\nFROM hospitality_technology.staff\nWHERE manager_id IS NULL;" }, { "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 hospitality_technology.staff ( staff_id character varying(64) NOT NULL, -- unique identifier for the staff member ...
[ { "role": "user", "content": "Show all policy numbers with their corresponding payment_id and amount_paid for payments made on or after January 1st, 2024." }, { "role": "assistant", "content": "SELECT p.policy_number, pp.payment_id, pp.amount_paid\nFROM insurance.premium_payments pp\nJOIN insura...
You are an SQL statement expert. Given the table 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 wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and amount, from the nft_holders table." }, { "role": "assistant", "content": "SELECT wallet_address, token_id, amount FROM nft_holders WHERE contract_type = 'ERC1155...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "Can you show me the total number of available services and the average price for each department?" }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS available_service_count, AVG(price) AS average_price FROM hospitality_technology.services WHERE is...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id.text, property_id.text, service_name.text, description.text, category.text...
[ { "role": "user", "content": "List each game's title along with the name of the developer and the total number of servers currently hosting that game." }, { "role": "assistant", "content": "SELECT g.title, g.developer_id, COUNT(s.server_id) AS total_servers\nFROM gaming_technology.games g\nLEFT ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt...
[ { "role": "user", "content": "For each route, list the route_number, origin city, destination city, and the total fare collected from completed bookings." }, { "role": "assistant", "content": "SELECT\n r.route_number,\n lo.city AS origin_city,\n ld.city AS destination_city,\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": "For the latest snapshot time, list the total `usd_value` held by CEXes for each distinct `token_symbol` across all chains. Order the results by total value descending." }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT max(snapshot_time) as 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 cex_token_balance (", "snapshot_time character varying(32) NOT NULL, -- the snapshot time of record, converted ...
[ { "role": "user", "content": "Show me all home loans (loan_id, principal_amount, interest_rate) where the current principal balance is more than 75% of the original principal amount, along with the account_id and employee details (first_name, last_name) of the employee who processed the loan application." ...
You are an SQL statement expert. Given the table 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,...