conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "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": "List all accounts (account_id, account_number, balance) that have at least one trade with a quantity greater than 1000, along with the count of such trades for each account." }, { "role": "assistant", "content": "SELECT a.account_id, a.account_number, a.balance, COU...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac...
[ { "role": "user", "content": "Can you help me count the total number of active staff members in the database?" }, { "role": "assistant", "content": "db.staff.countDocuments({ is_active: true });" } ]
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 // db.createCollection('stations') // Optional: Add unique index: db.stations.createIndex({ stati...
[ { "role": "user", "content": "Give me the total commission and average price_per_unit for each execution_venue for trades executed in the last 30 days." }, { "role": "assistant", "content": "SELECT execution_venue, SUM(commission) AS total_commission, AVG(price_per_unit) AS avg_price\nFROM finan...
You are an SQL statement expert. Given the table 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.text, account_id.text, security_id.text, order_id.text, trade_type.text, quantity....
[ { "role": "user", "content": "Show me all DApps that have 'exchange' in their name or description, along with their URLs and creation dates." }, { "role": "assistant", "content": "SELECT dapp_id, name, description, url FROM trading_platform.dapps WHERE name LIKE '%exchange%' OR description LIKE ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "List all pairs of employees who work in the same department but at different branches. For each pair, show the employee_id and branch_id for both members." }, { "role": "assistant", "content": "SELECT a.employee_id AS employee_id_a, a.branch_id AS branch_id_a, b.emp...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, -- unique identifier for the account c...
[ { "role": "user", "content": "For each payment, list its payment_id, guest_id, payment_timestamp, and the next payment_id and next payment_timestamp made by the same guest." }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.guest_id,\n p.payment_timestamp,\n n.paym...
You are an SQL statement expert. Given the table 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.payments ( payment_id text, reservation_id text, guest_id text, bill_id text, amount numeric, cu...
[ { "role": "user", "content": "Calculate the average 24-hour trading volume for all tokens listed in DEX pools on the 'BSC' chain." }, { "role": "assistant", "content": "SELECT AVG(volume_24h) FROM token_dexpool_info WHERE chain = 'BSC'" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "Get the count of unread messages for each conversation participant. Show user_id, conversation_id, and unread_count." }, { "role": "assistant", "content": "SELECT cp.user_id,\n cp.conversation_id,\n COUNT(m.message_id) AS unread_count\nFROM social_media....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, content text, medi...
[ { "role": "user", "content": "Show me the number of employees in each job title and department, for only employees whose status is 'Active'." }, { "role": "assistant", "content": "SELECT job_title, department, COUNT(employee_id) AS employee_count\nFROM financial_services.employees\nWHERE 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 financial_services.securities ( security_id text, ticker_symbol text, isin_code text, cusip_code text, security_name te...
[ { "role": "user", "content": "For each property, show the property name, average price of available services, and the maximum price of available services." }, { "role": "assistant", "content": "SELECT p.property_name,\n AVG(s.price) AS avg_price,\n MAX(s.price) AS max_price\nFROM hos...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "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": "Retrieve all users and their associated wallet identifiers." }, { "role": "assistant", "content": "SELECT T1.username , T2.wallet_id FROM blockchain.users AS T1 JOIN blockchain.wallets AS T2 ON T1.user_id = T2.user_id" }, { "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 blockchain.nodes ( node_id character varying(64) NOT NULL, -- unique identifier for the node ip_address charac...
[ { "role": "user", "content": "List all premium payments that are currently overdue (status = 'overdue'), showing their policy IDs and due dates." }, { "role": "assistant", "content": "SELECT payment_id, policy_id, due_date FROM insurance.premium_payments WHERE status = 'overdue';" }, { "...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, policy_id text, customer_id text, payment_date timestamp, amo...
[ { "role": "user", "content": "Show me the total quantity traded and the average trade price for each asset, including the asset's name and symbol." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name AS asset_name, a.symbol AS asset_symbol, SUM(t.quantity) AS total_quantity_traded, 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 trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "role": "user", "content": "Retrieve the policy_number, start_date, end_date, premium_amount, and corresponding product_name for policies with a coverage_limit greater than 500000." }, { "role": "assistant", "content": "SELECT p.policy_number, p.start_date, p.end_date, p.premium_amount, ip.pro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "For each driver status, find the earliest and latest hire date. Show status, earliest hire date, and latest hire date." }, { "role": "assistant", "content": "SELECT\n status,\n MIN(hire_date) AS earliest_hire_date,\n MAX(hire_date) AS latest_hire_date\nFROM trans...
You are an SQL statement expert. Given the table 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": "For Sui coins, can you show the coin_type and owner address for each coin where the balance is greater than 100000?" }, { "role": "assistant", "content": "SELECT coin_type, owner FROM sui_coins WHERE CAST(balance AS NUMERIC) > 100000;" }, { "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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "Show me the tag name and creation timestamp for all hashtags recorded in the system." }, { "role": "assistant", "content": "SELECT tag_name, created_at FROM social_media.hashtags;" } ]
You are an SQL statement expert. Given the table 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 NFTs with a rarity rank less than 100 and show their name and the name of their collection." }, { "role": "assistant", "content": "SELECT nm.name AS nft_name, nc.name AS collection_name FROM nft_metadata nm JOIN nft_collections nc ON nm.contract_address = n...
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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "List all documents with their document_name, document_type, the name of the associated case, and the first and last name of the client who owns the case." }, { "role": "assistant", "content": "SELECT d.document_id, d.document_name, d.document_type, c.case_name, cl.f...
You are an SQL statement expert. Given the table 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": "Which players have unlocked any achievement?" }, { "role": "assistant", "content": "SELECT DISTINCT player_id FROM player_achievements;" }, { "role": "user", "content": "Show me the player ID and the total number of points they've accumulated from all un...
You are an SQL statement expert. Given the table 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, game_id.uuid, name.text, description.text, icon_url.text, points....
[ { "role": "user", "content": "Find maintenance log pairs for the same vehicle where the odometer reading is significantly higher in the second log compared to the first. Show the vehicle ID, service date and odometer for both logs in the pair, for increases greater than 50,000." }, { "role": "assist...
You are an SQL statement expert. Given the table 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, vehicle_id character varying(64) NOT NULL, ser...
[ { "role": "user", "content": "Show the first and last names of citizens who appear in both the appointments table and the payments table." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name , T1.last_name FROM government_services.citizens AS T1 JOIN government_services.appointm...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Show the names of all insurance plans and the number of patients enrolled in each plan." }, { "role": "assistant", "content": "SELECT ip.plan_name, COUNT(pi.patient_id) AS enrolled_patients FROM healthcare.insurance_plans ip JOIN healthcare.patient_insurance pi ON i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Show me all room types with a base rate over $200 and max occupancy of at least 4, along with their property IDs and amenities." }, { "role": "assistant", "content": "SELECT rt.room_type_id, rt.property_id, rt.type_name, rt.base_rate, rt.max_occupancy, rt.amenities ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, property_id character varying(64) NOT ...
[ { "role": "user", "content": "Show me all transactions (transaction_id, amount, transaction_type) where the transaction_type is 'Transfer' and the status is 'Completed', along with the account_id and related_account_id." }, { "role": "assistant", "content": "SELECT transaction_id, amount, transa...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the trans...
[ { "role": "user", "content": "Show the names and policy numbers of all insured patients whose policy is currently expired." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, pi.policy_number, pi.expiration_date\nFROM healthcare.patients p\nJOIN healthcare.patient_insurance ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "How many lawyers are there in each specialization?" }, { "role": "assistant", "content": "SELECT specialization, COUNT(*) AS lawyer_count\nFROM legal_services.lawyers\nGROUP BY specialization;" }, { "role": "user", "content": "Only include specialization...
You are an SQL statement expert. Given the table 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": "I want to see the total fare and number of bookings for each passenger." }, { "role": "assistant", "content": "SELECT b.passenger_id, COUNT(b.booking_id) AS booking_count, SUM(b.fare) AS total_fare\nFROM transportation.bookings b\nGROUP BY b.passenger_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.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "Show me all documents uploaded by lawyers from law firms located in 'New York'. Include the document name, upload timestamp, the first and last name of the uploading lawyer, and the firm name." }, { "role": "assistant", "content": "SELECT d.document_name, d.upload_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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "Find all patients along with the number of unique diagnoses each has received. Only include patients who have at least two diagnoses." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, COUNT(DISTINCT d.diagnosis_id) AS num_diagnos...
You are an SQL statement expert. Given the table 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 all diagnosis codes and descriptions for patients diagnosed by doctor 'doctor_789'." }, { "role": "assistant", "content": "SELECT patient_id, diagnosis_code, description FROM healthcare.diagnoses WHERE doctor_id = 'doctor_789';" }, { "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 healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty...
[ { "role": "user", "content": "Show each passenger's first_name, last_name, and the total number of bookings they have made." }, { "role": "assistant", "content": "SELECT p.passenger_id, p.first_name, p.last_name, COUNT(b.booking_id) AS booking_count\nFROM transportation.passengers p\nLEFT JOIN 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.vehicles ( vehicle_id text, license_plate text, vin text, make text, model text, year integer, type text...
[ { "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(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "List all prescriptions for patients whose address contains 'New York'. Show the patient's first name, last name, medication name, and prescription date." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.medication_name, T3.prescription_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 healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Show me all patients who have been prescribed medications with dosage greater than 100mg, along with their full names and the medication details." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, m.medication_name, m.generic_name, pr.dosage, 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.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "Count the number of policies issued in each calendar year, and show the year and the count." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM issued_at), COUNT(*) FROM insurance.policies WHERE issued_at IS NOT NULL GROUP BY 1 ORDER BY 1;" } ]
You are an SQL statement expert. Given the table 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 post IDs and the corresponding hashtag names where posts were created near latitude 40.0 and longitude -74.0." }, { "role": "assistant", "content": "SELECT p.post_id, h.tag_name\nFROM social_media.posts p\nJOIN social_media.post_hashtags ph ON p.post_id = 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 social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u...
[ { "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": "List properties and the average base rate of their room types." }, { "role": "assistant", "content": "SELECT T1.property_name , AVG(T2.base_rate) FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_types AS T2 ON T1.property_id = T2.prop...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, -- unique identifier for the room ...
[ { "role": "user", "content": "Show each user_id for users with 'pending' KYC status along with the count of unread notifications they have." }, { "role": "assistant", "content": "SELECT k.user_id, COUNT(n.notification_id) AS unread_count\nFROM trading_platform.kyc_audit k\nJOIN trading_platform....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.orders ( order_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, wallet_id ch...
[ { "role": "user", "content": "Show the contract address and total number of approvals for all ERC20 tokens from the erc20_approval table." }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS total_approvals\nFROM erc20_approval\nGROUP BY contract_address;" }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "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": "Show me all properties in California with a star rating above 4.0, along with their city and postal code." }, { "role": "assistant", "content": "SELECT property_name, city, postal_code FROM hospitality_technology.properties WHERE state_province = 'California' AND st...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "For each player, can you find the username and registration_date of the player who registered immediately before them in the same country?" }, { "role": "assistant", "content": "SELECT p.player_id,\n p.username AS current_username,\n p.registration_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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "List the name of each agency and the total number of service locations it operates in New York State." }, { "role": "assistant", "content": "SELECT a.agency_name, COUNT(sl.location_id) AS location_count\nFROM government_services.agencies a\nLEFT JOIN government_serv...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "For each sender and recipient pair, show the total number of transfers and the sum of value sent between them." }, { "role": "assistant", "content": "SELECT from_address, to_address, COUNT(*) AS transfer_count, SUM(value) AS total_value\nFROM web3.token_transfers\nG...
You are an SQL statement expert. Given the table 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.token_transfers ( transfer_id.text, token_id.text, from_address.text, to_address.text, value.numeric, transaction_...
[ { "role": "user", "content": "Show each player's total session count and the date of their earliest acquired inventory item." }, { "role": "assistant", "content": "SELECT gs.player_id,\n COUNT(gs.session_id) AS session_count,\n MIN(pi.acquired_at) AS first_item_date\nFROM gaming_tech...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, game_id ...
[ { "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 PRIMARY KEY, first_name text, last_name text, email text, phone_number te...
[ { "role": "user", "content": "Show me the top 5 users who have the highest total trade volume (quantity * price) as buyers, along with the number of distinct assets they traded." }, { "role": "assistant", "content": "SELECT t.buyer_id, u.email, SUM(t.quantity * t.price) AS total_volume, COUNT(DI...
You are an SQL statement expert. Given the table 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": "For each property, compute the average price and count of available services grouped by department." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, s.department, COUNT(*) AS service_count, AVG(s.price) AS avg_price\nFROM hospitality_tec...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "List payment records in USD including guest names and processing staff names." }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.amount,\n p.currency_code,\n g.guest_name,\n s.staff_name\nFROM hospitality_technology.payments p\nJ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "role": "user", "content": "Show the reference number, status, and the name of the agency for all applications submitted for services in the 'Permits' category." }, { "role": "assistant", "content": "SELECT a.reference_number, a.status, ag.agency_name\nFROM government_services.applications a\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 government_services.agencies ( agency_id character varying(64) NOT NULL, -- unique identifier for the agency ag...
[ { "role": "user", "content": "Show the name and city of all maintenance facility locations and include the total number of maintenance logs performed at each location." }, { "role": "assistant", "content": "SELECT l.name, l.city, COUNT(m.log_id) AS maintenance_count\nFROM transportation.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.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "Count the total number of users who have enabled email notifications but disabled push notifications." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.user_settings WHERE email_notifications_enabled = TRUE AND push_notifications_enabled = FAL...
You are an SQL statement expert. Given the table 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.user_settings ( setting_id.text, user_id.text, theme.text, email_notifications_enabled.boolean, push_notif...
[ { "role": "user", "content": "Can you show me the number of lawyers grouped by specialization?" }, { "role": "assistant", "content": "SELECT specialization, COUNT(*) AS lawyer_count FROM lawyers GROUP BY specialization;" }, { "role": "user", "content": "Include only specializations 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 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 the total number of services offered per department and the average price of those services." }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS service_count, AVG(price) AS avg_price\nFROM hospitality_technology.services\nGROUP BY department;...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu...
[ { "role": "user", "content": "List smart money addresses with an ROI between 10 and 50. Display the address, chain, profit, and roi." }, { "role": "assistant", "content": "SELECT address, chain, profit, roi FROM smart_money_profit WHERE roi BETWEEN 10 AND 50" }, { "role": "user", "co...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, rank INT, profit numeric(38,6), roi numeric(38,2), realiz...
[ { "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 comment IDs and their content for comments made by users who have 'dark' as their theme." }, { "role": "assistant", "content": "SELECT c.comment_id, c.content\nFROM social_media.comments c\nJOIN social_media.user_settings s ON c.user_id = s.user_id\nWHERE 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 character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "List all group conversation names along with the number of different users who have sent a message in each group." }, { "role": "assistant", "content": "SELECT c.group_name, COUNT(DISTINCT m.sender_user_id) AS unique_senders\nFROM social_media.conversations c\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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List the first name and last name of citizens along with the amount of payments they have made." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.amount FROM government_services.citizens AS T1 JOIN government_services.payments AS T2 ON T1...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "List all appointments that have not been assigned to any employee. Show the appointment ID and the scheduled start time." }, { "role": "assistant", "content": "SELECT appointment_id, scheduled_start_time\nFROM government_services.appointments\nWHERE employee_id IS 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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "What is the total USD value held across all wallets for the ERC20 token with symbol 'DAI'?" }, { "role": "assistant", "content": "SELECT SUM((eb.amount::numeric / POWER(10, tm.decimals)) * tpl.price) AS total_usd\nFROM erc20_balances eb\nJOIN token_metas tm ON eb.co...
You are an SQL statement expert. Given the table 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 varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "List all chronic and active diagnoses for patient 'patient_456', including diagnosis_code, description, and diagnosis_date." }, { "role": "assistant", "content": "SELECT diagnosis_code, description, diagnosis_date FROM healthcare.diagnoses WHERE patient_id = 'patien...
You are an SQL statement expert. Given the table 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, record_id text, patient_id text, doctor_id text, diagnosis_code text, code_ty...
[ { "role": "user", "content": "List the usernames and the IDs of conversations they have joined." }, { "role": "assistant", "content": "SELECT T1.username, T2.conversation_id FROM social_media.users AS T1 JOIN social_media.conversation_participants AS T2 ON T1.user_id = T2.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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "List all SUI coins with 'active' status and their object_id, owner address, coin_type, and balance." }, { "role": "assistant", "content": "SELECT object_id, owner, coin_type, balance FROM sui_coins WHERE status = 'active';" }, { "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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Show me the number of guests for each city they reside in." }, { "role": "assistant", "content": "SELECT city, count(*) AS guest_count FROM hospitality_technology.guests WHERE city IS NOT NULL GROUP BY city;" }, { "role": "user", "content": "Now, only sh...
You are an SQL statement expert. Given the table 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": "List the agent ID, first name, last name, and commission rate for all agents with a commission rate between 0.08 and 0.15." }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, commission_rate FROM insurance.agents WHERE commission_rate BETW...
You are an SQL statement expert. Given the table 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 policies with a premium amount between 500 and 1500. Show the policy number, premium amount, and status." }, { "role": "assistant", "content": "SELECT policy_number , premium_amount , status FROM insurance.policies WHERE premium_amount BETWEEN 500 AND 150...
You are an SQL statement expert. Given the table 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": "Show me all smart contracts created by addresses that have created more than 3 contracts, along with the count of contracts each creator has made." }, { "role": "assistant", "content": "SELECT creator_address, COUNT(*) AS contract_count FROM blockchain.smart_contrac...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, creator_address character varying(128) NOT NUL...
[ { "role": "user", "content": "Could you provide a report showing each in-game item's name and the total quantity currently held in player inventories?" }, { "role": "assistant", "content": "SELECT ii.item_name, SUM(pi.quantity) AS total_held FROM gaming_technology.player_inventory pi JOIN gaming...
You are an SQL statement expert. Given the table 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": "List every maintenance log for each vehicle, including the vehicle's license plate and the mechanic's name." }, { "role": "assistant", "content": "SELECT ml.log_id, ml.vehicle_id, v.license_plate, ml.service_date, ml.service_type, ml.description, ml.mechanic_name\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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Show me the total number of time entries for each case." }, { "role": "assistant", "content": "SELECT case_id, COUNT(*) AS entry_count\nFROM legal_services.time_entries\nGROUP BY case_id;" }, { "role": "user", "content": "Only include cases where the tot...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id character varying(64) NOT NULL, -- unique identifier for the time entry ...
[ { "role": "user", "content": "能否帮我统计数据库中每个城市的车站数量?" }, { "role": "assistant", "content": "SELECT city, COUNT(*) AS station_count\nFROM stations\nGROUP BY city\nORDER BY station_count DESC;" } ]
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 /stations { "mappings": { "properties": { "station_id": { "type": "keyword" },...
[ { "role": "user", "content": "Can you show the total quantity of all in-game items held by each player?" }, { "role": "assistant", "content": "SELECT player_id, SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player_id;" }, { "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.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for...
[ { "role": "user", "content": "Show me the top 5 most recent medical records with a fever recorded. Return record_id, patient_id, record_date, and the temperature value from vitals." }, { "role": "assistant", "content": "SELECT record_id,\n patient_id,\n record_date,\n vitals->>...
You are an SQL statement expert. Given the table 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 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": "For each case, show the latest uploaded document's name, version number, and upload timestamp." }, { "role": "assistant", "content": "SELECT d.case_id, d.document_name, d.version, d.upload_timestamp\nFROM legal_services.documents d\nINNER JOIN (\n SELECT case_id, 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 legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "List all insurance plans and the number of patients associated with each plan." }, { "role": "assistant", "content": "SELECT ip.plan_name, COUNT(pi.patient_id) FROM healthcare.insurance_plans ip JOIN healthcare.patient_insurance pi ON ip.plan_id = pi.plan_id GROUP B...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List each trip_id along with the number of seats booked and the total fuel cost incurred during that trip." }, { "role": "assistant", "content": "SELECT fl.trip_id, COUNT(b.booking_id) AS seats_booked, SUM(fl.total_cost) AS total_fuel_cost\nFROM transportation.fuel_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "List the username and the total number of notifications each user has received, and also count how many of those are still unread." }, { "role": "assistant", "content": "SELECT u.username,\n COUNT(n.notification_id) AS total_notifications,\n SUM(CASE WHE...
You are an SQL statement expert. Given the table 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": "For each player, calculate the total quantity of items they have acquired. Return player_id and total_quantity." }, { "role": "assistant", "content": "SELECT player_id,\n SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, item_id uuid, quantity int, acquire...
[ { "role": "user", "content": "Show me the list of players who have never logged in since they registered." }, { "role": "assistant", "content": "SELECT player_id, username, registration_date\nFROM gaming_technology.players\nWHERE last_login IS NULL;" }, { "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.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "Which active services have a standard fee less than 100, and what are the agency IDs and categories for these services?" }, { "role": "assistant", "content": "SELECT service_name, agency_id, category FROM government_services.services WHERE is_active = TRUE AND stand...
You are an SQL statement expert. Given the table 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": "Please provide a list of all trips along with their route details, including the route_number, origin city, and destination city, ordered by scheduled_departure." }, { "role": "assistant", "content": "SELECT t.trip_id,\n t.vehicle_id,\n t.driver_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 transportation.routes ( route_id character varying(64) NOT NULL, route_number character varying(32) NOT NULL UNIQUE, de...
[ { "role": "user", "content": "Show the wallet address and amount for the token with tick 'ordi', along with its maximum supply from the `token_info` table." }, { "role": "assistant", "content": "SELECT T1.wallet_address, T1.amount, T2.max_supply FROM token_balances AS T1 JOIN token_info AS T2 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "How many hidden achievements are there?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM gaming_technology.achievements WHERE hidden = true;" }, { "role": "user", "content": "Also, what is the average point value of all achievements that are 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 gaming_technology.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name text, description text, icon_url t...
[ { "role": "user", "content": "List the document name, type, version, and description for all documents." }, { "role": "assistant", "content": "SELECT document_name, document_type, version, description FROM documents;" }, { "role": "user", "content": "Only include documents where the ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "role": "user", "content": "Show the contract address, token name, and total supply for all tokens, along with the deployer address of the contract where each token was created." }, { "role": "assistant", "content": "SELECT t.contract_address, t.token_name, t.total_supply, c.deployer_address\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.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...
[ { "role": "user", "content": "Find all pairs of achievement unlocks and item acquisitions by the same player where the item was acquired after the achievement was unlocked. List player_id, achievement_id, unlocked_at, item_id, and acquired_at." }, { "role": "assistant", "content": "SELECT pa.pla...
You are an SQL statement expert. Given the table 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, game_id.uuid, name.text, description.text, icon_url.text, points....
[ { "role": "user", "content": "Can you show me the titles and release dates of all games developed by companies founded after 2018, as well as the name and country of each developer?" }, { "role": "assistant", "content": "SELECT g.title, g.release_date, d.name AS developer_name, d.country\nFROM 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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "Get all active SUI coins with their owner and balance." }, { "role": "assistant", "content": "SELECT coin_type, owner, balance\nFROM sui_coins\nWHERE status = 'active';" }, { "role": "user", "content": "Join metadata to include the coin symbol and decima...
You are an SQL statement expert. Given the table 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 wallets that share the same private key but have different addresses. Show the wallet IDs, addresses, and the shared private key." }, { "role": "assistant", "content": "SELECT w1.wallet_id AS wallet_id_1, w1.address AS address_1, w2.wallet_id AS wallet_id_2...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "Show me all NFT collections on the 'Ethereum' blockchain, listing their name, contract address, and ERC type." }, { "role": "assistant", "content": "SELECT name, contract_address, erc_type FROM nft_collections WHERE blockchain = 'Ethereum'" }, { "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 erc20_balances ( block_number bigint, contract_address text, wallet_address text, amount text, pk text ) CREATE TABLE n...
[ { "role": "user", "content": "Which citizens have had both applications and appointments for services in the 'Healthcare' category? List their full name, application ID, and appointment ID." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, a....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Find all pairs of developers who share the exact same founded_year but are from different countries. Show both developer names, their countries, and the founded_year." }, { "role": "assistant", "content": "SELECT d1.name AS developer1_name, d1.country AS country1, d...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "Which exchanges hold the highest total USD value of tokens on the Ethereum chain, and what are their top 3 tokens by USD value?" }, { "role": "assistant", "content": "SELECT exchange, token_symbol, usd_value FROM (SELECT exchange, token_symbol, usd_value, ROW_NUMBER...
You are an SQL statement expert. Given the table 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 text, chain text, address text, exchange text, token_address text, token_symbol text,...
[ { "role": "user", "content": "List all pairs of routes where the origin location of one route is the destination location of the other, showing both route numbers and their types." }, { "role": "assistant", "content": "SELECT r1.route_number AS route_number_1, r1.type AS type_1,\n r2.route...
You are an SQL statement expert. Given the table 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...