conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Get the total number of appointments grouped by status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS appointment_count\nFROM healthcare.appointments\nGROUP BY status;" }, { "role": "user", "content": "Now filter to include on...
You are an SQL statement expert. Given the table 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": "For each narrative in token_basic_info, compute the total liquidity and count of tokens from token_dexpool_info. Show narrative, total_liquidity, and token_count." }, { "role": "assistant", "content": "SELECT tbi.narrative,\n SUM(td.liquidity) AS total_liquidity,\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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show me the average market cap and average 24-hour price change percentage for tokens on each chain." }, { "role": "assistant", "content": "SELECT chain, AVG(market_cap) AS average_market_cap, AVG(price_change_percentage_24h) AS average_price_change_24h FROM token_b...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var...
[ { "role": "user", "content": "List all employees (employee_id, first_name, last_name) who have processed trades with a commission greater than $500." }, { "role": "assistant", "content": "SELECT DISTINCT e.employee_id, e.first_name, e.last_name FROM financial_services.employees e JOIN financial_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.trades ( trade_id.text, account_id.text, security_id.text, order_id.text, trade_type.text, quantity....
[ { "role": "user", "content": "List all doctors who have diagnosed chronic conditions, along with the count of such diagnoses per doctor." }, { "role": "assistant", "content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(dg.diagnosis_id) AS chronic_diagnoses_count FROM healthcare.doctors...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List all employees who were hired in the last two years along with their department and status." }, { "role": "assistant", "content": "SELECT employee_id, first_name, last_name, department, status FROM financial_services.employees WHERE hire_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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "List the last 20 messages that have a media_url, showing message_id, sender_user_id, media_type, and sent_at, ordered by sent_at descending." }, { "role": "assistant", "content": "SELECT message_id,\n sender_user_id,\n media_type,\n sent_at\nFROM s...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.messages ( message_id character varying(64) NOT NULL, -- unique identifier for the message convers...
[ { "role": "user", "content": "For each status, show the total number of service orders and the average total price, grouped by status and the staff member who delivered the service." }, { "role": "assistant", "content": "SELECT status, staff_id_delivered, COUNT(*) AS order_count, AVG(total_price...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id text, guest_id text, service_id text,...
[ { "role": "user", "content": "Show me all electric vehicles that have completed trips in the last month, along with the count of trips each vehicle has completed." }, { "role": "assistant", "content": "SELECT v.vehicle_id, v.make, v.model, COUNT(t.trip_id) AS trip_count FROM transportation.vehic...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU...
[ { "role": "user", "content": "Show me the usernames and full names of all users who have liked at least one post that was created in May 2024." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.full_name\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.use...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "List all Sui NFT collections where the owner is not null, including their name and collection_type." }, { "role": "assistant", "content": "SELECT name, collection_type FROM sui_nfts WHERE owner IS NOT NULL;" }, { "role": "user", "content": "Can you also ...
You are an SQL statement expert. Given the table 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": "Show me the total price and quantity for each service order, along with the guest's full name." }, { "role": "assistant", "content": "SELECT t1.order_id, t1.total_price, t1.quantity, t2.first_name, t2.last_name FROM hospitality_technology.service_orders AS t1 JOIN h...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, -- unique identifier for the prope...
[ { "role": "user", "content": "List each customer along with another customer living at the same address." }, { "role": "assistant", "content": "SELECT a.customer_id AS customer_id_a, a.first_name || ' ' || a.last_name AS full_name_a, b.customer_id AS customer_id_b, b.first_name || ' ' || b.last_...
You are an SQL statement expert. Given the table 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": "What is the average price of tokens held by Binance exchange across all chains in the cex_token_balance table?" }, { "role": "assistant", "content": "SELECT AVG(price) AS average_price FROM cex_token_balance WHERE exchange = 'Binance';" } ]
You are an SQL statement expert. Given the table 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 ch...
[ { "role": "user", "content": "List all policies with a premium amount between 500 and 1500. Show the policy number, premium amount, and status." }, { "role": "assistant", "content": "SELECT policy_number , premium_amount , status FROM insurance.policies WHERE premium_amount BETWEEN 500 AND 150...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "Give me the count of locations per country and type. List country, type, and location_count." }, { "role": "assistant", "content": "SELECT country, type, COUNT(*) AS location_count\nFROM transportation.locations\nGROUP BY country, type;" }, { "role": "user",...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id character varying(64) NOT NULL, -- unique identifier for the location n...
[ { "role": "user", "content": "Show me the usernames of all users who have placed orders for assets that have associated metadata with the key 'network'. Also include the asset name and symbol." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, a.name AS asset_name, a.symbol\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 trading_platform.wallets ( wallet_id text, user_id text, address text, private_key text, created_at timestamp ) CREATE ...
[ { "role": "user", "content": "How many cases are associated with each unique lead lawyer ID? Show the lead lawyer ID and the count of cases, but only for lawyers who lead at least 5 cases. Sort the results by the case count in descending order." }, { "role": "assistant", "content": "SELECT lead_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t...
[ { "role": "user", "content": "Show me the usernames and the group names for each user who has sent at least one message in a group chat." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, c.group_name\nFROM social_media.users u\nJOIN social_media.conversation_participants cp ON u...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "How many users registered on each weekday? Return the weekday name and registration count." }, { "role": "assistant", "content": "SELECT\n to_char(created_at, 'FMDay') AS weekday,\n COUNT(*) AS registration_count\nFROM web3.users\nGROUP BY 1\nORDER BY registration...
You are an SQL statement expert. Given the table 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": "How many applications are currently pending review? Please group the results by assigned_employee_id." }, { "role": "assistant", "content": "SELECT assigned_employee_id, COUNT(*) AS pending_applications FROM government_services.applications WHERE status = 'Pending' ...
You are an SQL statement expert. Given the table 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 text, citizen_id text, service_id text, submitted_at timestamp, statu...
[ { "role": "user", "content": "List all active services whose average processing time exceeds the overall average processing time across all active services. Show the service_id, service_name, its average_processing_time_days, and the overall average_processing_time." }, { "role": "assistant", "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 government_services.services ( service_id.text, agency_id.text, service_name.text, description.text, category.text, eli...
[ { "role": "user", "content": "Show me the daily number of notifications sent in March 2024." }, { "role": "assistant", "content": "SELECT DATE(sent_at) AS date, COUNT(*) AS notification_count\nFROM government_services.notifications\nWHERE sent_at >= '2024-03-01' AND sent_at < '2024-04-01'\nGROUP...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "Show each user's username along with the number of conversations they have joined." }, { "role": "assistant", "content": "SELECT u.username, COUNT(cp.conversation_id) AS conversation_count\nFROM social_media.users u\nJOIN social_media.conversation_participants cp ON...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List all users and the count of wallets they own." }, { "role": "assistant", "content": "SELECT u.username, COUNT(w.wallet_id) AS wallet_count FROM blockchain.users u JOIN blockchain.wallets w ON u.user_id = w.user_id GROUP BY u.user_id, u.username;" }, { "r...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.addresses ( address_id character varying(128) NOT NULL, public_key text N...
[ { "role": "user", "content": "Find all smart contracts where the code length is greater than 1000 characters." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, LENGTH(code) AS code_length\nFROM blockchain.smart_contracts\nWHERE LENGTH(code) > 1000\nORDER BY code_length ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id text, creator_address text, code text, timestamp timestamp )
[ { "role": "user", "content": "For each customer, provide a summary of their account statuses, showing their full name, account status, and the count of accounts for each status." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.status, COUNT(a.account_id) AS account_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 financial_services.accounts ( account_id character varying(64) NOT NULL, -- unique identifier for the account c...
[ { "role": "user", "content": "I want to know for each player, what's the average time interval in days between their achievement unlocks? Only show player_ids with at least 2 unlocks." }, { "role": "assistant", "content": "SELECT player_id, AVG(unlocked_at - LAG(unlocked_at) OVER (PARTITION BY p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, achievement_id.uuid, unlocked_at.ti...
[ { "role": "user", "content": "Please list all doctors and their specialties, along with the phone numbers of any other doctors who share the same specialty." }, { "role": "assistant", "content": "SELECT d1.doctor_id, d1.first_name, d1.last_name, d1.specialty, d2.phone_number AS colleague_phone_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 healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "Find pairs of prescriptions for the same patient with overlapping periods. Show p1.prescription_id, p2.prescription_id, patient_id, and the overlap duration in days where the overlap is greater than 15 days." }, { "role": "assistant", "content": "SELECT p1.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.prescriptions ( prescription_id.text, record_id.text, patient_id.text, doctor_id.text, medication_id.text, d...
[ { "role": "user", "content": "Show me the service name, category, and price for all services that are currently not available." }, { "role": "assistant", "content": "SELECT service_name, category, price FROM hospitality_technology.services WHERE is_available = FALSE;" }, { "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 hospitality_technology.services ( service_id.text, property_id.text, service_name.text, description.text, category.text...
[ { "role": "user", "content": "Show the wallet address and number of NFTs held for all holders of the NFT with contract address '0x5678...' and token ID '1234'." }, { "role": "assistant", "content": "SELECT wallet_address, amount FROM nft_holders WHERE contract_address = '0x5678...' AND token_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "Show me all drivers who have completed more than 5 trips in the last month, along with their contact information and the average passenger count per trip." }, { "role": "assistant", "content": "SELECT d.driver_id, d.first_name, d.last_name, d.contact_number, d.email...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name text, last_name text, license_number ...
[ { "role": "user", "content": "Find all claims with a settlement amount between 5000 and 10000. List the claim ID, incident date, and settlement date." }, { "role": "assistant", "content": "SELECT claim_id, incident_date, settlement_date\nFROM insurance.claims\nWHERE settlement_amount BETWEEN 500...
You are an SQL statement expert. Given the table 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, policy_id character varying(64) NOT NULL, customer_id chara...
[ { "role": "user", "content": "List the transaction IDs and timestamps for all transactions sent to the contract address of the token with the symbol 'USDC'." }, { "role": "assistant", "content": "SELECT T1.transaction_id, T1.timestamp FROM web3.transactions AS T1 JOIN web3.tokens AS T2 ON T1.to_...
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": "List all patients who have both a primary insurance plan and at least one completed appointment, including their insurance provider names." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, i.insurance_provider FROM healthcare.patients p JOIN h...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Find, for each token, how many unique recipient addresses it has. Show token_symbol, contract_address, and recipient_count, ordered by recipient_count descending." }, { "role": "assistant", "content": "SELECT t.token_symbol,\n t.contract_address,\n 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 web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for the token contract_address cha...
[ { "role": "user", "content": "For each trip, list the trip_id, the passenger_count from trips, the number of bookings for that trip, and the average fare of those bookings." }, { "role": "assistant", "content": "SELECT t.trip_id, t.passenger_count, COUNT(b.booking_id) AS booking_count, AVG(b.far...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, route_id character varying(64), vehicle_id character var...
[ { "role": "user", "content": "Show me the average number of current players for each server region." }, { "role": "assistant", "content": "SELECT region, AVG(current_players) AS average_players FROM gaming_technology.servers GROUP BY region;" }, { "role": "user", "content": "Now, onl...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p...
[ { "role": "user", "content": "For each maintenance log, list the vehicle's license plate, the name of the mechanic, and the service date, ordered by most recent service first." }, { "role": "assistant", "content": "SELECT ml.log_id, v.license_plate, ml.mechanic_name, ml.service_date\nFROM transp...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "For each property, show the total number of reservations with status 'Confirmed' and the average total_amount." }, { "role": "assistant", "content": "SELECT p.property_id,\n p.property_name,\n COUNT(r.reservation_id) AS confirmed_reservations,\n RO...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Retrieve the property_id, property_name, city, and star_rating for properties in the USA, sorted by star_rating descending." }, { "role": "assistant", "content": "SELECT property_id,\n property_name,\n city,\n star_rating\nFROM hospitality_technolo...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Provide the total number of reservations made for each property, including the property name and reservation count." }, { "role": "assistant", "content": "SELECT p.property_name, COUNT(r.reservation_id) AS reservation_count\nFROM hospitality_technology.properties p\...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Could you list all medications, including their name, manufacturer, and NDC code from the healthcare.medications table?" }, { "role": "assistant", "content": "SELECT medication_name, manufacturer, ndc_code FROM healthcare.medications;" }, { "role": "user", ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, generic_name text, manufacturer text, nd...
[ { "role": "user", "content": "List all medical record entries where the treatment_plan mentions a medication name. Return patient_id, record_id, and the matching medication_name." }, { "role": "assistant", "content": "SELECT mr.patient_id,\n mr.record_id,\n m.medication_name\nFROM he...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "Show the guest's full name, reservation ID, check-in date, and status for all reservations made via 'Phone'." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, r.reservation_id, r.check_in_date, r.status FROM hospitality_technology.reservations...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, la...
[ { "role": "user", "content": "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": "List smart money addresses with an ROI between 10 and 50. Display the address, chain, profit, and roi." }, { "role": "assistant", "content": "SELECT address, chain, profit, roi FROM smart_money_profit WHERE roi BETWEEN 10 AND 50" }, { "role": "user", "co...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_profit ( address character varying(100) NOT NULL, rank INT, profit numeric(38,6), roi numeric(38,2), realiz...
[ { "role": "user", "content": "List all transactions where the receiver is a smart contract address, along with the contract creation timestamp." }, { "role": "assistant", "content": "SELECT t.*, sc.timestamp AS contract_creation_time FROM blockchain.transactions t JOIN blockchain.smart_contracts...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id character varying(64) NOT NULL, block_id character varying(64) NOT NULL, sende...
[ { "role": "user", "content": "Show me all customers (customer_id, first_name, last_name) from California (state = 'CA') who have taken out a home loan (loan_type = 'Home'), along with their loan details (loan_id, principal_amount, interest_rate)." }, { "role": "assistant", "content": "SELECT c.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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_h...
[ { "role": "user", "content": "List all public reviews that have a staff response, showing the review ID, overall rating, and the full name of the staff member who responded." }, { "role": "assistant", "content": "SELECT T1.review_id, T1.rating_overall, T2.first_name, T2.last_name FROM hospitalit...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show me the top 5 players by their average game session score, including their username and calculated average score." }, { "role": "assistant", "content": "SELECT p.username,\n AVG(gs.score) AS average_score\nFROM gaming_technology.players p\nJOIN gaming_tech...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player ...
[ { "role": "user", "content": "Find policies that have two different 'Spouse' beneficiaries. List policy_id, spouse1_id, and spouse2_id." }, { "role": "assistant", "content": "SELECT pb1.policy_id,\n pb1.beneficiary_id AS spouse1_id,\n pb2.beneficiary_id AS spouse2_id\nFROM insurance....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id character varying(64) NOT NULL, policy_id character varying(64) NOT NUL...
[ { "role": "user", "content": "Give me a list of users who follow more than one other user, including their username and the count of people they follow." }, { "role": "assistant", "content": "SELECT u.username, COUNT(f.following_user_id) AS following_count\nFROM social_media.follows f\nJOIN soci...
You are an SQL statement expert. Given the table 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": "I need to get a list of employees assigned to a specific assembly line, including their job title and hire date." }, { "role": "assistant", "content": "MATCH (e:Employee)-[:ASSIGNED_TO]->(al:AssemblyLine {line_id: 'specific_line_id'})\nRETURN e.employee_id, e.first_...
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 all users who have commented on posts that are visible as 'unlisted'. I want the usernames and the content of their comments." }, { "role": "assistant", "content": "SELECT u.username, c.content\nFROM social_media.comments c\nJOIN social_media.posts p ON c.po...
You are an SQL statement expert. Given the table 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": "Retrieve all billable but not yet billed time entries, showing entry_id, lawyer_id, case_id, hours_spent, and billing_rate." }, { "role": "assistant", "content": "SELECT entry_id, lawyer_id, case_id, hours_spent, billing_rate\nFROM legal_services.time_entries\nWHERE...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, case_number text UNIQUE, case_name text, client_id text, lead_lawyer_i...
[ { "role": "user", "content": "List all developer names and their countries." }, { "role": "assistant", "content": "SELECT name, country FROM gaming_technology.developers;" }, { "role": "user", "content": "Filter the list to only include developers from countries that start with 'U'."...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "List all payments, showing the payment amount, currency, and the guest's full name who made the payment." }, { "role": "assistant", "content": "SELECT p.payment_id, p.amount, p.currency_code, g.first_name, g.last_name FROM hospitality_technology.payments AS p JOIN h...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "Show the usernames of users who have used any hashtag in their posts, along with the tag name." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T4.tag_name FROM social_media.users AS T1 JOIN posts AS T2 ON T1.user_id = T2.user_id JOIN post_hashtag...
You are an SQL statement expert. Given the table 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": "Show each player's total session count and the date of their earliest acquired inventory item." }, { "role": "assistant", "content": "SELECT gs.player_id,\n COUNT(gs.session_id) AS session_count,\n MIN(pi.acquired_at) AS first_item_date\nFROM gaming_tech...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid NOT NULL DEFAULT gen_random_uuid(), player_id uuid NOT NULL, game_id ...
[ { "role": "user", "content": "How many unique email domains are there among all registered users?" }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT SUBSTRING(email FROM POSITION('@' IN email)+1)) AS unique_domains FROM blockchain.users;" }, { "role": "user", "content": "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 blockchain.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email character va...
[ { "role": "user", "content": "Which posts have been mentioned with at least one hashtag and also have users who joined the conversation corresponding to the post? Please show the post_id and the user_id of participants." }, { "role": "assistant", "content": "SELECT ph.post_id, cp.user_id\nFROM s...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text ) CREATE TABLE social_media.conversati...
[ { "role": "user", "content": "List all NFTs on the 'Ethereum' blockchain, showing their name, contract address, token ID, and the name of the collection they belong to." }, { "role": "assistant", "content": "SELECT t1.name, t1.contract_address, t1.token_id, t2.name AS collection_name FROM nft_me...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "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": "Show me the total number of trades and total volume for each buyer-seller pair where the same two users traded multiple assets." }, { "role": "assistant", "content": "SELECT buyer_id, seller_id, COUNT(DISTINCT asset_id) AS asset_count, COUNT(*) AS trade_count, SUM(q...
You are an SQL statement expert. Given the table 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 text, order_id text, buyer_id text, seller_id text, asset_id text, quantity numeric,...
[ { "role": "user", "content": "Calculate the average duration of appointments in minutes for each doctor. Return doctor_id and avg_duration." }, { "role": "assistant", "content": "SELECT doctor_id, AVG(duration_minutes) AS avg_duration\nFROM healthcare.appointments\nGROUP BY doctor_id;" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "특정 품질 등급 이상의 공급업체를 조회하고 싶습니다. 품질 등급, 공급업체 이름, 국가를 포함해 주세요." }, { "role": "assistant", "content": "GET suppliers/_search\n{\n \"query\": {\n \"range\": {\n \"quality_rating\": {\n \"gte\": 4.0\n }\n }\n },\n \"_source\": [\"supplier_name\", ...
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 Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { ty...
[ { "role": "user", "content": "List all SUI NFT objects with status 'exists' and show their object ID, name, and owner." }, { "role": "assistant", "content": "SELECT object_id, name, owner FROM sui_nfts WHERE status = 'exists';" }, { "role": "user", "content": "Add their collection_ty...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE erc1155_approval_for_all ( block_number.bigint, block_timestamp.timestamp, transaction_index.integer, transaction_hash....
[ { "role": "user", "content": "Show me all securities listed on the 'NYSE' exchange with their ticker symbol and most recent close price." }, { "role": "assistant", "content": "SELECT s.security_name, s.ticker_symbol, md.close_price\nFROM financial_services.securities s\nJOIN financial_services.m...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.securities ( security_id character varying(64) NOT NULL, -- unique identifier for the security ...
[ { "role": "user", "content": "Count how many posts have media attachments." }, { "role": "assistant", "content": "SELECT count(*) FROM social_media.posts WHERE media_url IS NOT NULL" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "What is the average age of verified citizens as of today?" }, { "role": "assistant", "content": "SELECT AVG(EXTRACT(YEAR FROM AGE(NOW(), date_of_birth))) AS average_age_verified\nFROM government_services.citizens\nWHERE is_verified = TRUE;" } ]
You are an SQL statement expert. Given the table 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": "For each employee, retrieve their first and last name along with the number of appointments they've scheduled." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, COUNT(a.appointment_id) AS appointment_count\nFROM government_services.employees 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.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "List all reservations scheduled to start in the next 7 days, including reservation_id, guest_id, check_in_date, type_name, and base_rate. Order by check_in_date ascending." }, { "role": "assistant", "content": "SELECT r.reservation_id, r.guest_id, r.check_in_date, 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.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu...
[ { "role": "user", "content": "Show me all guests from California who are loyalty members, along with their email and phone number, ordered by last name." }, { "role": "assistant", "content": "SELECT guest_id, first_name, last_name, email, phone_number FROM hospitality_technology.guests WHERE sta...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te...
[ { "role": "user", "content": "List each guest's full name along with the property name, review comment, and review date for all reviews." }, { "role": "assistant", "content": "SELECT g.first_name || ' ' || g.last_name AS guest_name, p.property_name, r.comment, r.review_date\nFROM hospitality_tec...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reviews ( review_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Show me the total number of appointments grouped by status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS appointment_count\nFROM legal_services.appointments\nGROUP BY status;" }, { "role": "user", "content": "Focus only on st...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id character varying(64) NOT NULL, -- unique identifier for the invoice invo...
[ { "role": "user", "content": "Show me the first name, last name, and email for all clients registered in January 2023." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM legal_services.clients WHERE EXTRACT(YEAR FROM date_registered) = 2023 AND EXTRACT(MONTH FROM 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 legal_services.clients ( client_id character varying(64) NOT NULL, -- unique identifier for the client first_n...
[ { "role": "user", "content": "List all usernames and the ID of the wallets they own." }, { "role": "assistant", "content": "SELECT t1.username, t2.wallet_id FROM blockchain.users AS t1 INNER JOIN blockchain.wallets AS t2 ON t1.user_id = t2.user_id;" }, { "role": "user", "content": "F...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.transactions ( transaction_id text, block_id text, sender_address text, r...
[ { "role": "user", "content": "List the IDs of citizens who have received notifications related to more than one distinct type of entity." }, { "role": "assistant", "content": "SELECT citizen_id FROM government_services.notifications WHERE related_entity_type IS NOT NULL AND 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 PRIMARY KEY, citizen_id text, application_id text, message_sub...
[ { "role": "user", "content": "Show the average maintenance cost for each service type per vehicle." }, { "role": "assistant", "content": "SELECT vehicle_id,\n service_type,\n AVG(cost) AS avg_cost\nFROM transportation.maintenance_logs\nGROUP BY vehicle_id, service_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "List all non-primary insurance plans for patients, including their policy numbers and effective dates, sorted by expiration date." }, { "role": "assistant", "content": "SELECT patient_id, policy_number, effective_date FROM healthcare.patient_insurance WHERE is_prima...
You are an SQL statement expert. Given the table 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, patient_id character varying(64) NO...
[ { "role": "user", "content": "Which countries have the highest number of developer companies founded after 2005? Please show country, the number of developers, and order by developer count descending." }, { "role": "assistant", "content": "SELECT country, COUNT(*) AS developer_count\nFROM gaming...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "Show the usernames of players who have started at least one game session." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username FROM gaming_technology.players AS T1 JOIN gaming_technology.game_sessions AS T2 ON T1.player_id = T2.player_id;" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "Show all cases that were opened and subsequently closed in the same calendar year. List the case name, case number, date opened, and date closed." }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened, date_closed FROM legal_services.cases...
You are an SQL statement expert. Given the table 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": "Retrieve all pairs of distinct contract IDs that were created by the same creator within an hour of each other. Include the creator address and the timestamps of both contracts." }, { "role": "assistant", "content": "SELECT sc1.creator_address, sc1.contract_id AS co...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "role": "user", "content": "Now, sort the results by the date opened, oldest first, and show only the top 10." }, { "role": "assistant", "content": "SELECT case_name, case_number, date_opened FROM legal_services.cases WHERE lead_lawyer_id = 'lawyer_abc' AND status = 'Open' AND case_type = 'Cri...
You are an SQL statement expert. Given the table 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": "List the names and prices of all services ordered by guests from 'Texas', along with the guest's full name." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, s.service_name, s.price\nFROM hospitality_technology.guests g\nJOIN hospitality_techn...
You are an SQL statement expert. Given the table 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 me all trips that were delayed by more than 1 hour, including their vehicle and driver IDs, along with the origin and destination location IDs." }, { "role": "assistant", "content": "SELECT trip_id, vehicle_id, driver_id, origin_location_id, destination_locatio...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, -- unique identifier for a specific trip instance ...
[ { "role": "user", "content": "List all Sui NFTs with 'exists' status from the 'Gaming' collection type. Show the object_id, name, and owner." }, { "role": "assistant", "content": "SELECT object_id, name, owner FROM sui_nfts WHERE status = 'exists' AND collection_type = 'Gaming'" }, { "ro...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "Show me all active drivers along with their license expiry dates and the number of trips they've completed in the last month." }, { "role": "assistant", "content": "SELECT d.driver_id, d.first_name, d.last_name, d.license_expiry_date, COUNT(t.trip_id) AS trips_compl...
You are an SQL statement expert. Given the table 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 me the first and last names of citizens, the appointment id, and the department of the employee who scheduled their appointment." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.appointment_id, e.department\nFROM government_services.ap...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "Show me the total transaction amount and count for each account type. Please include the account type and the total amount and count from the transactions table." }, { "role": "assistant", "content": "SELECT\n a.account_type,\n SUM(t.amount) AS total_transaction_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 financial_services.accounts ( account_id character varying(64) NOT NULL, -- unique identifier for the account c...
[ { "role": "user", "content": "Get the total fuel cost per route, showing route_number and the sum of total_cost for all fuel logs associated with trips on that route." }, { "role": "assistant", "content": "SELECT r.route_number,\n SUM(fl.total_cost) AS total_fuel_cost\nFROM transportation....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "Find all doctors created in the last 6 months who have both a phone number and email listed, showing their full name, specialty, and contact details." }, { "role": "assistant", "content": "SELECT first_name, last_name, specialty, phone_number, email FROM healthcare....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "List all Sui NFT collections where the owner is not null, including their name and collection_type, sorted by name." }, { "role": "assistant", "content": "SELECT name, collection_type FROM sui_nfts WHERE owner IS NOT NULL ORDER BY name ASC;" }, { "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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3) NOT NULL, transaction_index integ...
[ { "role": "user", "content": "For each project in project_fundraising_record, show the project's earliest and latest fundraising rounds with their corresponding investment_date and investment_value. Include project_name, earliest_round, earliest_date, earliest_value, latest_round, latest_date, and latest_va...
You are an SQL statement expert. Given the table 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": "For each reservation, list reservation_id, guest_id, check_in_date, and the next reservation_id and check_in_date for the same guest." }, { "role": "assistant", "content": "SELECT r1.reservation_id AS current_reservation_id, r1.guest_id, r1.check_in_date AS current_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_id text, room_id text, room_type_id ...
[ { "role": "user", "content": "List all users who have created wallets in the last 30 days, showing their usernames and wallet addresses." }, { "role": "assistant", "content": "SELECT u.username, w.address FROM web3.users u JOIN web3.wallets w ON u.user_id = w.user_id WHERE w.created_at >= NOW() ...
You are an SQL statement expert. Given the table 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.text, contract_id.text, event_name.text, data.text, emitted_at.timestamp, transaction_id.text, l...
[ { "role": "user", "content": "Which five license states have the highest count of active agents? Return the license_state and agent_count." }, { "role": "assistant", "content": "SELECT license_state,\n COUNT(*) AS agent_count\nFROM insurance.agents\nWHERE status = 'Active'\nGROUP BY licens...
You are an SQL statement expert. Given the table 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...