conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "List accounts that were opened in the same month and year as another account for the same customer, but have a different account type. Show the account_id, customer_id, account_type, and opened_date for these accounts." }, { "role": "assistant", "content": "SELECT 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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "For each service category, find the total number of notifications sent related to applications of services in that category." }, { "role": "assistant", "content": "SELECT s.category, COUNT(n.notification_id) AS notification_count\nFROM government_services.notificati...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Show each player's highest score for each game they have played." }, { "role": "assistant", "content": "SELECT player_id, game_id, MAX(score) AS highest_score FROM gaming_technology.game_sessions GROUP BY player_id, game_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.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_id uuid, server_id uuid, start_time...
[ { "role": "user", "content": "List all medications along with the length of their description, but only include those with descriptions longer than 100 characters. Show medication_id, medication_name, and description length." }, { "role": "assistant", "content": "SELECT medication_id, medication...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medications ( medication_id.text, medication_name.text, generic_name.text, manufacturer.text, ndc_code.text,...
[ { "role": "user", "content": "List all unique service categories and the count of services in each category." }, { "role": "assistant", "content": "SELECT category, COUNT(service_id) FROM hospitality_technology.services GROUP BY category;" }, { "role": "user", "content": "Only includ...
You are an SQL statement expert. Given the table 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": "List all games and the servers hosting them, showing the game title, server name, region, and status." }, { "role": "assistant", "content": "SELECT g.title, s.server_name, s.region, s.status FROM gaming_technology.games g JOIN gaming_technology.servers s ON g.game_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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "For each guest, show their full name and the total quantity of services they have ordered in the last 30 days." }, { "role": "assistant", "content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n SUM(so.quantity) AS total_quanti...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "List all trades for asset 'BTC' where the trade quantity is greater than 5." }, { "role": "assistant", "content": "SELECT trade_id, order_id, buyer_id, seller_id, quantity, price, traded_at FROM trading_platform.trades WHERE asset_id = 'BTC' AND quantity > 5;" } ]
You are an SQL statement expert. Given the table 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": "Can you show me the document types submitted by citizens whose accounts are verified, and for each, the email of the citizen who uploaded it?" }, { "role": "assistant", "content": "SELECT d.document_type, c.contact_email\nFROM government_services.documents d\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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Show me the average, maximum, and minimum points for all achievements." }, { "role": "assistant", "content": "SELECT AVG(points) AS average_points, MAX(points) AS maximum_points, MIN(points) AS minimum_points FROM gaming_technology.achievements;" }, { "role"...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date...
[ { "role": "user", "content": "List asset_id, issuer and launch_date metadata values for each asset that has both 'issuer' and 'launch_date' keys." }, { "role": "assistant", "content": "SELECT m_iss.asset_id,\n m_iss.value AS issuer,\n m_ld.value AS launch_date\nFROM 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.metadata ( metadata_id character varying(64) NOT NULL, asset_id character varying(64) NOT NULL, key ch...
[ { "role": "user", "content": "Find all pairs of securities that are issued by the same issuer but listed on different exchanges." }, { "role": "assistant", "content": "SELECT a.issuer_name, a.ticker_symbol AS symbol_a, a.exchange AS exchange_a, b.ticker_symbol AS symbol_b, b.exchange AS exchange...
You are an SQL statement expert. Given the table 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": "List all NFT collections where the floor price is greater than 0.5 ETH, including their names and contract addresses." }, { "role": "assistant", "content": "SELECT name, contract_address FROM nft_collections WHERE CAST(floor_price AS decimal) > 0.5 AND floor_price_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "List all narratives with a trend rank in the top 10 and a 24-hour trading volume over $100 million." }, { "role": "assistant", "content": "SELECT narrative, trend_rank, volume_24h FROM narrative_info WHERE trend_rank <= 10 AND volume_24h > 100000000 ORDER BY trend_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 narrative_info (", "narrative character varying(512) NOT NULL, -- the id of narrative", "top_3_coins text, --...
[ { "role": "user", "content": "Get the average price of all services for each category." }, { "role": "assistant", "content": "SELECT category, AVG(price) AS avg_price\nFROM hospitality_technology.services\nGROUP BY category;" }, { "role": "user", "content": "Only include categories w...
You are an SQL statement expert. Given the table 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": "List all unique claim handler IDs present in the claims table." }, { "role": "assistant", "content": "SELECT DISTINCT claim_handler_id FROM insurance.claims WHERE claim_handler_id IS NOT NULL" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "Show me all business center services (category = 'Business Center') along with their property IDs and descriptions, where the service is available." }, { "role": "assistant", "content": "SELECT service_name, property_id, description FROM hospitality_technology.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 hospitality_technology.services ( service_id character varying(64) NOT NULL, -- unique identifier for a chargeable ...
[ { "role": "user", "content": "How many followers does each user have? Show user_id and follower_count." }, { "role": "assistant", "content": "SELECT following_user_id AS user_id, COUNT(*) AS follower_count\nFROM social_media.follows\nGROUP BY following_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.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u...
[ { "role": "user", "content": "For each branch, show the number of employees and the average tenure in days for those currently active." }, { "role": "assistant", "content": "SELECT branch_id, COUNT(*) AS employee_count, AVG(DATE_PART('day', CURRENT_DATE - hire_date)) AS avg_tenure_days\nFROM fin...
You are an SQL statement expert. Given the table 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": "Count the number of metadata entries for each asset_id." }, { "role": "assistant", "content": "SELECT asset_id,\n COUNT(*) AS metadata_count\nFROM trading_platform.metadata\nGROUP BY asset_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 trading_platform.metadata ( metadata_id character varying(64) NOT NULL, asset_id character varying(64) NOT NULL, key ch...
[ { "role": "user", "content": "List the number of employees hired in each department per year." }, { "role": "assistant", "content": "SELECT\n department,\n EXTRACT(YEAR FROM hire_date) AS hire_year,\n COUNT(employee_id) AS employee_count\nFROM financial_services.employees\nWHERE\n hire_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 financial_services.accounts ( account_id character varying(64) NOT NULL, -- unique identifier for the account c...
[ { "role": "user", "content": "What is the total USD value of all token outflows (type = 2) across all chains?" }, { "role": "assistant", "content": "SELECT SUM(usd_value) AS total_outflow_usd FROM smart_money_token_inflow WHERE type = 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 smart_money_token_inflow ( token_address character varying(100) NOT NULL, -- the token's address token_symbol character...
[ { "role": "user", "content": "Show me all in-progress trips with their vehicle IDs and the difference between scheduled and actual departure time in minutes." }, { "role": "assistant", "content": "SELECT trip_id, vehicle_id, EXTRACT(EPOCH FROM (actual_departure - scheduled_departure))/60 AS depa...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, driver_id text, scheduled_departure ti...
[ { "role": "user", "content": "Find all pairs of appointments that are scheduled for the same case and overlap in time. Show the IDs of the two overlapping appointments and the shared case ID." }, { "role": "assistant", "content": "SELECT t1.appointment_id AS appointment1_id, t2.appointment_id 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 legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "content": "Show me all agents and their managers' full names. For each agent, include agent_id, agent's first and last name, and their manager's first and last name." }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agen...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state...
[ { "role": "user", "content": "Retrieve each vehicle's most recent maintenance service date and next_service_due_date along with the date of its most recent trip actual_arrival. Include vehicle_id, service_date, next_service_due_date, and most_recent_arrival." }, { "role": "assistant", "content":...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id character varying(64) NOT NULL, -- unique identifier for the route route_numb...
[ { "role": "user", "content": "Show me all trades (trade_id, security_id, total_amount) executed by employees in the 'Investment' department, along with their employee_id and first_name." }, { "role": "assistant", "content": "SELECT t.trade_id, t.security_id, t.total_amount, e.employee_id, e.firs...
You are an SQL statement expert. Given the table 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": "Show the number of notifications sent per channel." }, { "role": "assistant", "content": "SELECT channel, COUNT(*) AS notification_count\nFROM government_services.notifications\nGROUP BY channel;" }, { "role": "user", "content": "Filter the result to inc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "Show me all available services with a unit of 'Per Hour'." }, { "role": "assistant", "content": "SELECT service_name , description , price FROM hospitality_technology.services WHERE is_available = true AND unit = 'Per Hour'" }, { "role": "user", "c...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu...
[ { "role": "user", "content": "Show me all active electric vehicles along with their make, model, and license plate, ordered by acquisition date with the newest first." }, { "role": "assistant", "content": "SELECT vehicle_id, make, model, license_plate, acquisition_date 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 character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "How many prescriptions have been issued for each medication?" }, { "role": "assistant", "content": "SELECT medication_id, COUNT(*) AS prescription_count FROM healthcare.prescriptions GROUP BY medication_id;" }, { "role": "user", "content": "Exclude null ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Show all reviews made by guests along with the guest_id, guest's reservation_id, and the related property's property_id and review_date." }, { "role": "assistant", "content": "SELECT r.review_id, r.guest_id, r.reservation_id, r.property_id, r.review_date\nFROM hospi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id character varying(64) NOT NULL, property_id character varying(64) ...
[ { "role": "user", "content": "For each blockchain (chain), find the token with the highest ROI in the smart_money_token_performance table, and include that token's narrative from smart_money_token_inflow, its net_flow, and avg_cost." }, { "role": "assistant", "content": "WITH ranked_tokens 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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,...
[ { "role": "user", "content": "List all appointments scheduled in the next 30 days with appointment_id, client_id, case_id, and any invoice_id linked to that case." }, { "role": "assistant", "content": "SELECT\n a.appointment_id,\n a.client_id,\n a.case_id,\n i.invoice_id\nFROM legal_services...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, -- unique identifier for the law firm firm_...
[ { "role": "user", "content": "Can you provide the total investment amount and the number of projects for each fundraising round?" }, { "role": "assistant", "content": "SELECT rounds_name, SUM(investment_value) AS total_investment, COUNT(DISTINCT project_name) AS project_count FROM project_fundra...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id text, project_id text, project_name text, rounds_name text, investment_value numeric, i...
[ { "role": "user", "content": "Show a list of all fuel refueling events for each trip, including the trip ID, fuel type, quantity, total cost, and the name of the refueling location." }, { "role": "assistant", "content": "SELECT fl.trip_id, fl.fuel_type, fl.quantity, fl.total_cost, l.name AS loca...
You are an SQL statement expert. Given the table 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": "Identify all sender addresses that have transferred tokens in more than 3 distinct transactions. Return from_address and transfer_count, ordered by transfer_count descending." }, { "role": "assistant", "content": "SELECT\n from_address,\n COUNT(DISTINCT transactio...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add...
[ { "role": "user", "content": "For each loan, show the loan ID, principal amount, interest rate, and the balance and currency of the associated account." }, { "role": "assistant", "content": "SELECT l.loan_id, l.principal_amount, l.interest_rate, a.balance, a.currency FROM financial_services.loan...
You are an SQL statement expert. Given the table 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": "Provide a list of node IDs, IP addresses, and the contract IDs and timestamps of smart contracts that were hypothetically created by these nodes." }, { "role": "assistant", "content": "SELECT T1.node_id, T1.ip_address, T2.contract_id, T2.timestamp FROM blockchain.no...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, -- unique identifier...
[ { "role": "user", "content": "Can you help me fetch the inventory details for components associated with a specific aircraft build, including the batch number, quantity, and warehouse location?" }, { "role": "assistant", "content": "MATCH (ab:AircraftBuild {build_id: 'specific_build_id'})-[:IS_M...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str...
[ { "role": "user", "content": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens with decimals equal to 18." }, { "role": "assistant", "content": "SELECT name, contract_address, total_supply FROM token_metas WHERE ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded ...
[ { "role": "user", "content": "Show me all patients who have scheduled appointments with doctors specializing in Cardiology, along with their appointment times and the doctors' full names." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, a.appointment_time, d.first_name AS...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Can you list all chronic diagnoses made in January 2024, showing diagnosis_id, diagnosis_code, and status, along with the doctor_id who made each diagnosis?" }, { "role": "assistant", "content": "SELECT diagnosis_id, diagnosis_code, status, doctor_id FROM healthcare...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry ...
[ { "role": "user", "content": "Show me the subjects and start times of all appointments for a specific client, along with the assigned lawyer ID." }, { "role": "assistant", "content": "SELECT subject, start_time, lawyer_id FROM legal_services.appointments WHERE client_id = 'CLIENT123';" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.appointments ( appointment_id text PRIMARY KEY, client_id text, lawyer_id text, case_id text, start_time...
[ { "role": "user", "content": "List all properties and the room types they offer, including the base rate for each room type." }, { "role": "assistant", "content": "SELECT T1.property_name, T2.type_name, T2.base_rate FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_ty...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- unique identifier for the room prope...
[ { "role": "user", "content": "List all rooms currently under Maintenance, including their room number, property name, room type name, and base rate." }, { "role": "assistant", "content": "SELECT r.room_number, p.property_name, rt.type_name, rt.base_rate\nFROM hospitality_technology.rooms r\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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "For citizens who registered before January 1, 2023, show the total number of notifications sent to them for each channel. List the citizen's first name, last name, the channel, and the count of notifications." }, { "role": "assistant", "content": "SELECT\n T1.first...
You are an SQL statement expert. Given the table 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": "Could you list all pairs of developers in the same country but different companies? Return developer1, developer2, and country." }, { "role": "assistant", "content": "SELECT d1.name AS developer1,\n d2.name AS developer2,\n d1.country\nFROM gaming_techno...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "Show the number of service orders for each status and the average total_price for each status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS order_count,\n AVG(total_price) AS avg_total_price\nFROM hospitality_technology.service_ord...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id.text, reservation_id.text, guest_id.text, service_id.text, staff_id_or...
[ { "role": "user", "content": "Show the number of trips operated by each driver along with the earliest and latest scheduled departure dates for them." }, { "role": "assistant", "content": "SELECT driver_id, COUNT(*) AS trip_count, MIN(scheduled_departure) AS first_departure, MAX(scheduled_depart...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id text, route_id text, vehicle_id text, driver_id text, scheduled_departure timestamp, act...
[ { "role": "user", "content": "Show the first name, last name, and email for all guests created in 2023." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM guests WHERE created_at >= '2023-01-01' AND created_at < '2024-01-01';" }, { "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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "List all in-game items' names, types, and rarity along with their total cost in USD, for items that belong to games released on or after 2021-01-01." }, { "role": "assistant", "content": "SELECT i.item_name, i.item_type, i.rarity, i.cost_amount\nFROM gaming_technolo...
You are an SQL statement expert. Given the table 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(), -- unique identifier for the player ...
[ { "role": "user", "content": "Show me the total number of trades and the sum of total_amount for each status in the trades table." }, { "role": "assistant", "content": "SELECT\n t.status,\n COUNT(t.trade_id) AS trade_count,\n SUM(t.total_amount) AS total_amount_by_status\nFROM financial_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 financial_services.trades ( trade_id character varying(64) NOT NULL, account_id character varying(64) NOT NULL, securit...
[ { "role": "user", "content": "Show the usernames and email addresses of users who have commented on their own posts." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email\nFROM social_media.comments c\nJOIN social_media.users u ON c.user_id = u.user_id\nJOIN social_media.pos...
You are an SQL statement expert. Given the table 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 guests who have not provided their date of birth, along with their email and phone number if available." }, { "role": "assistant", "content": "SELECT guest_id, first_name, last_name, email, phone_number FROM hospitality_technology.guests WHERE date_of_birth...
You are an SQL statement expert. Given the table 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 produce a summary report listing each security's ticker_symbol, exchange, average close_price, and average volume based on market_data?" }, { "role": "assistant", "content": "SELECT s.ticker_symbol, s.exchange, AVG(m.close_price) AS avg_close_price, AVG(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 financial_services.transactions ( transaction_id character varying(64) NOT NULL, account_id character varying(64) NOT N...
[ { "role": "user", "content": "List all inactive customers from California who were created in the last 5 years, showing their full names and creation dates." }, { "role": "assistant", "content": "SELECT first_name, last_name, created_at FROM insurance.customers WHERE state = 'California' AND sta...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Provide the contract ID, creator address, and timestamp for all smart contracts created between January 1st, 2022, and December 31st, 2024." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE ti...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, time...
[ { "role": "user", "content": "Which bed types are offered in each property and how many different room types are associated with each bed type?" }, { "role": "assistant", "content": "SELECT property_id, bed_type, COUNT(DISTINCT room_type_id) AS room_type_count FROM hospitality_technology.room_ty...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, property_id text, type_name text, description text, ...
[ { "role": "user", "content": "For each citizen, get their full name and the count of documents they have uploaded." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(d.document_id) AS document_count\nFROM government_services.citizens AS c\nLEFT JOIN government_service...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "List all male patients who don't have an email address but have an emergency contact, showing their full names and emergency contact details." }, { "role": "assistant", "content": "SELECT first_name, last_name, emergency_contact_name, emergency_contact_phone FROM he...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "List all payments for reservations made at properties with a star rating of 5.0. Include the payment amount, guest ID, reservation ID, and property name." }, { "role": "assistant", "content": "SELECT T1.amount, T1.guest_id, T1.reservation_id, T3.property_name FROM h...
You are an SQL statement expert. Given the table 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": "What is the count of securities for each security_type in the 'Technology' sector?" }, { "role": "assistant", "content": "SELECT security_type, COUNT(*) as security_count FROM financial_services.securities WHERE sector = 'Technology' GROUP BY security_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 financial_services.securities ( security_id character varying(64) NOT NULL, -- unique identifier for the security ...
[ { "role": "user", "content": "I want to identify pairs of players who unlocked the same achievement within one hour of each other. List player1_id, player2_id, achievement_id, and the time difference in minutes." }, { "role": "assistant", "content": "SELECT pa1.player_id AS player1_id,\n 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 gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, achievement_id uuid, unlocked_at ti...
[ { "role": "user", "content": "How many hashtags were created in each month of 2023?" }, { "role": "assistant", "content": "SELECT TO_CHAR(created_at, 'YYYY-MM') AS month, COUNT(*) AS hashtag_count\nFROM social_media.hashtags\nWHERE created_at BETWEEN '2023-01-01' AND '2023-12-31'\nGROUP BY month...
You are an SQL statement expert. Given the table 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.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name character varying(100) NOT NULL UNIQUE, cre...
[ { "role": "user", "content": "Show me the top 5 smart money addresses by profit on the Ethereum chain, along with their most profitable token and ROI, but only include addresses with a realized profit ratio above 70%." }, { "role": "assistant", "content": "SELECT address, most_profit_token, roi ...
You are an SQL statement expert. Given the table 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, -- the user's address rank INT, -- the rank of the addres...
[ { "role": "user", "content": "Show me the top 5 users who have the highest total order quantity, along with their order type and the average price they paid." }, { "role": "assistant", "content": "SELECT user_id, order_type, SUM(quantity) as total_quantity, AVG(price) as avg_price FROM trading_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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan...
[ { "role": "user", "content": "Show me all players who have unlocked a hidden achievement. List the player ID, the name of the achievement, and the date they unlocked it." }, { "role": "assistant", "content": "SELECT pa.player_id, a.name AS achievement_name, pa.unlocked_at FROM 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.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,...
[ { "role": "user", "content": "Which five companies have the most clients, and how many clients does each have?" }, { "role": "assistant", "content": "SELECT company_name, COUNT(*) AS client_count\nFROM legal_services.clients\nGROUP BY company_name\nORDER BY client_count DESC\nLIMIT 5;" } ]
You are an SQL statement expert. Given the table 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": "Provide a count of agencies for each distinct jurisdiction level." }, { "role": "assistant", "content": "SELECT jurisdiction_level, COUNT(*) AS agency_count FROM government_services.agencies GROUP BY jurisdiction_level;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show me the top 3 narratives by 24-hour trading volume, along with their 1-hour and 24-hour price change percentages." }, { "role": "assistant", "content": "SELECT narrative.text, price_change_percentage_1h.numeric, price_change_percentage_24h.numeric FROM narrative...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume...
[ { "role": "user", "content": "How many reservations does each property have?" }, { "role": "assistant", "content": "SELECT property_id,\n COUNT(*) AS reservation_count\nFROM hospitality_technology.reservations\nGROUP BY property_id;" }, { "role": "user", "content": "Actually, o...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id.text, property_id.text, guest_id.text, room_id.text, room_type_id....
[ { "role": "user", "content": "List the document ID, document type, and verification status for all documents verified by employees working for the agency with ID 'AG101'. Also include the verifying employee's full name." }, { "role": "assistant", "content": "SELECT T1.document_id , T1.document_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "List the first name, last name, and specialization of all lawyers who have uploaded at least one document." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T1.specialization FROM legal_services.lawyers AS T1 JOIN legal_services.documents 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "For each doctor, count how many medical record entries they have created and show the doctor_id alongside the record count." }, { "role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS record_count\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": "List all service orders for spa services with their guest names and total prices, ordered by total price in descending order." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, so.order_id, so.total_price FROM hospitality_technology.service_ord...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, property_id character varying(64) NOT ...
[ { "role": "user", "content": "For Sui NFTs with status 'exists', list their object_id, name, and owner." }, { "role": "assistant", "content": "SELECT object_id, name, owner\nFROM sui_nfts\nWHERE status = 'exists';" }, { "role": "user", "content": "I also need to see collection_type 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 erc20_balances_historical ( block_number bigint NOT NULL, -- Block number containing the transaction contract_a...
[ { "role": "user", "content": "List all orders, showing order ID, type, quantity, and the asset name." }, { "role": "assistant", "content": "SELECT o.order_id, o.order_type, o.quantity, a.name FROM trading_platform.orders o JOIN trading_platform.assets a ON o.asset_id = a.asset_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 trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp ) CREATE ...
[ { "role": "user", "content": "Show me all time entries, including the case name they are associated with." }, { "role": "assistant", "content": "SELECT T1.*, T2.case_name FROM time_entries AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id" }, { "role": "user", "content": "Only show 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.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 patients who have both primary and non-primary insurance plans, along with their policy numbers and expiration dates." }, { "role": "assistant", "content": "SELECT p1.patient_id, p1.policy_number AS primary_policy, p1.expiration_date AS primary_expiry, p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id.text, patient_id.text, plan_id.text, policy_number.text, group_numb...
[ { "role": "user", "content": "List the conversation IDs and user IDs for participants who have email notifications enabled." }, { "role": "assistant", "content": "SELECT cp.conversation_id, cp.user_id FROM social_media.conversation_participants AS cp JOIN social_media.user_settings AS us ON cp.u...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "List policies issued by active agents to customers in the 'CA' state, including policy number, customer's first and last name, agent's first and last name, and the agent's license state." }, { "role": "assistant", "content": "SELECT p.policy_number, c.first_name AS ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE 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 wallets holding at least 3 different ERC1155 NFTs on Ethereum, along with the number of distinct tokens held by each wallet." }, { "role": "assistant", "content": "SELECT wallet_address, COUNT(DISTINCT token_id) as distinct_tokens\nFROM nft_holders\nWHER...
You are an SQL statement expert. Given the table 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": "What is the average interest rate for auto loans (loan_type = 'Auto') with a principal amount between $20,000 and $50,000?" }, { "role": "assistant", "content": "SELECT AVG(interest_rate) AS avg_interest_rate FROM financial_services.loans WHERE loan_type = 'Auto' AN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.loans ( loan_id text, account_id text, loan_type text, principal_amount numeric, current_principal_b...
[ { "role": "user", "content": "Count the number of hashtags associated with each post." }, { "role": "assistant", "content": "SELECT post_id,\n COUNT(hashtag_id) AS hashtag_count\nFROM social_media.post_hashtags\nGROUP BY post_id;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Which cities are listed as primary_address for citizens who have a verified account? Can you show the city names and the number of verified citizens in each city?" }, { "role": "assistant", "content": "SELECT SPLIT_PART(primary_address, ',', 1) AS city, COUNT(*) 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "How many unique hashtags has each post been associated with? Please return post_id and unique_hashtag_count." }, { "role": "assistant", "content": "SELECT post_id, COUNT(DISTINCT hashtag_id) AS unique_hashtag_count\nFROM social_media.post_hashtags\nGROUP BY post_id;...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text ) CREATE TABLE social_media.conversati...
[ { "role": "user", "content": "List all trips scheduled on '2023-11-01' along with the license plate of the assigned vehicle and the driver's full name." }, { "role": "assistant", "content": "SELECT t.trip_id, t.route_id, t.scheduled_departure, v.license_plate, d.first_name || ' ' || d.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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Please provide the first name, last name, and the total number of trips completed by each driver." }, { "role": "assistant", "content": "SELECT T1.first_name , T1.last_name , COUNT(T2.trip_id) FROM transportation.drivers AS T1 JOIN transportation.trips 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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "List the names of NFT collections and the wallet addresses that hold NFTs from those collections." }, { "role": "assistant", "content": "SELECT DISTINCT T1.name, T2.wallet_address FROM nft_collections AS T1 JOIN nft_holder_historical AS T2 ON T1.contract_address = T...
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": "I need to get the inventory quantity and location for a specific batch number. Can you help with that?" }, { "role": "assistant", "content": "HGETALL inv:<inventory_record_id>" }, { "role": "user", "content": "Can you also show me the component ID associ...
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 Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c...
[ { "role": "user", "content": "List all pairs of achievements unlocked by the same player, showing player_id, achievement1, and achievement2." }, { "role": "assistant", "content": "SELECT pa1.player_id,\n pa1.achievement_id AS achievement1,\n pa2.achievement_id AS achievement2\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.player_achievements ( player_achievement_id uuid, player_id uuid, achievement_id uuid, unlocked_at ti...
[ { "role": "user", "content": "List all failed payments with their details." }, { "role": "assistant", "content": "SELECT payment_id, application_id, citizen_id, service_id, amount, currency, payment_method, payment_provider_reference, payment_timestamp, status, notes FROM government_services.pay...
You are an SQL statement expert. Given the table 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.payments ( payment_id.text, application_id.text, citizen_id.text, service_id.text, amount.numeric, ...
[ { "role": "user", "content": "Show me the subjects and start times of all appointments along with the document names of any documents uploaded for the associated case." }, { "role": "assistant", "content": "SELECT a.subject, a.start_time, d.document_name\nFROM legal_services.appointments a\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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "List the employee full names, the department they work in, and the number of notifications sent to citizens who have made payments for the services managed by these employees' agencies." }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "List all payments made by credit card, including the payment ID, guest ID, amount, status, and card last four digits. Order by payment amount descending." }, { "role": "assistant", "content": "SELECT payment_id, guest_id, amount, status, card_last_four\nFROM hospita...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.payments ( payment_id text PRIMARY KEY, reservation_id text, guest_id text, bill_id text, amount...
[ { "role": "user", "content": "What is the count of customers for each state where the status is 'Active' and the created_at date is within the last 3 months?" }, { "role": "assistant", "content": "SELECT state, COUNT(*) as customer_count FROM financial_services.customers WHERE status = 'Active' ...
You are an SQL statement expert. Given the table 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": "Calculate the average quantity for orders based on their status." }, { "role": "assistant", "content": "SELECT status, AVG(quantity) FROM trading_platform.orders 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 trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "List all cancelled policies with their cancellation reasons and premium amounts, sorted by cancellation date in descending order." }, { "role": "assistant", "content": "SELECT policy_id, cancellation_reason, premium_amount, cancellation_date FROM insurance.policies ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "Which SUI coins are owned by the address '0xSuperOwner'? Please list the object_id, coin_type, and balance." }, { "role": "assistant", "content": "SELECT object_id, coin_type, balance\nFROM sui_coins\nWHERE owner = '0xSuperOwner';" }, { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...