system stringlengths 315 8.44k | conversations listlengths 2 8 |
|---|---|
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 identifi... | [
{
"role": "user",
"content": "For each wallet, list its address, the user_id, and the total value of all token transfers sent from that wallet, along with the contract address of the token.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w.wallet_id, w.address, w.user_id, SUM(tt.v... |
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 characte... | [
{
"role": "user",
"content": "List all patients who have been prescribed medications manufactured by 'AstraZeneca', showing patient ID, first and last name, medication name, and manufacturer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.patient_id, p.first_name, p.la... |
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, fu... | [
{
"role": "user",
"content": "List the usernames of users who are following user 'U500', and also show their theme setting.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, T3.theme FROM social_media.users AS T1 JOIN social_media.follows AS T2 ON T1.user_id = T2.follow... |
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": "Retrieve the top 5 players by the number of distinct achievements unlocked. Show player_id and distinct_unlocks.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id, COUNT(DISTINCT pa.achievement_id) AS distinct_unlocks\nFROM gaming_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 healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text... | [
{
"role": "user",
"content": "Retrieve prescription_id, medication_name, and insurance plan_name for all prescriptions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.prescription_id,\n m.medication_name,\n ip.plan_name\nFROM healthcare.prescriptions p\nJOIN healthc... |
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.employees ( employee_id text, first_name text, last_name text, jo... | [
{
"role": "user",
"content": "Could you list each employee along with their manager’s full name?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.employee_id, e.first_name || ' ' || e.last_name AS employee_name, m.first_name || ' ' || m.last_name AS manager_name\nFROM financial_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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "List each agency's name and primary contact email along with the total number of notifications related to that agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agency_name, a.primary_contact_email, COUNT(n.notification_id) AS notification_cou... |
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, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "For each employee, could you show their full name alongside the sector and security name of any securities issued by a company with the same name as the employee's department?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.employee_id, e.first_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 legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w... | [
{
"role": "user",
"content": "Show me the names and phone numbers of all law firms founded in the same city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lf1.firm_name AS firm1_name, lf1.phone AS firm1_phone, lf2.firm_name AS firm2_name, lf2.phone AS firm2_phone, lf1.address \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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "I want to find the number of orders each user has placed along with their username and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, u.email, COUNT(o.order_id) AS order_count\nFROM trading_platform.users u\nLEFT JOIN 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List the plan_id, plan_name, and plan_type for all insurance plans where the insurance_provider is 'Humana'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n plan_id,\n plan_name,\n plan_type\nFROM healthcare.insurance_plans\nWHERE\n insurance_pr... |
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, addre... | [
{
"role": "user",
"content": "List the name, city, state, and country for all locations with a latitude greater than 40 and a longitude less than -70.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, city, state_province, country FROM transportation.locations WHERE latitude >... |
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, prop... | [
{
"role": "user",
"content": "List all services along with the count of service orders for each service and the corresponding property name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_id, s.service_name, p.property_name, COUNT(so.order_id) AS order_count\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
CREATE TABLE gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr... | [
{
"role": "user",
"content": "Retrieve pairs of visible achievements from the same game along with their point difference.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.achievement_id AS ach1_id,\n b.achievement_id AS ach2_id,\n a.name AS ach1_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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Show the average maintenance cost for vehicles of each make, including only vehicles that have had at least one maintenance log.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.make, AVG(ml.cost) AS average_maintenance_cost FROM transportation.vehic... |
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.games ( game_id uuid, title text, developer_id uuid, publisher_id ... | [
{
"role": "user",
"content": "List all in-game items with their name, type, and rarity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_name, item_type, rarity FROM gaming_technology.in_game_items;",
"sql": null
},
{
"role": "user",
"content": "Filter this lis... |
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 PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "List the first name, last name, and city for all customers who live in the state 'NY'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, city FROM insurance.customers WHERE state = 'NY';",
"sql": 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 legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id tex... | [
{
"role": "user",
"content": "List all time entries that do not have a description, including the entry ID, date worked, hours spent, and the first and last name of the lawyer who recorded the entry.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT te.entry_id, te.date_worked, te.h... |
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, passwo... | [
{
"role": "user",
"content": "For each user, show their user_id, username, and the total number of trades they have participated in, counting both as buyer and as seller.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n u.user_id,\n u.username,\n COALESCE(b.buy_count, 0) + COA... |
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 te... | [
{
"role": "user",
"content": "Show me the top 5 guests who have submitted the most reviews. Include guest_id and review_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY guest_id\nORDER BY revie... |
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 character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List the names of all open cases, the name of the client for each case, and the name of the lead lawyer, but only for cases where the lead lawyer specializes in 'Family Law'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.case_name , T2.first_nam... |
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 te... | [
{
"role": "user",
"content": "Show each passenger's name and the total number of trips they have booked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, COUNT(b.booking_id) AS trip_count\nFROM transportation.passengers p\nJOIN transportation.bookings b 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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "Find all pairs of developers who share the exact same founded_year but are from different countries. Show both developer names, their countries, and the founded_year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.name AS developer1_name, d1.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.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Show me a list of appointments, including their subject and start time, along with the case number for the related case.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.subject, T1.start_time, T2.case_number FROM appointments AS T1 JOIN cases AS T2... |
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 PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Can you give me a count of players for each player status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(player_id) FROM gaming_technology.players GROUP BY status;",
"sql": null
},
{
"role": "user",
"content": "Now, onl... |
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 ... | [
{
"role": "user",
"content": "Show each user's username along with their total traded value as buyers and their total traded value as sellers for trades executed in June 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username,\n COALESCE(buy_tot.buy_value, 0) AS buy... |
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.text, address.text, abi.text, bytecode.text, deployer_a... | [
{
"role": "user",
"content": "Find the usernames of users who have deployed contracts and list the address of the contract they deployed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, T3.address FROM web3.users AS T1 JOIN web3.wallets AS T2 ON T1.user_id = T2.user_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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi... | [
{
"role": "user",
"content": "Show the agency names and the number of active services they currently offer. List only those agencies with more than 2 active services.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agency_name, COUNT(s.service_id) AS active_service_count\nFROM 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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number contain... | [
{
"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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.symbol, t.name, p.price FROM sui_coins_metadata t JOIN token_prices_latest p... |
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": "List each client_id, first_name, last_name, and the sum of total_amount for all of their invoices.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.client_id,\n c.first_name,\n c.last_name,\n SUM(i.total_amount) AS total_invoiced\nF... |
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 properties together with the floor numbers and room numbers of their rooms located in cities with a star rating greater than 4.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_id, p.property_name, p.city, p.star_rating, r.floor, r.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Show all users along with the number of different assets they have traded as buyers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COUNT(DISTINCT t.asset_id) AS assets_traded\nFROM trading_platform.users u\nLEFT JOIN trading_p... |
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.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Give me a count of employees hired in each department for employees currently active or terminated.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, status, COUNT(employee_id) AS employee_count FROM financial_services.employees WHERE status... |
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 na... | [
{
"role": "user",
"content": "Show me the top 3 narratives by 24-hour trading volume, along with their 1-hour and 24-hour price change percentages.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, volume_24h, price_change_percentage_1h, price_change_percentage_24h FROM 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 text, property_name text, address_li... | [
{
"role": "user",
"content": "Show the property name, star rating, and number of rooms for each property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, p.star_rating, COUNT(r.room_id) AS room_count\nFROM hospitality_technology.properties p\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 financial_services.accounts ( account_id character varying(64) NOT NULL, customer_id... | [
{
"role": "user",
"content": "For each account type and status, can you show the total number of accounts and their combined balance per currency?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_type, status, currency, COUNT(*) AS total_accounts, SUM(balance) AS total_bala... |
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 varch... | [
{
"role": "user",
"content": "List all NFTs on the blockchain with contract type 'ERC1155' and show their contract address, token id, and total number held by all wallets.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, token_id, SUM(CAST(amount AS INTEGER)) 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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "Show me all player usernames and their country code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, country_code FROM gaming_technology.players;",
"sql": null
},
{
"role": "user",
"content": "Now, only include players whose ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var... | [
{
"role": "user",
"content": "For the 'DeFi' narrative, what is the average price, average market cap, and average 24-hour trading volume of its tokens?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT AVG(price) AS avg_price, AVG(market_cap) AS avg_market_cap, AVG(CAST(total_volum... |
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.insurance_products ( product_id character varying(64) NOT NULL, product_na... | [
{
"role": "user",
"content": "Show me the total premium paid by each customer for insurance products where the base premium is less than 2000. I want to see customer_id, product_id, and total_premium_paid.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pp.customer_id, ip.product_... |
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 ... | [
{
"role": "user",
"content": "List all completed trips, including each trip's scheduled and actual arrival times, along with the make and model of the assigned vehicle.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.trip_id, t.scheduled_arrival, t.actual_arrival, v.make, v.mode... |
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 character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "I want to see a list of invoice_number and appointment_id for each invoice that has a scheduled appointment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.invoice_number,\n a.appointment_id\nFROM legal_services.invoices i\nJOIN legal_service... |
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, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "List all securities along with their latest close price and volume from the market data.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.security_id, s.security_name, m.close_price, m.volume\nFROM financial_services.market_data m\nJOIN (\n SELECT 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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi... | [
{
"role": "user",
"content": "List the application IDs and statuses for applications assigned to employees in the 'Customer Service' department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.application_id, a.status\nFROM government_services.applications a\nJOIN government_ser... |
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_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "Which are the top 5 smart money addresses with the highest ROI on the BSC chain, and what are their profit, realized ratio, and most profitable token?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, profit, roi, realized_ratio, most_profit_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 financial_services.transactions ( transaction_id.text, account_id.text, related_acco... | [
{
"role": "user",
"content": "For each day in the past month, can you show the combined total transaction amount and the total volume traded from market data?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.effective_date, SUM(t.amount) AS total_transaction_amount, SUM(md.volume... |
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.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id ... | [
{
"role": "user",
"content": "Show me all maintenance logs that do not have a next service due date recorded. List the log ID, vehicle ID, and service date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT log_id, vehicle_id, service_date FROM transportation.maintenance_logs WHERE ... |
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.premium_payments (
payment_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "I need the total amount and count of payments for each policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id,\n COUNT(*) AS payment_count,\n SUM(amount_paid) AS total_paid\nFROM insurance.premium_payments\nGROUP BY policy_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 web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "List all transactions along with the user ID and username of the sender, if available. Show transaction id, from_address, user id, and username.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tx.transaction_id, tx.from_address, w.user_id, u.username\... |
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 contain... | [
{
"role": "user",
"content": "For each Bitcoin token tick, show me the creator address from the token_info_bitcoin table and the number of unique wallets currently holding that token.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ti.tick, ti.creator, COUNT(DISTINCT tb.wallet_add... |
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, docum... | [
{
"role": "user",
"content": "List all documents uploaded in July 2024, including their document_name, document_type, and upload_timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name, document_type, upload_timestamp FROM legal_services.documents WHERE upload_tim... |
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 iden... | [
{
"role": "user",
"content": "How many active insurance policies does each patient have? Return patient_id and active_policy_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id,\n COUNT(*) AS active_policy_count\nFROM healthcare.patient_insurance\nWHERE expirat... |
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 ... | [
{
"role": "user",
"content": "Show the names and URLs of all DApps along with the name and symbol of any asset associated to them via a metadata entry where the metadata key starts with 'link'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name AS dapp_name, d.url AS dapp_url,... |
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 c... | [
{
"role": "user",
"content": "List all routes along with the number of unique vehicles assigned to trips on each route.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_id, r.route_number, COUNT(DISTINCT t.vehicle_id) AS unique_vehicles\nFROM transportation.routes r\nLEFT J... |
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 full names of citizens who have made payments for services that are currently inactive. Also show the service name and payment amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name || ' ' || c.last_name AS full_name, s.service_... |
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, -- uni... | [
{
"role": "user",
"content": "How many total appointments have been recorded?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT count(*) FROM appointments;",
"sql": null
},
{
"role": "user",
"content": "What is the count of appointments that have the status 'Complete... |
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": "Show me all staff members who are currently active, along with their property name and position.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name \nFROM hospitality_technology.staff 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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "Show a count of drivers per status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS driver_count\nFROM transportation.drivers\nGROUP BY status;",
"sql": null
},
{
"role": "user",
"content": "Can you also list the ea... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text, user_id text, address text, private_key text, created... | [
{
"role": "user",
"content": "List all wallet addresses that have the same private key as another wallet, showing the wallet_id, address, and the shared private_key.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id, w1.address, w1.private_key\nFROM web3.wallets w1\nJOI... |
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": "I need to find all pairs of medications that share the same manufacturer. For each pair, show the first medication's ID and name, the second medication's ID and name, and the manufacturer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m1.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 social_media.follows ( follow_id.text, follower_user_id.text, following_user_id.text... | [
{
"role": "user",
"content": "Show me all users who started following someone in May 2024, along with both the user ID of the follower and the followed user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT follower_user_id, following_user_id\nFROM social_media.follows\nWHERE creat... |
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 te... | [
{
"role": "user",
"content": "Show me each staff member by response_staff_id and the number of unique guests whose reviews they have responded to.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT response_staff_id, COUNT(DISTINCT guest_id) AS unique_guest_count\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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "List all drivers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name FROM transportation.drivers;",
"sql": null
},
{
"role": "user",
"content": "Can you also include their hire date and status?",
"sql"... |
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_li... | [
{
"role": "user",
"content": "For each property, list the property name, the number of room types it offers, and the average area in square feet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name,\n COUNT(rt.room_type_id) AS room_type_count,\n ROUND(AVG(r... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List each lawyer's full name with the full name of the partner at the same firm.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.lawyer_id,\n CONCAT(l.first_name, ' ', l.last_name) AS lawyer_name,\n CONCAT(p.first_name, ' ', p.last_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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "List narratives that have a 24-hour trading volume exceeding $50,000,000 and include at least 100 distinct tokens. Show the narrative name, volume, and token count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, volume_24h, token_num FROM ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "I want to get the number of servers and the average current players for each game, including the game title.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title,\n COUNT(s.server_id) AS server_count,\n AVG(s.current_players) AS avg_cur... |
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, ... | [
{
"role": "user",
"content": "List all pairs of vehicles from the same depot that have different fuel types. Include vehicle1_id, fuel_type1, vehicle2_id, fuel_type2, and the depot_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v1.vehicle_id AS vehicle1_id, v1.fuel_type AS fu... |
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 NOT NULL DEFAULT gen_random_uuid(), g... | [
{
"role": "user",
"content": "Can you list all item names along with their type, rarity, and cost amount for every item in the database?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_name, item_type, rarity, cost_amount FROM gaming_technology.in_game_items;",
"sql": nul... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created... | [
{
"role": "user",
"content": "Find the address and creation date of all wallets whose private keys start with '0xabc'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, created_at FROM web3.wallets WHERE private_key LIKE '0xabc%';",
"sql": null
},
{
"role": "use... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... | [
{
"role": "user",
"content": "特定の組み立てラインに関連するすべての手順を取得したいです。ラインIDと手順名、手順番号、必要なスキルレベルを含めてください。",
"sql": null
},
{
"role": "assistant",
"content": "db.assembly_steps.find(\n { line_id: '<specific_line_id>' },\n { step_id: 1, line_id: 1, step_number: 1, step_name: 1, required_skill_level:... |
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 ... | [
{
"role": "user",
"content": "For each driver, show the driver's full name and the total number of trips they have driven. Only include drivers whose status is 'Active' and sort the result by trip count in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.driver_... |
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.appointments ( appointment_id character varying(64) NOT NULL, client_... | [
{
"role": "user",
"content": "How many appointments have a status of 'Cancelled'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM legal_services.appointments WHERE status = 'Cancelled';",
"sql": 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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "List all NFT holdings from the `nft_holders` table where the `contract_type` is 'ERC721'. Show the wallet address, contract address, token ID, and amount held.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT wallet_address, contract_address, token_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 transportation.routes ( route_id character varying(64) NOT NULL, route_number charac... | [
{
"role": "user",
"content": "I need a report showing each passenger's total number of bookings and the date of their most recent booking.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.passenger_id,\n COUNT(*) AS total_bookings,\n MAX(b.booking_time) AS last_bookin... |
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.text, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "Show the count of unread notifications per user for notifications related to posts. Return recipient_user_id and unread_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT recipient_user_id, COUNT(*) AS unread_count\nFROM social_media.notifications... |
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 character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Could you provide the number of customers in each state who currently have at least one active policy? Return the state and customer_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.state, COUNT(DISTINCT c.customer_id) AS customer_count\nFROM ... |
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": "List the first name, last name, and specialty for all doctors whose last name begins with the letter 'M'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, specialty FROM healthcare.doctors WHERE last_name LIKE 'M%';",
"sql": ... |
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 text PRIMARY KEY, contract_address text, token_name text, tok... | [
{
"role": "user",
"content": "Show all tokens where the total_supply is less than 10000, listing the token_id, token_symbol, and decimals.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_id, token_symbol, decimals FROM web3.tokens WHERE total_supply < 10000;",
"sql": nul... |
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 character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me details of all premium payments made by customers for policies that had any claim filed in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pp.payment_id, pp.customer_id, pp.policy_id, pp.payment_date, pp.amount_paid\nFROM insurance.premi... |
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, case_id text, lawyer_id text, date_work... | [
{
"role": "user",
"content": "Can you list all billable and non-billable entry pairs for the same lawyer on the same date?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.lawyer_id,\n b.date_worked,\n b.entry_id AS billable_entry,\n n.entry_id AS non_billable_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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show the contract address, symbol, and current total supply for all Avalanche tokens from token_balances_avalanche.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tick AS contract_address, tick AS symbol, SUM(total_supply) AS current_total_supply\nFR... |
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.services ( service_id text, property_id text, service_name te... | [
{
"role": "user",
"content": "Can you give me the number of available services and their average price for each department?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS available_services_count, AVG(price) AS average_price\nFROM hospitality_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 web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "Show all wallet addresses together with the private key, sorted from the most recent to oldest creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, private_key, created_at FROM web3.wallets ORDER BY created_at DESC;",
"sql": nul... |
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 text PRIMARY KEY, user_id text, content text, media_url... | [
{
"role": "user",
"content": "List all post IDs and their corresponding hashtag names for posts that include media.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ph.post_id, h.tag_name\nFROM social_media.post_hashtags ph\nJOIN social_media.hashtags h ON ph.hashtag_id = h.hashtag... |
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 contain... | [
{
"role": "user",
"content": "Which wallets have sent more than 5 BTC in the past 7 days? Show wallet_address and total_sent_amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ta.from_address AS wallet_address, SUM(ta.amt) AS total_sent\nFROM token_activities ta\nWHERE ta.tic... |
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 character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "List the total number of appointments for each status and also show the latest appointment_time for each status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS total_appointments, MAX(appointment_time) AS latest_appointment_time\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.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Find pairs of trip IDs where both trips departed on the same calendar day, shared the same origin and destination locations, but were distinct trips.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n t1.trip_id AS trip_id_1,\n t2.trip_id AS trip_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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "Find projects from project_fundraising_record that had fundraising rounds in the year 2023 and have a corresponding token in token_dexpool_info. Show the project name, the investment value, the fundraising round name, and the token symbol and current price from the DEX pool tab... |
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_timestamp timestamp(3... | [
{
"role": "user",
"content": "For wallet address '0xWalletA', list the ERC20 tokens held, showing contract address and amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, amount FROM erc20_balances WHERE wallet_address = '0xWalletA';",
"sql": 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 gaming_technology.games ( game_id uuid, title text, developer_id uuid, publisher_id ... | [
{
"role": "user",
"content": "Could you list each game title along with its developer's name and the total number of servers hosting it?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, d.name AS developer_name, COUNT(s.server_id) AS server_count\nFROM gaming_technology.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 trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo... | [
{
"role": "user",
"content": "Show me each completed order with order_id, the username of the user who placed it, asset_id, quantity, and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n o.order_id,\n u.username,\n o.asset_id,\n o.quantity,\n o.price\nFROM trading_pla... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "Show me all Sui coins with at least 6 decimal places and status 'exists' from the metadata table. List coin_type, symbol, name, and decimals.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nW... |
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_i... | [
{
"role": "user",
"content": "Provide a list of all email addresses used by citizens whose national ID number starts with 'X'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contact_email FROM government_services.citizens WHERE national_id_number LIKE 'X%';",
"sql": 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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "Retrieve the title and release_date of all games on the 'PC' platform.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT title, release_date\nFROM gaming_technology.games\nWHERE platform = 'PC';",
"sql": null
},
{
"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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"role": "user",
"content": "List all rooms that have a 'Jacuzzi' feature, including the room_number, property_id, type_name, and base_rate.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_number,\n r.property_id,\n rt.type_name,\n rt.base_rate\nFROM hosp... |
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_li... | [
{
"role": "user",
"content": "List every staff member's full name and their position.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name || ' ' || last_name AS staff_full_name, position\nFROM hospitality_technology.staff;",
"sql": null
},
{
"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.guests ( guest_id character varying(64) NOT NULL, first_name ... | [
{
"role": "user",
"content": "List the full name of all guests who have submitted a review.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM hospitality_technology.guests AS T1 JOIN hospitality_technology.reviews AS T2 ON T1.guest_id = T2.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.locations ( location_id text, name text, type text, address_line1 tex... | [
{
"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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.location_id AS location1_id, l1.name AS location1_name, l1.... |
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 character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show all patients who have received a prescription for medication ID 'med123' and also have a diagnosis code of 'I10'. Include patient ID, prescription ID, and diagnosis date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.patient_id, p.pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.