conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Can you show me each user's address and the date their wallet was created?" }, { "role": "assistant", "content": "SELECT user_id, address, created_at FROM trading_platform.wallets;" }, { "role": "user", "content": "Now, can you show only wallets created ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp )
[ { "role": "user", "content": "List all wallets holding the NFT with contract_address '0xabc123' and token_id '100' and the amount held." }, { "role": "assistant", "content": "SELECT wallet_address, amount\nFROM nft_holders\nWHERE contract_address = '0xabc123'\n AND token_id = '100';" }, { ...
You are an SQL statement expert. Given the table 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 NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ...
[ { "role": "user", "content": "List the symbol and balance for all SUI coins, joining the `sui_coins` and `sui_coins_metadata` tables." }, { "role": "assistant", "content": "SELECT T2.symbol, T1.balance FROM sui_coins AS T1 INNER JOIN sui_coins_metadata AS T2 ON T1.object_id = T2.object_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 CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "List all premium payments with status 'overdue'. Show payment_id, policy_id, customer_id, amount_paid, ordered by due_date ascending." }, { "role": "assistant", "content": "SELECT payment_id,\n policy_id,\n customer_id,\n amount_paid\nFROM insuranc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "For each doctor, show the doctor ID and the latest record date among all medical records they created." }, { "role": "assistant", "content": "SELECT doctor_id, MAX(record_date) AS latest_record_date\nFROM healthcare.medical_records\nGROUP BY doctor_id;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "role": "user", "content": "For each verified user, count their followers and show user_id and follower_count, ordered by follower_count descending." }, { "role": "assistant", "content": "SELECT u.user_id,\n COUNT(f.follower_user_id) AS follower_count\nFROM social_media.users u\nJOIN soc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "List all assets that have been traded at least 50 times, along with their total trade volume and average price." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name, COUNT(t.trade_id) AS trade_count, SUM(t.quantity * t.price) AS total_volume, AVG(t.price...
You are an SQL statement expert. Given the table 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": "Can you list the number of items for each rarity in the system?" }, { "role": "assistant", "content": "SELECT rarity, COUNT(*) AS item_count\nFROM gaming_technology.in_game_items\nGROUP BY rarity;" }, { "role": "user", "content": "Please only show rariti...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.in_game_items ( item_id uuid PRIMARY KEY, game_id uuid, item_name text, item_type text, description t...
[ { "role": "user", "content": "List all appointments for doctor 'doctor_A1'." }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, appointment_time, duration_minutes, reason, status, location_id, notes, created_at FROM healthcare.appointments WHERE doctor_id = 'doctor_A1';" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, -- unique identifier for the appointment ...
[ { "role": "user", "content": "Give me a list of all specializations available at each law firm." }, { "role": "assistant", "content": "SELECT DISTINCT firm_id, specialization\nFROM legal_services.lawyers;" }, { "role": "user", "content": "For each specialization, show the number of 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.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "What are the training programs or certifications completed by a staff member with the role of Platform Supervisor?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the training programs or certifications completed by sta...
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.s...
[ { "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 me each department in each property, along with the total number of available services and their combined price." }, { "role": "assistant", "content": "SELECT property_id, department, COUNT(*) AS service_count, SUM(price) AS total_price FROM hospitality_technol...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL...
[ { "role": "user", "content": "How many patients are there in each gender category?" }, { "role": "assistant", "content": "SELECT gender,\n COUNT(*) AS patient_count\nFROM healthcare.patients\nGROUP BY gender;" }, { "role": "user", "content": "Limit this to categories with more ...
You are an SQL statement expert. Given the table 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": "Can you show me all user IDs that have both email and push notifications disabled, along with whether their profile is set to private?" }, { "role": "assistant", "content": "SELECT user_id, private_profile FROM social_media.user_settings WHERE email_notifications_en...
You are an SQL statement expert. Given the table 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": "Get the count of room types and the average area_sqft per property." }, { "role": "assistant", "content": "SELECT property_id,\n COUNT(room_type_id) AS room_type_count,\n AVG(area_sqft) AS avg_area\nFROM hospitality_technology.room_types\nGROUP BY 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Find all blocks with difficulty above 5000 and include their timestamp." }, { "role": "assistant", "content": "SELECT block_id, timestamp FROM blockchain.blocks WHERE difficulty > 5000;" }, { "role": "user", "content": "Now show me the count of such bloc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp timestamp, nonce int, merkle_root text...
[ { "role": "user", "content": "List each Avalanche token tick with its creator from token_info and the total transfer volume over the past 7 days." }, { "role": "assistant", "content": "SELECT ta.tick,\n ti.creator,\n SUM(ta.amt) AS total_volume\nFROM token_activities_avalanche ta\nJO...
You are an SQL statement expert. Given the table 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": "List all document IDs and document types for documents that have been verified by an employee, along with the verification timestamp and the ID of the verifying employee." }, { "role": "assistant", "content": "SELECT document_id, document_type, verification_timestam...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.documents ( document_id text, application_id text, citizen_id text, document_type text, file_refere...
[ { "role": "user", "content": "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": "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": "List the full names and positions of all staff members along with the name of the property they work for." }, { "role": "assistant", "content": "SELECT s.first_name || ' ' || s.last_name AS full_name, s.position, p.property_name\nFROM hospitality_technology.staff s\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.staff ( staff_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, fir...
[ { "role": "user", "content": "List all transactions where the receiver is a smart contract address, along with the contract creation timestamp." }, { "role": "assistant", "content": "SELECT t.transaction_id, t.sender_address, t.receiver_address, t.amount, t.timestamp, c.creation_timestamp AS 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 blockchain.transactions ( transaction_id.text, block_id.text, sender_address.text, receiver_address.text, amount.numeri...
[ { "role": "user", "content": "Show me all services along with their property names." }, { "role": "assistant", "content": "SELECT s.service_id, s.service_name, p.property_name\nFROM hospitality_technology.services s\nJOIN hospitality_technology.properties p ON s.property_id = p.property_id;" }...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "role": "user", "content": "Find all agents with their managers where the agent's commission rate is above 0.10." }, { "role": "assistant", "content": "SELECT a.agent_id,\n a.first_name || ' ' || a.last_name AS agent_name,\n m.agent_id AS manager_id,\n m.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 insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "List all customers who have policies with a coverage limit above 500000, showing their first name, last name, and the policy number." }, { "role": "assistant", "content": "SELECT t1.first_name, t1.last_name, t2.policy_number FROM insurance.customers AS t1 JOIN insur...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin...
[ { "role": "user", "content": "Show me all policies and the base premium of the insurance product they are based on. Include policy number, premium amount, and product base premium." }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.premium_amount, T2.base_premium FROM insurance.p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "List the number of cases for each case type that are currently marked as 'Open'." }, { "role": "assistant", "content": "SELECT case_type, COUNT(*) FROM legal_services.cases WHERE status = 'Open' GROUP BY case_type;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.cases ( case_id text, case_number text, case_name text, client_id text, lead_lawyer_id text, case_type t...
[ { "role": "user", "content": "Show me all active accounts with a balance greater than 2000." }, { "role": "assistant", "content": "SELECT account_id, account_number, customer_id, account_type, balance, currency\nFROM financial_services.accounts\nWHERE status = 'Open' AND balance > 2000;" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer ...
[ { "role": "user", "content": "How many games are there per platform, and what is the earliest release_date for each platform?" }, { "role": "assistant", "content": "SELECT platform,\n COUNT(*) AS game_count,\n MIN(release_date) AS earliest_release\nFROM gaming_technology.games\nGROUP...
You are an SQL statement expert. Given the table 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 smart money addresses, their chain, and profit for those who have incurred a loss. Order the results by the magnitude of the loss (smallest profit value first)." }, { "role": "assistant", "content": "SELECT address, chain, profit FROM smart_money_profit WHERE p...
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 smart_money_profit ( address character varying(100) NOT NULL, rank INT, profit numer...
[ { "role": "user", "content": "Show all active customers who live in the same zip_code." }, { "role": "assistant", "content": "SELECT a.customer_id AS cust1,\n b.customer_id AS cust2,\n a.zip_code\nFROM financial_services.customers a\nJOIN financial_services.customers b\n ON a.zip_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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "For applications approved in the past month, list the application ID, reference number, citizen's first and last name, and the number of related notifications sent." }, { "role": "assistant", "content": "SELECT a.application_id, a.reference_number, c.first_name, c.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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "List games that have servers deployed in more than one geographical region. Show the game title and the count of regions." }, { "role": "assistant", "content": "SELECT g.title, count(DISTINCT s.region) AS region_count FROM games AS g JOIN servers AS s ON g.game_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 gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea...
[ { "role": "user", "content": "List all rooms that include 'Kitchenette' in their features, showing the room number, property ID, and floor." }, { "role": "assistant", "content": "SELECT room_number, property_id, floor\nFROM hospitality_technology.rooms\nWHERE features LIKE '%Kitchenette%';" },...
You are an SQL statement expert. Given the table 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, property_id text, room_number text, room_type_id text, floor integer, stat...
[ { "role": "user", "content": "Can you show, for each employee, the full name and job title of their direct manager, as well as the employee's department and branch_id?" }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name AS employee_first_name, e.last_name AS employee_last_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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "Find all wallets created in the last 30 days along with any tokens they might have deployed, showing the wallet address and token names." }, { "role": "assistant", "content": "SELECT w.address, t.token_name FROM web3.wallets w LEFT JOIN web3.contracts c ON w.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 web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "List users and their latest wallet address if they have one, ordered by username." }, { "role": "assistant", "content": "SELECT u.username, w.address FROM users u JOIN wallets w ON u.user_id = w.user_id WHERE w.created_at = (SELECT MAX(w2.created_at) FROM wallets w2...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "List all pairs of patients who registered on the same day. Show patient1_id, patient1_name, patient2_id, patient2_name, and the shared registration date." }, { "role": "assistant", "content": "SELECT p1.patient_id AS patient1_id, p1.first_name || ' ' || p1.last_name...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "List all auto loans (loan_id, principal_amount, interest_rate) where the current principal balance is less than 40% of the original principal amount, along with the account_id and the difference between principal_amount and current_principal_balance." }, { "role": "assi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.loans ( loan_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL UNIQUE, lo...
[ { "role": "user", "content": "List all trades, including the status of the corresponding order." }, { "role": "assistant", "content": "SELECT t.trade_id, t.order_id, o.status FROM trading_platform.trades t JOIN trading_platform.orders o ON t.order_id = o.order_id;" }, { "role": "user", ...
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 trading_platform.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, p...
[ { "role": "user", "content": "Retrieve the name and city of all locations that act as both origin and destination for any route." }, { "role": "assistant", "content": "SELECT l.name, l.city\nFROM transportation.locations l\nWHERE l.location_id IN (SELECT origin_location_id FROM transportation.ro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "For each reservation, display the guest's full name, property_id, the total number of service orders placed, and the total price of those service orders." }, { "role": "assistant", "content": "SELECT r.reservation_id, g.first_name, g.last_name, r.property_id, COUNT(...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, room_type_id text, floor integer, stat...
[ { "role": "user", "content": "How many unique projects are there in the project_fundraising_record table, and what's their average investment value?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT project_id) AS unique_project_count, AVG(investment_value) AS avg_investment_value\nFR...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i...
[ { "role": "user", "content": "Show me all vehicles that are due for their next service before the end of this month, along with their last service date and type." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, s.service_date, s.service_type FROM transportation.vehicl...
You are an SQL statement expert. Given the table 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 players who have completed at least one game session with a score greater than 100, showing their player_id and username." }, { "role": "assistant", "content": "SELECT DISTINCT T1.player_id, T1.username FROM gaming_technology.players AS T1 JOIN gaming_technolog...
You are an SQL statement expert. Given the table 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 all pairs of service orders that share the same bill_id, showing order1_id, order2_id, and the bill_id." }, { "role": "assistant", "content": "SELECT s1.order_id AS order1_id,\n s2.order_id AS order2_id,\n s1.bill_id\nFROM hospitality_technology.ser...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id.text, reservation_id.text, guest_id.text, service_id.text, staff_id_or...
[ { "role": "user", "content": "Count the number of appointments for each status." }, { "role": "assistant", "content": "SELECT status, count(*) FROM government_services.appointments 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 government_services.appointments ( appointment_id character varying(64) NOT NULL, citizen_id character varying(64) NOT ...
[ { "role": "user", "content": "List all booking IDs and their status for bookings that have a special request recorded." }, { "role": "assistant", "content": "SELECT booking_id, status\nFROM transportation.bookings\nWHERE special_requests IS NOT 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 transportation.bookings ( booking_id character varying(64) NOT NULL, passenger_id character varying(64) NOT NULL, trip_...
[ { "role": "user", "content": "Show me all users along with the total number of unique hashtags used in their posts." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(DISTINCT ph.hashtag_id) AS unique_hashtag_count\nFROM social_media.users u\nLEFT JOIN social_media.posts ...
You are an SQL statement expert. Given the table 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 fuel logs for vehicle 'VHCL123', showing the fuel type, quantity, and log timestamp." }, { "role": "assistant", "content": "SELECT fuel_type, quantity, log_timestamp FROM transportation.fuel_logs WHERE vehicle_id = 'VHCL123';" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "Calculate the average market cap and average 24-hour trading volume for tokens belonging to each narrative category." }, { "role": "assistant", "content": "SELECT narrative, AVG(market_cap) AS average_market_cap, AVG(CAST(REPLACE(total_volume, ',', '') AS NUMERIC)) ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_basic_info ( coin_id text, token_name text, token_symbol text, token_address text, chain text, price numeric, pri...
[ { "role": "user", "content": "Which games have at least one achievement worth exactly 75 points, and what are the names and descriptions of those achievements?" }, { "role": "assistant", "content": "SELECT g.title, a.name AS achievement_name, a.description\nFROM gaming_technology.games g\nJOIN 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": "Which policies have a premium amount greater than the base premium of their respective insurance product? Please show the policy_number, premium_amount, product_name, and base_premium." }, { "role": "assistant", "content": "SELECT p.policy_number, p.premium_amount, ...
You are an SQL statement expert. Given the table 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 a list of clients whose status is 'inactive', including their first and last name, email, phone, and date registered." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, phone, date_registered\nFROM legal_services.clients\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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "List all clients with the count of cases they have opened." }, { "role": "assistant", "content": "SELECT\n c.client_id,\n c.first_name,\n c.last_name,\n COUNT(cs.case_id) AS case_count\nFROM legal_services.clients c\nLEFT JOIN legal_services.cases cs ON c.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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "How many clients are registered with an active status?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM legal_services.clients WHERE status = 'active';" }, { "role": "user", "content": "Could you also tell me the average number of days since 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 legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "List all customers who have two policies with overlapping coverage periods and show both policy numbers along with the overlap start and end dates." }, { "role": "assistant", "content": "SELECT p1.customer_id, p1.policy_number AS policy_number1, p2.policy_number AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "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": "Show each user's username along with their total traded value as buyers and their total traded value as sellers for trades executed in June 2024." }, { "role": "assistant", "content": "SELECT u.username,\n COALESCE(buy_tot.buy_value, 0) AS buyer_value,\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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "List the names of law firms whose managing partner has uploaded at least one document, and show the managing partner ID along with the firm's phone number." }, { "role": "assistant", "content": "SELECT DISTINCT T1.firm_name, T1.managing_partner_id, T1.phone FROM leg...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, phone text, website text, founded_da...
[ { "role": "user", "content": "List the usernames and full names of users who created their account in 2024 and are verified." }, { "role": "assistant", "content": "SELECT username, full_name FROM social_media.users WHERE created_at >= '2024-01-01' AND created_at < '2025-01-01' AND is_verified = ...
You are an SQL statement expert. Given the table 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": "How many hashtags are associated with each post? Return post_id and alias it as hashtag_count, but only show posts with more than one hashtag." }, { "role": "assistant", "content": "SELECT post_id, COUNT(*) AS hashtag_count\nFROM social_media.post_hashtags\nGROUP BY...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.post_hashtags ( post_hashtag_id.text, post_id.text, hashtag_id.text ) CREATE TABLE social_media.conversati...
[ { "role": "user", "content": "List each in-game item along with the number of sessions played in the game it belongs to. Show item_id, item_name, and session_count." }, { "role": "assistant", "content": "SELECT i.item_id, i.item_name, COUNT(s.session_id) AS session_count\nFROM gaming_technology....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d...
[ { "role": "user", "content": "How many participants are there in each conversation? Return conversation_id and participant_count." }, { "role": "assistant", "content": "SELECT conversation_id,\n COUNT(*) AS participant_count\nFROM social_media.conversation_participants\nGROUP BY conversati...
You are an SQL statement expert. Given the table 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.conversation_participants ( participant_id text, conversation_id text, user_id text, joined_at timestamp, ...
[ { "role": "user", "content": "List the product_id, product_name, and base_premium for all products that are currently inactive." }, { "role": "assistant", "content": "SELECT product_id, product_name, base_premium\nFROM insurance.insurance_products\nWHERE is_active = false;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "Can you list the number of citizens registered each month in 2024? Please show the month and the citizen count." }, { "role": "assistant", "content": "SELECT TO_CHAR(registration_date, 'YYYY-MM') AS registration_month, COUNT(*) AS citizen_count FROM government_servi...
You are an SQL statement expert. Given the table 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": "Show me all smart contracts created by users whose email domain is 'gmail.com', along with the contract creation timestamp and the user's username." }, { "role": "assistant", "content": "SELECT sc.contract_id, sc.timestamp, u.username FROM blockchain.smart_contracts...
You are an SQL statement expert. Given the table 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": "Show the total transaction amount for each customer, including their full name and risk profile. Join customers to accounts and then to transactions." }, { "role": "assistant", "content": "SELECT\n T2.first_name,\n T2.last_name,\n T2.risk_profile,\n SUM(T1.amoun...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad...
[ { "role": "user", "content": "I want to find pairs of developers that share the same website domain. For each pair, show both developer names and the domain." }, { "role": "assistant", "content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.domain AS domain\nFROM (\n SELECT develope...
You are an SQL statement expert. Given the table 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": "Show me all active vehicles with their make, model, and license plate, along with their depot_id." }, { "role": "assistant", "content": "SELECT make, model, license_plate, depot_id FROM transportation.vehicles WHERE status = 'active';" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "For each state_province, count the number of guests." }, { "role": "assistant", "content": "SELECT state_province,\n COUNT(*) AS guest_count\nFROM guests\nGROUP BY state_province;" }, { "role": "user", "content": "Only include states with more than...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "Could you show me the usernames of users who have received likes on their posts, along with the total number of likes each user's posts have received?" }, { "role": "assistant", "content": "SELECT T1.username, count(T3.like_id) AS total_likes_received FROM social_me...
You are an SQL statement expert. Given the table 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, -- unique identifier for the user username charac...
[ { "role": "user", "content": "For each narrative and chain, calculate the total USD buy and sell values, and show only those where buys exceed sells. Display narrative, chain, total_buy_usd, total_sell_usd, and buy_sell_difference." }, { "role": "assistant", "content": "WITH buy_agg AS (\n SELE...
You are an SQL statement expert. Given the table 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_inflow (", "token_address character varying(100) NOT NULL, -- the token's address", "token...
[ { "role": "user", "content": "List the invoice_number, total_amount, the full name of the client, and the case_number for all invoices." }, { "role": "assistant", "content": "SELECT i.invoice_number, i.total_amount, c.first_name || ' ' || c.last_name AS client_full_name, cs.case_number\nFROM leg...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad...
[ { "role": "user", "content": "List all achievements with points greater than 100, showing achievement_id, name, and points." }, { "role": "assistant", "content": "SELECT achievement_id, name, points\nFROM gaming_technology.achievements\nWHERE points > 100;" }, { "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 gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, description.text, icon_url.text, points....
[ { "role": "user", "content": "Which document types have been uploaded by citizens, and how many times has each type been uploaded?" }, { "role": "assistant", "content": "SELECT document_type, COUNT(document_id) AS upload_count\nFROM government_services.documents\nGROUP BY document_type;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "List clients whose status is 'active' and registered in the year 2024." }, { "role": "assistant", "content": "SELECT * FROM legal_services.clients WHERE status = 'active' AND EXTRACT(YEAR FROM date_registered) = 2024;" }, { "role": "user", "content": "Al...
You are an SQL statement expert. Given the table 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": "List all fuel log IDs along with their vehicle IDs and odometer readings for logs where the quantity is below 10." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, odometer_reading\nFROM transportation.fuel_logs\nWHERE quantity < 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 transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "Show me all properties in New York along with their room types and base rates, ordered by property name." }, { "role": "assistant", "content": "SELECT p.property_name, rt.type_name, rt.base_rate FROM hospitality_technology.properties p JOIN hospitality_technology.ro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show me each product_type along with the count of products for that type, but only include types where the average base_premium exceeds 500. Order the results by the product count in descending order." }, { "role": "assistant", "content": "SELECT product_type,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Find pairs of patients who share the same last name. Show the patient IDs, full names, and the shared last name." }, { "role": "assistant", "content": "SELECT p1.patient_id AS patient1_id, p1.first_name AS patient1_first_name, p1.last_name AS patient1_last_name, p2....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "List the plan ID, name, provider, and type for all insurance plans from 'Healthcare Partners' with a plan type of 'PPO'." }, { "role": "assistant", "content": "SELECT plan_id, plan_name, insurance_provider, plan_type FROM healthcare.insurance_plans WHERE insurance_p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, plan_type.text, contact_phone.text,...
[ { "role": "user", "content": "How many insurance products are currently marked as inactive?" }, { "role": "assistant", "content": "SELECT count(*) FROM insurance.insurance_products WHERE is_active = false;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_name character varying(150) NOT NULL,...
[ { "role": "user", "content": "List all vehicles and their last maintenance service date along with the odometer reading, including only those that have not had a fuel refill in the past 30 days." }, { "role": "assistant", "content": "SELECT m.vehicle_id,\n m.last_service_date,\n m.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.routes ( route_id character varying(64) NOT NULL, route_number character varying(32) NOT NULL UNIQUE, de...
[ { "role": "user", "content": "Show me the top 5 users who have interacted with the most DApps, along with the count of DApps they interacted with." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(DISTINCT d.dapp_id) AS dapp_count FROM trading_platform.users u JOIN tradi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "For each user, show their user_id, KYC status, and the total count of completed orders they've placed." }, { "role": "assistant", "content": "SELECT k.user_id, k.status, COUNT(o.order_id) AS completed_order_count\nFROM trading_platform.kyc_audit k\nJOIN trading_plat...
You are an SQL statement expert. Given the table 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 the names of service locations and the names of the agencies they belong to, specifically for locations situated in the state of 'Texas' that are marked as accessible." }, { "role": "assistant", "content": "SELECT t1.location_name, t2.agency_name FROM governmen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "How many customers are there for each status?" }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM financial_services.customers GROUP BY status" }, { "role": "user", "content": "Only show statuses where the count is greater than 50." }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, ad...
[ { "role": "user", "content": "Show me the total fuel cost for each trip along with the trip's route number and the type of the route." }, { "role": "assistant", "content": "SELECT t.trip_id, r.route_number, r.type, SUM(f.total_cost) AS total_fuel_cost\nFROM transportation.trips t\nJOIN transport...
You are an SQL statement expert. Given the table 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": "Calculate the total billable hours spent by each lawyer for entries in March 2024." }, { "role": "assistant", "content": "SELECT lawyer_id,\n SUM(hours_spent) AS total_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\n AND date_worked BETWEEN...
You are an SQL statement expert. Given the table 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": "List all token symbols and their total supply for tokens where the total supply is greater than the average total supply of all tokens." }, { "role": "assistant", "content": "SELECT token_symbol, total_supply FROM web3.tokens WHERE total_supply > (SELECT AVG(total_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.events ( event_id character varying(64) NOT NULL, contract_id character varying(64) NOT NULL, event_name character...
[ { "role": "user", "content": "For Sui coins owned by address '0xabc...xyz', list the balance and their symbol by joining the coins and metadata tables." }, { "role": "assistant", "content": "SELECT T1.balance, T2.symbol FROM sui_coins AS T1 JOIN sui_coins_metadata AS T2 ON T1.coin_type = T2.coin...
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": "Provide a count of servers per game status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS server_count FROM gaming_technology.servers GROUP BY status;" }, { "role": "user", "content": "Filter the list to only show statuses that have 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 gaming_technology.game_sessions ( session_id.uuid, player_id.uuid, game_id.uuid, server_id.uuid, start_time.timestamptz...
[ { "role": "user", "content": "I need the total fuel cost per vehicle for each fuel type." }, { "role": "assistant", "content": "SELECT vehicle_id, fuel_type, SUM(total_cost) AS total_cost_per_type\nFROM transportation.fuel_logs\nGROUP BY vehicle_id, 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 character varying(64) NOT NULL, -- unique identifier for the fuel log entry...
[ { "role": "user", "content": "Count the number of securities by exchange." }, { "role": "assistant", "content": "SELECT exchange, COUNT(*) AS security_count\nFROM financial_services.securities\nGROUP BY exchange;" }, { "role": "user", "content": "Now group the count by sector instead...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_number text, account_type text, ba...
[ { "role": "user", "content": "Show all token symbols along with the contract address where the token was created." }, { "role": "assistant", "content": "SELECT token_symbol, contract_address FROM web3.tokens;" }, { "role": "user", "content": "Can you also include the deployer 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 web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,...
[ { "role": "user", "content": "Find all wallet addresses that don't have an associated user_id." }, { "role": "assistant", "content": "SELECT address_id, private_key FROM blockchain.wallets WHERE user_id IS NULL;" }, { "role": "user", "content": "Now show me these addresses along with...
You are an SQL statement expert. Given the table 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.wallets ( wallet_id text, user_id text, address_id text, private_key text )
[ { "role": "user", "content": "Count the total number of unique insurance providers in the system." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT insurance_provider) FROM healthcare.insurance_plans;" } ]
You are an SQL statement expert. Given the table 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.insurance_plans ( plan_id.text, plan_name.text, insurance_provider.text, plan_type.text, contact_phone.text,...
[ { "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...