system stringlengths 315 11.5k | 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.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Get the property name, room type name, base rate, and star rating for all room types with a base_rate above 200 in properties located in the USA, sorted by base_rate in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Retrieve each agency’s name along with the count of accessible service locations it has in California.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n a.agency_name,\n COUNT(l.location_id) AS accessible_location_count\nFROM government_services.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 legal_services.clients ( client_id text, first_name text, last_name text, company_na... | [
{
"role": "user",
"content": "I need a list of each case_number and case_name with the total hours spent on each case based on time_entries, but only include cases where the total hours is greater than 10.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number, c.case_name,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversation_participants ( participant_id.text, conversation_id.text, ... | [
{
"role": "user",
"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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT participant_id, user_id, conversation_id, joine... |
You are an expert in writing database language. You can write a corresponding 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.notifications ( notification_id text PRIMARY KEY, citizen_id tex... | [
{
"role": "user",
"content": "For each notification, list its notification_id, message_subject, and the message_subject of the notification it relates to (assuming related_entity_type = 'notification').",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.notification_id,\n n.m... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List all conversation IDs with the total number of messages sent in each conversation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT conversation_id, COUNT(*) AS message_count\nFROM social_media.messages\nGROUP BY conversation_id;",
"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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "List the first and last names of employees and the number of services offered by their agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS service_count\nFROM government_services.employees e\nLEFT ... |
You are an expert in writing database language. You can write a corresponding 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.text, token_name.text, token_symbol.text, token_address.t... | [
{
"role": "user",
"content": "Show me tokens with a 24-hour trading volume over $1,000,000 from DEX pools that also have a positive net flow from smart money addresses. Display the token symbol, chain, 24h volume, and net flow.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tdi.t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "Show the name and city of all maintenance facility locations and include the total number of maintenance logs performed at each location.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.name, l.city, COUNT(m.log_id) AS maintenance_count\nFROM transp... |
You are an expert in writing database language. You can write a corresponding 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.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List the full names of all employees who are currently employed (i.e., have no termination date).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name || ' ' || last_name AS full_name FROM government_services.employees WHERE termination_date IS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "List maintenance logs including vehicle make, model, service_date, cost, and next_service_due_date for vehicles that are currently 'Active'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ml.log_id,\n v.make,\n v.model,\n ml.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 legal_services.documents ( document_id.text, case_id.text, document_name.text, docum... | [
{
"role": "user",
"content": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS ca... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id.text, username.text, email.text, password_hash.text... | [
{
"role": "user",
"content": "List the names and URLs of all decentralized applications where the description includes the word 'exchange'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name, d.url\nFROM trading_platform.dapps d\nWHERE d.description ILIKE '%exchange%';",
"... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Show tokens held by CEX addresses that have a positive ROI from smart money. Display the token symbol, chain, the exchange holding it, the CEX USD value of the holding, and the smart money ROI. Limit the results to the top 10 tokens ranked by smart money ROI in descending order... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List the top 5 exchanges with the highest total USD value of tokens held on the 'Ethereum' chain for the latest snapshot time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT exchange, SUM(usd_value) AS TotalUSDValue FROM cex_token_balance WHERE chain... |
You are an expert in writing database language. You can write a corresponding 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.notifications ( notification_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List the application_id and the number of notifications with status 'Pending' for each application.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT application_id, COUNT(*) AS pending_notification_count\nFROM government_services.notifications\nWHERE 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 gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Which games were developed by companies in 'United Kingdom'? List the game title and the developer's name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.title, T2.name FROM gaming_technology.games AS T1 JOIN gaming_technology.developers AS T2 ON ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case... | [
{
"role": "user",
"content": "Show me all invoices with their invoice number, client ID, and total amount, along with the issue and due dates. Only include invoices where the total amount is at least 10,000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_number, client_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 social_media.conversations ( conversation_id character varying(64) NOT NULL, created... | [
{
"role": "user",
"content": "For each group chat, list its ID, name, creation time, and the creation time of the next group chat created after it, ordered by creation time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT conversation_id, group_name, created_at, LEAD(created_at) 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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show me all users who have been notified by the system (i.e. notifications where the sender_user_id is NULL). Please include their username and the type of each notification.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, n.notification_t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "For each driver status, find the earliest and latest hire date. Show status, earliest hire date, and latest hire date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n status,\n MIN(hire_date) AS earliest_hire_date,\n MAX(hire_date) AS latest_hire... |
You are an expert in writing database language. You can write a corresponding 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, patient_id ch... | [
{
"role": "user",
"content": "Show me the record_id, patient_id, prescription_id, medication_id, start_date, and the systolic blood pressure from the associated medical record for all prescriptions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.prescription_id,\n p.medic... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Show me the current ERC20 token balances for the wallet address '0x1A2b3C4dE5f6A7b8C9d0E1f2A3b4C5d6E7f8A9b0'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, amount FROM erc20_balances WHERE wallet_address = '0x1A2b3C4dE5f6A7b8C9d0E1... |
You are an expert in writing database language. You can write a corresponding 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, patient_id ... | [
{
"role": "user",
"content": "List appointments with a duration longer than 45 minutes where the 'reason' includes the word 'follow-up'. Show the appointment ID, patient ID, duration, and reason.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, patient_id, duration_... |
You are an expert in writing database language. You can write a corresponding 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_... | [
{
"role": "user",
"content": "For each server, show it alongside another server in the same region that has the closest number of current players.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n s1.server_id AS server_a_id,\n s1.server_name AS server_a_name,\n s2.server_id AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reservations (
reservation_id character varying(64) NOT N... | [
{
"role": "user",
"content": "List all reviews where the cleanliness rating is 3 or below. Include the review comment and the full name of the guest who submitted it.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.comment, T2.first_name, T2.last_name FROM hospitality_technolog... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "How many citizens registered in each year?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DATE_PART('year', registration_date) AS year,\n COUNT(*) AS registration_count\nFROM government_services.citizens\nGROUP BY DATE_PART('year', registration... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.first_name AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "List the full name and firm name for all lawyers who are not partners.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.firm_name FROM legal_services.lawyers AS T1 JOIN legal_services.law_firms AS T2 ON T1.firm_id = T2.f... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.bookings ( booking_id text, passenger_id text, trip_id text, seat_num... | [
{
"role": "user",
"content": "List each booking with its previous booking time for the same passenger.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id,\n b.passenger_id,\n b.booking_time,\n LAG(b.booking_time) OVER (PARTITION BY b.passenger_id ORDER ... |
You are an expert in writing database language. You can write a corresponding 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": "Show each lawyer's first and last name along with the number of open cases they lead, ordered by the highest number of open cases first.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, COUNT(c.case_id) AS open_case_count\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 social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,... | [
{
"role": "user",
"content": "List group conversation names and the count of messages sent in each conversation after '2024-06-01'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.group_name, COUNT(T2.message_id) FROM social_media.conversations AS T1 JOIN social_media.messages ... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Which narratives saw the highest average net flow from smart money performance this year, and what is the average roi for those narratives along with the total number of tokens in each?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tbi.narrative, AV... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Show me all servers in the same region that have different statuses. I want to see the server names, regions, and their statuses for each pair.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1, s2.server_name AS server2, s1.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 hospitality_technology.properties ( property_id.text, property_name.text, address_li... | [
{
"role": "user",
"content": "Retrieve all reservations and the full name of the guest who made each reservation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.reservation_id, T2.first_name, T2.last_name FROM hospitality_technology.reservations AS T1 INNER JOIN 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 gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "Find pairs of servers that are currently 'online' and share the same game_id, listing their server names and the shared game_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1_name, s2.server_name AS server2_name, s1.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 web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_a... | [
{
"role": "user",
"content": "Find all token transfers where the value is greater than 5000, including the token_id and transaction details like from_address and gas_used, sorted by value in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tt.token_id, tt.value, 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.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE status = 'expired' AND end_dat... |
You are an expert in writing database language. You can write a corresponding 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.securities ( security_id text PRIMARY KEY, ticker_symbol text, is... | [
{
"role": "user",
"content": "List all securities issued by 'Morgan Stanley' along with their ticker_symbol, security_name, and exchange. Then also show the sector for each.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ticker_symbol, security_name, exchange, sector FROM financi... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Which routes have their origin and destination in the same city? Show the route number, description, and the origin and destination location IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number, r.description, r.origin_location_id, r.de... |
You are an expert in writing database language. You can write a corresponding 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": "List all group chat conversations and the number of messages in each group chat.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id,\n c.group_name,\n COUNT(m.message_id) AS message_count\nFROM social_media.conversations c\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 gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.t... | [
{
"role": "user",
"content": "List every offline server alongside an online server in the same region. Show offline_server and online_server names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT o.server_name AS online_server, f.server_name AS offline_server\nFROM gaming_technolo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "Which token on the Ethereum chain had the highest realized ratio last quarter? Show the symbol, realized ratio, and ROI.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, realized_ratio, roi FROM smart_money_token_performance WHERE chain =... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "For each account, show account_number, customer_id, and the count of other accounts the same customer has.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.account_number, a.customer_id, COUNT(b.account_id) AS other_account_count FROM financial_servi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... | [
{
"role": "user",
"content": "特定の職種の従業員情報を取得したいです。従業員ID、名前、職種、雇用日を表示してください。",
"sql": null
},
{
"role": "assistant",
"content": "db.employees.find(\n { job_title: '<specific_job_title>' },\n { employee_id: 1, first_name: 1, last_name: 1, job_title: 1, hire_date: 1, _id: 0 }\n).sort({ hi... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List the full names and email addresses of all lawyers who have handled at least one appointment for a client from the company 'Innovatech Ltd', along with the company name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT l.first_name, l.last... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "List the names and email addresses of guests who have made a reservation in the last 60 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT g.first_name, g.last_name, g.email\nFROM hospitality_technology.guests g\nJOIN hospitality_technolog... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "For each SUI coin type, show the total balance across all owners and the number of distinct owners.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n coin_type,\n SUM(CAST(balance AS DECIMAL)) AS total_balance,\n COUNT(DISTINCT owner) AS owner_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 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 hospitality_technology.reservations ( reservation_id text, property_id text, guest_i... | [
{
"role": "user",
"content": "Find all pairs of overlapping reservations for the same room. Show the two reservation IDs, room_id, and both reservations' check-in and check-out dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.reservation_id AS reservation1_id, r2.reservat... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List all narratives with a trend rank better than 50, showing the narrative name and their listed 'Top 3 Coins'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, top_3_coins FROM narrative_info WHERE trend_rank < 50",
"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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "Which hashtags appear on the most posts? Return hashtag_id, tag_name, and the number of posts each hashtag is used in, sorted descending, limited to the top 3.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n h.hashtag_id,\n h.tag_name,\n COUNT(ph... |
You are an expert in writing database language. You can write a corresponding 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": "Can you show me all pairs of trips that use the same vehicle but have different drivers? Please include both trip IDs, vehicle_id, and the driver_id for each trip.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.trip_id AS trip_id_1, t2.trip_id AS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id... | [
{
"role": "user",
"content": "Show me all appointment IDs and their scheduled start times along with the employee ID and service ID for appointments that have been booked using the 'Kiosk' booking method.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, scheduled_st... |
You are an expert in writing database language. You can write a corresponding 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": "Can you show me, for each account type, the total transaction amount and the number of transactions, including the customer full name for each account type?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.account_type, c.first_name || ' ' || c.last_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id text, claim_id text, document_type text, fil... | [
{
"role": "user",
"content": "I want to find all claim IDs that have both an 'Accident Report' and a 'Police Report' document.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT a.claim_id\nFROM insurance.claim_documents a\nJOIN insurance.claim_documents b\n ON a.claim_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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "For each ERC1155 NFT contract on Ethereum, show the contract address, token_id, and the total amount held across all wallets.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT nh.contract_address, nh.token_id, SUM(CAST(nh.amount AS NUMERIC)) AS total_am... |
You are an expert in writing database language. You can write a corresponding 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.policy_beneficiaries ( beneficiary_id text PRIMARY KEY, policy_id text, cu... | [
{
"role": "user",
"content": "List all beneficiaries who have a null contact_info. Return beneficiary_id, first_name, last_name, policy_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT beneficiary_id, first_name, last_name, policy_id\nFROM insurance.policy_beneficiaries\nWHERE ... |
You are an expert in writing database language. You can write a corresponding 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.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Give me all unspent UTXOs for address '1A2b3C4d5E', sorted by amount descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT utxo_id, transaction_id, output_index, address, amount\nFROM trading_platform.utxos\nWHERE address = '1A2b3C4d5E' AND spen... |
You are an expert in writing database language. You can write a corresponding 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": "Show me all documents along with the document name and type, together with both the upload_timestamp and the lawyer ID who uploaded them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_id, document_name, document_type, upload_timestamp, uplo... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"role": "user",
"content": "I want to list pairs of insurance plans from the same provider, showing both plan IDs and names alongside the provider.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.plan_id, p1.plan_name, p2.plan_id AS plan_id_2, p2.plan_name AS plan_name_2, p1.... |
You are an expert in writing database language. You can write a corresponding 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_rand... | [
{
"role": "user",
"content": "Can you show the total quantity of all in-game items held by each player?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player_id;",
"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 healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "Show all diagnoses, including the diagnosis ID, description, diagnosis date, and the full name of the doctor who made the diagnosis.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.diagnosis_id, T1.description, T1.diagnosis_date, T2.first_name, 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 web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each transaction status, what is the average transaction value?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, AVG(value) FROM web3.transactions GROUP BY status",
"sql": null
},
{
"role": "user",
"content": "Could you filt... |
You are an expert in writing database language. You can write a corresponding 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, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "Show the first and last names of citizens along with the total amount of all payments associated with them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , SUM(T2.amount) FROM government_services.citizens AS T1 JOIN go... |
You are an expert in writing database language. You can write a corresponding 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, -- un... | [
{
"role": "user",
"content": "Find all citizens who have both uploaded at least one document and made at least one payment. Show their citizen ID, full name, and contact email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.citizen_id, c.first_name || ' ' || c.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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "Give me the max supply, creator, and current supply for all Avalanche tokens by their tick.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tia.tick, tia.max_supply, tia.creator, tb.total_supply\nFROM token_info_avalanche tia\nLEFT JOIN token_balances... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "What is the total estimated_loss and average settlement_amount for all claims with status 'Approved'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(estimated_loss) AS total_estimated_loss,\n AVG(settlement_amount) AS average_settlement\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 social_media.hashtags ( hashtag_id text, tag_name text, created_at timestamp )
| [
{
"role": "user",
"content": "Show me all hashtag IDs and their tag names that were created after June 10, 2024 and whose tag names contain the word 'dev'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT hashtag_id, tag_name FROM social_media.hashtags WHERE created_at > '2024-06-1... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "I want a list of group conversations with at least one unread message, including the conversation_id, group_name, and the count of unread messages, joining messages and conversations tables.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversation_participants (
participant_id character varying(64) NO... | [
{
"role": "user",
"content": "List each participant_id along with the total number of participants in their conversation, and include user_id and conversation_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cp.participant_id, cp.user_id, cp.conversation_id, counts.participant_... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List the full names of citizens who have uploaded documents with a verification status of 'Pending' and the type of document they uploaded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.document_type FROM government_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 healthcare.patient_insurance (
patient_insurance_id character varying(64) NOT NU... | [
{
"role": "user",
"content": "Show me all patients who have non-primary insurance plans with expiration dates within the next 60 days, along with their policy numbers and subscriber names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, policy_number, subscriber_name F... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id cha... | [
{
"role": "user",
"content": "List all claim IDs that have both an 'Accident Report' and a 'Damage Assessment' document type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id\nFROM insurance.claim_documents\nWHERE document_type IN ('Accident Report', 'Damage Assessment')\n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List the full names of patients who have had at least one appointment scheduled with a doctor, along with the medication names they have been prescribed. Please include only patients who have both an appointment and at least one corresponding medication.",
"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... | [
{
"role": "user",
"content": "Show all token transfers including the token symbol and the address of the contract that created each token. List the transfer id, token id, value, transaction id, the contract address, and the token symbol.",
"sql": null
},
{
"role": "assistant",
"content": "SE... |
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... | [
{
"role": "user",
"content": "What is the ticket price for a journey on train number T4321?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about ticket prices for specific trains. The data I have is limited to train details such as model... |
You are an expert in writing database language. You can write a corresponding 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 the names of properties and the room number for every room at each property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.property_name , T2.room_number FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.rooms AS T2 O... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "List the name, city, and country of all locations where at least one vehicle is currently assigned (i.e., depot_id matches location_id).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.name, l.city, l.country\nFROM transportation.locations l\nJOIN t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reviews ( review_id.text, property_id.text, reservation_id.te... | [
{
"role": "user",
"content": "List public reviews whose comment contains the word 'slow'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT review_id, comment, review_date, rating_overall, property_id FROM hospitality_technology.reviews WHERE is_public = TRUE AND LOWER(comment) LIKE... |
You are an expert in writing database language. You can write a corresponding 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 staff members, showing their full name, position, and the name of the property where they work.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.position, T2.property_name FROM hospitality_technology.staff AS T1... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "I’d like to see a list of appointments along with any prescriptions made on the same day. Include appointment_id, prescription_id, medication_name, and appointment_time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, p.prescription_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me all bookings with the passenger's full name and the booking status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id, p.first_name || ' ' || p.last_name AS passenger_full_name, b.status\nFROM transportation.bookings b\nJOIN transpo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_achievements (
player_achievement_id uuid NOT NULL DEFA... | [
{
"role": "user",
"content": "For each player, count the total number of achievements they've unlocked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id,\n COUNT(*) AS total_achievements\nFROM gaming_technology.player_achievements\nGROUP BY player_id;",
"sql": 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": "Get a list of all guests who have at least one review for a property with a star_rating greater than 4. Include the guest's full name, email, property_name, and review_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, g.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Could you list each player's username and the total number of sessions they have played?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, COUNT(gs.session_id) AS total_sessions\nFROM gaming_technology.players p\nLEFT JOIN 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.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List patient_id, full name, policy_number, plan_type, and insurance_provider for all active primary insurance policies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.patient_id,\n p.first_name,\n p.last_name,\n pi.policy_number,... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "For each payment status, how many payments were made and what was the total amount paid? Order the results by the total amount paid in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS payment_count, SUM(amount_paid... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve all public posts that have geolocation coordinates specified, showing post_id, user_id, location_lat, location_lon, ordered by created_at descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT post_id, user_id, location_lat, location_lon... |
You are an expert in writing database language. You can write a corresponding 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 employees who were hired in the last two years along with their department and status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT employee_id, first_name, last_name, department, status FROM financial_services.employees WHERE hire_date >=... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.developers ( developer_id.uuid, name.text, country.text, founded_y... | [
{
"role": "user",
"content": "List all developer names and their websites.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, website FROM gaming_technology.developers;",
"sql": null
},
{
"role": "user",
"content": "Can you only include developers whose 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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List the top 5 most used services across all properties. Show service_name and total quantity ordered, ordered by quantity descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_name,\n SUM(o.quantity) AS total_quantity\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 healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List all patients along with their primary insurance plan name and the first and last name of their prescribing doctor for any prescription they have received.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name AS patient_first... |
You are an expert in writing database language. You can write a corresponding 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, ... | [
{
"role": "user",
"content": "List each player's most recent achievement unlock, showing the player_id, achievement_id, and unlocked_at timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pa.player_id, pa.achievement_id, pa.unlocked_at FROM gaming_technology.player_achievem... |
You are an expert in writing database language. You can write a corresponding 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": "Show me each property and the average rating_service from reviews posted in the last year.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name,\n AVG(rw.rating_service) AS avg_rating_service\nFROM hospitality_technology.properties 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 transportation.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri... | [
{
"role": "user",
"content": "Give me all trips where the trip status is 'Completed' with their trip ID, vehicle ID, and number of passengers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, passenger_count FROM transportation.trips WHERE status = 'Completed';... |
You are an expert in writing database language. You can write a corresponding 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": "I want to see each user's username and the number of posts they've made that include a media attachment of type 'image'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(*) AS image_post_count\nFROM social_media.users u\nJOIN social_m... |
You are an expert in writing database language. You can write a corresponding 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, product_name text, product_type text... | [
{
"role": "user",
"content": "List all products, showing their ID, name, type, and whether they are active.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, product_type, is_active FROM insurance.insurance_products;",
"sql": null
},
{
"role": "... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Find all in-game items that have a 'mana_cost' attribute in their attributes JSON. Show the item ID, item name, and the value of the 'mana_cost'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_id, item_name, attributes ->> 'mana_cost' AS mana_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 financial_services.accounts (
account_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "For each customer, show the number of open accounts and their combined balance, joining the accounts table with itself on customer_id for demonstration.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id, COUNT(a.account_id) AS open_account... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.