conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Find all users who have deployed contracts on the 'ethereum' network, along with the count of contracts they've deployed and the most recent deployment timestamp." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(c.contract_id) AS contract_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 web3.contracts ( contract_id text PRIMARY KEY, address text, abi text, bytecode text, deployer_address text, deployed_a...
[ { "role": "user", "content": "Get the usernames of users who have created any public posts, and count how many public posts each user has made. Order the results by the post count in descending order." }, { "role": "assistant", "content": "SELECT u.username, COUNT(p.post_id) AS public_post_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 social_media.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "How many employees work in each department? List the department name and the count." }, { "role": "assistant", "content": "SELECT department, COUNT(*) FROM government_services.employees GROUP BY department" }, { "role": "user", "content": "Only show depa...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "List all follow IDs that were created on '2024-06-18'." }, { "role": "assistant", "content": "SELECT follow_id FROM social_media.follows WHERE DATE(created_at) = '2024-06-18';" } ]
You are an SQL statement expert. Given the table 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.follows ( follow_id.text, follower_user_id.text, following_user_id.text, created_at.timestamp )
[ { "role": "user", "content": "For each trade, show the buyer's and seller's usernames, the name and symbol of the traded asset, trade quantity, and trade price." }, { "role": "assistant", "content": "SELECT t.trade_id, ub.username AS buyer_username, us.username AS seller_username, a.name AS asse...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique identifier for the user username ch...
[ { "role": "user", "content": "For each asset, show the asset name, symbol, and the latest trade price." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name AS asset_name, a.symbol AS asset_symbol, (\n SELECT t1.price FROM trading_platform.trades t1\n WHERE t1.asset_id = a.asset...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.trades ( trade_id character varying(64) NOT NULL, order_id character varying(64) NOT NULL, buyer_id ch...
[ { "role": "user", "content": "List all appointments scheduled for clients whose status is 'prospect', showing the client's first name, last name, and the appointment subject." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.subject FROM legal_services.clients AS c JOIN ...
You are an SQL statement expert. Given the table 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": "Show me all ERC20 token contracts that have had at least 200 approvals. Include the token symbol and total approval count." }, { "role": "assistant", "content": "SELECT m.contract_address, m.symbol, COUNT(*) AS approval_count\nFROM erc20_approval a\nJOIN token_metas...
You are an SQL statement expert. Given the table 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": "I want to know how many vehicles are assigned to each depot_id." }, { "role": "assistant", "content": "SELECT depot_id, COUNT(*) AS vehicle_count FROM transportation.vehicles GROUP BY depot_id;" }, { "role": "user", "content": "Please only include depots...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Show me a list of all properties along with their average overall review rating." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "For each reservation, list the guest ID, property name, and the total amount booked. Only include reservations where the total amount is greater than 300." }, { "role": "assistant", "content": "SELECT r.reservation_id, r.guest_id, p.property_name, r.total_amount\nFR...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "How many doctors are affiliated with each hospital?" }, { "role": "assistant", "content": "SELECT hospital_affiliation_id, COUNT(*) AS doctor_count\nFROM healthcare.doctors\nGROUP BY hospital_affiliation_id;" }, { "role": "user", "content": "Filter to in...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number...
[ { "role": "user", "content": "How many primary insurance policies are currently active for each plan_id? Show plan_id and active_count." }, { "role": "assistant", "content": "SELECT plan_id,\n COUNT(*) AS active_count\nFROM healthcare.patient_insurance\nWHERE is_primary = TRUE\n AND (expi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id text, policy_number text, group_numb...
[ { "role": "user", "content": "Show me the top 5 users who have interacted with DApps, along with the count of distinct DApps they interacted with and their wallet addresses." }, { "role": "assistant", "content": "SELECT w.user_id, COUNT(DISTINCT d.dapp_id) AS dapp_count, w.address FROM trading_p...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Retrieve a list of all patient insurance policies, showing the subscriber name and the name of the insurance provider for the plan." }, { "role": "assistant", "content": "SELECT T1.subscriber_name, T2.insurance_provider FROM healthcare.patient_insurance 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 healthcare.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, -- unique identifier for this p...
[ { "role": "user", "content": "Show me invoices where the total amount is greater than 5000. Display the invoice number, total amount, and client ID." }, { "role": "assistant", "content": "SELECT invoice_number, total_amount, client_id FROM invoices WHERE total_amount > 5000;" }, { "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 legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case_id.text, issue_date.date, due_date...
[ { "role": "user", "content": "List all pairs of transactions within the same block where the from_address of one transaction is the to_address of another transaction. Show both transaction_ids, the block_number, from_address, and to_address." }, { "role": "assistant", "content": "SELECT t1.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 web3.transactions ( transaction_id text, from_address text, to_address text, value numeric, gas_used integer, gas_price...
[ { "role": "user", "content": "List each citizen's full name and the number of documents they have uploaded per service category." }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS full_name,\n s.category,\n COUNT(d.document_id) AS document_count\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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show me the number of active (online) servers for each game genre, and include the genre name and total count." }, { "role": "assistant", "content": "SELECT g.genre, COUNT(s.server_id) AS active_server_count\nFROM gaming_technology.games g\nJOIN gaming_technology.se...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the game ti...
[ { "role": "user", "content": "Count how many follow relationships were created in June 2024." }, { "role": "assistant", "content": "SELECT COUNT(follow_id) FROM social_media.follows WHERE created_at >= '2024-06-01' AND created_at < '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 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 names of all employees along with the names of the agencies they work for, and the number of appointments each employee has scheduled." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, a.agency_name, COUNT(appt.appointment_id) AS 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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Show me all users who have both bought and sold the same cryptocurrency asset, along with the asset details and their total buy/sell volumes." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, a.asset_id, a.name AS asset_name, a.symbol, SUM(CASE WHEN ...
You are an SQL statement expert. Given the table 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": "Give me a breakdown of available services by unit, with the count of services and the average price, grouped by property." }, { "role": "assistant", "content": "SELECT property_id, unit, COUNT(*) AS service_count, AVG(price) AS avg_price FROM hospitality_technology....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL...
[ { "role": "user", "content": "How many notifications have been sent for comments in total?" }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM social_media.notifications\nWHERE target_entity_type = 'comment';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, full_name.text, profile_picture_url.t...
[ { "role": "user", "content": "List all premium payments made via credit card in the last 30 days, showing their policy IDs and payment amounts." }, { "role": "assistant", "content": "SELECT policy_id, amount_paid FROM insurance.premium_payments WHERE payment_method = 'credit card' AND payment_da...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "Find all pairs of developers in the same country but founded in different years. Show each developer's name, their founded_year, and the shared country." }, { "role": "assistant", "content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.country, d1.founde...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "Show me the wallet ID and address for user 'user_abc'." }, { "role": "assistant", "content": "SELECT wallet_id, address FROM web3.wallets WHERE user_id = 'user_abc';" }, { "role": "user", "content": "Could you sort those wallets by their creation date in...
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.wallets ( wallet_id text, user_id text, address text, private_key text, created...
[ { "role": "user", "content": "Give me a list of the usernames and email addresses of users who have participated in at least one conversation." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email\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 character varying(64) NOT NULL, username character varying(50) NOT NULL UNIQUE, email char...
[ { "role": "user", "content": "I need to find all tickets for a specific route 'RT456' along with the car details and route information." }, { "role": "assistant", "content": "SELECT t.ticket_id, t.seat_number, t.price, tc.car_number, tc.car_type, r.route_name, r.description\nFROM train_station_m...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "List every guest along with every room type available in the system." }, { "role": "assistant", "content": "SELECT g.guest_id, g.first_name, g.last_name, rt.room_type_id, rt.type_name\nFROM hospitality_technology.guests g\nCROSS JOIN hospitality_technology.room_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 hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, -- unique identifier for the room ...
[ { "role": "user", "content": "List all beneficiaries who have a null contact_info. Return beneficiary_id, first_name, last_name, policy_id." }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name, last_name, policy_id\nFROM insurance.policy_beneficiaries\nWHERE contact_info IS N...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, customer_id text, first_name text, la...
[ { "role": "user", "content": "Show me the top 3 tokens by USD value inflow where smart money was buying (type = 1), along with their chain information." }, { "role": "assistant", "content": "SELECT token_symbol, chain, usd_value FROM smart_money_token_inflow WHERE type = 1 ORDER BY usd_value DES...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE narrative_info ( narrative character varying(512) NOT NULL, -- the id of narrative top_3_coins text, -- the top 3 token...
[ { "role": "user", "content": "Show me the earliest created smart contract for each creator address." }, { "role": "assistant", "content": "SELECT creator_address, MIN(timestamp) as earliest_contract FROM blockchain.smart_contracts GROUP BY creator_address;" }, { "role": "user", "cont...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, timestamp.timestamp )
[ { "role": "user", "content": "Show me all male patients who have an email address but no emergency contact listed, along with their full names and phone numbers." }, { "role": "assistant", "content": "SELECT CONCAT(first_name, ' ', last_name) AS full_name, phone_number FROM healthcare.patients W...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Which fundraising round in 2022 had the highest single investment amount, and what is the name and introduction of the associated project?" }, { "role": "assistant", "content": "SELECT rounds_name, project_name, introduction, investment_value FROM project_fundraisin...
You are an SQL statement expert. Given the table 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": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own." }, { "role": "assistant", "content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.users ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonce.integer, merkle_root.text, diffic...
[ { "role": "user", "content": "Show me all diesel fuel logs where the quantity is more than 100 liters, including the vehicle ID and total cost." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, quantity, total_cost FROM transportation.fuel_logs WHERE fuel_type = 'diesel' AND...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu...
[ { "role": "user", "content": "Show the top 5 transactions with the highest number of token transfers, along with their Ethereum value. Include transaction_id, token_transfer_count, and ether_value." }, { "role": "assistant", "content": "SELECT\n tt.transaction_id,\n COUNT(tt.transfer_id) AS to...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, from_address character varying(128) NOT NULL, to_add...
[ { "role": "user", "content": "How many users are registered in the system?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM blockchain.users;" }, { "role": "user", "content": "List the user ID and email for users whose email contains the string 'support'." }, { "ro...
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.users ( user_id.text, username.text, email.text, password_hash.text )
[ { "role": "user", "content": "List every offline server alongside an online server in the same region. Show offline_server and online_server names." }, { "role": "assistant", "content": "SELECT o.server_name AS online_server, f.server_name AS offline_server\nFROM gaming_technology.servers f\nJOI...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.text, ip_address.text, port.integer,...
[ { "role": "user", "content": "Which agents were hired in 2023 and have a commission rate over 0.07? Return their agent_id, full name, agency name, and hire date." }, { "role": "assistant", "content": "SELECT agent_id, first_name, last_name, agency_name, hire_date\nFROM insurance.agents\nWHERE EX...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "Show the make, model, and license plate for each vehicle along with the name of the depot it is assigned to." }, { "role": "assistant", "content": "SELECT v.make, v.model, v.license_plate, d.depot_name FROM transportation.vehicles AS v JOIN transportation.depots 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle lice...
[ { "role": "user", "content": "List service orders showing order ID, quantity, total price, and the name of the service ordered." }, { "role": "assistant", "content": "SELECT T1.order_id, T1.quantity, T1.total_price, T2.service_name FROM hospitality_technology.service_orders AS T1 INNER JOIN hosp...
You are an SQL statement expert. Given the table 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 total USD value of tokens held by each centralized exchange on the 'Polygon' chain for the most recent snapshot time. List the exchange name and the total USD value." }, { "role": "assistant", "content": "WITH LatestSnapshot AS ( SELECT MAX(snapshot_time...
You are an SQL statement expert. Given the table 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": "Can you show me the total score and number of sessions for each player and each game they played?" }, { "role": "assistant", "content": "SELECT player_id, game_id, COUNT(session_id) AS session_count, SUM(score) AS total_score\nFROM gaming_technology.game_sessions\nG...
You are an SQL statement expert. Given the table 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(), -- unique identifier for the ...
[ { "role": "user", "content": "Give me a count of all notifications sent to each user." }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) AS notification_count\nFROM trading_platform.notifications\nGROUP BY user_id;" }, { "role": "user", "content": "Now, only show users w...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address ch...
[ { "role": "user", "content": "List the NDC code and description for any medication that has an NDC code starting with '5'." }, { "role": "assistant", "content": "SELECT ndc_code, description FROM healthcare.medications WHERE ndc_code LIKE '5%';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medications ( medication_id character varying(64) NOT NULL, medication_name character varying(255) NOT NULL,...
[ { "role": "user", "content": "Which fundraising rounds had more than 5 projects participate, and what was the total investment value for each?" }, { "role": "assistant", "content": "SELECT rounds_name, COUNT(DISTINCT project_id) AS project_count, SUM(investment_value) AS total_investment FROM 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 project_fundraising_record (", "id character varying(32) NOT NULL, -- fundraising record id", "project_id ch...
[ { "role": "user", "content": "What is the total USD value held across all wallets for the ERC20 token with symbol 'DAI'?" }, { "role": "assistant", "content": "SELECT SUM((eb.amount::numeric / POWER(10, tm.decimals)) * tpl.price) AS total_usd\nFROM erc20_balances eb\nJOIN token_metas tm ON eb.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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "I want to list pairs of developers from the same country. For each pair, show both developers’ names and their country." }, { "role": "assistant", "content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.country\nFROM gaming_technology.developers d1\nJOIN...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "List the names of agencies that were established before any appointments were recorded in the system." }, { "role": "assistant", "content": "SELECT agency_name FROM agencies WHERE established_date < (SELECT MIN(created_at) FROM appointments);" } ]
You are an SQL statement expert. Given the table 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": "List all users who have made comments that are replies to other comments. Show their user IDs, the comment ID, and the parent comment ID." }, { "role": "assistant", "content": "SELECT user_id, comment_id, parent_comment_id\nFROM social_media.comments\nWHERE parent_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 social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "Show me the total quantity and total price for each service ordered by each guest." }, { "role": "assistant", "content": "SELECT guest_id, service_id, SUM(quantity) AS total_quantity, SUM(total_price) AS total_price FROM hospitality_technology.service_orders GROUP 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 hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id text, guest_id text, service_id text,...
[ { "role": "user", "content": "Show me the top 5 most recently minted NFTs on the Ethereum blockchain with their contract_address, token_id, name, and rarity_score from nft_metadata." }, { "role": "assistant", "content": "SELECT contract_address, token_id, name, rarity_score\nFROM nft_metadata\nW...
You are an SQL statement expert. Given the table 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 varchar, wallet_address varchar, amount varchar, pk varchar ) CR...
[ { "role": "user", "content": "For each day in the past month, can you show the combined total transaction amount and the total volume traded from market data?" }, { "role": "assistant", "content": "SELECT t.effective_date, SUM(t.amount) AS total_transaction_amount, SUM(md.volume) AS total_traded...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id.text, account_id.text, related_account_id.text, transaction_type.text,...
[ { "role": "user", "content": "Show me all insurance products along with the number of distinct agents whose handled claims are for policies using that product. Include product_id, product_name, and agent_count." }, { "role": "assistant", "content": "SELECT ip.product_id, ip.product_name, COUNT(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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "List all Bitcoin token ticks and their creators from token_info_bitcoin." }, { "role": "assistant", "content": "SELECT tick, creator\nFROM token_info_bitcoin;" }, { "role": "user", "content": "Include the total amount held by all wallets for each tick fr...
You are an SQL statement expert. Given the table 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": "For each address, show the total amount contained in UTXOs that have been spent." }, { "role": "assistant", "content": "SELECT address, SUM(amount) FROM utxos WHERE spent = TRUE GROUP BY address;" }, { "role": "user", "content": "Only include addresses w...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.utxos ( utxo_id character varying(64) NOT NULL, -- unique identifier for the UTXO transaction...
[ { "role": "user", "content": "List policy IDs, policy numbers, start dates, and premium amounts for policies issued in the last 90 days with a premium amount greater than 5000." }, { "role": "assistant", "content": "SELECT policy_id, policy_number, start_date, premium_amount FROM insurance.polic...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "I need a list of each case_number and case_name with the total hours spent on each case based on time_entries, but only include cases where the total hours is greater than 10." }, { "role": "assistant", "content": "SELECT c.case_number, c.case_name, SUM(te.hours_spe...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad...
[ { "role": "user", "content": "List all pairs of users where the first user registered before the second user, including both usernames and their registration dates." }, { "role": "assistant", "content": "SELECT a.username AS user1, a.created_at AS user1_created, b.username AS user2, b.created_at...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, created_at timestamp ...
[ { "role": "user", "content": "List all pairs of time entries worked by the same lawyer on the same day but billed at different rates. Include both entry IDs, the lawyer_id, the date_worked, and each billing_rate." }, { "role": "assistant", "content": "SELECT t1.entry_id AS entry1_id,\n t2....
You are an SQL statement expert. Given the table 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, case_id.text, lawyer_id.text, date_worked.date, hours_spent.numeric, billi...
[ { "role": "user", "content": "Which developers have been founded before 2005? Show their name and country." }, { "role": "assistant", "content": "SELECT name, country\nFROM gaming_technology.developers\nWHERE founded_year < 2005;" }, { "role": "user", "content": "Add how many years 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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player ...
[ { "role": "user", "content": "List all pairs of lawyers from the same firm who were hired in the same month and year. Include each lawyer's first_name, last_name, firm_id, and the shared hire_month_year." }, { "role": "assistant", "content": "SELECT a.first_name AS lawyer1_first_name,\n 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "List the username and email of users who have disabled push notifications." }, { "role": "assistant", "content": "SELECT u.username, u.email\nFROM social_media.users u\nJOIN social_media.user_settings s ON u.user_id = s.user_id\nWHERE s.push_notifications_enabled = ...
You are an SQL statement expert. Given the table 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": "Show me all customers who have purchased policies for insurance products of type 'health', including their full name, policy number, and the insurance product's name." }, { "role": "assistant", "content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_nu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name...
[ { "role": "user", "content": "List all users who have deployed contracts, along with their email addresses and the count of contracts they've deployed." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, COUNT(c.contract_id) AS contract_count FROM web3.users u JOIN web3.contracts 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 web3.contracts ( contract_id.text, address.text, abi.text, bytecode.text, deployer_address.text, deployed_at.timestamp,...
[ { "role": "user", "content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT name, symbol, address FROM token_prices_latest WHERE price BETWEEN 1 AND 10 AND blockchain = 'ethereum'...
You are an SQL statement expert. Given the table 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 number containing the transaction block_times...
[ { "role": "user", "content": "List all appointments that have a location specified and their status is not 'Cancelled'. Show the appointment ID, subject, and location." }, { "role": "assistant", "content": "SELECT appointment_id, subject, location FROM legal_services.appointments WHERE location ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.appointments ( appointment_id character varying(64) NOT NULL, client_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List all peers that haven't been active for more than 7 days, along with their IP addresses and ports." }, { "role": "assistant", "content": "SELECT peer_id, ip_address, port FROM trading_platform.peers WHERE last_seen < NOW() - INTERVAL '7 days';" }, { "rol...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, user_id text, address text, private_key text, created_at timesta...
[ { "role": "user", "content": "Show me all claims handled by agents who were hired in the last 3 years, along with the agent's full name and agency." }, { "role": "assistant", "content": "SELECT c.claim_id, c.policy_id, c.incident_date, c.status, CONCAT(a.first_name, ' ', a.last_name) AS agent_na...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incident_date timestamp, reported_date ...
[ { "role": "user", "content": "Which service locations are not accessible and belong to agencies with a jurisdiction level of 'Local'? Show the location name and city." }, { "role": "assistant", "content": "SELECT sl.location_name, sl.city\nFROM government_services.service_locations sl\nINNER JOI...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text, agency_name text, jurisdiction_level text, primary_contact_email text, m...
[ { "role": "user", "content": "List all customer-employee pairs where they share the same email domain, showing customer_id, customer email, employee_id, and employee email." }, { "role": "assistant", "content": "SELECT c.customer_id,\n c.email AS customer_email,\n e.employee_id,\n ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE 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 smart contracts created by addresses that have a balance greater than 1000." }, { "role": "assistant", "content": "SELECT sc.* FROM blockchain.smart_contracts sc JOIN blockchain.addresses a ON sc.creator_address = a.address_id WHERE a.balance > 1000;" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE blockchain.blocks ( block_id text PRIMARY KEY, previous_block_id text, timestamp timestamp, nonce int, merkle_root text...
[ { "role": "user", "content": "Show me all users who have made at least one comment and have their profiles set to private. I want their user IDs and the time their settings were last updated." }, { "role": "assistant", "content": "SELECT DISTINCT c.user_id, us.updated_at\nFROM social_media.comme...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "List all documents that have multiple versions, including document_name, case_id, and the count of versions." }, { "role": "assistant", "content": "SELECT document_name,\n case_id,\n COUNT(*) AS version_count\nFROM legal_services.documents\nGROUP BY docu...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u...
[ { "role": "user", "content": "List the service name, category, and standard fee for all services offered by agencies that have at least one accessible service location in the state of 'California'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.service_name, T1.category, T1.standard_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 government_services.services ( service_id character varying(64) NOT NULL, -- unique identifier for the service ...
[ { "role": "user", "content": "Which achievement_id was unlocked the most times in the first quarter of 2024?" }, { "role": "assistant", "content": "SELECT achievement_id, COUNT(*) as unlock_count FROM gaming_technology.player_achievements WHERE unlocked_at >= '2024-01-01 00:00:00+00' AND unlocke...
You are an SQL statement expert. Given the table 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 NOT NULL DEFAULT gen_random_uuid(), player_id uuid N...
[ { "role": "user", "content": "What is the average score across all game sessions for each game? Include the game title and the average score." }, { "role": "assistant", "content": "SELECT T1.title, AVG(T2.score) FROM gaming_technology.games AS T1 JOIN gaming_technology.game_sessions AS T2 ON T1....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea...
[ { "role": "user", "content": "List all pairs of medications that share the same generic_name but are produced by different manufacturers. Include medication1_id, medication1_name, medication2_id, medication2_name, and the shared generic_name." }, { "role": "assistant", "content": "SELECT m1.medi...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the medication type...
[ { "role": "user", "content": "Please provide a list of all driver and passenger pairs who were hired and registered on the same date. Show the driver's full name, the passenger's full name, and the shared date." }, { "role": "assistant", "content": "SELECT d.first_name AS driver_first_name, d.la...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Provide a count of how many peers were last seen on each distinct day recorded in the system." }, { "role": "assistant", "content": "SELECT DATE(last_seen), COUNT(*) FROM trading_platform.peers GROUP BY DATE(last_seen) ORDER BY DATE(last_seen);" } ]
You are an SQL statement expert. Given the table 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 booking IDs and fares for bookings associated with trips using vehicles that had maintenance logs recorded in the last 90 days." }, { "role": "assistant", "content": "SELECT T1.booking_id , T1.fare FROM transportation.bookings AS T1 JOIN transportation.trips 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 transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id character varying(64) NOT NULL, ser...
[ { "role": "user", "content": "List all items of type 'Armor' in the database, showing the item name, rarity, and their corresponding game_id." }, { "role": "assistant", "content": "SELECT item_id, item_name, rarity, game_id\nFROM gaming_technology.in_game_items\nWHERE item_type = 'Armor';" }, ...
You are an SQL statement expert. Given the table 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 contracts that were deployed by the same deployer address on the same network, showing the contract IDs, deployer address, and network ID." }, { "role": "assistant", "content": "SELECT c1.contract_id AS contract_id_1, c2.contract_id AS contract_id_2, c1.dep...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, -- unique identifier for the contract address cha...
[ { "role": "user", "content": "What is the total count of medical records created in the year 2023 where the assessment field is not empty?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.medical_records mr WHERE (mr.assessment IS NOT NULL AND mr.assessment != '') AND EXTRA...
You are an SQL statement expert. Given the table 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": "Show me the wallet addresses and their creation dates for wallets created in the last 30 days, sorted by creation date in descending order." }, { "role": "assistant", "content": "SELECT address, created_at FROM web3.wallets WHERE created_at >= CURRENT_DATE - INTERVA...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_id character...
[ { "role": "user", "content": "Retrieve a list of beneficiaries who are assigned to more than one policy. Show customer_id, first_name, last_name, and the number of policies they are beneficiaries on." }, { "role": "assistant", "content": "SELECT pb.customer_id, pb.first_name, pb.last_name, 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 insurance.claims ( claim_id character varying(64) NOT NULL, policy_id character varying(64) NOT NULL, customer_id chara...
[ { "role": "user", "content": "Show me all SUI coins with a balance greater than 1000, including their symbol and name." }, { "role": "assistant", "content": "SELECT sc.object_id, sc.coin_type, sc.balance, scm.symbol, scm.name FROM sui_coins sc JOIN sui_coins_metadata scm ON sc.coin_type = scm.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 erc20_balances ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar ) CR...
[ { "role": "user", "content": "Show me all male patients who have received more than one prescription, including their full name, date of birth, and the total number of prescriptions." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, p.date_of_birth, COUNT(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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "What is the average trade price for each asset for trades executed between '2024-05-01' and '2024-05-31'?" }, { "role": "assistant", "content": "SELECT\n asset_id,\n AVG(price) AS avg_price\nFROM trading_platform.trades\nWHERE traded_at >= '2024-05-01' AND traded_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.trades ( trade_id character varying(64) NOT NULL, -- unique identifier for the trade order_id...
[ { "role": "user", "content": "What are the personal contact details of the staff member associated with staff_id 'STAFF789' who worked on a specific maintenance record?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide personal contact details of staff members as this informa...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE train_station_management.m...
[ { "role": "user", "content": "List the first name, last name, and job title for all employees." }, { "role": "assistant", "content": "SELECT first_name, last_name, job_title FROM financial_services.employees;" }, { "role": "user", "content": "Only show employees who are currently act...
You are an SQL statement expert. Given the table 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": "For each prescription, find the next prescription for the same patient. Return current prescription_id, next_prescription_id, patient_id, and days between start dates." }, { "role": "assistant", "content": "SELECT p1.patient_id,\n p1.prescription_id 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 healthcare.prescriptions ( prescription_id.text, record_id.text, patient_id.text, doctor_id.text, medication_id.text, d...
[ { "role": "user", "content": "Show me a list of all users who have made posts that are set to 'private' visibility. Include their user_id, post_id, post creation time, and the user's current theme." }, { "role": "assistant", "content": "SELECT p.user_id, p.post_id, p.created_at, us.theme\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.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ...
[ { "role": "user", "content": "Show a list of all wallet addresses along with the user_id who owns them, sorted by the wallet creation time." }, { "role": "assistant", "content": "SELECT user_id, address FROM web3.wallets ORDER BY created_at;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_id character...
[ { "role": "user", "content": "Show me all PDF documents uploaded in the last 3 months, along with their claim IDs and uploaders." }, { "role": "assistant", "content": "SELECT document_id, claim_id, uploaded_by, uploaded_at FROM insurance.claim_documents WHERE mime_type = 'application/pdf' AND up...
You are an SQL statement expert. Given the table 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.text, claim_id.text, document_type.text, file_name.text, file_path.text, file_s...
[ { "role": "user", "content": "Retrieve the first name, last name, and email address for all passengers who are part of the loyalty program." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM transportation.passengers WHERE loyalty_program_id IS NOT NULL;" }, { ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, -- unique identifier for the driver employe...
[ { "role": "user", "content": "我想查询某个飞机构建的所有检查记录,包括检查类型、检查结果、检查时间以及被检查的组件名称。" }, { "role": "assistant", "content": "MATCH (ab:AircraftBuild)-[:UNDERWENT]->(i:Inspection)-[:INSPECTED_COMPONENT]->(c:Component)\nWHERE ab.build_id = 'specific_build_id'\nRETURN i.inspection_type, i.result, i.inspectio...
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": "For each contract, how many tokens are deployed at the contract address? Show contract_id, address, and token_count." }, { "role": "assistant", "content": "SELECT c.contract_id, c.address, COUNT(t.token_id) AS token_count\nFROM web3.contracts c\nLEFT JOIN web3.token...
You are an SQL statement expert. Given the table 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 character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL...