conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Show me claim IDs, incident dates, and file names for all 'Accident Report' claim documents." }, { "role": "assistant", "content": "SELECT cd.claim_id, cl.incident_date, cd.file_name\nFROM insurance.claim_documents cd\nJOIN insurance.claims cl ON cd.claim_id = cl.cl...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.customers ( customer_id text PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "Find all patients who have both an emergency contact and a phone number, and show their full names along with the emergency contact name and phone number, sorted by last name." }, { "role": "assistant", "content": "SELECT CONCAT(first_name, ' ', last_name) AS patien...
You are an SQL statement expert. Given the table 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": "How many addresses on the Ethereum chain have an ROI between 2 and 4?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS address_count FROM smart_money_profit WHERE chain = 'Ethereum' AND roi >= 2 AND roi <= 4;" }, { "role": "user", "content": "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 text, rank numeric, profit numeric, roi numeric, realized_ratio numeric, most_profit_token...
[ { "role": "user", "content": "List all policies that were issued in the year 2023, showing the policy number, start date, end date, and premium amount." }, { "role": "assistant", "content": "SELECT policy_number, start_date, end_date, premium_amount FROM insurance.policies WHERE issued_at >= '20...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "List the content and creation time of posts made by users who are following user 'U200'." }, { "role": "assistant", "content": "SELECT T1.content, T1.created_at FROM social_media.posts AS T1 JOIN social_media.follows AS T2 ON T1.user_id = T2.follower_user_id WHERE T...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id text, user_id text, content text, media_url text, media_type text, created_at timestamp, u...
[ { "role": "user", "content": "我想查询所有检查结果为'Pass'的记录,包括检查类型、检查时间和检查备注,同时关联到对应的组件信息。" }, { "role": "assistant", "content": "db.inspections.aggregate([\n {\n $match: {\n result: 'Pass'\n }\n },\n {\n $lookup: {\n from: 'components',\n localField: 'component_id',\n for...
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 Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id...
[ { "role": "user", "content": "Show the full name and contact email of citizens who have submitted at least one application for services that are currently inactive." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM gover...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "How many pairs of distinct locations are there that share the same state or province but are in different cities?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM transportation.locations AS l1 JOIN transportation.locations AS l2 ON l1.state_province = l2...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ...
[ { "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 unique item, what is the total quantity that has been acquired by all players?" }, { "role": "assistant", "content": "SELECT item_id, SUM(quantity) AS total_quantity_acquired FROM gaming_technology.player_inventory GROUP BY item_id;" }, { "role": "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.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date...
[ { "role": "user", "content": "Show me the count of notifications sent for each channel for applications submitted after January 1, 2024." }, { "role": "assistant", "content": "SELECT n.channel, COUNT(*) AS notification_count\nFROM government_services.notifications n\nJOIN government_services.app...
You are an SQL statement expert. Given the table 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": "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": "Summarize the accounts table by account type and currency, showing the average balance for each combination." }, { "role": "assistant", "content": "SELECT account_type, currency, AVG(balance) AS average_balance, COUNT(account_id) AS account_count FROM financial_serv...
You are an SQL statement expert. Given the table 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": "Show me all available rooms (status = 'available') with their room numbers and features, along with their property IDs and room type details including base rate and max occupancy." }, { "role": "assistant", "content": "SELECT r.room_number, r.features, r.property_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 hospitality_technology.rooms ( room_id text PRIMARY KEY, property_id text, room_number text, room_type_id text, floor i...
[ { "role": "user", "content": "Can you retrieve a list of all case numbers, their names, the client's full name, and the date_opened, sorted by date_opened descending?" }, { "role": "assistant", "content": "SELECT c.case_number,\n c.case_name,\n CONCAT(cl.first_name, ' ', cl.last_name...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "Count the number of documents submitted for each service. Show the service_name and the document_count." }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(d.document_id) AS document_count\nFROM government_services.services s\nJOIN government_service...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.services ( service_id.text, agency_id.text, service_name.text, description.text, category.text, eli...
[ { "role": "user", "content": "Show me all room types with 'King' in the bed_type field, along with their property IDs and base rates." }, { "role": "assistant", "content": "SELECT room_type_id, property_id, type_name, bed_type, base_rate FROM hospitality_technology.room_types WHERE bed_type LIKE...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text, type_name text, description text, ...
[ { "role": "user", "content": "Show conversations that are group chats and have more than 5 participants. List the conversation_id and group_name." }, { "role": "assistant", "content": "SELECT c.conversation_id, c.group_name FROM social_media.conversations AS c JOIN social_media.conversation_part...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, content text, medi...
[ { "role": "user", "content": "List the name, type, and city for all properties located in 'Canada'." }, { "role": "assistant", "content": "SELECT property_name, property_type, city FROM hospitality_technology.properties WHERE country_code = 'CAN';" } ]
You are an SQL statement expert. Given the table 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": "Provide the count of drivers for each status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS driver_count\nFROM transportation.drivers\nGROUP BY status;" }, { "role": "user", "content": "Only include statuses with more than 5 drivers 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.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "Which users have 'traveler' in their bio and are located in 'New York'? Please show their usernames, full names, and locations." }, { "role": "assistant", "content": "SELECT username, full_name, location FROM social_media.users WHERE bio ILIKE '%traveler%' AND locat...
You are an SQL statement expert. Given the table 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": "Show the number of achievements unlocked by each player per month. Display player_id, month (as YYYY-MM), and achievement_count." }, { "role": "assistant", "content": "SELECT player_id,\n TO_CHAR(unlocked_at, 'YYYY-MM') AS year_month,\n COUNT(*) AS achie...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, achievement_id uuid, unlocked_at ti...
[ { "role": "user", "content": "List the top 3 tokens by net flow on the Binance chain, including their symbol and average cost." }, { "role": "assistant", "content": "SELECT token_symbol, net_flow, avg_cost FROM smart_money_token_performance WHERE chain = 'Binance' ORDER BY net_flow DESC LIMIT 3;...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE smart_money_token_performance ( token_address character varying(100) NOT NULL, -- the token's address token_symbol char...
[ { "role": "user", "content": "Show me the top 3 smart money addresses by PnL in the last month, along with their most profitable token and ROI." }, { "role": "assistant", "content": "SELECT token_address, token_symbol, pnl, roi FROM smart_money_token_performance ORDER BY pnl DESC LIMIT 3;" }, ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show me all reservations with their guest IDs and room IDs where the total amount is greater than $500 and the status is 'Confirmed', ordered by check-in date." }, { "role": "assistant", "content": "SELECT reservation_id, guest_id, room_id, check_in_date, total_amou...
You are an SQL statement expert. Given the table 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": "Show me the total fuel quantity and cost for each route, grouped by route number, only for trips that have associated fuel logs." }, { "role": "assistant", "content": "SELECT r.route_number, SUM(f.quantity) AS total_quantity, SUM(f.total_cost) AS total_cost\nFROM tr...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati...
[ { "role": "user", "content": "Get all pairs of services from the same department where one service is more expensive than another. Show department, service1_name, price1, service2_name, price2." }, { "role": "assistant", "content": "SELECT s1.department, s1.service_name AS service1_name, s1.pric...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, property_id text, service_name text, description text, c...
[ { "role": "user", "content": "List all policies that have been cancelled, showing the policy number, cancelled date, and cancellation reason." }, { "role": "assistant", "content": "SELECT policy_number, cancellation_date, cancellation_reason FROM insurance.policies WHERE cancellation_date IS NOT...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "List the sender_user_id and the total number of messages they have sent that include media attachments, along with the conversation_id." }, { "role": "assistant", "content": "SELECT sender_user_id, conversation_id, COUNT(*) AS media_message_count\nFROM social_media....
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_user_id text, content text, media_url...
[ { "role": "user", "content": "What is the current market price of a Boeing 737 MAX aircraft?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and general information ab...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE manufacturing.aircraft_mod...
[ { "role": "user", "content": "For each game session, list session_id, player_id, and the number of achievements that the player had unlocked before the session start_time." }, { "role": "assistant", "content": "```sql\nSELECT\n gs.session_id,\n gs.player_id,\n COUNT(pa.achievement_id) AS achi...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, password_hash text, registration_dat...
[ { "role": "user", "content": "Show each user_id along with the total number of wallets they own." }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) AS wallet_count\nFROM blockchain.wallets\nGROUP BY user_id;" }, { "role": "user", "content": "Only include users who have 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 blockchain.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address_id chara...
[ { "role": "user", "content": "Find all active policies with a coverage limit of at least 1,000,000. List the policy_id, policy_number, and coverage_limit." }, { "role": "assistant", "content": "SELECT policy_id, policy_number, coverage_limit\nFROM insurance.policies\nWHERE status = 'active' 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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, product_id c...
[ { "role": "user", "content": "Show the usernames and the total number of messages sent by each user in conversations they joined before January 1, 2024." }, { "role": "assistant", "content": "SELECT u.username, COUNT(m.message_id) AS total_messages\nFROM social_media.conversation_participants cp...
You are an SQL statement expert. Given the table 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 the names of agencies and the total standard fee sum for all active services they currently provide." }, { "role": "assistant", "content": "SELECT a.agency_name, SUM(s.standard_fee) AS total_active_service_fee\nFROM government_services.agencies a\nJOIN governme...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "List the invoice_number, total_amount, the full name of the client, and the case_number for all invoices." }, { "role": "assistant", "content": "SELECT i.invoice_number, i.total_amount, c.first_name || ' ' || c.last_name AS client_full_name, cs.case_number\nFROM leg...
You are an SQL statement expert. Given the table 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": "What is the schedule of trains arriving at platform 1A at station XYZ on December 25th, 2023?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about train schedules or specific arrival times as this data is not included in the platfo...
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.p...
[ { "role": "user", "content": "Find token transfers within the same transaction where the recipient of an earlier transfer (based on log_index) becomes the sender of a later transfer. List the transaction ID, the earlier transfer ID, the later transfer ID, the shared address, and the value transferred in bot...
You are an SQL statement expert. Given the table 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.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address text, to_address text, value numeric, ...
[ { "role": "user", "content": "Show me all locations in New York with their type, city, and coordinates, ordered by latitude in descending order." }, { "role": "assistant", "content": "SELECT type, city, latitude, longitude FROM transportation.locations WHERE state_province = 'New York' ORDER BY ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE transportation.locations ( location_id text, name text, type text, address_line1 text, city text, state_province text, ...
[ { "role": "user", "content": "Show me the top 5 assets by the number of actions logged in the trading platform, along with their types." }, { "role": "assistant", "content": "SELECT a.asset_id, a.name, a.type, COUNT(l.log_id) AS action_count FROM trading_platform.assets a JOIN trading_platform.l...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.assets ( asset_id text, name text, symbol text, type text ) CREATE TABLE trading_platform.logs ( log_i...
[ { "role": "user", "content": "Can you show me the full name, date of birth, and policy number for all patients who have insurance policies that will expire in the next 60 days, including the insurance plan ID?" }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, p.date_of_bir...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, -- unique identifier for the patient first_na...
[ { "role": "user", "content": "Show me the balances held by the 'Coinbase' exchange. For each token, list the token symbol, balance, and the current price from the token basic info table." }, { "role": "assistant", "content": "SELECT ctb.token_symbol, ctb.balance, tbi.price FROM cex_token_balance...
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.text, token_name.text, token_symbol.text, token_address.t...
[ { "role": "user", "content": "Show me the full names of all patients who have received a diagnosis for 'hypertension', along with the appointment time and the doctor's full name for each related appointment." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, a.appointment_t...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me the full name of guests who have left reviews along with the overall rating they gave." }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, r.rating_overall FROM hospitality_technology.reviews r JOIN hospitality_technology.guests g ON r.g...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id character varying(64) NOT NULL, -- unique identifier for the room ...
[ { "role": "user", "content": "For each staff member who placed a service order, show their full name and the total revenue generated from those orders." }, { "role": "assistant", "content": "SELECT S.first_name, S.last_name, SUM(SO.total_price) AS total_generated_revenue FROM hospitality_technol...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2...
[ { "role": "user", "content": "List all patients who have been diagnosed with chronic conditions, including their diagnosis descriptions and dates." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, d.diagnosis_description, d.diagnosis_date FROM healthcare.pati...
You are an SQL statement expert. Given the table 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": "Retrieve all orders placed after '2024-06-01', including order_id, user_id, asset_id, quantity, and price." }, { "role": "assistant", "content": "SELECT order_id, user_id, asset_id, quantity, price\nFROM trading_platform.orders\nWHERE created_at > '2024-06-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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, asset_id text, order_type text, quan...
[ { "role": "user", "content": "For each token, show its token name, token symbol, the address of the contract it was created on, and the deployer address of that contract." }, { "role": "assistant", "content": "SELECT t.token_id, t.token_name, t.token_symbol, t.contract_address, c.deployer_addres...
You are an SQL statement expert. Given the table 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...
[ { "role": "user", "content": "Which agencies offer services with a standard fee greater than 100? List the agency name and the corresponding service names." }, { "role": "assistant", "content": "SELECT T1.agency_name, T2.service_name FROM government_services.agencies AS T1 INNER JOIN government_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "List all terminated agents who worked for more than 5 years, showing their full names and termination dates." }, { "role": "assistant", "content": "SELECT first_name, last_name, termination_date FROM insurance.agents WHERE termination_date IS NOT NULL AND (terminati...
You are an SQL statement expert. Given the table 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 PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "I want the case number, case name, the client's full name, and the lead lawyer's full name for all cases." }, { "role": "assistant", "content": "SELECT cs.case_number,\n cs.case_name,\n cl.first_name || ' ' || cl.last_name AS client_full_name,\n lw...
You are an SQL statement expert. Given the table 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": "Show all comments that are replies, including the comment_id, parent_comment_id, and post_id." }, { "role": "assistant", "content": "SELECT comment_id, parent_comment_id, post_id FROM social_media.comments WHERE parent_comment_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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, parent_comment_id text, content text, ...
[ { "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 service name and the count of applications currently in 'Under Review' status for each service." }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(a.application_id) AS under_review_count\nFROM government_services.services s\nLEFT JOIN g...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "List each user_id and the date of their latest log." }, { "role": "assistant", "content": "SELECT user_id, MAX(logged_at) AS latest_log\nFROM trading_platform.logs\nGROUP BY user_id;" }, { "role": "user", "content": "Please also show the total number of ...
You are an SQL statement expert. Given the table 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 each trip_id along with the number of seats booked and the total fuel cost incurred during that trip." }, { "role": "assistant", "content": "SELECT fl.trip_id, COUNT(b.booking_id) AS seats_booked, SUM(fl.total_cost) AS total_fuel_cost\nFROM transportation.fuel_...
You are an SQL statement expert. Given the table 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": "Show me the count of posts per media_type for public posts." }, { "role": "assistant", "content": "SELECT media_type, COUNT(*) AS post_count\nFROM social_media.posts\nWHERE visibility = 'public'\nGROUP BY media_type;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, content text, medi...
[ { "role": "user", "content": "List all trades, including the status of the corresponding order." }, { "role": "assistant", "content": "SELECT t.trade_id, t.order_id, o.status FROM trading_platform.trades t JOIN trading_platform.orders o ON t.order_id = o.order_id;" }, { "role": "user", ...
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 trading_platform.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, p...
[ { "role": "user", "content": "Show me the top 5 tokens by 24-hour trading volume on the Ethereum chain, along with their price and 24-hour price change percentage." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, price, price_change_percentage_24h, volume_24h FROM token_de...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE token_dexpool_info ( pair_address character varying(512) NOT NULL, token_name character varying(100) NOT NULL, token_sy...
[ { "role": "user", "content": "Show me the top 5 users who have interacted with the most DApps, along with their email addresses and the count of distinct DApps they interacted with." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, COUNT(DISTINCT l.details) AS dapp_count FROM tra...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id text, username text, email text, password_hash text, created_at timestamp ) CREATE TAB...
[ { "role": "user", "content": "List all room types along with the name of the property they belong to. Show the room type name, property name, and base rate." }, { "role": "assistant", "content": "SELECT t1.type_name, t2.property_name, t1.base_rate FROM hospitality_technology.room_types AS t1 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 hospitality_technology.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu...
[ { "role": "user", "content": "Can you list all billable and non-billable entry pairs for the same lawyer on the same date?" }, { "role": "assistant", "content": "SELECT b.lawyer_id,\n b.date_worked,\n b.entry_id AS billable_entry,\n n.entry_id AS non_billable_entry,\n b.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 legal_services.time_entries ( entry_id text, case_id text, lawyer_id text, date_worked date, hours_spent numeric, billi...
[ { "role": "user", "content": "List all beneficiaries whose last name starts with 'S', including beneficiary_id, full name, and relationship." }, { "role": "assistant", "content": "SELECT beneficiary_id, first_name || ' ' || last_name AS full_name, relationship\nFROM insurance.policy_beneficiarie...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id.text, policy_id.text, customer_id.text, first_name.text, last_name.text...
[ { "role": "user", "content": "Which services have 'Eligibility' mentioned in their eligibility_criteria field?" }, { "role": "assistant", "content": "SELECT service_name, eligibility_criteria\nFROM government_services.services\nWHERE eligibility_criteria ILIKE '%Eligibility%';" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT...
[ { "role": "user", "content": "Show me medical records that mention a medication from the 'medications' table by name in their treatment plan. List the record ID, record date, patient ID, and the name of the mentioned medication." }, { "role": "assistant", "content": "SELECT T1.record_id, T1.reco...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointment_id text, doctor_id text, record_d...
[ { "role": "user", "content": "Show me all properties in California with their star ratings and the count of active staff members at each property, ordered by staff count in descending order." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, p.star_rating, COUNT(s.staf...
You are an SQL statement expert. Given the table 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": "Show me the content of all comments that have received at least one like." }, { "role": "assistant", "content": "SELECT DISTINCT T1.content FROM social_media.comments AS T1 JOIN social_media.likes AS T2 ON T1.comment_id = T2.comment_id;" }, { "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 social_media.comments ( comment_id character varying(64) NOT NULL, -- unique identifier for the comment post_id...
[ { "role": "user", "content": "List all tokens, showing their symbol, name, and the status of the contract they were deployed on." }, { "role": "assistant", "content": "SELECT T1.token_symbol, T1.token_name, T2.status FROM web3.tokens AS T1 JOIN web3.contracts AS T2 ON T1.contract_address = T2.ad...
You are an SQL statement expert. Given the table 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": "Get a list of all distinct specialties found among the doctors." }, { "role": "assistant", "content": "SELECT DISTINCT specialty 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.doctors ( doctor_id text, first_name text, last_name text, specialty text, license_number text, phone_number...
[ { "role": "user", "content": "For each chain, which centralized exchange holds the largest total USD value in their token balance as of the most recent snapshot?" }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT MAX(snapshot_time) AS max_time FROM cex_token_balance\n)\nS...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "Show me each case ID with its latest uploaded document. I want to see the case ID, document name, version, and upload timestamp for the most recently uploaded document in each case." }, { "role": "assistant", "content": "SELECT d.case_id, d.document_name, d.version,...
You are an SQL statement expert. Given the table 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": "Show the full names and contact emails of all citizens who have made a payment for an application that is currently in 'Pending' status." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM gov...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show me all employees (employee_id, first_name, last_name) who work in the 'Investment' department and have processed trades (trade_id, security_id) in the last month, along with the trade details." }, { "role": "assistant", "content": "SELECT e.employee_id, e.first...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id character varying(64) NOT NULL, ac...
[ { "role": "user", "content": "For each game, which server has hosted the most sessions?" }, { "role": "assistant", "content": "SELECT game_id, server_id, COUNT(*) AS session_count FROM gaming_technology.game_sessions GROUP BY game_id, server_id;" }, { "role": "user", "content": "I wa...
You are an SQL statement expert. Given the table 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, player_id uuid, game_id uuid, server_id uuid, start_time timestamp w...
[ { "role": "user", "content": "For each user with 'approved' KYC status, show their user ID and the total amount in their unspent UTXOs." }, { "role": "assistant", "content": "SELECT T1.user_id, SUM(T2.amount) FROM trading_platform.kyc_audit AS T1 JOIN trading_platform.utxos AS T2 ON T1.user_id =...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.utxos ( utxo_id text, transaction_id text, output_index integer, address text, amount numeric, spent b...
[ { "role": "user", "content": "Show me all insurance plans that have more than 5 patients enrolled, along with the provider name and count of patients, sorted by patient count in descending order." }, { "role": "assistant", "content": "SELECT i.plan_name, i.insurance_provider, COUNT(p.patient_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": "Show me all wallet addresses that hold more than 3 different NFTs from any ERC1155 contract. For each wallet, list the contract address and the count of distinct token_ids." }, { "role": "assistant", "content": "SELECT contract_address, wallet_address, COUNT(DISTINC...
You are an SQL statement expert. Given the table 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": "Find all medical records where the recorded temperature in vitals is above 38°C. Return record_id, patient_id, record_date, and the temperature." }, { "role": "assistant", "content": "SELECT\n record_id,\n patient_id,\n record_date,\n (vitals->>'temp')::...
You are an SQL statement expert. Given the table 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": "For each driver, show their driver_id, first_name, last_name, along with any other driver whose license_expiry_date is earlier than theirs." }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver_id,\n d1.first_name,\n d1.last_name,\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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "For each customer, list their customer ID and the total number of policies they have purchased. Only include customers who have purchased more than one type of insurance product." }, { "role": "assistant", "content": "SELECT customer_id, COUNT(policy_id) AS total_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 insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "List all transaction IDs, sender addresses, and amounts for transactions received by '0xFEDCBA9876543210FEDCBA9876543210FEDCBA98' between '2023-01-01' and '2023-03-31'." }, { "role": "assistant", "content": "SELECT transaction_id, sender_address, amount FROM blockch...
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 character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Find all pairs of inventory entries where the same player acquired the same item twice. Show the player_id, item_id, the earlier inventory_id as first_inv, and the later inventory_id as second_inv." }, { "role": "assistant", "content": "SELECT p1.player_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 gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, item_id uuid, quantity int, acquire...
[ { "role": "user", "content": "Find all policies that were cancelled due to 'Non-payment'. Show the policy number, cancellation date, and premium amount for these policies." }, { "role": "assistant", "content": "SELECT policy_number , cancellation_date , premium_amount FROM insurance.policies 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 insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "Find currently employed employees whose direct manager has been terminated. Display the employee's full name, hire date, manager's full name, and manager's termination date." }, { "role": "assistant", "content": "SELECT e.employee_id,\n CONCAT(e.first_name, ' ...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "Show me the wallet addresses holding the ERC20 token with contract address '0xabcdeffedcba9876543210abcdefedcba9876'. Include the amount they hold." }, { "role": "assistant", "content": "SELECT wallet_address, amount FROM erc20_balances WHERE contract_address = '0xa...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,...
[ { "role": "user", "content": "Which users have registered but never created a wallet? Show their user_id, username, and email." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, u.email\nFROM trading_platform.users u\nLEFT JOIN trading_platform.wallets w ON u.user_id = w.user_i...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "List all ERC20 tokens with their names and symbols where the price is greater than $10, sorted by price in descending order." }, { "role": "assistant", "content": "SELECT t.symbol, t.name, p.price FROM sui_coins_metadata t JOIN token_prices_latest p ON t.coin_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 erc1155_approval_for_all ( block_number bigint NOT NULL, -- Block number containing the transaction block_times...
[ { "role": "user", "content": "List all pairs of law firms that were founded on the same month and day, showing their names, and the shared founding date. Exclude firms founded on January 1st." }, { "role": "assistant", "content": "SELECT t1.firm_name AS firm1_name, t2.firm_name AS firm2_name, 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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name character varying(200) NOT NULL, address t...
[ { "role": "user", "content": "List all applications that have at least one document with a verification status of 'Verified'. Show the application reference number and the name of the service associated with the application." }, { "role": "assistant", "content": "SELECT\n T1.reference_number,\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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Find all events with name 'Transfer' that were emitted by contracts deployed by address '0x1234', showing the event data and deployment timestamp of the contract." }, { "role": "assistant", "content": "SELECT e.event_id, e.data, c.deployed_at FROM web3.events e 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 web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifier for the contract address cha...
[ { "role": "user", "content": "Find all wallets that were created on the same day and list their wallet IDs, addresses, and the creation date." }, { "role": "assistant", "content": "SELECT w1.wallet_id, w1.address, w1.created_at::date AS creation_date FROM web3.wallets w1 JOIN (SELECT created_at:...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE web3.wallets ( wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet user_id character...
[ { "role": "user", "content": "List all users who have sent messages containing media files in group conversations, showing their username, email, and the group name." }, { "role": "assistant", "content": "SELECT DISTINCT u.username, u.email, c.group_name\nFROM social_media.messages m\nJOIN socia...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List the full names and email addresses of staff members who have delivered at least one service order in the past 30 days, along with the count of orders they delivered. Sort by count descending." }, { "role": "assistant", "content": "SELECT st.staff_id,\n 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 hospitality_technology.staff ( staff_id text, property_id text, first_name text, last_name text, position text, work_em...
[ { "role": "user", "content": "Show me the user ID, wallet address, and transaction ID for the first 20 transactions sent from any user's wallet." }, { "role": "assistant", "content": "SELECT W.user_id, W.address, T.transaction_id FROM web3.wallets W JOIN web3.transactions T ON W.address = T.from...
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 PRIMARY KEY, from_address text, to_address t...
[ { "role": "user", "content": "Provide a count of agencies for each distinct jurisdiction level." }, { "role": "assistant", "content": "SELECT jurisdiction_level, COUNT(*) AS agency_count FROM government_services.agencies GROUP BY jurisdiction_level;" } ]
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show me all lawyers, their specializations, and the address of the law firm they work at." }, { "role": "assistant", "content": "SELECT l.first_name || ' ' || l.last_name AS lawyer_full_name, l.specialization, f.address\nFROM legal_services.lawyers l\nJOIN legal_ser...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "I’d like to see a list of appointments along with any prescriptions made on the same day. Include appointment_id, prescription_id, medication_name, and appointment_time." }, { "role": "assistant", "content": "SELECT a.appointment_id, p.prescription_id, m.medication_...
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appointment_time timestamp, duration_mi...
[ { "role": "user", "content": "Show all payments along with the guest's first and last name, and the staff member who processed each payment. Include payment_id, amount, currency_code, payment_timestamp, guest first_name, guest last_name, staff first_name, and staff last_name." }, { "role": "assistan...
You are an SQL statement expert. Given the table 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": "For each group chat, can you show me each participant's username and the date they joined the chat?" }, { "role": "assistant", "content": "SELECT u.username, c.group_name, cp.joined_at\nFROM social_media.conversation_participants cp\nJOIN social_media.users u ON cp....
You are an SQL statement expert. Given the table 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 employees have a manager assigned to them?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS employee_count\nFROM government_services.employees\nWHERE manager_employee_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 government_services.employees ( employee_id text, agency_id text, first_name text, last_name text, job_title text, depa...