system stringlengths 3.56k 8.72k | conversations listlengths 4 26 |
|---|---|
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.events ( event_id character varying(64) NOT NULL, contract_id character varying(... | [
{
"role": "user",
"content": "List the username, registration date, and the creation date of the first wallet created by each user who owns at least one wallet."
},
{
"role": "assistant",
"content": "SELECT u.username, u.created_at AS registration_date, MIN(w.created_at) AS first_wallet_creation... |
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 government_services.agencies (
agency_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me a list of all agencies and the number of distinct citizens who have submitted documents to each agency."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, COUNT(DISTINCT d.citizen_id) AS citizen_count\nFROM government_services.documents d\nJOIN gov... |
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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transactio... | [
{
"role": "user",
"content": "Show me the contract address and symbol for all ERC20 tokens that have at least one approval recorded."
},
{
"role": "assistant",
"content": "SELECT DISTINCT ea.contract_address, tm.symbol\nFROM erc20_approval ea\nLEFT JOIN token_prices_latest tm ON ea.contract_addr... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique i... | [
{
"role": "user",
"content": "Show the top 10 most expensive fuel log entries including fuel_log_id, vehicle make and model, location name and city, and total_cost."
},
{
"role": "assistant",
"content": "SELECT f.fuel_log_id,\n v.make,\n v.model,\n loc.name AS location_name,\n ... |
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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Retrieve all active staff members who processed payments in USD within the last 30 days. Return staff first_name, last_name, property_name, and the count of payments processed."
},
{
"role": "assistant",
"content": "SELECT s.first_name, s.last_name, p.property_name,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifie... | [
{
"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 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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_na... | [
{
"role": "user",
"content": "Show all active customers who live in the same zip_code."
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS cust1,\n b.customer_id AS cust2,\n a.zip_code\nFROM financial_services.customers a\nJOIN financial_services.customers b\n ON a.zip_co... |
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(6) NOT NULL, block_number bigint NOT NULL, tr... | [
{
"role": "user",
"content": "For each ERC1155 contract in erc1155_approval_for_all, show contract_address, the count of approval-for-all events, and the number of unique current holders from nft_holders. Order by holder_count descending and limit to 5."
},
{
"role": "assistant",
"content": "SEL... |
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: :Station
// Properties:
// station_id: String (Constraint: UNIQUE)
// station_n... | [
{
"role": "user",
"content": "Can you retrieve the total number of train cars for each train in the database?"
},
{
"role": "assistant",
"content": "MATCH (t:Train)<-[:PART_OF_TRAIN]-(tc:TrainCar)\nRETURN t.train_id, t.train_number, COUNT(tc) AS total_cars\nORDER BY t.train_id"
},
{
"rol... |
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.users ( user_id character varying(64) NOT NULL, username character v... | [
{
"role": "user",
"content": "List the name and symbol for all assets that do not have a corresponding entry with the key 'website' in the metadata table."
},
{
"role": "assistant",
"content": "SELECT T1.name , T1.symbol FROM trading_platform.assets AS T1 LEFT JOIN trading_platform.metadata AS T... |
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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name... | [
{
"role": "user",
"content": "Show all tokens on the Ethereum chain in token_dexpool_info that had a price increase in the last 6 hours, along with their 24h trading volume and smart money ROI."
},
{
"role": "assistant",
"content": "SELECT td.token_symbol,\n td.price_change_percentage_6h,\... |
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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id... | [
{
"role": "user",
"content": "Retrieve each citizen's first_name, last_name, and their most recent notification's message_subject and sent_at, only for notifications sent via 'Email'."
},
{
"role": "assistant",
"content": "SELECT c.first_name,\n c.last_name,\n n.message_subject,\n ... |
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 project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrais... | [
{
"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 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 varcha... | [
{
"role": "user",
"content": "List all SUI coins that have the status 'inactive', including their owner address and coin_type."
},
{
"role": "assistant",
"content": "SELECT coin_type, owner FROM sui_coins WHERE status = 'inactive';"
},
{
"role": "user",
"content": "Add the name and s... |
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.users ( user_id text PRIMARY KEY, username text, email text, passwor... | [
{
"role": "user",
"content": "List the names and URLs of all available decentralized applications (DApps)."
},
{
"role": "assistant",
"content": "SELECT name, url FROM dapps;"
},
{
"role": "user",
"content": "For each agency, list the agency name and the total count of employees who ... |
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 hospitality_technology.reservations ( reservation_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Show all reviews made by guests along with the guest_id, guest's reservation_id, and the related property's property_id and review_date."
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.guest_id, r.reservation_id, r.property_id, r.review_date\nFROM hospi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
// db.createCollection('platforms')
// Optional: db.platforms.createIndex({ platform_id: 1 }, { un... | [
{
"role": "user",
"content": "Can you help me get the total number of operational platforms across all stations?"
},
{
"role": "assistant",
"content": "db.platforms.countDocuments({ status: 'Operational' });"
},
{
"role": "user",
"content": "What is the detailed repair history of the... |
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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_name... | [
{
"role": "user",
"content": "List all maintenance logs for vehicles that had 'Oil Change' service in the last 3 months, showing vehicle ID, service date, and cost."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE service_typ... |
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 project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrais... | [
{
"role": "user",
"content": "List the top 5 tokens by 24 hour trading volume on DEX pools."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, volume_24h \nFROM token_dexpool_info \nORDER BY volume_24h DESC LIMIT 5;"
},
{
"role": "user",
"content": "Show only the... |
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 transportation.routes ( route_id text, route_number text, description text, origin_lo... | [
{
"role": "user",
"content": "List all completed trips, showing the trip ID, the names of the origin and destination locations for the trip, and the actual arrival time."
},
{
"role": "assistant",
"content": "SELECT t.trip_id, loc_origin.name AS origin_location_name, loc_dest.name AS destination... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth... | [
{
"role": "user",
"content": "What is the average number of refills allowed across all prescriptions?"
},
{
"role": "assistant",
"content": "SELECT AVG(refills_allowed) FROM healthcare.prescriptions;"
},
{
"role": "user",
"content": "Which token on each chain has the highest ROI and ... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique i... | [
{
"role": "user",
"content": "List all depots (location type 'Depot') and the number of vehicles assigned to each. Include the depot name and city."
},
{
"role": "assistant",
"content": "SELECT T1.name , T1.city , COUNT(T2.vehicle_id) FROM transportation.locations AS T1 LEFT JOIN transportatio... |
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.users (
user_id character varying(64) NOT NULL, -- unique ident... | [
{
"role": "user",
"content": "Show for every asset the usernames of users who have both bought and sold that asset, along with the asset name."
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.asset_id, a.name AS asset_name, u.username\nFROM trading_platform.assets a\nJOIN trading_platfor... |
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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prope... | [
{
"role": "user",
"content": "Get a list of room types along with their property name and the count of rooms currently Available for each type."
},
{
"role": "assistant",
"content": "SELECT rt.type_name, p.property_name, COUNT(r.room_id) AS available_rooms_count\nFROM hospitality_technology.room... |
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 transportation.routes ( route_id.text, route_number.text, description.text, origin_lo... | [
{
"role": "user",
"content": "Count the number of trips for each route type."
},
{
"role": "assistant",
"content": "SELECT R.type, COUNT(T.trip_id) FROM transportation.trips AS T JOIN transportation.routes AS R ON T.route_id = R.route_id GROUP BY R.type;"
},
{
"role": "user",
"conten... |
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 transportation.locations ( location_id text, name text, type text, address_line1 text... | [
{
"role": "user",
"content": "Find pairs of distinct locations in the same city that have different types. Include location IDs, names, city, and type for both locations."
},
{
"role": "assistant",
"content": "SELECT l1.location_id AS location1_id, l1.name AS location1_name, l1.city, l1.type AS ... |
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 financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_... | [
{
"role": "user",
"content": "List all accounts with a balance below 1000, showing the account_id, account_number, and currency."
},
{
"role": "assistant",
"content": "SELECT account_id, account_number, currency\nFROM financial_services.accounts\nWHERE balance < 1000;"
},
{
"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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List property names and the total maximum occupancy across all their room types."
},
{
"role": "assistant",
"content": "SELECT T1.property_name, SUM(T2.max_occupancy) FROM properties AS T1 JOIN room_types AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property... |
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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "For each insurance product, can you list its product name, the number of unique agents who have sold policies for that product, and the total premium paid across those policies?"
},
{
"role": "assistant",
"content": "SELECT ip.product_name, COUNT(DISTINCT a.agent_id... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
// Use Hashes to store station details. Key format: station:<station_id>
// Example:
// HSET stati... | [
{
"role": "user",
"content": "能否帮我查询特定列车(train_id 为 'train_789')上的所有车辆信息,并关联到该列车所在的路线信息?"
},
{
"role": "assistant",
"content": "SMEMBERS train:train_789:cars\nHGETALL car:<car_id> for each car_id in result\nHGETALL train:train_789\nSMEMBERS schedule:sched_1122:bookings\nHGETALL booking:<booking_... |
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.users ( user_id.text, username.text, email.text, password_hash.text,... | [
{
"role": "user",
"content": "List all peer logs, showing the user_id and the action taken, ordered by the most recent log entry."
},
{
"role": "assistant",
"content": "SELECT user_id, action, logged_at\nFROM trading_platform.logs\nORDER BY logged_at DESC;"
},
{
"role": "user",
"cont... |
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ... | [
{
"role": "user",
"content": "List the service_id, service_name, and agency_id for all active services that have an online application URL provided."
},
{
"role": "assistant",
"content": "SELECT service_id,\n service_name,\n agency_id\nFROM government_services.services\nWHERE is_acti... |
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.users ( user_id.text, username.text, email.text, password_hash.text,... | [
{
"role": "user",
"content": "List all DApps along with the number of metadata entries linked to each, even if the DApp has no linked metadata."
},
{
"role": "assistant",
"content": "SELECT d.name, d.url, COUNT(m.metadata_id) AS metadata_count\nFROM trading_platform.dapps d\nLEFT JOIN trading_pl... |
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 legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "Calculate the total billable hours spent by each lawyer for entries in March 2024."
},
{
"role": "assistant",
"content": "SELECT lawyer_id,\n SUM(hours_spent) AS total_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\n AND date_worked BETWEEN... |
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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "Show all cases that were opened and subsequently closed in the same calendar year. List the case name, case number, date opened, and date closed."
},
{
"role": "assistant",
"content": "SELECT case_name, case_number, date_opened, date_closed FROM legal_services.cases... |
You are an 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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "List each conversation_id and the number of unread messages (where read_at is null)."
},
{
"role": "assistant",
"content": "SELECT m.conversation_id, COUNT(*) AS unread_messages FROM social_media.messages m WHERE m.read_at IS NULL GROUP BY m.conversation_id;"
},
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id text PRIMARY KEY, property_id text, first_nam... | [
{
"role": "user",
"content": "Show all public reviews that have a comment."
},
{
"role": "assistant",
"content": "SELECT review_id, property_id, guest_id, rating_overall, comment FROM reviews WHERE is_public = TRUE AND comment IS NOT NULL AND comment != '';"
},
{
"role": "user",
"con... |
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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Show the total number of customers in each state."
},
{
"role": "assistant",
"content": "SELECT\n state,\n COUNT(customer_id)\nFROM insurance.customers\nGROUP BY\n state;"
},
{
"role": "user",
"content": "What is the current location of train number A... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE blockchain.transactions ( transaction_id text, block_id text, sender_address text, re... | [
{
"role": "user",
"content": "Show me each transaction with its ID, amount, timestamp, and the usernames of both sender and receiver."
},
{
"role": "assistant",
"content": "SELECT t.transaction_id, t.amount, t.timestamp, us.username AS sender_username, ur.username AS receiver_username\nFROM bloc... |
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 social_media.users ( user_id text, username text, email text, password_hash text, ful... | [
{
"role": "user",
"content": "For each private conversation (is_group_chat = false), list the conversation_id and the usernames of its two participants."
},
{
"role": "assistant",
"content": "SELECT c.conversation_id,\n u1.username AS participant_one,\n u2.username AS participant_two... |
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.users ( user_id character varying(64) NOT NULL, username character v... | [
{
"role": "user",
"content": "For each peer port, count how many peers have used that port."
},
{
"role": "assistant",
"content": "SELECT port,\n COUNT(*) AS peer_count\nFROM trading_platform.peers\nGROUP BY port;"
},
{
"role": "user",
"content": "Give me the count of policies ... |
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.assets ( asset_id text PRIMARY KEY, name text, symbol text, type tex... | [
{
"role": "user",
"content": "Show the number of UTXOs associated with each unique address in the system."
},
{
"role": "assistant",
"content": "SELECT address, COUNT(utxo_id) FROM trading_platform.utxos GROUP BY address;"
},
{
"role": "user",
"content": "List all maintenance logs fo... |
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 erc20_balances_historical ( block_number bigint, contract_address varchar, wallet_add... | [
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address."
},
{
"role": "assistant",
"content": "SELECT wallet_address, token_id, contract_address FROM nft_holders WHERE contract_type = 'ERC1155' AND CA... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique i... | [
{
"role": "user",
"content": "Provide a summary showing, for each vehicle type, the total number of fueling events and the combined total fuel quantity refueled."
},
{
"role": "assistant",
"content": "SELECT v.type AS vehicle_type, COUNT(f.fuel_log_id) AS total_fueling_events, SUM(f.quantity) AS... |
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 social_media.users ( user_id text, username text, email text, password_hash text, ful... | [
{
"role": "user",
"content": "List the users who have never posted any public posts, showing user_id, username, and email."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, u.email FROM social_media.users u LEFT JOIN social_media.posts p ON p.user_id = u.user_id AND p.visibili... |
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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text,... | [
{
"role": "user",
"content": "Retrieve all unique chief complaints from medical_records."
},
{
"role": "assistant",
"content": "SELECT DISTINCT chief_complaint\nFROM healthcare.medical_records;"
},
{
"role": "user",
"content": "Now show chief complaints that occur more than 3 times a... |
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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prope... | [
{
"role": "user",
"content": "List all room types along with their property name, bed type, and base rate for properties located in Canada, ordered by base rate descending."
},
{
"role": "assistant",
"content": "SELECT rt.type_name, p.property_name, rt.bed_type, rt.base_rate\nFROM hospitality_te... |
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 social_media.users ( user_id text, username text, email text, password_hash text, ful... | [
{
"role": "user",
"content": "Show me all comments that are replies (i.e., have a parent_comment_id) on posts that include media, along with the comment content and creation time."
},
{
"role": "assistant",
"content": "SELECT c.comment_id, c.parent_comment_id, c.content, c.created_at\nFROM socia... |
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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, spe... | [
{
"role": "user",
"content": "List all prescriptions, showing the prescription ID, the medication name, and the dosage."
},
{
"role": "assistant",
"content": "SELECT p.prescription_id, m.medication_name, p.dosage FROM healthcare.prescriptions AS p JOIN healthcare.medications AS m ON p.medication... |
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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character ... | [
{
"role": "user",
"content": "What are the top 5 tokens by 7-day price change percentage? Show token_symbol, token_name, narrative, and chain, ordered by price_change_percentage_7d descending."
},
{
"role": "assistant",
"content": "```sql\nSELECT\n token_symbol,\n token_name,\n narrative,\n ... |
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 healthcare.diagnoses (
diagnosis_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List the patient ID and subscriber name for all patients who have both at least one diagnosis recorded and at least one primary insurance policy."
},
{
"role": "assistant",
"content": "SELECT DISTINCT pi.patient_id, pi.subscriber_name FROM healthcare.patient_insuran... |
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 varcha... | [
{
"role": "user",
"content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount."
},
{
"role": "assistant",
"content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas tm ON eb.contract_address = tm... |
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.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for ... | [
{
"role": "user",
"content": "List each wallet that has received tokens of more than one distinct token type. Show wallet_id, address, the number of distinct tokens received as distinct_token_count, and the total received value, ordered by total_received_value descending."
},
{
"role": "assistant",
... |
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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id... | [
{
"role": "user",
"content": "List the names of active services offered by agencies with at least one accessible service location in the state of 'New York'. Show the service name, category, agency name, and the location name."
},
{
"role": "assistant",
"content": "SELECT T1.service_name, T1.cat... |
You are an 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.users ( user_id character varying(64) NOT NULL, username character v... | [
{
"role": "user",
"content": "How many DApps have names that start with the letter 'A'?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS dapp_count\nFROM trading_platform.dapps\nWHERE name LIKE 'A%';"
},
{
"role": "user",
"content": "What is the average trade price for each ... |
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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containi... | [
{
"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 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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique i... | [
{
"role": "user",
"content": "List all vehicles that have no associated fuel logs. Include the vehicle's make, model, and license plate."
},
{
"role": "assistant",
"content": "SELECT T1.make , T1.model , T1.license_plate FROM transportation.vehicles AS T1 LEFT JOIN transportation.fuel_logs AS ... |
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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "List all group chats created in 2024, showing the group_name, conversation_id, and creation time."
},
{
"role": "assistant",
"content": "SELECT conversation_id, group_name, created_at\nFROM social_media.conversations\nWHERE is_group_chat = true AND created_at >= '20... |
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 healthcare.medical_records ( record_id.text, patient_id.text, appointment_id.text, do... | [
{
"role": "user",
"content": "For each patient, find the date of their most recent medical record and the effective date of their current primary insurance plan. Return patient_id, last_record_date, and effective_date."
},
{
"role": "assistant",
"content": "SELECT m.patient_id,\n m.last_da... |
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 hospitality_technology.reservations ( reservation_id text PRIMARY KEY, property_id te... | [
{
"role": "user",
"content": "List each reservation along with the next reservation for the same guest. Show the original reservation_id, its check_out_date, the next_reservation_id, and the next reservation's check_in_date."
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id,\n ... |
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 varcha... | [
{
"role": "user",
"content": "Show me the current amount held and wallet address for all wallets holding more than 100,000 units of the ERC20 token with contract address '0xeeee...'."
},
{
"role": "assistant",
"content": "SELECT wallet_address, amount FROM erc20_balances WHERE contract_address =... |
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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), --... | [
{
"role": "user",
"content": "How many players are there in each country?"
},
{
"role": "assistant",
"content": "SELECT country_code, COUNT(*) AS player_count\nFROM gaming_technology.players\nGROUP BY country_code;"
},
{
"role": "user",
"content": "Only include countries with more th... |
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 erc20_balances ( block_number bigint, contract_address varchar, wallet_address varcha... | [
{
"role": "user",
"content": "List all active SUI coins showing coin_type, balance, and owner from sui_coins."
},
{
"role": "assistant",
"content": "SELECT coin_type, balance, owner\nFROM sui_coins\nWHERE status = 'exists';"
},
{
"role": "user",
"content": "Add symbol and decimals fr... |
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.contracts (
contract_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "Count the number of contracts per network and status."
},
{
"role": "assistant",
"content": "SELECT\n network_id,\n status,\n COUNT(*) AS contract_count\nFROM web3.contracts\nGROUP BY network_id, status;"
},
{
"role": "user",
"content": "Actually, ple... |
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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "List usernames and bio information for users who have set a non-empty bio in their profile."
},
{
"role": "assistant",
"content": "SELECT username, bio\nFROM social_media.users\nWHERE bio IS NOT NULL AND TRIM(bio) <> '';"
},
{
"role": "user",
"content": ... |
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 varcha... | [
{
"role": "user",
"content": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens where the price is greater than $0.1."
},
{
"role": "assistant",
"content": "SELECT tm.name, tm.contract_address, tm.total_supply, tp... |
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 government_services.service_locations ( location_id.text, agency_id.text, location_na... | [
{
"role": "user",
"content": "Could you retrieve pairs of accessible service locations in the same city but with different postal codes?"
},
{
"role": "assistant",
"content": "SELECT sl1.location_id AS location1_id,\n sl2.location_id AS location2_id,\n sl1.city\nFROM government_servi... |
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 transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "List all unique pairs of origin and destination location IDs that have been used in trips, and count how many trips have occurred for each pair."
},
{
"role": "assistant",
"content": "SELECT origin_location_id, destination_location_id, COUNT(*) AS trip_count FROM tr... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique i... | [
{
"role": "user",
"content": "For each fuel type, show the number of unique vehicles that have used it and the total quantity refueled."
},
{
"role": "assistant",
"content": "SELECT f.fuel_type, COUNT(DISTINCT f.vehicle_id) AS vehicle_count, SUM(f.quantity) AS total_quantity\nFROM transportation... |
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 healthcare.medications ( medication_id.text, medication_name.text, generic_name.text,... | [
{
"role": "user",
"content": "Find all medications whose generic_name matches the medication_name of another entry, displaying the brand medication_id, brand medication_name, generic medication_id, and generic medication_name."
},
{
"role": "assistant",
"content": "SELECT b.medication_id AS bran... |
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 gaming_technology.game_sessions ( session_id.uuid, player_id.uuid, game_id.uuid, serv... | [
{
"role": "user",
"content": "List the names of servers and their regions, and the names of achievements available in the games hosted on those servers."
},
{
"role": "assistant",
"content": "SELECT s.server_name, s.region, a.name AS achievement_name FROM gaming_technology.servers AS s JOIN gami... |
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 project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrais... | [
{
"role": "user",
"content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table."
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.valuation, tbi.token_symbol,... |
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 narrative_info (",
"narrative character varying(512) NOT NULL, -- the id of nar... | [
{
"role": "user",
"content": "List all tokens from the token_dexpool_info table with a liquidity over $10 million and a positive 6-hour price change percentage on the Ethereum chain."
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, liquidity, price_change_percentage_6h FRO... |
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 legal_services.cases ( case_id text, case_number text, case_name text, client_id text... | [
{
"role": "user",
"content": "For each case type, calculate the average time to close cases in days, only including cases that have been closed."
},
{
"role": "assistant",
"content": "SELECT case_type,\n AVG(EXTRACT(EPOCH FROM (date_closed - date_opened)) / 86400) AS avg_close_days\nFROM l... |
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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "Show the total number of policies in each status."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) FROM insurance.policies GROUP BY status"
},
{
"role": "user",
"content": "For each payment, list its payment_id, guest_id, payment_timestamp,... |
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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id... | [
{
"role": "user",
"content": "For each service location in Texas, provide the location name, city, and the number of appointments scheduled there by verified citizens."
},
{
"role": "assistant",
"content": "SELECT sl.location_name, sl.city, COUNT(a.appointment_id) AS appointment_count\nFROM gove... |
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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising recor... | [
{
"role": "user",
"content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 6 months, along with their narrative information if available."
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.rounds_name, pfr.valuation, pfr.investment_date, ... |
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 hospitality_technology.room_types (
room_type_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Which room types have a base rate above 250 USD, and what are their maximum occupancies?"
},
{
"role": "assistant",
"content": "SELECT room_type_id, type_name, base_rate, max_occupancy\nFROM hospitality_technology.room_types\nWHERE base_rate > 250;"
},
{
"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 social_media.likes (
like_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "Count the total number of likes on posts versus likes on comments across the entire platform."
},
{
"role": "assistant",
"content": "SELECT CASE WHEN post_id IS NOT NULL THEN 'post' ELSE 'comment' END AS like_target, COUNT(*) AS total_likes FROM social_media.likes G... |
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 transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "List the number of bookings made by each loyalty program member. Show the loyalty_program_id and the booking count."
},
{
"role": "assistant",
"content": "SELECT p.loyalty_program_id, COUNT(b.booking_id) AS booking_count\nFROM transportation.passengers p\nJOIN trans... |
You are an 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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transactio... | [
{
"role": "user",
"content": "How many 'ApprovalForAll' events are recorded for each ERC1155 contract address in the `erc1155_approval_for_all` table?"
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(*) AS approval_count FROM erc1155_approval_for_all GROUP BY contract_addres... |
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 hospitality_technology.properties ( property_id text, property_name text, address_lin... | [
{
"role": "user",
"content": "Show all rooms that are on floor 3."
},
{
"role": "assistant",
"content": "SELECT room_id, property_id, room_number FROM hospitality_technology.rooms WHERE floor = 3;"
},
{
"role": "user",
"content": "For these rooms, include the property name and room n... |
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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique ident... | [
{
"role": "user",
"content": "Show the first and last names, date of birth, and phone number for all patients who have provided an emergency contact."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, date_of_birth, phone_number\nFROM healthcare.patients\nWHERE emergency_contac... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "co... | [
{
"role": "user",
"content": "Can you help me fetch the inventory records for components stored in a specific warehouse, along with their expiry dates?"
},
{
"role": "assistant",
"content": "HGETALL inv:<inventory_record_id>\nZRANGE component_expiry:<component_id> 0 -1 WITHSCORES"
},
{
"... |
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 hospitality_technology.properties ( property_id text, property_name text, address_lin... | [
{
"role": "user",
"content": "Show me the payment amount and the name of the property associated with each payment record."
},
{
"role": "assistant",
"content": "SELECT\n p.amount,\n prop.property_name\nFROM hospitality_technology.payments AS p\nJOIN hospitality_technology.reservations AS r ON... |
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.notifications ( notification_id.text, user_id.text, message.text, se... | [
{
"role": "user",
"content": "Provide a count of notifications, separated by whether they have been read or not."
},
{
"role": "assistant",
"content": "SELECT CASE WHEN T1.read_at IS NULL THEN 'Unread' ELSE 'Read' END, count(T1.notification_id) FROM trading_platform.notifications AS T1 GROUP BY ... |
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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, ... | [
{
"role": "user",
"content": "Retrieve each vehicle's make and model along with the date and description of its latest maintenance service."
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id,\n v.make,\n v.model,\n m.service_date,\n m.description\nFROM transportat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
// Use Hashes for platform details. Key format: platform:<platform_id>
// HSET platform:plat_123 p... | [
{
"role": "user",
"content": "I need to find all bookings for a specific schedule with schedule_id 'sched_1122' and include the passenger and ticket details."
},
{
"role": "assistant",
"content": "SMEMBERS schedule:sched_1122:bookings\nHGETALL booking:book_*\nHGETALL passenger:pass_*\nSMEMBERS b... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_na... | [
{
"role": "user",
"content": "Which securities have had the largest maximum single-day trading volume in the market_data table? Show me the ticker symbol, security name, and that maximum volume."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, MAX(md.volume) AS max... |
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. You are an expert in writing database language and you can refuse the user's question if the question is not related... | [
{
"role": "user",
"content": "What is the maintenance schedule for the platforms at the station with ID 'ST234' for the next month?"
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the maintenance schedule for the platforms at any station. The data I have only include... |
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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique ident... | [
{
"role": "user",
"content": "List the full names and dates of birth of all patients whose emergency contact phone matches the phone number of any doctor."
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.first_name, p.last_name, p.date_of_birth\nFROM healthcare.patients p\nJOIN healthcar... |
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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character vary... | [
{
"role": "user",
"content": "Which agents, along with their managers' full names, are licensed in 'TX' and are currently active?"
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agent_last_name, m.first_name AS manager_first_name, m.last... |
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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text,... | [
{
"role": "user",
"content": "For each medication manufacturer, show the total number of distinct generic names they produce."
},
{
"role": "assistant",
"content": "SELECT manufacturer, COUNT(DISTINCT generic_name) AS distinct_generic_name_count FROM healthcare.medications WHERE generic_name IS ... |
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 financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_... | [
{
"role": "user",
"content": "Show the average current_principal_balance for each loan_type, and include the number of active loans per type."
},
{
"role": "assistant",
"content": "SELECT loan_type,\n COUNT(*) AS active_loan_count,\n AVG(current_principal_balance) AS avg_balance\nFRO... |
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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique ident... | [
{
"role": "user",
"content": "How many active insurance policies does each patient have? Return patient_id and active_policy_count."
},
{
"role": "assistant",
"content": "SELECT patient_id,\n COUNT(*) AS active_policy_count\nFROM healthcare.patient_insurance\nWHERE expiration_date IS NULL\... |
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 healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id charact... | [
{
"role": "user",
"content": "List each insurance provider along with the number of distinct plan types they offer."
},
{
"role": "assistant",
"content": "SELECT insurance_provider, COUNT(DISTINCT plan_type) AS type_count\nFROM healthcare.insurance_plans\nGROUP BY insurance_provider;"
},
{
... |
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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id ch... | [
{
"role": "user",
"content": "Show me each staff member and the count of service orders they have delivered."
},
{
"role": "assistant",
"content": "SELECT st.staff_id, st.first_name, st.last_name, COUNT(so.order_id) AS delivered_orders\nFROM hospitality_technology.staff st\nLEFT JOIN hospitality... |
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 gaming_technology.game_sessions ( session_id.uuid, player_id.uuid, game_id.uuid, serv... | [
{
"role": "user",
"content": "Show all in-game items (name, rarity) that belong to games where the average session score across all sessions for that game is greater than 300."
},
{
"role": "assistant",
"content": "SELECT ii.item_name, ii.rarity FROM gaming_technology.in_game_items AS ii WHERE i... |
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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.... | [
{
"role": "user",
"content": "Which servers are currently 'online' and located in the 'us-west-2' region, and what is the title of the game each server is hosting?"
},
{
"role": "assistant",
"content": "SELECT s.server_id, s.server_name, s.region, g.title AS game_title\nFROM gaming_technology.se... |
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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdic... | [
{
"role": "user",
"content": "List the application ID, citizen ID, assigned employee's full name, and total amount paid for each approved application."
},
{
"role": "assistant",
"content": "SELECT a.application_id,\n a.citizen_id,\n e.first_name || ' ' || e.last_name AS employee_name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.