system stringlengths 2.68k 8.8k | conversations listlengths 4 34 |
|---|---|
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.services ( service_id text PRIMARY KEY, agency_id text, service_n... | [
{
"role": "user",
"content": "How many notifications related to services were sent for each service category in the past 7 days?"
},
{
"role": "assistant",
"content": "SELECT\n s.category,\n COUNT(n.notification_id) AS notification_count\nFROM\n government_services.notifications n\n JOIN 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 hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.tex... | [
{
"role": "user",
"content": "Count reviews with an overall rating of 5 for each property."
},
{
"role": "assistant",
"content": "SELECT property_id, COUNT(*) AS five_star_review_count FROM hospitality_technology.reviews WHERE rating_overall = 5 GROUP BY property_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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number.... | [
{
"role": "user",
"content": "Can you show me the number of lawyers grouped by specialization?"
},
{
"role": "assistant",
"content": "SELECT specialization, COUNT(*) AS lawyer_count FROM lawyers GROUP BY specialization;"
},
{
"role": "user",
"content": "Include only specializations 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 blockchain.nodes ( node_id character varying(64) NOT NULL, ip_address character varyi... | [
{
"role": "user",
"content": "List each port along with the count of distinct IP addresses observed on that port."
},
{
"role": "assistant",
"content": "SELECT port, COUNT(DISTINCT ip_address) AS unique_ip_count FROM blockchain.nodes GROUP BY port;"
},
{
"role": "user",
"content": "O... |
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": "List pairs of distinct locations in the same city that share the same location type. Show both location IDs, names, city, and the shared type."
},
{
"role": "assistant",
"content": "SELECT L1.location_id AS location1_id, L1.name AS location1_name, L2.location_id 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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Which citizens have a contact email ending with '@yahoo.com' and have received at least one notification? Show their first name, last name, and email."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name, c.last_name, c.contact_email\nFROM government_... |
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.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_times... | [
{
"role": "user",
"content": "Calculate the monthly total quantity of fuel consumed and the average cost_per_unit for each fuel_type in 2023."
},
{
"role": "assistant",
"content": "SELECT date_trunc('month', log_timestamp) AS month,\n fuel_type,\n SUM(quantity) AS total_quantity... |
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": "Which cities are listed as primary_address for citizens who have a verified account? Can you show the city names and the number of verified citizens in each city?"
},
{
"role": "assistant",
"content": "SELECT SPLIT_PART(primary_address, ',', 1) AS city, COUNT(*) 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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_ye... | [
{
"role": "user",
"content": "Show the total number of game sessions played on each server that is currently 'online'. Include the server name, region, and the count of sessions."
},
{
"role": "assistant",
"content": "SELECT s.server_name, s.region, COUNT(gs.session_id) AS total_sessions FROM ga... |
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.post_hashtags (
post_hashtag_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Show me all conversation IDs (whether group chat or not) that have at least one hashtag used in posts linked to them."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.conversation_id\nFROM social_media.conversations c\nJOIN social_media.post_hashtags ph ON c... |
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": "Count the number of active services provided by each agency. Return the agency_name and the count of active services for each."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, COUNT(*) AS active_service_count\nFROM government_services.agencies AS a\nJOIN... |
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(), userna... | [
{
"role": "user",
"content": "Please list the top 5 players by number of achievements unlocked since 2023-01-01. Show each player's username and the total count of achievements they unlocked."
},
{
"role": "assistant",
"content": "SELECT p.username, COUNT(*) AS unlock_count\nFROM gaming_technolo... |
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 PRIMARY KEY, name text, type text, addres... | [
{
"role": "user",
"content": "Find all cities that contain at least one location of type 'Depot' and at least one location of type 'Station'."
},
{
"role": "assistant",
"content": "SELECT city FROM transportation.locations WHERE type IN ('Depot', 'Station') GROUP BY city HAVING COUNT(DISTINCT 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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyin... | [
{
"role": "user",
"content": "Show me all contracts deployed on the 'ethereum' network along with their deployer addresses and the count of transactions they've been involved in, sorted by transaction count in descending order."
},
{
"role": "assistant",
"content": "SELECT c.contract_id, c.addre... |
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.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text )
CR... | [
{
"role": "user",
"content": "Get all notifications for posts tagged with hashtag 'H123', showing notification_id and created_at."
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.created_at\nFROM social_media.notifications n\nJOIN social_media.post_hashtags ph\n ON n.target_en... |
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.documents ( document_id character varying(64) NOT NULL, applicati... | [
{
"role": "user",
"content": "List documents uploaded for applications that have received payments. Display the document ID, document type, associated application ID, and the payment amount."
},
{
"role": "assistant",
"content": "SELECT T1.document_id, T1.document_type, T1.application_id, T2.amo... |
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, license_plate text, vin text, make text, m... | [
{
"role": "user",
"content": "For each route type, count the distinct vehicles that have completed trips on those routes. Return type and vehicle_count, sorted by vehicle_count descending."
},
{
"role": "assistant",
"content": "SELECT r.type,\n COUNT(DISTINCT t.vehicle_id) AS vehicle_count... |
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": "Show me all time entries from the last 90 days, including the entry description, hours spent, the name of the case, and the name of the client."
},
{
"role": "assistant",
"content": "SELECT T1.description, T1.hours_spent, T2.case_name, T3.first_name, T3.last_name 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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name tex... | [
{
"role": "user",
"content": "List the first and last names of all drivers with status 'Active' along with the route number and type of all Express routes."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, r.route_number, r.type\nFROM transportation.drivers d\nCROSS JOIN 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 hospitality_technology.rooms ( room_id text, property_id text, room_number text, room... | [
{
"role": "user",
"content": "Calculate the total price for all service orders, grouped by their status."
},
{
"role": "assistant",
"content": "SELECT status, SUM(total_price) AS total_revenue FROM hospitality_technology.service_orders GROUP BY status;"
},
{
"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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_id... | [
{
"role": "user",
"content": "What is the total revenue (sum of total_amount) and total amount_paid for each booking_source?"
},
{
"role": "assistant",
"content": "SELECT booking_source,\n SUM(total_amount) AS total_revenue,\n SUM(amount_paid) AS total_paid\nFROM reservations\nGROUP ... |
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.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, as... | [
{
"role": "user",
"content": "Show me the total count and sum of amounts for spent and unspent UTXOs for each asset, including the asset name and symbol."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name AS asset_name, a.symbol, u.spent, COUNT(*) AS utxo_count, SUM(u.amount) AS to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE 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 legal_services.cases (
case_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "List all documents which have a version greater than 2, along with the case number and name."
},
{
"role": "assistant",
"content": "SELECT d.document_id, d.document_name, d.version, c.case_number, c.case_name\nFROM legal_services.documents d\nJOIN legal_services.cas... |
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.messages ( message_id text PRIMARY KEY, conversation_id text, sender_use... | [
{
"role": "user",
"content": "Show all messages that include a media attachment, along with the sender's user ID and the conversation ID."
},
{
"role": "assistant",
"content": "SELECT message_id, sender_user_id, conversation_id, media_url, media_type, sent_at FROM social_media.messages WHERE med... |
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, address character varyin... | [
{
"role": "user",
"content": "For each user, count the number of distinct smart contracts they have called. Return user_id, username, and contract_count, ordered by contract_count descending."
},
{
"role": "assistant",
"content": "SELECT u.user_id,\n u.username,\n COUNT(DISTINCT tx.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 gaming_technology.player_achievements (
player_achievement_id uuid NOT NULL DEFAU... | [
{
"role": "user",
"content": "Calculate for each player the timespan between their earliest and latest achievement unlocks."
},
{
"role": "assistant",
"content": "SELECT pa_min.player_id,\n pa_max.max_time - pa_min.min_time AS span\nFROM (\n SELECT player_id,\n MIN(unlocked_at) 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.likes ( like_id text PRIMARY KEY, user_id text, post_id text, comment_id... | [
{
"role": "user",
"content": "Show me all users who have liked both a post and a comment. Please include their user IDs, the post IDs, and the comment IDs."
},
{
"role": "assistant",
"content": "SELECT DISTINCT l1.user_id, l1.post_id, l2.comment_id\nFROM social_media.likes l1\nJOIN social_media.... |
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 healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id... | [
{
"role": "user",
"content": "For each patient, find the next appointment after each one. Return patient_id, appointment_id, next_appointment_id, and the waiting time in minutes between them."
},
{
"role": "assistant",
"content": "SELECT A.patient_id,\n A.appointment_id AS current_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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_id... | [
{
"role": "user",
"content": "Find all pairs of overlapping reservations for the same room. Show the two reservation IDs, room_id, and both reservations' check-in and check-out dates."
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id AS reservation1_id, r2.reservation_id AS reserva... |
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.achievements (
achievement_id uuid NOT NULL DEFAULT gen_random_... | [
{
"role": "user",
"content": "Show me the count of achievements that are hidden versus those that are not hidden."
},
{
"role": "assistant",
"content": "SELECT hidden, COUNT(*) FROM achievements GROUP BY hidden;"
},
{
"role": "user",
"content": "Include the average points for each gr... |
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.services (
service_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Find the names of service locations where services categorized as 'Licensing' have had appointments scheduled."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.location_name FROM service_locations AS T1 JOIN appointments AS T2 ON T1.location_id = T2.locatio... |
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.payments ( payment_id text PRIMARY KEY, reservation_id text, g... | [
{
"role": "user",
"content": "Find the total amount of payments and the number of payments for each status."
},
{
"role": "assistant",
"content": "SELECT status, SUM(amount) AS total_amount, COUNT(*) AS payment_count\nFROM hospitality_technology.payments\nGROUP BY status;"
},
{
"role": "... |
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.documents ( document_id character varying(64) NOT NULL, applicati... | [
{
"role": "user",
"content": "List application IDs that have both documents and payments associated with them."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.application_id FROM documents AS T1 JOIN payments AS T2 ON T1.application_id = T2.application_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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyin... | [
{
"role": "user",
"content": "Show each token's symbol, token_name, and the deployer_address and status of the contract where that token was created."
},
{
"role": "assistant",
"content": "SELECT t.token_symbol,\n t.token_name,\n c.deployer_address,\n c.status\nFROM web3.tokens... |
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": "What is the average commission rate for agents whose status is 'Terminated'?"
},
{
"role": "assistant",
"content": "SELECT AVG(commission_rate) FROM insurance.agents WHERE status = 'Terminated' AND commission_rate IS NOT NULL;"
},
{
"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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name tex... | [
{
"role": "user",
"content": "Retrieve the driver_id, first_name, and last_name for all drivers whose license_expiry_date falls within the next 6 months from today."
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name\nFROM transportation.drivers\nWHERE license_expiry_d... |
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.law_firms ( firm_id character varying(64) NOT NULL, firm_name characte... | [
{
"role": "user",
"content": "Find all law firms that share the same address, listing each address and the two firm names."
},
{
"role": "assistant",
"content": "SELECT f1.address, f1.firm_name AS firm1, f2.firm_name AS firm2 FROM law_firms f1 JOIN law_firms f2 ON f1.address = f2.address AND f1.... |
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": "Could you list the route number and the name of the destination location for routes that start at a location of type 'Depot'?"
},
{
"role": "assistant",
"content": "SELECT T1.route_number , T2.name FROM transportation.routes AS T1 JOIN transportation.locations 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth... | [
{
"role": "user",
"content": "List each insurance provider with the count of primary active policies (is_primary = TRUE and expiration_date IS NULL or expiration_date > CURRENT_DATE). Return the provider and the count."
},
{
"role": "assistant",
"content": "SELECT ip.insurance_provider, COUNT(*)... |
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.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_ty... | [
{
"role": "user",
"content": "I want to see pairs of items from the same game that share the same rarity but are of different types. Show each pair's names and types."
},
{
"role": "assistant",
"content": "SELECT a.game_id,\n a.item_name AS item1_name,\n a.item_type AS item1_type,\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.doctors ( doctor_id text, first_name text, last_name text, specialty text,... | [
{
"role": "user",
"content": "Find all prescriptions for patients who have at least one appointment scheduled in the future. Show the prescription ID, patient ID, medication name, and the earliest future appointment time for that patient."
},
{
"role": "assistant",
"content": "SELECT pr.prescrip... |
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, address character varyin... | [
{
"role": "user",
"content": "Find all contracts deployed by users who have also conducted transactions with a value greater than 1 ETH (where 1 ETH = 1e18 wei)."
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.contract_id, c.address, c.deployer_address FROM web3.contracts c JOIN web3.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 legal_services.law_firms (
firm_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all law firms that share the same address with another firm, showing both firm names and the address."
},
{
"role": "assistant",
"content": "SELECT f1.firm_name AS firm_a, f2.firm_name AS firm_b, f1.address\nFROM law_firms f1\nJOIN law_firms f2\n ON f1.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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, m... | [
{
"role": "user",
"content": "Which vehicles have had fueling events at locations of type 'Station'? For each vehicle, list the vehicle_id, license_plate, and the name and city of the fueling station."
},
{
"role": "assistant",
"content": "SELECT DISTINCT v.vehicle_id, v.license_plate, l.name 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 government_services.services (
service_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "List the service name, category, and standard fee for all services offered by agencies that have at least one accessible service location in the state of 'California'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.service_name, T1.category, T1.standard_f... |
You are an 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.nodes (
node_id character varying(64) NOT NULL, -- unique identifier ... | [
{
"role": "user",
"content": "Find pairs of distinct nodes that share the same 'last_seen' timestamp but have different port numbers. Show the node IDs, ports, and the shared timestamp for each pair."
},
{
"role": "assistant",
"content": "SELECT T1.node_id AS node1_id , T1.port AS node1_port , ... |
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 smart_money_token_inflow ( token_address text, token_symbol text, token_amount numeri... | [
{
"role": "user",
"content": "Which chain has the highest total USD inflow from buy transactions (type=1), and how many distinct tokens were involved in that inflow?"
},
{
"role": "assistant",
"content": "SELECT chain, SUM(usd_value) AS total_inflow, COUNT(DISTINCT token_symbol) AS distinct_toke... |
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.users (
user_id character varying(64) NOT NULL, -- unique ident... | [
{
"role": "user",
"content": "List all users whose usernames start with the letter 'B'."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, created_at FROM trading_platform.users WHERE username LIKE 'B%';"
},
{
"role": "user",
"content": "Can you make it case-inse... |
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 pairs of drivers who share the same hire_date, showing both driver IDs and the hire_date."
},
{
"role": "assistant",
"content": "SELECT d1.driver_id AS driver1_id,\n d2.driver_id AS driver2_id,\n d1.hire_date\nFROM transportation.drivers d1\nJOIN 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 hospitality_technology.room_types ( room_type_id text, property_id text, type_name te... | [
{
"role": "user",
"content": "Show me all available services with a unit of 'Per Hour'."
},
{
"role": "assistant",
"content": "SELECT service_name , description , price FROM hospitality_technology.services WHERE is_available = true AND unit = 'Per Hour'"
},
{
"role": "user",
"c... |
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.posts ( post_id character varying(64) NOT NULL, user_id character varyin... | [
{
"role": "user",
"content": "List all hashtags that have been used on posts created in the last 90 days. Show the tag_name and the date it was first used on a post within this period."
},
{
"role": "assistant",
"content": "SELECT h.tag_name, MIN(p.created_at) AS first_use_date_in_period FROM so... |
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": "Which users have received both a comment notification and a like notification? List the recipient_user_id and the total number of such users."
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT recipient_user_id) AS user_count\nFROM (\n SELECT recipient_us... |
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.text, contract_id.text, event_name.text, data.text, emitted_at... | [
{
"role": "user",
"content": "Find token transfers that correspond directly to an event log (same transaction and log index). List the transfer ID, value, and the event name."
},
{
"role": "assistant",
"content": "SELECT T1.transfer_id, T1.value, T2.event_name FROM web3.token_transfers AS T1 JOI... |
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, property_id.text, guest_id... | [
{
"role": "user",
"content": "List properties where actual check-in occurred later than the scheduled check-in date. Show the property ID and the count of such reservations."
},
{
"role": "assistant",
"content": "SELECT property_id, COUNT(*) FROM reservations WHERE actual_check_in_ts > check_in_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE social_media.post_hashtags ( post_hashtag_id.text, post_id.text, hashtag_id.text )
... | [
{
"role": "user",
"content": "Find all hashtag IDs that have been used on the same posts as hashtag 'h1'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT ph2.hashtag_id FROM social_media.post_hashtags ph1 JOIN social_media.post_hashtags ph2 ON ph1.post_id = ph2.post_id WHERE ph1.hashtag_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 social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyin... | [
{
"role": "user",
"content": "List all notifications of type 'like' where the target_entity_type is 'post'. For each notification, return notification_id, sender_user_id, target_entity_id (as post_id), and the notification creation time."
},
{
"role": "assistant",
"content": "SELECT notification... |
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, first_name character... | [
{
"role": "user",
"content": "Show the names of all insurance plans and the number of patients enrolled in each plan."
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, COUNT(pi.patient_id) AS enrolled_patients FROM healthcare.insurance_plans ip JOIN healthcare.patient_insurance pi ON 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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate ch... | [
{
"role": "user",
"content": "Show me the make and model of vehicles along with the route number and description for routes where the vehicle's capacity is 60 or less."
},
{
"role": "assistant",
"content": "SELECT v.make, v.model, r.route_number, r.description\nFROM transportation.vehicles v\nJO... |
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 text PRIMARY KEY, case_id text, lawyer_id text... | [
{
"role": "user",
"content": "Show the invoice_id and total hours logged for each invoice."
},
{
"role": "assistant",
"content": "SELECT invoice_id, SUM(hours_spent) AS total_hours FROM legal_services.time_entries WHERE invoice_id IS NOT NULL GROUP BY invoice_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 social_media.conversation_participants (
participant_id character varying(64) NOT... | [
{
"role": "user",
"content": "List each participant_id along with the total number of participants in their conversation, and include user_id and conversation_id."
},
{
"role": "assistant",
"content": "SELECT cp.participant_id, cp.user_id, cp.conversation_id, counts.participant_count\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 transportation.routes ( route_id text, route_number text, description text, origin_lo... | [
{
"role": "user",
"content": "Show me all pairs of routes where both routes have the same origin_location_id but different destination_location_id values. For each pair, display the first route's route_number, the second route's route_number, and their origin_location_id."
},
{
"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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_ha... | [
{
"role": "user",
"content": "List all posts that contain a non-empty media_url and show the usernames of their authors."
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.media_url, u.username\nFROM social_media.posts p\nJOIN social_media.users u ON p.user_id = u.user_id\nWHERE p.media_... |
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 the vehicle_id, make, model, and the next_service_due_date for each vehicle based on the most recent maintenance log."
},
{
"role": "assistant",
"content": "SELECT DISTINCT ON (ml.vehicle_id) v.vehicle_id, v.make, v.model, ml.next_service_due_date FROM tran... |
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, first_name character... | [
{
"role": "user",
"content": "Count how many doctors have an email address ending with '.com'."
},
{
"role": "assistant",
"content": "SELECT count(*) FROM healthcare.doctors WHERE email LIKE '%.com';"
},
{
"role": "user",
"content": "I want to find all notifications for messages 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 web3.transactions (
transaction_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show the average gas_price for each transaction status."
},
{
"role": "assistant",
"content": "SELECT status, AVG(gas_price) AS avg_gas_price\nFROM web3.transactions\nGROUP BY status;"
},
{
"role": "user",
"content": "Actually, can you also include the 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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docume... | [
{
"role": "user",
"content": "For each document_name in each case, retrieve the latest version number and its document_id."
},
{
"role": "assistant",
"content": "SELECT case_id,\n document_name,\n MAX(version) AS latest_version\nFROM legal_services.documents\nGROUP BY case_id, docume... |
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.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incid... | [
{
"role": "user",
"content": "Show me all insurance products along with the number of distinct agents whose handled claims are for policies using that product. Include product_id, product_name, and agent_count."
},
{
"role": "assistant",
"content": "SELECT ip.product_id, ip.product_name, COUNT(D... |
You are an 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": "Retrieve the most recent log entry for each user, including action and logged_at."
},
{
"role": "assistant",
"content": "SELECT l1.user_id,\n l1.action,\n l1.logged_at\nFROM trading_platform.logs l1\nWHERE l1.logged_at = (\n SELECT MAX(l2.logged_at)\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 transportation.routes ( route_id text PRIMARY KEY, route_number text, description tex... | [
{
"role": "user",
"content": "For each city, show how many trips have started there (origin), how many have ended there (destination), and the total number of unique vehicles used in trips that started in that city."
},
{
"role": "assistant",
"content": "SELECT l.city,\n COUNT(CASE WHEN 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 hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id tex... | [
{
"role": "user",
"content": "Get the total_quantity and total_revenue (sum of total_price) for each staff member who placed orders (staff_id_ordered)."
},
{
"role": "assistant",
"content": "SELECT staff_id_ordered,\n SUM(quantity) AS total_quantity,\n SUM(total_price) AS total_reven... |
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, agency_name text, jurisdiction_level t... | [
{
"role": "user",
"content": "List all employees with the job title 'Analyst'. Show their first name, last name, and department."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, department\nFROM government_services.employees\nWHERE job_title = 'Analyst';"
},
{
"role":... |
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.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name tex... | [
{
"role": "user",
"content": "Show me pairs of servers in the same region hosting different games where one has at least 100 more current players than the other."
},
{
"role": "assistant",
"content": "SELECT s1.server_id AS server1_id,\n s1.server_name AS server1_name,\n s1.region,\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 transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id charac... | [
{
"role": "user",
"content": "For each booking, show the booking_id, seat_number, fare, and the city of the origin location for the trip that was booked."
},
{
"role": "assistant",
"content": "SELECT b.booking_id, b.seat_number, b.fare, orig.city AS origin_city\nFROM transportation.bookings b\nJ... |
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 legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case_... | [
{
"role": "user",
"content": "Show me all invoices for case_id 'case_777', including the invoice number, total amount, and status."
},
{
"role": "assistant",
"content": "SELECT invoice_number, total_amount, status FROM legal_services.invoices WHERE case_id = 'case_777';"
},
{
"role": "us... |
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.documents (
document_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "List document names and versions for documents that share the same case_id, showing each pair of versions."
},
{
"role": "assistant",
"content": "SELECT d1.case_id, d1.document_name AS doc_name_v1, d1.version AS version1, d2.document_name AS doc_name_v2, d2.version ... |
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 character varying(64) NOT NULL, -- unique ident... | [
{
"role": "user",
"content": "What is the average estimated_duration_minutes for each route type?"
},
{
"role": "assistant",
"content": "SELECT type, AVG(estimated_duration_minutes) AS avg_duration FROM transportation.routes GROUP BY type;"
},
{
"role": "user",
"content": "Exclude 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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_n... | [
{
"role": "user",
"content": "Could you list pairs of services that belong to different agencies but share the same category? Provide the service names and their agency_ids."
},
{
"role": "assistant",
"content": "SELECT s1.service_name AS service_name_1, s1.agency_id AS agency_id_1, s2.service_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 web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "For each user with at least two wallets, calculate the average time difference in hours between consecutive wallet creations. Return user_id and avg_diff_hours."
},
{
"role": "assistant",
"content": "SELECT user_id, AVG(EXTRACT(EPOCH FROM (created_at - prev_created)... |
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.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "For each fuel_type, can you calculate the total total_cost and the average total_cost from the fuel_logs table?"
},
{
"role": "assistant",
"content": "SELECT fuel_type,\n SUM(total_cost) AS total_cost_sum,\n AVG(total_cost) AS average_cost\nFROM transpor... |
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, first_name text, last_name text, company_nam... | [
{
"role": "user",
"content": "List all appointments along with their subject and start time for lawyers specializing in 'Criminal Law'."
},
{
"role": "assistant",
"content": "SELECT T1.subject, T1.start_time FROM legal_services.appointments AS T1 JOIN legal_services.lawyers AS T2 ON T1.lawyer_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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ... | [
{
"role": "user",
"content": "Find the total payment amount and payment count made by citizen with national ID number 'A123456789'."
},
{
"role": "assistant",
"content": "SELECT SUM(p.amount) AS total_amount, COUNT(p.payment_id) AS payment_count\nFROM government_services.citizens c\nJOIN governm... |
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 text, property_id text, room_number text, room... | [
{
"role": "user",
"content": "Show me the count of rooms by status."
},
{
"role": "assistant",
"content": "SELECT status,\n COUNT(*) AS room_count\nFROM hospitality_technology.rooms\nGROUP BY status;"
},
{
"role": "user",
"content": "Actually, I need that breakdown by 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": "Which claims have at least one document uploaded by an agent located in 'NY'? Show the claim_id, document_type, file_name, uploaded_by, and the agent's first and last name."
},
{
"role": "assistant",
"content": "SELECT cd.claim_id, cd.document_type, cd.file_name, cd... |
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 gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name tex... | [
{
"role": "user",
"content": "I need to find every offline server alongside an online server in the same region."
},
{
"role": "assistant",
"content": "SELECT s_off.server_id AS offline_id,\n s_on.server_id AS online_id\nFROM gaming_technology.servers s_off\nJOIN gaming_technology.servers ... |
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": "How many applications are currently in 'Processing' status? Return the total count."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS processing_applications_count\nFROM government_services.applications\nWHERE status = 'Processing';"
},
{
"role": "us... |
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 PRIMARY KEY, property_name text,... | [
{
"role": "user",
"content": "List all guests who have a loyalty_member_id, showing their guest_id, first_name, last_name, and loyalty_member_id."
},
{
"role": "assistant",
"content": "SELECT guest_id,\n first_name,\n last_name,\n loyalty_member_id\nFROM hospitality_technology.... |
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.documents (
document_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "Show me document names and upload timestamps for documents linked to cases that were opened after January 1, 2023."
},
{
"role": "assistant",
"content": "SELECT T1.document_name, T1.upload_timestamp FROM documents AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id WH... |
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.bookings ( booking_id text, passenger_id text, trip_id text, seat_numb... | [
{
"role": "user",
"content": "List each booking with its previous booking time for the same passenger."
},
{
"role": "assistant",
"content": "SELECT b.booking_id,\n b.passenger_id,\n b.booking_time,\n LAG(b.booking_time) OVER (PARTITION BY b.passenger_id ORDER BY b.booking_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, ... | [
{
"role": "user",
"content": "Show the full name and email of each driver and the number of vehicles currently assigned to their depot."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, d.email, COUNT(v.vehicle_id) AS vehicles_at_depot\nFROM transportation.drivers d\nJOIN ... |
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.transactions ( transaction_id text, account_id text, related_accou... | [
{
"role": "user",
"content": "Show the total number of transactions for each currency."
},
{
"role": "assistant",
"content": "SELECT currency, COUNT(*) FROM financial_services.transactions GROUP BY currency"
},
{
"role": "user",
"content": "Can you also include the total amount for e... |
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 all public reviews from the past 30 days with the property name and overall rating."
},
{
"role": "assistant",
"content": "SELECT r.review_id, p.property_name, r.rating_overall, r.review_date\nFROM hospitality_technology.reviews AS r\nJOIN hospitality_technolog... |
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": "How many trips used more than 500 units of fuel, and what are their trip IDs and scheduled departure times?"
},
{
"role": "assistant",
"content": "SELECT t.trip_id, t.scheduled_departure, SUM(f.quantity) AS total_fuel\nFROM transportation.trips t\nJOIN 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, 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": "List all address IDs and their correspond... |
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 all posts along with the user emails of the authors."
},
{
"role": "assistant",
"content": "SELECT p.post_id, p.content, u.email\nFROM social_media.posts p\nJOIN social_media.users u ON p.user_id = u.user_id;"
},
{
"role": "user",
"content": "Show 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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, addres... | [
{
"role": "user",
"content": "List all locations situated within the state of California."
},
{
"role": "assistant",
"content": "SELECT location_id, name, city, state_province FROM transportation.locations WHERE state_province = 'CA';"
},
{
"role": "user",
"content": "Now, refine thi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.