system stringlengths 315 17.3k | 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 hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo... | [
{
"content": "How many available services are there per department for each property? Include property_id, department, and the service count.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n property_id,\n department,\n COUNT(*) AS available_services_count\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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"content": "Show me all insurance products of type 'Travel', including their product_id, product_name, and base_premium.",
"role": "user",
"sql": null
},
{
"content": "SELECT product_id, product_name, base_premium\nFROM insurance.insurance_products\nWHERE product_type = 'Travel';",
"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 web3.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created... | [
{
"content": "List all pairs of wallet IDs where both wallets were created on the same day but belong to different users, showing the user IDs and the creation date.",
"role": "user",
"sql": null
},
{
"content": "SELECT w1.wallet_id AS wallet_id_1, w2.wallet_id AS wallet_id_2, w1.user_id AS 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 gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"content": "List all players who have unlocked achievements in the last 7 days, showing their username and the number of achievements unlocked.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.username, COUNT(pa.achievement_id) AS unlocked_count\nFROM gaming_technology.players p\nJOIN 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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"content": "Show me the current amount held and wallet address for all wallets holding more than 100,000 units of the ERC20 token with contract address '0xeeee...'.",
"role": "user",
"sql": null
},
{
"content": "SELECT wallet_address, amount FROM erc20_balances WHERE contract_address = '0xeeee... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, am... | [
{
"content": "List each Avalanche token tick with its creator from token_info and the total transfer volume over the past 7 days.",
"role": "user",
"sql": null
},
{
"content": "SELECT ta.tick,\n ti.creator,\n SUM(ta.amt) AS total_volume\nFROM token_activities_avalanche ta\nJOIN token... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List the medication_id and medication_name for all medications with a generic name that starts with 'Amox'.",
"role": "user",
"sql": null
},
{
"content": "SELECT medication_id, medication_name\nFROM healthcare.medications\nWHERE generic_name ILIKE 'Amox%';",
"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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"content": "For each completed trip, list the trip ID, the driver's full name, and the name of the origin location.",
"role": "user",
"sql": null
},
{
"content": "SELECT t.trip_id, d.first_name || ' ' || d.last_name AS driver_name, l.name AS origin_location_name\nFROM transportation.trips t\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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"content": "Show a list of clients whose status is 'inactive', including their first and last name, email, phone, and date registered.",
"role": "user",
"sql": null
},
{
"content": "SELECT first_name, last_name, email, phone, date_registered\nFROM legal_services.clients\nWHERE status = 'inacti... |
You are an expert in writing database language. You can write a corresponding 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.token_transfers (
transfer_id character varying(64) NOT NULL, -- unique id... | [
{
"content": "Find all addresses that have both sent and received tokens. For each, show the address, the total value sent, and the total value received.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.address, s.total_sent, r.total_received\nFROM (\n SELECT from_address AS address, SUM... |
You are an expert in writing database language. You can write a corresponding 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 te... | [
{
"content": "Find all pairs of drivers who share the same status. Include both driver_ids, full names, and the shared status.",
"role": "user",
"sql": null
},
{
"content": "SELECT d1.driver_id AS driver1_id, d1.first_name || ' ' || d1.last_name AS driver1_name, d2.driver_id AS driver2_id, d2.fi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"content": "List all SUI coins with 'active' status, showing their owner address and balance.",
"role": "user",
"sql": null
},
{
"content": "SELECT owner, balance FROM sui_coins WHERE status = 'active';",
"role": "assistant",
"sql": null
},
{
"content": "Add the coin type and 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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"content": "For each account, show account_number, customer_id, and the count of other accounts the same customer has.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.account_number, a.customer_id, COUNT(b.account_id) AS other_account_count FROM financial_services.accounts a LEFT JOIN ... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"content": "List all fuel log entries with their associated trip's route_number and the vehicle's license_plate where the total_cost exceeds 200, sorted by total_cost descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT fl.*, t.route_id, r.route_number, v.license_plate\nFROM trans... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"content": "Show me the top 5 hashtags by number of distinct public posts they're used in. Return tag_name and post_count.",
"role": "user",
"sql": null
},
{
"content": "SELECT h.tag_name,\n COUNT(DISTINCT ph.post_id) AS post_count\nFROM social_media.hashtags AS h\nJOIN social_media.post... |
You are an expert in writing database language. You can write a corresponding 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, first_name charact... | [
{
"content": "List the customer ID, first_name, last_name, city, and the number of active policies each customer has, but only include customers who live in 'CA' and have at least 2 active policies.",
"role": "user",
"sql": null
},
{
"content": "SELECT cu.customer_id, cu.first_name, cu.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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"content": "Get the number of distinct wallet holders and total amount held for each NFT collection on Ethereum. Include collection name and contract_address.",
"role": "user",
"sql": null
},
{
"content": "SELECT nc.contract_address, nc.name, COUNT(DISTINCT nh.wallet_address) AS holder_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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"content": "List all ERC20 tokens where the total supply is between '1000000000' and '5000000000'. Show the symbol and name.",
"role": "user",
"sql": null
},
{
"content": "SELECT symbol, name FROM token_metas WHERE is_erc20 = 1 AND total_supply >= '1000000000' AND total_supply <= '5000000000'"... |
You are an expert in writing database language. You can write a corresponding 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_time... | [
{
"content": "Identify all instances where a vehicle's odometer_reading decreased compared to its previous fuel log entry.",
"role": "user",
"sql": null
},
{
"content": "SELECT curr.vehicle_id,\n prev.fuel_log_id AS previous_log_id,\n prev.odometer_reading AS previous_reading,\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.users ( user_id character varying(64) NOT NULL, username character varying(128)... | [
{
"content": "How many users registered in each month?",
"role": "user",
"sql": null
},
{
"content": "SELECT date_trunc('month', created_at) AS month,\n COUNT(*) AS registrations\nFROM web3.users\nGROUP BY month\nORDER BY month;",
"role": "assistant",
"sql": null
},
{
"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 te... | [
{
"content": "Find pairs of drivers where the first driver was hired after the second driver, but the first driver's license expires before the second driver's. Show driver IDs, hire dates, and license expiry dates for both drivers in each pair.",
"role": "user",
"sql": null
},
{
"content": "SEL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id character varying(64) NOT NULL, case_number character... | [
{
"content": "Show me the document_id, document_name, and upload_timestamp for all documents uploaded by lawyer with ID 'lawyer_456'.",
"role": "user",
"sql": null
},
{
"content": "SELECT document_id, document_name, upload_timestamp\nFROM legal_services.documents\nWHERE uploaded_by_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 gaming_technology.achievements ( achievement_id uuid PRIMARY KEY, game_id uuid, name... | [
{
"content": "Show me, for each game, the achievement that has been unlocked by the most players. Include the game title, achievement name, and the number of players who unlocked it.",
"role": "user",
"sql": null
},
{
"content": "WITH RankedAchievements AS ( SELECT pa.achievement_id, COUNT(pa.pl... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"content": "List the five most recent claims with their claim_id, incident_date, customer's full name, and estimated_loss, sorted by reported_date descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT c.claim_id, c.incident_date,\n cu.first_name || ' ' || cu.last_name AS full... |
You are an expert in writing database language. You can write a corresponding 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 ... | [
{
"content": "Show me all users who have wallets but have never placed any orders, along with their wallet addresses.",
"role": "user",
"sql": null
},
{
"content": "SELECT u.user_id, u.username, u.email, w.address FROM trading_platform.users u JOIN trading_platform.wallets w ON u.user_id = w.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
CREATE TABLE hospitality_technology.reviews ( review_id text PRIMARY KEY, property_id text, reser... | [
{
"content": "Find all review comments that have a staff response, showing the comment and the staff response date.",
"role": "user",
"sql": null
},
{
"content": "SELECT comment, response_date FROM reviews WHERE response_date IS NOT NULL;",
"role": "assistant",
"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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"content": "For each chain, what is the average price of tokens recorded in the smart_money_token_performance table?",
"role": "user",
"sql": null
},
{
"content": "SELECT chain, AVG(price) AS average_token_price FROM smart_money_token_performance GROUP BY chain;",
"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 transportation.bookings ( booking_id.text, passenger_id.text, trip_id.text, seat_num... | [
{
"content": "Find all pairs of bookings that share the same payment_transaction_id.",
"role": "user",
"sql": null
},
{
"content": "SELECT b1.booking_id AS booking_id_1, b2.booking_id AS booking_id_2, b1.payment_transaction_id\nFROM transportation.bookings b1\nJOIN transportation.bookings b2\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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number contain... | [
{
"content": "Which wallets have sent more than 5 BTC in the past 7 days? Show wallet_address and total_sent_amount.",
"role": "user",
"sql": null
},
{
"content": "SELECT ta.from_address AS wallet_address, SUM(ta.amt) AS total_sent\nFROM token_activities ta\nWHERE ta.tick = 'BTC'\n AND ta.block... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id... | [
{
"content": "Show me each patient and doctor pair that have both an active chronic diagnosis and at least one prescription recorded in the same medical record. Include patient_id, doctor_id, diagnosis_date, prescription_date, and medication_id.",
"role": "user",
"sql": null
},
{
"content": "SEL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, roo... | [
{
"content": "List all staff members showing their full name and position.",
"role": "user",
"sql": null
},
{
"content": "SELECT first_name || ' ' || last_name AS staff_full_name, position FROM hospitality_technology.staff;",
"role": "assistant",
"sql": null
},
{
"content": "Now ... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me the total balance for each SUI coin type across all owners. Include the coin_type and the sum of balances.",
"role": "user",
"sql": null
},
{
"content": "SELECT coin_type, sum(cast(balance as numeric)) AS total_balance FROM sui_coins GROUP BY coin_type",
"role": "assist... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"content": "Show the number of staff members for each property, along with the property name.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.property_name, COUNT(s.staff_id) AS staff_count\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.staff s ON p.property_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 gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, ... | [
{
"content": "List each player's most recent achievement unlock, showing the player_id, achievement_id, and unlocked_at timestamp.",
"role": "user",
"sql": null
},
{
"content": "SELECT pa.player_id, pa.achievement_id, pa.unlocked_at FROM gaming_technology.player_achievements pa INNER JOIN (SELEC... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var... | [
{
"content": "List all agents licensed in Texas ('TX') and their manager's full name.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agent_last_name, CONCAT(m.first_name, ' ', m.last_name) AS manager_full_name FROM insurance.age... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "For each day in the past month, can you show the combined total transaction amount and the total volume traded from market data?",
"role": "user",
"sql": null
},
{
"content": "SELECT t.effective_date, SUM(t.amount) AS total_transaction_amount, SUM(md.volume) AS total_traded_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 hospitality_technology.reservations (
reservation_id character varying(64) NOT N... | [
{
"content": "List all reservations made in the last 6 months, showing the reservation ID, guest ID, and status.",
"role": "user",
"sql": null
},
{
"content": "SELECT reservation_id, guest_id, status FROM hospitality_technology.reservations WHERE created_at >= current_date - interval '6 months';... |
You are an expert in writing database language. You can write a corresponding 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 ... | [
{
"content": "For each fuel type, show the number of unique vehicles that have used it and the total quantity refueled.",
"role": "user",
"sql": null
},
{
"content": "SELECT f.fuel_type, COUNT(DISTINCT f.vehicle_id) AS vehicle_count, SUM(f.quantity) AS total_quantity\nFROM transportation.fuel_lo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transacti... | [
{
"content": "Can you list all SUI coins with 'active' status and their owner addresses and balances?",
"role": "user",
"sql": null
},
{
"content": "SELECT object_id, coin_type, owner, balance\nFROM sui_coins\nWHERE status = 'active';",
"role": "assistant",
"sql": null
},
{
"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 healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"content": "I need a report showing each doctor's ID, full name, number of completed appointments, and number of medical records they have authored.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.doctor_id,\n d.first_name || ' ' || d.last_name AS doctor_name,\n COUNT(a.app... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "I need a report showing each security's ticker_symbol along with the total sum of trade total_amount and the count of trades executed in the last three months.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.ticker_symbol, SUM(t.total_amount) AS total_trade_amount, 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"content": "Which room types have a base rate above 250, and what are their property names and maximum occupancy?",
"role": "user",
"sql": null
},
{
"content": "SELECT rt.room_type_id, rt.type_name, p.property_name, rt.base_rate, rt.max_occupancy\nFROM hospitality_technology.room_types rt\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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ... | [
{
"content": "Show me all insurance products of type 'Health' or 'Dental'.",
"role": "user",
"sql": null
},
{
"content": "SELECT *\nFROM insurance.insurance_products\nWHERE product_type IN ('Health', 'Dental');",
"role": "assistant",
"sql": null
},
{
"content": "I only want to 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 social_media.conversation_participants ( participant_id.text, conversation_id.text, ... | [
{
"content": "Show me all participants who joined any conversation before January 1st, 2024. Return participant_id, user_id, conversation_id and the joined_at timestamp.",
"role": "user",
"sql": null
},
{
"content": "SELECT participant_id, user_id, conversation_id, joined_at FROM social_media.co... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text, token_id text, from_address text, to_addres... | [
{
"content": "For each transaction, show its transaction_id and the count of tokens transferred within that transaction.",
"role": "user",
"sql": null
},
{
"content": "SELECT transaction_id, COUNT(token_id) AS tokens_transferred FROM web3.token_transfers GROUP BY transaction_id;",
"role": "a... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id.uuid, name.text, country.text, founded_y... | [
{
"content": "List all developer names and their websites.",
"role": "user",
"sql": null
},
{
"content": "SELECT name, website FROM gaming_technology.developers;",
"role": "assistant",
"sql": null
},
{
"content": "Can you only include developers whose website contains '.net'?",
... |
You are an expert in writing database language. You can write a corresponding 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.... | [
{
"content": "For each service location, show the location name, city, and the number of appointments scheduled at that location.",
"role": "user",
"sql": null
},
{
"content": "SELECT sl.location_name, sl.city, COUNT(a.appointment_id) AS appointment_count\nFROM government_services.service_locati... |
You are an expert in writing database language. You can write a corresponding 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.metadata ( metadata_id character varying(64) NOT NULL, asset_id cha... | [
{
"content": "List asset_id, issuer and launch_date metadata values for each asset that has both 'issuer' and 'launch_date' keys.",
"role": "user",
"sql": null
},
{
"content": "SELECT m_iss.asset_id,\n m_iss.value AS issuer,\n m_ld.value AS launch_date\nFROM trading_platform.metadata... |
You are an expert in writing database language. You can write a corresponding 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 text, application_id text, citizen_id te... | [
{
"content": "How many documents have a file reference assigned?",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM government_services.documents WHERE file_reference IS NOT NULL AND file_reference <> '';",
"role": "assistant",
"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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"content": "Get a list of room types along with their property name and the count of rooms currently Available for each type.",
"role": "user",
"sql": null
},
{
"content": "SELECT rt.type_name, p.property_name, COUNT(r.room_id) AS available_rooms_count\nFROM hospitality_technology.room_types 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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"content": "List all premium payments along with the payment date, amount, and the status of the related policy.",
"role": "user",
"sql": null
},
{
"content": "SELECT pp.payment_id, pp.payment_date, pp.amount_paid, p.status AS policy_status\nFROM insurance.premium_payments pp\nJOIN insurance.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 gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"content": "Can you show me the number of servers in each region, as well as the total max_players for each region?",
"role": "user",
"sql": null
},
{
"content": "SELECT region, COUNT(*) AS server_count, SUM(max_players) AS total_max_players FROM gaming_technology.servers GROUP BY region;",
... |
You are an expert in writing database language. You can write a corresponding 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.patient_insurance ( patient_insurance_id character varying(64) NOT NULL, ... | [
{
"content": "List patient pairs where the same patient has two distinct insurance plans. Show patient_id, the earlier plan_id as old_plan, the later plan_id as new_plan, and their effective dates.",
"role": "user",
"sql": null
},
{
"content": "SELECT pi1.patient_id,\n pi1.plan_id AS old_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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"content": "What is the average commission rate for agents whose status is 'Terminated'?",
"role": "user",
"sql": null
},
{
"content": "SELECT AVG(commission_rate) FROM insurance.agents WHERE status = 'Terminated' AND commission_rate IS NOT NULL;",
"role": "assistant",
"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 web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"content": "For each event, display its event_id, the event_id of the previous event in the same transaction (if any), and the log_index of both events.",
"role": "user",
"sql": null
},
{
"content": "SELECT curr.event_id AS current_event_id,\n prev.event_id AS previous_event_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_i... | [
{
"content": "For each guest, list reservation_id, guest_id, check_in_date, and the next reservation_id and its check_in_date.",
"role": "user",
"sql": null
},
{
"content": "SELECT r1.reservation_id,\n r1.guest_id,\n r1.check_in_date,\n r2.reservation_id AS next_reservation_id,... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 1