system stringlengths 323 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 blockchain.transactions ( transaction_id text, block_id text, sender_address text, r... | [
{
"content": "Show me each transaction with its ID, amount, timestamp, and the usernames of both sender and receiver.",
"role": "user",
"sql": null
},
{
"content": "SELECT t.transaction_id, t.amount, t.timestamp, us.username AS sender_username, ur.username AS receiver_username\nFROM blockchain.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 insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha... | [
{
"content": "Find the claim ID and the total number of documents associated with each claim ID that has more than 10 documents.",
"role": "user",
"sql": null
},
{
"content": "SELECT claim_id, COUNT(*) FROM insurance.claim_documents GROUP BY claim_id HAVING COUNT(*) > 10;",
"role": "assistan... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, title text, developer_id uuid, p... | [
{
"content": "What is the average score across all game sessions for each game? Include the game title and the average score.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.title, AVG(T2.score) FROM gaming_technology.games AS T1 JOIN gaming_technology.game_sessions AS T2 ON T1.game_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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"content": "Show me all customers who have purchased policies for insurance products of type 'health', including their full name, policy number, and the insurance product's name.",
"role": "user",
"sql": null
},
{
"content": "SELECT c.customer_id, c.first_name, c.last_name, p.policy_number, ip... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"content": "Can you show me the number of lawyers grouped by specialization?",
"role": "user",
"sql": null
},
{
"content": "SELECT specialization, COUNT(*) AS lawyer_count FROM lawyers GROUP BY specialization;",
"role": "assistant",
"sql": null
},
{
"content": "Include only spe... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"content": "Show the full name and email of each driver and the number of vehicles currently assigned to their depot.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.first_name, d.last_name, d.email, COUNT(v.vehicle_id) AS vehicles_at_depot\nFROM transportation.drivers d\nJOIN transpor... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"content": "List all conversation IDs with the total number of messages sent in each conversation.",
"role": "user",
"sql": null
},
{
"content": "SELECT conversation_id, COUNT(*) AS message_count\nFROM social_media.messages\nGROUP BY conversation_id;",
"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, ... | [
{
"content": "List the top 5 most used services across all properties. Show service_name and total quantity ordered, ordered by quantity descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT s.service_name,\n SUM(o.quantity) AS total_quantity\nFROM hospitality_technology.servic... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uuid(), game_... | [
{
"content": "For each server, show it alongside another server in the same region that has the closest number of current players.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n s1.server_id AS server_a_id,\n s1.server_name AS server_a_name,\n s2.server_id AS server_b_id,\n s2.serve... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "I need a summary of fueling events grouped by fuel_type: count of events and total quantity.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n fuel_type,\n COUNT(*) AS event_count,\n SUM(quantity) AS total_quantity\nFROM transportation.fuel_logs\nGROUP BY fuel_type;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id ch... | [
{
"content": "Show me all premium payments made by customer with ID 'CUST789'.",
"role": "user",
"sql": null
},
{
"content": "SELECT * FROM insurance.premium_payments WHERE customer_id = 'CUST789';",
"role": "assistant",
"sql": null
},
{
"content": "From those payments, only incl... |
You are an expert in writing database language. You can write a corresponding 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 the highest average base_rate? Return type_name and avg_rate, sorted descending, limit 5.",
"role": "user",
"sql": null
},
{
"content": "SELECT rt.type_name,\n AVG(rt.base_rate) AS avg_rate\nFROM hospitality_technology.room_types rt\nGROUP BY rt.type_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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"content": "For each SUI coin type, show the total balance across all owners and the number of distinct owners.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n coin_type,\n SUM(CAST(balance AS DECIMAL)) AS total_balance,\n COUNT(DISTINCT owner) AS owner_count\nFROM sui_coins\nGROUP ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.passengers ( passenger_id text PRIMARY KEY, first_name text, last_nam... | [
{
"content": "Show each pair of passengers who share the same loyalty_program_id but have different registration times. Return p1.first_name AS earlier, p2.first_name AS later, and loyalty_program_id.",
"role": "user",
"sql": null
},
{
"content": "SELECT p1.first_name AS earlier, p2.first_name 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 legal_services.invoices (
invoice_id character varying(64) NOT NULL, -- unique ... | [
{
"content": "Show me the invoice number, total amount, and due date for all invoices, along with the corresponding client ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT invoice_number, total_amount, due_date, client_id FROM legal_services.invoices;",
"role": "assistant",
"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 transportation.routes ( route_id text, route_number text, description text, origin_l... | [
{
"content": "Which routes have a distance_km of exactly 100 and are classified as 'Intercity Train'? Please provide their route_number and description.",
"role": "user",
"sql": null
},
{
"content": "SELECT route_number, description\nFROM transportation.routes\nWHERE distance_km = 100 AND type =... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.kyc_audit (
kyc_audit_id character varying(64) NOT NULL, -- un... | [
{
"content": "Show me all KYC audit records for user ID 'user_abc_123'.",
"role": "user",
"sql": null
},
{
"content": "SELECT kyc_audit_id, user_id, status, reviewed_at FROM kyc_audit WHERE user_id = 'user_abc_123';",
"role": "assistant",
"sql": null
},
{
"content": "From those, ... |
You are an expert in writing database language. You can write a corresponding 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": "List all SUI coins with status 'exists', showing their object_id, coin_type, and owner.",
"role": "user",
"sql": null
},
{
"content": "SELECT object_id, coin_type, owner FROM sui_coins WHERE status = 'exists'",
"role": "assistant",
"sql": null
},
{
"content": "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 hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"content": "Show the number of reservations and the sum total_amount for each property.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.property_id, p.property_name, COUNT(r.reservation_id) AS reservation_count, SUM(r.total_amount) AS total_revenue \nFROM hospitality_technology.propert... |
You are an expert in writing database language. You can write a corresponding 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": "For each account type, show the average balance and the number of completed trades associated with accounts of that type.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.account_type, AVG(a.balance) AS average_balance, COUNT(t.trade_id) AS completed_trade_count\nFROM financ... |
You are an expert in writing database language. You can write a corresponding 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": "Show me a list of all doctors who have made at least one diagnosis along with the total number of diagnoses they have made.",
"role": "user",
"sql": null
},
{
"content": "SELECT d.doctor_id, d.first_name, d.last_name, COUNT(di.diagnosis_id) AS diagnosis_count\nFROM healthcare.docto... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"content": "What are the ticket prices for trains departing from the station with ID 'ST456'?",
"role": "user",
"sql": null
},
{
"content": "I'm sorry, but I can't provide information on ticket prices as this data is not included in the station management database. For ticket pricing, please 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, -- unique ide... | [
{
"content": "I need to find, for each active agent, the number of active policies they have sold and the average premium_amount of those active policies.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.agent_id, a.first_name || ' ' || a.last_name AS agent_name, COUNT(p.policy_id) AS pol... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Find all users who have at least two wallets with different private keys. Show user_id and the count of distinct private keys for those users.",
"role": "user",
"sql": null
},
{
"content": "SELECT user_id, COUNT(DISTINCT private_key) AS distinct_private_key_count\nFROM web3.wallets... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.ti... | [
{
"content": "Show me all claims handled by agent 'AG123' along with their settlement details.",
"role": "user",
"sql": null
},
{
"content": "SELECT claim_id, policy_id, customer_id, settlement_amount, settlement_date FROM insurance.claims WHERE claim_handler_id = 'AG123';",
"role": "assista... |
You are an expert in writing database language. You can write a corresponding 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": "Calculate the total fuel quantity and total cost consumed for each trip where passenger_count > 50. List trip_id, total_quantity, and total_cost.",
"role": "user",
"sql": null
},
{
"content": "SELECT f.trip_id,\n SUM(f.quantity) AS total_quantity,\n SUM(f.total_cost) AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url... | [
{
"content": "For each group conversation, get the latest message's sender_user_id and sent_at, including conversation_id and group_name.",
"role": "user",
"sql": null
},
{
"content": "SELECT c.conversation_id, c.group_name, m.sender_user_id, m.sent_at\nFROM social_media.conversations c\nJOIN so... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.likes ( like_id text PRIMARY KEY, user_id text, post_id text, comment_i... | [
{
"content": "Show me all users who have liked both a post and a comment. Please include their user IDs, the post IDs, and the comment IDs.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT l1.user_id, l1.post_id, l2.comment_id\nFROM social_media.likes l1\nJOIN social_media.likes l2... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "For each trip, show the trip ID, vehicle ID, driver ID, and both the actual starting and ending location IDs.",
"role": "user",
"sql": null
},
{
"content": "SELECT trip_id, vehicle_id, driver_id, origin_location_id, destination_location_id FROM transportation.trips;",
"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 hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_nam... | [
{
"content": "List all guests who have provided a phone number, showing their guest ID and phone number.",
"role": "user",
"sql": null
},
{
"content": "SELECT guest_id, phone_number FROM hospitality_technology.guests WHERE phone_number IS NOT NULL AND phone_number <> '';",
"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 gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_u... | [
{
"content": "For each player, show the total quantity of all items they have ever acquired and their earliest acquisition date.",
"role": "user",
"sql": null
},
{
"content": "SELECT player_id, SUM(quantity) AS total_quantity, MIN(acquired_at) AS earliest_acquisition FROM gaming_technology.playe... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"content": "Show me the average number of current players per server for each region.",
"role": "user",
"sql": null
},
{
"content": "SELECT region, AVG(current_players) AS avg_current_players\nFROM gaming_technology.servers\nGROUP BY region;",
"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.room_types ( room_type_id text PRIMARY KEY, property_id text,... | [
{
"content": "Show me all room types with 'King' in the bed_type field, along with their property IDs and base rates.",
"role": "user",
"sql": null
},
{
"content": "SELECT room_type_id, property_id, type_name, bed_type, base_rate FROM hospitality_technology.room_types WHERE bed_type LIKE '%King%... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions (
session_id uuid NOT NULL DEFAULT gen_random_uu... | [
{
"content": "I want to see, for each player, the total score they have accumulated on each server, along with the server_id and player_id. Only include sessions where the server_id is not null.",
"role": "user",
"sql": null
},
{
"content": "SELECT player_id, server_id, SUM(score) AS total_score... |
You are an expert in writing database language. You can write a corresponding 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": "For each property, show the total number of reservations with status 'Confirmed' and the average total_amount.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.property_id,\n p.property_name,\n COUNT(r.reservation_id) AS confirmed_reservations,\n ROUND(AVG(... |
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"content": "List each genre and the number of games in that genre.",
"role": "user",
"sql": null
},
{
"content": "SELECT genre,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY genre;",
"role": "assistant",
"sql": null
},
{
"content": "Now filter to only 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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"content": "Retrieve the property name, review source, and review date for all reviews.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.property_name , T2.review_source , T2.review_date FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.reviews AS T2 ON T1.prop... |
You are an expert in writing database language. You can write a corresponding 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 pairs of customers who live in the same city. Return both customer IDs, their full names, and the city.",
"role": "user",
"sql": null
},
{
"content": "SELECT c1.customer_id AS customer1_id, c1.first_name || ' ' || c1.last_name AS customer1_name, c2.customer_id AS customer2_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 healthcare.insurance_plans ( plan_id text, plan_name text, insurance_provider text, ... | [
{
"content": "Find all insurance plans that have both a contact phone number and a website listed, showing their provider and plan type.",
"role": "user",
"sql": null
},
{
"content": "SELECT insurance_provider, plan_type FROM healthcare.insurance_plans WHERE contact_phone IS NOT NULL AND website... |
You are an expert in writing database language. You can write a corresponding 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": "I want to know the usernames of users who have followed more than three different people, along with the date they created their accounts.",
"role": "user",
"sql": null
},
{
"content": "SELECT u.username, u.created_at, COUNT(DISTINCT f.following_user_id) AS following_count\nFROM so... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"content": "Show me all ERC1155 NFT contracts and the total number of wallet addresses that currently hold at least one NFT from each contract.",
"role": "user",
"sql": null
},
{
"content": "SELECT contract_address, COUNT(DISTINCT wallet_address) as holder_count FROM nft_holders WHERE contract... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"content": "I need to list pairs of partners working at the same firm, showing each partner's full name and their specialization.",
"role": "user",
"sql": null
},
{
"content": "SELECT CONCAT(p1.first_name, ' ', p1.last_name) AS partner1_name, p1.specialization, CONCAT(p2.first_name, ' ', p2.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 legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "Calculate the total billable hours spent by each lawyer for entries in March 2024.",
"role": "user",
"sql": null
},
{
"content": "SELECT lawyer_id,\n SUM(hours_spent) AS total_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\n AND date_worked BETWEEN '2024-0... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"content": "Show me the usernames and full names of all users who have liked at least one post that was created in May 2024.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT u.username, u.full_name\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.user_id\nJO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"content": "Retrieve each customer_id, first_name, last_name, and close_price for market_data entries that occurred on the day of their account creation.",
"role": "user",
"sql": null
},
{
"content": "SELECT c.customer_id, c.first_name, c.last_name, md.close_price FROM financial_services.custo... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List the names of properties and the number of services they offer in the 'Spa' department.",
"role": "user",
"sql": null
},
{
"content": "SELECT P.property_name, COUNT(S.service_id) AS spa_service_count FROM hospitality_technology.properties AS P JOIN hospitality_technology.servic... |
You are an expert in writing database language. You can write a corresponding 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, -- the id of the token t... | [
{
"content": "List tokens on the 'Arbitrum' chain with a 24-hour price change percentage greater than 10% and a market cap above 1,000,000 USD. Show their symbol, name, price, 24-hour change percentage, and market cap. Order the results by the 24-hour change percentage in descending order.",
"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 gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"content": "List all items in the player_inventory table along with the game title each item belongs to.",
"role": "user",
"sql": null
},
{
"content": "SELECT pi.inventory_id, pi.player_id, pi.item_id, i.item_name, g.title AS game_title\nFROM gaming_technology.player_inventory pi\nJOIN gaming_... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Get each review with the next review date for the same guest.",
"role": "user",
"sql": null
},
{
"content": "SELECT guest_id, review_id, review_date,\n LEAD(review_date) OVER (PARTITION BY guest_id ORDER BY review_date) AS next_review_date\nFROM hospitality_technology.reviews... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "For each agency, list the agency name and the total count of employees who have a recorded termination date.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.agency_name, COUNT(e.employee_id) FROM government_services.agencies AS a LEFT JOIN government_services.employees AS 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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"content": "List the first name, last name, license number, and status for all drivers whose license expires in the next 6 months.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n first_name,\n last_name,\n license_number,\n status\nFROM transportation.drivers\nWHERE\n license_expi... |
You are an expert in writing database language. You can write a corresponding 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.trades ( trade_id character varying(64) NOT NULL, account_id char... | [
{
"content": "Show me all trades (trade_id, security_id, total_amount) where the trade_type is 'Buy' and the execution_venue is 'NYSE', along with the loan details (loan_type, principal_amount) for accounts that have both trades and loans.",
"role": "user",
"sql": null
},
{
"content": "SELECT t.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.wallets ( wallet_id.text, user_id.text, address_id.text, private_key.text... | [
{
"content": "Show me all wallet addresses that belong to user_id 'U12345'.",
"role": "user",
"sql": null
},
{
"content": "SELECT address_id FROM blockchain.wallets WHERE user_id = 'U12345';",
"role": "assistant",
"sql": null
},
{
"content": "Now join this with another table to 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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "Show me the room number, floor, and the name of the property for all rooms located in properties in Texas.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.room_number, T1.floor, T2.property_name FROM hospitality_technology.rooms AS T1 JOIN hospitality_technology.properties... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"content": "Show the usernames of all users who were created in 2024.",
"role": "user",
"sql": null
},
{
"content": "SELECT username\nFROM social_media.users\nWHERE EXTRACT(YEAR FROM created_at) = 2024;",
"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.rooms ( room_id text, property_id text, room_number text, roo... | [
{
"content": "List the names and prices of all services ordered by guests from 'Texas', along with the guest's full name.",
"role": "user",
"sql": null
},
{
"content": "SELECT g.first_name, g.last_name, s.service_name, s.price\nFROM hospitality_technology.guests g\nJOIN hospitality_technology.re... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List all pairs of customers who live in the same zip_code. Show customer1_id, customer2_id, and zip_code.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n c1.customer_id AS customer1_id,\n c2.customer_id AS customer2_id,\n c1.zip_code\nFROM insurance.customers c1\nJOIN in... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"content": "Find narrative pairs where the sum of their price_change_percentage_1h is greater than 5. Show narrative1, change1, narrative2, change2, and the sum as total_change.",
"role": "user",
"sql": null
},
{
"content": "SELECT n1.narrative AS narrative1, n1.price_change_percentage_1h AS c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo... | [
{
"content": "What is the total sum of all amounts for all UTXOs in the system, regardless of whether they are spent or unspent?",
"role": "user",
"sql": null
},
{
"content": "SELECT SUM(amount) FROM trading_platform.utxos",
"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 text PRIMARY KEY, property_name text... | [
{
"content": "Show all reviews with the guest's ID, review comment, and the full name of the staff member who responded.",
"role": "user",
"sql": null
},
{
"content": "SELECT r.review_id, r.guest_id, r.comment, s.first_name AS response_staff_first_name, s.last_name AS response_staff_last_name\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 social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"content": "List the content of posts that have received comments from verified users, showing the post content and the username of the verified commenter.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT p.content AS post_content, u.username AS commenter_username FROM social_med... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.wallets ( wallet_id text PRIMARY KEY, user_id text, address text, private_key t... | [
{
"content": "Find pairs of wallets that were created at the exact same timestamp but are owned by different users. List the IDs of both wallets and the shared creation timestamp.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n w1.wallet_id AS wallet1_id,\n w2.wallet_id AS wallet2_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.room_types ( room_type_id text, property_id text, type_name t... | [
{
"content": "List all public reviews with a rating_overall of at least 4, including review_id, guest_id, property_id, reservation_id, and review_date.",
"role": "user",
"sql": null
},
{
"content": "SELECT review_id, guest_id, property_id, reservation_id, review_date\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 social_media.conversations ( conversation_id character varying(64) NOT NULL, created... | [
{
"content": "Provide a breakdown of the total number of conversations, showing how many are group chats and how many are not. Also, show the count of conversations that have a recorded last message time.",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) AS total_conversations, COUN... |
You are an expert in writing database language. You can write a corresponding 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": "List the usernames of users who have created posts associated with any hashtag, and the name of the hashtag.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n u.username,\n h.tag_name\nFROM social_media.users AS u\nJOIN social_media.posts AS p\n ON u.user_id = p.user_id\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 web3.events ( event_id text PRIMARY KEY, contract_id text, event_name text, data tex... | [
{
"content": "List all token transfers with values greater than 1000, including the token ID and transaction ID.",
"role": "user",
"sql": null
},
{
"content": "SELECT transfer_id, token_id, transaction_id, value FROM web3.token_transfers WHERE value > 1000;",
"role": "assistant",
"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 government_services.documents ( document_id character varying(64) NOT NULL, applicat... | [
{
"content": "List the notification ID, message subject, and sent time for all notifications sent through the 'SMS' channel.",
"role": "user",
"sql": null
},
{
"content": "SELECT notification_id, message_subject, sent_at FROM government_services.notifications WHERE channel = 'SMS';",
"role":... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 3