Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
276
7.75k
[ { "role": "user", "content": "Show me the count of service orders for each distinct status." }, { "role": "assistant", "content": "SELECT status, COUNT(order_id) FROM hospitality_technology.service_orders GROUP BY status;" }, { "role": "user", "content": "Also, include the total quan...
You are an SQL statement expert. Given the table 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 route, show the route number and the total number of trips associated with it." }, { "role": "assistant", "content": "SELECT T2.route_number, count(T1.trip_id) FROM transportation.trips AS T1 JOIN transportation.routes AS T2 ON T1.route_id = T2.route_id GRO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Show me all customers who have missing contact information (either phone number or email is null), along with their state and city." }, { "role": "assistant", "content": "SELECT first_name, last_name, state, city FROM insurance.customers WHERE phone_number IS NULL 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 insurance.customers ( customer_id character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "For each developer, can you find the next developer in the same country using a self join, returning developer_ids and names?" }, { "role": "assistant", "content": "SELECT d1.developer_id AS current_dev,\n d1.name AS current_name,\n d2.develo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "List all guests who have placed service orders for services in the 'Transportation' department, along with their full names and the service names." }, { "role": "assistant", "content": "SELECT g.guest_id, g.first_name, g.last_name, s.service_name\nFROM hospitality_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, email.text, phone_number.text, date_of_...
[ { "role": "user", "content": "How many documents were uploaded in the year 2023?" }, { "role": "assistant", "content": "SELECT count(*) FROM government_services.documents WHERE date_part('year', upload_timestamp) = 2023;" } ]
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "List the names of employees and the agency they work for who have scheduled at least one appointment. Show the employee's first name, last name, and agency_id." }, { "role": "assistant", "content": "SELECT DISTINCT e.first_name, e.last_name, e.agency_id\nFROM govern...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, description text, category text, eli...
[ { "role": "user", "content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts." }, { "role": "assistant", "content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE status = 'expired' AND end_date >= CURRENT_DATE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "List each guest’s full name and the total number of service orders they have placed, ordered by order count descending." }, { "role": "assistant", "content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n COUNT(so.order_id) AS 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.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te...
[ { "role": "user", "content": "Calculate the total value of unspent UTXOs for each user whose KYC status has been 'approved'." }, { "role": "assistant", "content": "SELECT kyc.user_id, SUM(u.amount) FROM trading_platform.kyc_audit kyc JOIN trading_platform.utxos u ON kyc.user_id = u.user_id 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 trading_platform.utxos ( utxo_id.text, transaction_id.text, output_index.integer, address.text, amount.numeric, spent.b...
[ { "role": "user", "content": "Show me all events emitted by contracts where the event name contains 'Approval', along with the contract ID and transaction ID, sorted by emitted timestamp in descending order." }, { "role": "assistant", "content": "SELECT event_id, contract_id, event_name, transac...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for the event contract_id characte...
[ { "role": "user", "content": "Show me the top 3 smart money addresses by profit across all chains, along with their most profitable token and chain information." }, { "role": "assistant", "content": "SELECT address, profit, most_profit_token, chain\nFROM smart_money_profit\nORDER BY profit DESC\...
You are an SQL statement expert. Given the table 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": "What is the total estimated_loss and average settlement_amount for all claims with status 'Approved'?" }, { "role": "assistant", "content": "SELECT SUM(estimated_loss) AS total_estimated_loss,\n AVG(settlement_amount) AS average_settlement\nFROM insurance.clai...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text, policy_id text, customer_id text, incident_date timestamp, reported_date timestamp, d...
[ { "role": "user", "content": "Show me the top 5 users by the total trade volume (quantity * price) as buyers, along with their email addresses and the number of distinct assets they traded." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, COUNT(DISTINCT t.asset_id) AS distinct_a...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "For each Avalanche token tick, calculate the total transfer volume and transaction count over the past 7 days using token_activities_avalanche. Include the token tick, total_volume, and tx_count." }, { "role": "assistant", "content": "SELECT\n tick,\n SUM(amt) 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "Show me a list of all properties along with their average overall review rating." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "For each driver, find the other driver whose license_expiry_date is the next one after theirs. Show both IDs, names and their expiry dates." }, { "role": "assistant", "content": "SELECT\n d1.driver_id AS driver_id,\n d1.first_name || ' ' || d1.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.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "List pairs of smoking and non-smoking rooms on the same floor for each property, showing the property_id, floor, smoking room_number, and non_smoking room_number." }, { "role": "assistant", "content": "SELECT r1.property_id,\n r1.floor,\n r1.room_number ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat...
[ { "role": "user", "content": "For each group chat, list its ID, name, creation time, and the creation time of the next group chat created after it, ordered by creation time." }, { "role": "assistant", "content": "SELECT conversation_id, group_name, created_at, LEAD(created_at) OVER (ORDER BY cre...
You are an SQL statement expert. Given the table 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.conversations ( conversation_id character varying(64) NOT NULL, created_at timestamp NOT NULL DEFAULT CURR...
[ { "role": "user", "content": "Find employees who are managers and list the number of employees they directly manage. Show the manager's full name and the count of their direct reports." }, { "role": "assistant", "content": "SELECT m.first_name || ' ' || m.last_name AS manager_full_name, COUNT(e....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.employees ( employee_id character varying(64) NOT NULL, -- unique identifier for the government...
[ { "role": "user", "content": "Show me all claims with police reports that were filed in the last 3 months, along with the policy details and customer information." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, c.customer_id, c.incident_date, c.reported_date, c.description...
You are an SQL statement expert. Given the table 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 the usernames along with the names of group chats they are participating in and the dates they joined each group." }, { "role": "assistant", "content": "SELECT u.username, c.group_name, cp.joined_at\nFROM social_media.conversation_participants cp\nJOIN socia...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Find receiver addresses that have received transactions from more than 5 distinct sender addresses. Show the receiver address and the count of distinct senders." }, { "role": "assistant", "content": "SELECT receiver_address, COUNT(DISTINCT sender_address) FROM block...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the transaction ...
[ { "role": "user", "content": "How many reviews does each staff member respond to, along with their full name and the average response time in hours?" }, { "role": "assistant", "content": "SELECT st.staff_id,\n st.first_name || ' ' || st.last_name AS staff_full_name,\n COUNT(*) AS res...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Find the average percentage share among all beneficiaries for each distinct relationship type." }, { "role": "assistant", "content": "SELECT relationship, AVG(percentage_share) FROM insurance.policy_beneficiaries GROUP BY relationship ORDER BY relationship;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Show me the top 5 games by number of online servers in European regions. I want the game title and the server count." }, { "role": "assistant", "content": "SELECT g.title, COUNT(s.server_id) AS server_count\nFROM gaming_technology.games g\nJOIN gaming_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 gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "I want to list all employees who currently manage at least one other employee, showing their full name, email, and the total number of direct reports for each manager." }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name || ' ' || e.last_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 financial_services.accounts ( account_id character varying(64) NOT NULL, -- unique identifier for the account c...
[ { "role": "user", "content": "Give me each server's name, the region, and the maximum number of players that have been connected at once." }, { "role": "assistant", "content": "SELECT s.server_id, s.server_name, s.region, MAX(s.current_players) AS max_players_seen\nFROM gaming_technology.servers...
You are an SQL statement expert. Given the table 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": "For each doctor, list their full name along with the number of prescriptions they have written and the number of unique insurance providers among their patients." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(pr.prescript...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "Show me each service order along with the next order placed by the same guest, including both order IDs and the time difference in minutes between the two orders." }, { "role": "assistant", "content": "SELECT a.order_id,\n b.order_id AS next_order_id,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id.text, reservation_id.text, guest_id.text, service_id.text, staff_id_or...
[ { "role": "user", "content": "Find any two claims made by the same customer on the same day. Return customer_id, the two claim IDs, and the incident date." }, { "role": "assistant", "content": "SELECT c1.customer_id,\n c1.claim_id AS claim1_id,\n c2.claim_id AS claim2_id,\n DAT...
You are an SQL statement expert. Given the table 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 all pairs of clients who registered on the same day, showing each client's first_name, last_name, and the registration date." }, { "role": "assistant", "content": "SELECT c1.first_name AS first_name_1, c1.last_name AS last_name_1, c2.first_name AS first_name_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 legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad...
[ { "role": "user", "content": "List each citizen's first and last name along with the number of applications they have submitted, only include those with at least 3 applications." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, COUNT(a.application_id) AS application_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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "How many messages in total have been sent that do not contain any media attachment?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS non_media_message_count\nFROM social_media.messages\nWHERE media_url IS NULL OR media_url = '';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_user_id text, content text, media_url...
[ { "role": "user", "content": "Find all wallets that were created on the same day and list their wallet IDs, addresses, and the creation date." }, { "role": "assistant", "content": "SELECT w1.wallet_id, w1.address, w1.created_at::date AS creation_date FROM web3.wallets w1 JOIN (SELECT created_at:...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_id character...
[ { "role": "user", "content": "List all cancelled policies with their cancellation reasons and premium amounts." }, { "role": "assistant", "content": "SELECT policy_id, policy_number, cancellation_reason, premium_amount FROM insurance.policies WHERE status = 'Cancelled';" }, { "role": "us...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "Can you help me get the total number of operational platforms across all stations?" }, { "role": "assistant", "content": "db.platforms.countDocuments({ status: 'Operational' });" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // db.createCollection('platforms') // Optional: db.platforms.createIndex({ platform_id: 1 }, { u...
[ { "role": "user", "content": "List all patients who have a current prescription that was prescribed by a doctor with a specialty of 'Endocrinology'. Show patient full name, prescription ID, medication name, and prescription date." }, { "role": "assistant", "content": "SELECT p.patient_id, p.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 healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appointment_time timestamp, duration_mi...
[ { "role": "user", "content": "Find all wallets created by users in the last 7 days along with any tokens that have a total supply greater than 10 million, showing the wallet address and token details." }, { "role": "assistant", "content": "SELECT w.address AS wallet_address, t.token_name, t.toke...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha...
[ { "role": "user", "content": "Show me all home loans (loan_id, principal_amount, interest_rate) where the current principal balance is more than 75% of the original principal amount, along with the account_id and employee details (first_name, last_name) of the employee who processed the loan application." ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id.text, account_id.text, related_account_id.text, transaction_type.text,...
[ { "role": "user", "content": "Provide the count of diagnoses by status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS count\nFROM healthcare.diagnoses\nGROUP BY status;" }, { "role": "user", "content": "Now only include statuses with more than 10 diagnoses...
You are an SQL statement expert. Given the table 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": "How many users registered in each month?" }, { "role": "assistant", "content": "SELECT date_trunc('month', created_at) AS month,\n COUNT(*) AS registrations\nFROM web3.users\nGROUP BY month\nORDER BY month;" }, { "role": "user", "content": "Actuall...
You are an SQL statement expert. Given the table 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.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email character varying(...
[ { "role": "user", "content": "I want to find pairs of transactions where one transaction’s related_account_id matches the other’s account_id, indicating reciprocal transfers between accounts." }, { "role": "assistant", "content": "SELECT t1.transaction_id AS outgoing_txn, t2.transaction_id AS in...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id text PRIMARY KEY, account_id text, related_account_id text, transactio...
[ { "role": "user", "content": "What is the total and average amount of unspent UTXOs per address?" }, { "role": "assistant", "content": "SELECT\n address,\n COUNT(*) AS utxo_count,\n SUM(amount) AS total_unspent_amount,\n AVG(amount) AS average_unspent_amount\nFROM trading_platform.utxos\nWHE...
You are an SQL statement expert. Given the table 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": "I want to find all appointment pairs where two appointments are scheduled for the same client at overlapping times. Provide the appointment_id from both overlapping appointments." }, { "role": "assistant", "content": "SELECT a1.appointment_id AS appointment_id_1, a2...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.appointments ( appointment_id text PRIMARY KEY, client_id text, lawyer_id text, case_id text, start_time...
[ { "role": "user", "content": "What is the fuel efficiency of the train car with car_id 'TC456'?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the fuel efficiency of specific train cars. The data available in the train_cars table only includes deta...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.t...
[ { "role": "user", "content": "List all agencies that do not have a website URL specified. Return their agency_id, agency_name, and main_phone_number." }, { "role": "assistant", "content": "SELECT agency_id, agency_name, main_phone_number FROM government_services.agencies WHERE website_url IS NUL...
You are an SQL statement expert. Given the table 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": "List all rooms that have a 'Jacuzzi' feature, including the room_number, property_id, type_name, and base_rate." }, { "role": "assistant", "content": "SELECT r.room_number,\n r.property_id,\n rt.type_name,\n rt.base_rate\nFROM hospitality_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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, room_type_id.text, floor.integer, stat...
[ { "role": "user", "content": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count." }, { "role": "assistant", "content": "SELECT g.genre, COUNT(gs.session_id) AS session_count, COUNT(DISTIN...
You are an SQL statement expert. Given the table 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 the name of each agency and whether it operates at least one service location marked as accessible." }, { "role": "assistant", "content": "SELECT T1.agency_name FROM government_services.agencies AS T1 JOIN government_services.service_locations AS T2 ON T1.agenc...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, -- unique identifier for the agency ag...
[ { "role": "user", "content": "List the reference number and status for applications where the notes contain the keyword 'urgent'." }, { "role": "assistant", "content": "SELECT reference_number, status FROM government_services.applications WHERE notes ILIKE '%urgent%';" }, { "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 government_services.applications ( application_id character varying(64) NOT NULL, citizen_id character varying(64) NOT ...
[ { "role": "user", "content": "List all users whose email contains the word 'block', along with their username and registration timestamp." }, { "role": "assistant", "content": "SELECT user_id, username, email, created_at\nFROM web3.users\nWHERE email ILIKE '%block%';" }, { "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 web3.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
[ { "role": "user", "content": "Show the full names and contact emails of all citizens who have applied for services with a standard fee greater than 100." }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM government_services.citize...
You are an SQL statement expert. Given the table 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": "For all NFT collections on the Ethereum blockchain, show me the collection name and the current floor price. Sort by floor price descending." }, { "role": "assistant", "content": "SELECT name, floor_price FROM nft_collections WHERE blockchain = 'Ethereum' ORDER BY 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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "What are the maintenance costs for a specific aircraft model like the Airbus A320?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to data regarding maintenance costs for specific aircraft models such as the Airbus A320. The information in ...
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 manufacturing.aircraft_mod...
[ { "role": "user", "content": "Count the number of events for each hour of the day based on the emitted_at timestamp." }, { "role": "assistant", "content": "SELECT EXTRACT(HOUR FROM emitted_at) AS event_hour, COUNT(*) AS event_count FROM web3.events GROUP BY event_hour ORDER BY event_hour;" }, ...
You are an SQL statement expert. Given the table 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": "Show me all insurance plans where the website includes 'secure'." }, { "role": "assistant", "content": "SELECT * FROM healthcare.insurance_plans WHERE website ILIKE '%secure%';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "role": "user", "content": "Show me the top 5 buyers by total trade volume (quantity * price) in the last 30 days, along with their trade count." }, { "role": "assistant", "content": "SELECT buyer_id, COUNT(trade_id) AS trade_count, SUM(quantity * price) AS total_volume FROM trading_platform.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 trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "role": "user", "content": "Find the total amount paid for all premium payments made in the last 30 days." }, { "role": "assistant", "content": "SELECT SUM(amount_paid) FROM insurance.premium_payments WHERE payment_date >= CURRENT_DATE - INTERVAL '30 day';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "Find all pairs of contracts deployed by the same deployer on the same day, showing the deployer_address, the deployment date, and both contract IDs." }, { "role": "assistant", "content": "SELECT c1.deployer_address,\n DATE(c1.deployed_at) AS deploy_date,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,...
[ { "role": "user", "content": "What is the detailed repair history of the equipment used by the staff with staff_id 'STAFF123' during maintenance tasks?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the detailed repair history of equipment used by staff memb...
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.m...
[ { "role": "user", "content": "What are the environmental impact assessments for the production of the Airbus A350 model?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to data regarding the environmental impact assessments for the production of specific aircraft models...
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 manufacturing.aircraft_mod...
[ { "role": "user", "content": "Which room types offer both 'Sea View' and 'Balcony' amenities? Show their type names, property IDs, and base rates." }, { "role": "assistant", "content": "SELECT type_name, property_id, base_rate FROM hospitality_technology.room_types WHERE amenities LIKE '%Sea Vie...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id.text, property_id.text, type_name.text, description.text, base_rate.nu...
[ { "role": "user", "content": "List the latest version of each document (identified by case_id and document_name), showing the version number and its upload_timestamp." }, { "role": "assistant", "content": "SELECT d.case_id,\n d.document_name,\n d.version AS latest_version,\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 legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "List all rooms, including their room number, the name of the property they belong to, and their room type name, specifically for rooms with 'Maintenance' status." }, { "role": "assistant", "content": "SELECT T1.room_number, T2.property_name, T3.type_name FROM rooms ...
You are an SQL statement expert. Given the table 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 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": "For wallet address '0xWalletA', list the ERC20 tokens held, showing contract address and amount." }, { "role": "assistant", "content": "SELECT contract_address, amount FROM erc20_balances WHERE wallet_address = '0xWalletA';" }, { "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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ...
[ { "role": "user", "content": "Show me all maintenance logs for 'Oil Change' services performed in the last 3 months, including the vehicle ID, service date, and cost." }, { "role": "assistant", "content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE service_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.maintenance_logs ( log_id character varying(64) NOT NULL, -- unique identifier for the maintenance ...
[ { "role": "user", "content": "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": "For each relationship type among policy beneficiaries, count how many beneficiaries exist of that type. Provide relationship and count, ordered by count descending." }, { "role": "assistant", "content": "SELECT relationship,\n COUNT(*) AS beneficiary_count\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 insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Find all in-game items that have a 'mana_cost' attribute in their attributes JSON. Show the item ID, item name, and the value of the 'mana_cost'." }, { "role": "assistant", "content": "SELECT item_id, item_name, attributes ->> 'mana_cost' AS mana_cost FROM gaming_te...
You are an SQL statement expert. Given the table 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 the citizen IDs for individuals who have both uploaded documents and made payments." }, { "role": "assistant", "content": "SELECT DISTINCT T1.citizen_id FROM documents AS T1 JOIN payments AS T2 ON T1.citizen_id = T2.citizen_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 government_services.documents ( document_id character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "List claims along with the name of the insurance product associated with the policy under which the claim was filed. Show claim_id, incident_date, and product_name." }, { "role": "assistant", "content": "SELECT T1.claim_id, T1.incident_date, T3.product_name FROM ins...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the claim policy_id charac...
[ { "role": "user", "content": "Which service locations are not accessible and belong to agencies with a jurisdiction level of 'Local'? Show the location name and city." }, { "role": "assistant", "content": "SELECT sl.location_name, sl.city\nFROM government_services.service_locations sl\nINNER JOI...
You are an SQL statement expert. Given the table 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, agency_name text, jurisdiction_level text, primary_contact_email text, m...
[ { "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 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": "For each employee who has verified documents, show their full name and the total number of documents they have verified with a status of 'Verified'." }, { "role": "assistant", "content": "SELECT e.full_name, COUNT(d.document_id) FROM government_services.documents d ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.documents ( document_id text, application_id text, citizen_id text, document_type text, file_refere...
[ { "role": "user", "content": "List pairs of citizens who share the same email domain." }, { "role": "assistant", "content": "SELECT c1.first_name AS first1,\n c1.last_name AS last1,\n c2.first_name AS first2,\n c2.last_name AS last2,\n SPLIT_PART(c1.contact_email, '@', 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Find all patients who have been prescribed medications with dosage greater than 50mg, along with their medication details and prescribing doctor's name." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pr.dosage, pr.medication_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "What is the average ROI and average realized_ratio for each chain?" }, { "role": "assistant", "content": "SELECT chain,\n AVG(roi) AS avg_roi,\n AVG(realized_ratio) AS avg_realized_ratio\nFROM smart_money_token_performance\nGROUP BY chain;" }, { ...
You are an SQL statement expert. Given the table 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,...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
4