conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Find all developers founded before the year 2000 and show their name and country." }, { "role": "assistant", "content": "SELECT name, country FROM gaming_technology.developers WHERE founded_year < 2000;" }, { "role": "user", "content": "Now, for the coun...
You are an SQL statement expert. Given the table 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": "Retrieve the service names, location names, and cities for active services offered at accessible locations in California." }, { "role": "assistant", "content": "SELECT s.service_name,\n sl.location_name,\n sl.city\nFROM government_services.services AS 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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show me all prescriptions made by doctors who have issued diagnoses described as 'Hypertension'. Include the doctor's ID, prescription ID, medication ID, and prescription date." }, { "role": "assistant", "content": "SELECT p.doctor_id, p.prescription_id, p.medicatio...
You are an SQL statement expert. Given the table 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 the names and numbers of cases that were opened in June 2024." }, { "role": "assistant", "content": "SELECT case_name, case_number FROM legal_services.cases WHERE date_opened >= '2024-06-01' AND date_opened < '2024-07-01';" } ]
You are an SQL statement expert. Given the table 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": "What is the average ROI for tokens with a realized ratio above 50% across all chains?" }, { "role": "assistant", "content": "SELECT AVG(roi) AS average_roi FROM smart_money_token_performance WHERE realized_ratio > 50;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_token_performance ( token_address character varying(100) NOT NULL, -- the token's address token_symbol char...
[ { "role": "user", "content": "List the names of active services offered by agencies with at least one accessible service location in the state of 'New York'. Show the service name, category, agency name, and the location name." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.cat...
You are an SQL statement expert. Given the table 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 reviews have been submitted for each review_source?" }, { "role": "assistant", "content": "SELECT review_source, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY review_source;" }, { "role": "user", "content": "Now, show 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.reviews ( review_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Show me the top 5 NFT collections with the highest number of unique owners, along with their names and contract addresses." }, { "role": "assistant", "content": "SELECT nc.name, nc.contract_address, COUNT(DISTINCT nh.wallet_address) AS unique_owners FROM nft_collect...
You are an SQL statement expert. Given the table 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, contract_address varchar, wallet_address varchar, amount varchar, pk i...
[ { "role": "user", "content": "Show the license numbers and full names of all doctors who were registered before January 1, 2020 and work at 'hospital_789'." }, { "role": "assistant", "content": "SELECT license_number, first_name, last_name FROM healthcare.doctors WHERE created_at < '2020-01-01' ...
You are an SQL statement expert. Given the table 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 all transactions that occurred in the last week." }, { "role": "assistant", "content": "SELECT * FROM web3.transactions WHERE timestamp >= NOW() - INTERVAL '7 days';" }, { "role": "user", "content": "From that list, only show the ones with a stat...
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 web3.transactions ( transaction_id.text, from_address.text, to_address.text, value.n...
[ { "role": "user", "content": "Show me the user IDs and the notification types for users who have participated in any conversation. Also show the conversation ID they joined." }, { "role": "assistant", "content": "SELECT cp.user_id, n.notification_type, cp.conversation_id\nFROM social_media.conve...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media_type.text, created_at.timestamp, u...
[ { "role": "user", "content": "Show me the top 5 wallet addresses with the highest total ERC20 token balances, including their wallet addresses and total amounts." }, { "role": "assistant", "content": "SELECT wallet_address, SUM(CAST(amount AS decimal)) AS total_balance FROM erc20_balances GROUP ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, amount.text, pk.text ) CREATE TABLE e...
[ { "role": "user", "content": "Can you list the wallet addresses and the amount held for the NFT with contract address '0xabcd...' and token ID '123'?" }, { "role": "assistant", "content": "SELECT wallet_address, amount FROM nft_holders WHERE contract_address = '0xabcd...' AND token_id = '123';" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "Show me all reviews that have a staff response, including review_id, property_id, guest_id, and the response_staff_id." }, { "role": "assistant", "content": "SELECT review_id, property_id, guest_id, response_staff_id\nFROM hospitality_technology.reviews\nWHERE respo...
You are an SQL statement expert. Given the table 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": "List the file name and document type for all documents uploaded by the user with ID 'agent456'." }, { "role": "assistant", "content": "SELECT file_name, document_type FROM insurance.claim_documents WHERE uploaded_by = 'agent456';" }, { "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 insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id character varying(64) NOT NULL, docume...
[ { "role": "user", "content": "List all claims along with the corresponding policy number and the full names of all beneficiaries associated with each policy." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, p.policy_number, b.first_name || ' ' || b.last_name AS beneficiary_...
You are an SQL statement expert. Given the table 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": "I need a list of all chronic diagnoses marked as 'Active', showing diagnosis_id, diagnosis_date, doctor_id, and the associated chief_complaint from medical_records." }, { "role": "assistant", "content": "SELECT d.diagnosis_id,\n d.diagnosis_date,\n d.doc...
You are an SQL statement expert. Given the table 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 text PRIMARY KEY, patient_id text, appointment_id text, doctor_id text, record_d...
[ { "role": "user", "content": "Find the top 3 staff members who have responded to the most public reviews. Include their staff_id, first_name, last_name, and the count of responses." }, { "role": "assistant", "content": "SELECT\n s.staff_id,\n s.first_name,\n s.last_name,\n COUNT(*) AS respon...
You are an SQL statement expert. Given the table 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": "Show the symbol, name, and total supply for all SUI coins with status 'active'." }, { "role": "assistant", "content": "SELECT scm.symbol, scm.name, scm.coin_type, scm.total_supply\nFROM sui_coins_metadata scm\nWHERE scm.status = 'active';" }, { "role": "user...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text, transaction_index bigint, from_add...
[ { "role": "user", "content": "Can you list all the policy numbers and their group_numbers for policies that will expire within the next 90 days from today?" }, { "role": "assistant", "content": "SELECT policy_number, group_number FROM healthcare.patient_insurance WHERE expiration_date BETWEEN CU...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, -- unique identifier for this p...
[ { "role": "user", "content": "Show the latest version number of each document_name for every case." }, { "role": "assistant", "content": "SELECT case_id,\n document_name,\n MAX(version) AS latest_version\nFROM legal_services.documents\nGROUP BY case_id, document_name;" }, { "...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u...
[ { "role": "user", "content": "What is the total number of likes recorded in the system?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.likes;" } ]
You are an SQL statement expert. Given the table 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.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, created_at.timestamp )
[ { "role": "user", "content": "List the distinct cities where service locations are present." }, { "role": "assistant", "content": "SELECT DISTINCT city FROM government_services.service_locations;" } ]
You are an SQL statement expert. Given the table 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.service_locations ( location_id text, agency_id text, location_name text, address text, city text, ...
[ { "role": "user", "content": "Which rooms on the 4th floor are non-smoking, along with their property IDs and type IDs?" }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number, room_type_id FROM hospitality_technology.rooms WHERE floor = 4 AND is_smoking = FALSE;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, room...
[ { "role": "user", "content": "I need a count of appointments per patient that took place between '2024-04-01' and '2024-04-30', showing patient_id, first_name, last_name, and the total number of appointments." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "Show me all employees (employee_id, first_name, last_name) in the 'Investment' department who have processed trades for securities in the 'Technology' sector, along with the count of such trades for each employee." }, { "role": "assistant", "content": "SELECT e.empl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "Show me all patients who have both primary and non-primary insurance plans from the same provider, including their policy numbers and expiration dates." }, { "role": "assistant", "content": "SELECT pi1.patient_id, pi1.policy_number AS primary_policy, pi1.expiration_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, -- unique identifier for this p...
[ { "role": "user", "content": "Show me the count of posts per media_type for public posts." }, { "role": "assistant", "content": "SELECT media_type, COUNT(*) AS post_count\nFROM social_media.posts\nWHERE visibility = 'public'\nGROUP BY media_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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, content text, medi...
[ { "role": "user", "content": "Show me all users who had their KYC rejected along with when their review was completed." }, { "role": "assistant", "content": "SELECT user_id, reviewed_at FROM trading_platform.kyc_audit WHERE status = 'rejected';" } ]
You are an SQL statement expert. Given the table 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.kyc_audit ( kyc_audit_id.text, user_id.text, status.text, reviewed_at.timestamp )
[ { "role": "user", "content": "List the usernames and status of all players who have 'de' as their country_code." }, { "role": "assistant", "content": "SELECT username, status FROM gaming_technology.players WHERE country_code = 'DE';" }, { "role": "user", "content": "Can you also add ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "List tokens with trend rank 5 or better and a price below $1. Show symbol, price, and trend rank." }, { "role": "assistant", "content": "SELECT token_symbol, price, trend_rank FROM token_dexpool_info WHERE trend_rank IS NOT NULL AND trend_rank <= 5 AND price < 1;" ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, -- the id of dexpool token_name character varying(10...
[ { "role": "user", "content": "Find pairs of servers in the same region where one server's last heartbeat was recorded within the last hour, and the other server's last heartbeat was recorded between 1 and 2 hours ago. Show the server names, regions, and last heartbeat timestamps for both servers in each pai...
You are an SQL statement expert. Given the table 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 NOT NULL DEFAULT gen_random_uuid(), game_id uuid NOT NULL, server_name chara...
[ { "role": "user", "content": "Show all review IDs, property IDs, and the rating for service given for each review." }, { "role": "assistant", "content": "SELECT review_id, property_id, rating_service\nFROM hospitality_technology.reviews;" }, { "role": "user", "content": "Only display...
You are an SQL statement expert. Given the table 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.reviews ( review_id character varying(64) NOT NULL, -- unique identifier for the review ...
[ { "role": "user", "content": "Show all projects that have raised funds and have a matching token in the token_basic_info table, listing their project name, fundraising round, investment_value, as well as the token symbol, chain, and narrative." }, { "role": "assistant", "content": "SELECT p.proj...
You are an SQL statement expert. Given the table 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": "List the first name and last name of all policy beneficiaries, along with the name of the insurance product associated with their policy." }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.product_name FROM insurance.policy_beneficiaries 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 insurance.insurance_products ( product_id.text, product_name.text, product_type.text, description.text, base_premium.nu...
[ { "role": "user", "content": "Could you please list the first name, last name, and email address for all passengers in the system?" }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM transportation.passengers;" }, { "role": "user", "content": "Now, refine ...
You are an SQL statement expert. Given the table 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.passengers ( passenger_id character varying(64) NOT NULL, -- unique identifier for the passenger ...
[ { "role": "user", "content": "Can you provide the total number of accounts and the average balance for each account_type?" }, { "role": "assistant", "content": "SELECT account_type, COUNT(*) AS total_accounts, AVG(balance) AS avg_balance\nFROM financial_services.accounts\nGROUP BY account_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.accounts ( account_id.text, customer_id.text, account_number.text, account_type.text, balance.numeri...
[ { "role": "user", "content": "List all premium payments that were made using 'credit card' as the payment method." }, { "role": "assistant", "content": "SELECT payment_id, policy_id, customer_id, payment_date, amount_paid, payment_method\nFROM insurance.premium_payments\nWHERE payment_method = '...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "Get name pairs of achievements for each game where one is hidden and the other is visible." }, { "role": "assistant", "content": "SELECT a.achievement_id AS hidden_achievement_id, a.name AS hidden_name, b.achievement_id AS visible_achievement_id, b.name AS visible_n...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, description text, icon_url text, points ...
[ { "role": "user", "content": "I want to find pairs of developers who share the same website domain. Show each pair's names and the domain." }, { "role": "assistant", "content": "SELECT d1.name AS dev1,\n d2.name AS dev2,\n SPLIT_PART(SPLIT_PART(d1.website, '://', 2), '/', 1) AS domai...
You are an SQL statement expert. Given the table 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": "Count the number of users for each email domain." }, { "role": "assistant", "content": "SELECT split_part(email, '@', 2) AS domain, COUNT(*) AS user_count\nFROM web3.users\nGROUP BY domain;" }, { "role": "user", "content": "Filter to domains with more th...
You are an SQL statement expert. Given the table 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, -- unique identifier for the user username character vary...
[ { "role": "user", "content": "List all cases assigned to lead lawyer ID 'lawyer_abc' that are currently 'Open'. Show the case name, case number, and date opened." }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'la...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE 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": "Count the number of claims for each status in the system." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM insurance.claims GROUP BY status;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d...
[ { "role": "user", "content": "Show all tokens on the 'Arbitrum' chain from DEX pools that have a 24-hour trading volume between $100,000 and $500,000. Display token symbol, price, and volume_24h." }, { "role": "assistant", "content": "SELECT\n token_symbol,\n price,\n volume_24h\nFROM token_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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show me all staff members who are currently active, along with their property name and position." }, { "role": "assistant", "content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name \nFROM hospitality_technology.staff s \nJOIN hospitality...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "List each user ID along with the total count of log entries and the total count of notifications associated with them." }, { "role": "assistant", "content": "SELECT COALESCE(T1.user_id, T2.user_id) AS user_id, COUNT(DISTINCT T1.log_id) AS log_count, COUNT(DISTINCT 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.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Show me all active loans (loan_id, loan_type, principal_amount) where the remaining term is between 12 and 24 months, along with their account_id and monthly_payment." }, { "role": "assistant", "content": "SELECT loan_id, loan_type, principal_amount, account_id, mon...
You are an SQL statement expert. Given the table 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": "Show me the top 5 users who have interacted with the most DApps, along with their email addresses and the count of distinct DApps they interacted with." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, COUNT(DISTINCT l.details) AS dapp_count FROM tra...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text, username text, email text, password_hash text, created_at timestamp ) CREATE TAB...
[ { "role": "user", "content": "List the application ID, citizen ID, assigned employee's full name, and total amount paid for each approved application." }, { "role": "assistant", "content": "SELECT a.application_id,\n a.citizen_id,\n e.first_name || ' ' || e.last_name AS employee_name...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "List all pairs of clients who registered in the same year. Show each client's first_name, last_name, and the registration year." }, { "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, 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 legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad...
[ { "role": "user", "content": "List `user_id` and `conversation_id` for participants who are in conversations where there is at least one message sent by *another* user that they have not read." }, { "role": "assistant", "content": "SELECT DISTINCT T1.user_id, T1.conversation_id FROM social_media...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.messages ( message_id character varying(64) NOT NULL, conversation_id character varying(64) NOT NULL, send...
[ { "role": "user", "content": "Count the number of payments processed by each staff member. Display the staff ID and the count." }, { "role": "assistant", "content": "SELECT staff_id_processed, COUNT(*) FROM hospitality_technology.payments WHERE staff_id_processed IS NOT NULL GROUP BY staff_id_pr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, -- unique identifier for the guest profil...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name) from California (state = 'CA') who have both a checking account (account_type = 'Checking') and a home loan (loan_type = 'Home'), along with their total account balance and loan principal amount." }, { "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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "List all passengers with their first name, last name, and email." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM transportation.passengers;" }, { "role": "user", "content": "Can you also include their phone number in the 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "Can you list all replies along with their parent comment content for post_id 'P100'?" }, { "role": "assistant", "content": "SELECT reply.comment_id AS reply_id, parent.content AS parent_content, reply.content AS reply_content FROM comments AS reply JOIN comments 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 social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_id.text, content.text, created_at.t...
[ { "role": "user", "content": "I want to see a list of followers and the usernames of the users they are following, along with when they followed." }, { "role": "assistant", "content": "SELECT u_f.username AS follower_username,\n u_t.username AS following_username,\n f.created_at\nFRO...
You are an SQL statement expert. Given the table 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": "Show a list of all game developers with their name and founded year." }, { "role": "assistant", "content": "SELECT\n name,\n founded_year\nFROM gaming_technology.developers;" }, { "role": "user", "content": "Please filter the list to only include devel...
You are an SQL statement expert. Given the table 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": "Find services that have associated documents with a 'Pending' verification status. Show the service name and the document type name." }, { "role": "assistant", "content": "SELECT DISTINCT s.service_name, dt.document_type_name FROM government_services.services AS s J...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "List all contracts with status 'active' and include their ABI length in characters." }, { "role": "assistant", "content": "SELECT contract_id, address, LENGTH(abi) AS abi_length FROM web3.contracts WHERE status = 'active';" }, { "role": "user", "content"...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,...
[ { "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,...
[ { "role": "user", "content": "List the first name, last name, and email of all customers who live in New York or California." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM insurance.customers WHERE state IN ('NY', 'CA');" } ]
You are an SQL statement expert. Given the table 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 drivers hired in 2023, including their full name and email address." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM transportation.drivers WHERE hire_date >= '2023-01-01' AND hire_date < '2024-01-01';" }, { "role":...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Show the names, symbols, and types of all assets whose symbol starts with the letter 'B'." }, { "role": "assistant", "content": "SELECT name, symbol, type\nFROM trading_platform.assets\nWHERE symbol LIKE 'B%';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, -- unique identifier for the asset name cha...
[ { "role": "user", "content": "Find tokens with positive ROI and a positive net flow from smart money addresses. For these tokens, show their symbol, chain, ROI, net flow, and the total USD value from buy transactions." }, { "role": "assistant", "content": "SELECT T1.token_symbol, T1.chain, T1.ro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,...
[ { "role": "user", "content": "List all appointments handled by lawyers from law firms founded after 2015, showing the appointment subject and the lawyer's firm name." }, { "role": "assistant", "content": "SELECT a.subject, f.firm_name\nFROM legal_services.appointments a\nJOIN legal_services.lawy...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer first_n...
[ { "role": "user", "content": "Show me all active policies with coverage limits above $500,000, along with the customer names and agent names, sorted by coverage limit in descending order." }, { "role": "assistant", "content": "SELECT p.policy_id, p.coverage_limit, c.first_name AS customer_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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "List all user IDs and the number of posts each has made where the post includes a media file (media_url is not null), along with whether their profile is private." }, { "role": "assistant", "content": "SELECT p.user_id, COUNT(*) AS media_post_count, us.private_profi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ...
[ { "role": "user", "content": "What is the average profit for smart money addresses on the 'Arbitrum' chain?" }, { "role": "assistant", "content": "SELECT AVG(profit) FROM smart_money_profit WHERE chain = 'Arbitrum'" }, { "role": "user", "content": "And how many smart money addresses ...
You are an SQL statement expert. Given the table 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 text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token...
[ { "role": "user", "content": "List all documents with their document_name, document_type, the name of the associated case, and the first and last name of the client who owns the case." }, { "role": "assistant", "content": "SELECT d.document_id, d.document_name, d.document_type, c.case_name, cl.f...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "For each property, list the property name and the count of payments processed." }, { "role": "assistant", "content": "SELECT\n prop.property_name,\n COUNT(p.payment_id) AS payment_count\nFROM hospitality_technology.properties AS prop\nJOIN hospitality_technology.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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "List all fuel logs for vehicle 'VHCL789', showing the fuel type, quantity, and log timestamp." }, { "role": "assistant", "content": "SELECT fuel_type, quantity, log_timestamp FROM transportation.fuel_logs WHERE vehicle_id = 'VHCL789';" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "List pairs of invoices for the same case where one invoice's total_amount is lower than another's; show lower_invoice_number, higher_invoice_number, and case_id." }, { "role": "assistant", "content": "SELECT a.invoice_number AS lower_invoice_number,\n b.invoic...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, client_id text, case_id text, issue_...
[ { "role": "user", "content": "For each item type and rarity combination, show the maximum and minimum cost amount." }, { "role": "assistant", "content": "SELECT item_type, rarity, MAX(cost_amount) AS max_cost, MIN(cost_amount) AS min_cost FROM gaming_technology.in_game_items GROUP BY item_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 gaming_technology.in_game_items ( item_id uuid, game_id uuid, item_name text, item_type text, description text, rarity ...
[ { "role": "user", "content": "Find all pairs of law firms that were founded on the exact same date. List each pair’s firm names and the date they were founded." }, { "role": "assistant", "content": "SELECT f1.firm_name AS firm_a, f2.firm_name AS firm_b, f1.founded_date\nFROM law_firms f1\nJOIN l...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, -- unique identifier for the law firm firm_...
[ { "role": "user", "content": "List all SUI coins that have status 'exists' in both `sui_coins` and `sui_coins_metadata`. Show their `coin_type`, `balance`, and `owner`." }, { "role": "assistant", "content": "SELECT sc.coin_type, sc.balance, sc.owner FROM sui_coins sc JOIN sui_coins_metadata scm ...
You are an SQL statement expert. Given the table 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 reservations that have made multiple payment transactions. Return reservation_id and payment_id for each occurrence." }, { "role": "assistant", "content": "SELECT DISTINCT p1.reservation_id, p1.payment_id\nFROM hospitality_technology.payments p1\nJOIN 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.payments ( payment_id character varying(64) NOT NULL, -- unique identifier for the payment ...
[ { "role": "user", "content": "How many beneficiaries are there for each relationship type in the policy_beneficiaries table?" }, { "role": "assistant", "content": "SELECT relationship, COUNT(*) AS beneficiary_count\nFROM insurance.policy_beneficiaries\nGROUP 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.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id text, first_name text, last_name text...
[ { "role": "user", "content": "Show me the email addresses and usernames of users who have sent messages in group chats." }, { "role": "assistant", "content": "SELECT DISTINCT u.email, u.username\nFROM social_media.messages m\nJOIN social_media.conversations c ON m.conversation_id = c.conversatio...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "Provide a count of notifications grouped by their related entity type." }, { "role": "assistant", "content": "SELECT related_entity_type, COUNT(*) FROM government_services.notifications GROUP BY related_entity_type;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.notifications ( notification_id text, citizen_id text, application_id text, message_subject text, m...
[ { "role": "user", "content": "Could you provide the sum of Deposit and Withdrawal amounts for each customer, showing their first and last names?" }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name,\n SUM(CASE WHEN t.transaction_type = 'Deposit' THEN t.amo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, ...
[ { "role": "user", "content": "How many law firms were founded after 2010, and what are their names and phone numbers?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS firm_count FROM legal_services.law_firms WHERE founded_date > '2010-01-01';" }, { "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 legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, website text, founded_date date, man...
[ { "role": "user", "content": "Which clients have appointments scheduled for a case that also has at least one invoice issued? Please show the client_id, appointment_id, appointment start_time, related case_id, and invoice_number." }, { "role": "assistant", "content": "SELECT a.client_id, a.appoi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case_id.text, issue_date.date, due_date...
[ { "role": "user", "content": "Could you provide a list of each diagnosis, the full name of the doctor who made it, and the name of the insurance plan whose contact phone number matches the doctor's phone number? Please include diagnosis_id, description, doctor full name, and insurance plan name." }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ...
[ { "role": "user", "content": "List the number of bookings made by each loyalty program member. Show the loyalty_program_id and the booking count." }, { "role": "assistant", "content": "SELECT p.loyalty_program_id, COUNT(b.booking_id) AS booking_count\nFROM transportation.passengers p\nJOIN trans...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.passengers ( passenger_id character varying(64) NOT NULL, -- unique identifier for the passenger ...
[ { "role": "user", "content": "List the name and location ID for all locations where the postal code is missing." }, { "role": "assistant", "content": "SELECT name, location_id FROM transportation.locations WHERE postal_code IS NULL;" }, { "role": "user", "content": "Also include the ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "Which route numbers connect locations with a distance less than 80 km and more than 5 words in their description? Include the route type in the results." }, { "role": "assistant", "content": "SELECT route_number, type FROM transportation.routes WHERE distance_km < 8...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "Show me the post ID, content, and any associated hashtag IDs for posts that have media_type 'image'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.post_id, T1.content, T2.hashtag_id FROM social_media.posts AS T1 JOIN social_media.post_hashtags AS T2 ON 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 social_media.users ( user_id character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "Show me the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their price and 24-hour price change percentage." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, price_change_percentage_24h, volume_24h FROM token_de...
You are an SQL statement expert. Given the table 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_dexpool_info ( pair_address character varying(512) NOT NULL, token_name character varying(100) NOT NULL, token_sy...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name) who have both a checking account (account_type = 'Checking') and a savings account (account_type = 'Savings'), along with their total combined balance." }, { "role": "assistant", "content": "SELECT c.custome...
You are an SQL statement expert. Given the table 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": "For each property, list the name of the room type and the number of rooms of that type at the property." }, { "role": "assistant", "content": "SELECT T1.property_name, T2.type_name, count(T3.room_id) AS room_count FROM hospitality_technology.properties AS T1 JOIN ho...
You are an SQL statement expert. Given the table 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 tokens held by CEX addresses, showing the token symbol, name, current price, and the total USD value held by all CEXes for that token." }, { "role": "assistant", "content": "SELECT T1.token_symbol, T1.token_name, T1.price, SUM(T2.usd_value) AS total_cex_usd...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "Show me all time entries for case ID 'case_abc', including the entry ID, date worked, hours spent, and the first and last name of the lawyer." }, { "role": "assistant", "content": "SELECT te.entry_id, te.date_worked, te.hours_spent, l.first_name, l.last_name FROM le...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu...
[ { "role": "user", "content": "For each doctor, show their full name along with all plan names of insurance plans that have a 'contact_phone' beginning with '+44'." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, ip.plan_name\nFROM healthcare.doctors d\nCROSS JOIN healthca...
You are an SQL statement expert. Given the table 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": "Could you provide a report listing each game and the number of unique players who unlocked at least one hidden achievement for that game?" }, { "role": "assistant", "content": "SELECT g.title,\n COUNT(DISTINCT pa.player_id) AS hidden_achievement_players\nFROM ...
You are an SQL statement expert. Given the table 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": "Can you retrieve the document_id, file_name, file_size_bytes, uploaded_at, and the full name of the agent (first and last name concatenated) for all documents uploaded in 2024 by active agents licensed in CA?" }, { "role": "assistant", "content": "SELECT cd.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 insurance.agents ( agent_id text, first_name text, last_name text, agency_name text, license_number text, license_state...
[ { "role": "user", "content": "Can you help me retrieve the list of components made of a specific material along with their supplier details?" }, { "role": "assistant", "content": "SMEMBERS material_components:mat:TI64\nHGETALL component:<component_id>\nHGET component:<component_id> supplier_id" ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure Use Hashes. Key pattern: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_numbe...
[ { "role": "user", "content": "Show me the hashtag IDs and their names." }, { "role": "assistant", "content": "SELECT hashtag_id, tag_name FROM social_media.hashtags;" }, { "role": "user", "content": "I also want to see when each hashtag was created." }, { "role": "assistant",...
You are an SQL statement expert. Given the table 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": "List all invoices, showing the invoice number, issue date, total amount, and the payment status." }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, total_amount, status FROM invoices" }, { "role": "user", "content": "Only include 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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "I want to know the number of agencies established each year by jurisdiction level." }, { "role": "assistant", "content": "SELECT jurisdiction_level, EXTRACT(YEAR FROM established_date) AS year, COUNT(*) AS agency_count\nFROM government_services.agencies\ngroup by ju...
You are an SQL statement expert. Given the table 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": "Retrieve each prescription's id, patient's full name, medication_name, and prescription_date for prescriptions where dosage contains 'tablet'." }, { "role": "assistant", "content": "SELECT pr.prescription_id, CONCAT(p.first_name, ' ', p.last_name) AS patient_name, m...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...