system stringlengths 315 8.44k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id.text, name.text, type.text, address_line1.tex... | [
{
"role": "user",
"content": "Provide a count of locations for each country listed in the table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT country, COUNT(*) FROM transportation.locations GROUP BY country",
"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.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each token, list its symbol and the number of transfers recorded in token_transfers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n t.token_symbol,\n COUNT(tt.transfer_id) AS transfer_count\nFROM web3.tokens t\nLEFT JOIN web3.token_transfers ... |
You are an expert in writing database language. You can write a corresponding 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": "List each doctor's full name and the total number of medical records they have created.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, COUNT(T2.record_id) FROM healthcare.doctors AS T1 JOIN healthcare.medical_records AS T... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "Count how many fundraising rounds each project has. Show project_name and round_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n project_name,\n COUNT(*) AS round_count\nFROM project_fundraising_record\nGROUP BY project_name;",
"sql": nu... |
You are an expert in writing database language. You can write a corresponding 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 doctors whose license number starts with 'MD', including their ID, first name, and last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id, first_name, last_name FROM healthcare.doctors WHERE license_number LIKE 'MD%';",
"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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_bir... | [
{
"role": "user",
"content": "List the product_id and product_name for insurance products that are not currently active.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_id, product_name FROM insurance.insurance_products WHERE is_active = FALSE;",
"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 erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number contain... | [
{
"role": "user",
"content": "Show all SUI coins that are marked as 'exists' in both sui_coins and sui_coins_metadata, displaying their coin_type, symbol, name, and balance.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sc.coin_type, scm.symbol, scm.name, sc.balance FROM sui_coi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "For each player and game, how many achievements has the player unlocked? Display the player's username, the game title, and the number of achievements unlocked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, g.title, COUNT(pa.player_achie... |
You are an expert in writing database language. You can write a corresponding 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 hospitality_technology.guests ( guest_id character varying(64) NOT NULL, first_name ... | [
{
"role": "user",
"content": "Find pairs of guests living in the same city, returning each pair’s full names and the city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g1.first_name || ' ' || g1.last_name AS guest1,\n g2.first_name || ' ' || g2.last_name AS guest2,\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 smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "Which tokens on BSC and Polygon have a ROI higher than 2 this year? Show their symbols, ROI, and average cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, roi, avg_cost, chain FROM smart_money_token_performance WHERE (chain = 'BSC' 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Show me the full names of all patients who have received a diagnosis for 'hypertension', along with the appointment time and the doctor's full name for each related appointment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "List all game sessions that lasted longer than 30 minutes. Show the session_id, player_id, game_id, and duration_seconds.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT session_id, player_id, game_id, duration_seconds FROM gaming_technology.game_sess... |
You are an expert in writing database language. You can write a corresponding 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 achievement with the very next achievement unlocked by the same player using a self-join. Show player_id, current_ach, current_unlocked_at, next_ach, and next_unlocked_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pa1.player_id,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "List the citizen_id, first_name, last_name, and registration_date for all citizens who registered during March 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT citizen_id, first_name, last_name, registration_date\nFROM government_services.citizen... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Can you provide all pairs of hashtags created on the same date, including both hashtag_id values and their creation timestamps?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h1.hashtag_id AS hashtag1, h2.hashtag_id AS hashtag2, h1.created_at AS time... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.... | [
{
"role": "user",
"content": "Show the full names and contact emails of all citizens who have made payments for applications assigned to employees with the job title 'Supervisor'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.bookings ( booking_id.text, passenger_id.text, trip_id.text, seat_num... | [
{
"role": "user",
"content": "What are the average and maximum fare amounts for each booking status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, AVG(fare) AS avg_fare, MAX(fare) AS max_fare\nFROM transportation.bookings\nGROUP BY status;",
"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 blockchain.addresses ( address_id character varying(128) NOT NULL, public_key text N... | [
{
"role": "user",
"content": "List all address IDs and their corresponding public keys from the addresses table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address_id, public_key FROM blockchain.addresses;",
"sql": null
},
{
"role": "user",
"content": "Now, fi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "For each game, count the total number of achievements unlocked across all players. Show game title and count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, COUNT(pa.player_achievement_id) AS total_unlocked_achievements FROM gaming_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 web3.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(6... | [
{
"role": "user",
"content": "For each user, can you list all their wallet addresses and the creation timestamps of those wallets?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, address, created_at FROM web3.wallets ORDER BY user_id, created_at;",
"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 trading_platform.utxos (
utxo_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show all DApps that have metadata linked to an asset with a key of 'category', including the DApp name, URL, and the associated asset_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name, d.url, m.asset_id\nFROM trading_platform.dapps d\nJOIN tr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.messages (
message_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Which users have sent messages in multiple different conversations? Show the user ID and the count of unique conversations.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sender_user_id, COUNT(DISTINCT conversation_id) AS unique_conversation_count FR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.genre, COUNT(gs.session_id) AS session_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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "Show me all comments that have non-empty content, including their ID, post ID, user ID, and content.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT comment_id, post_id, user_id, content FROM social_media.comments WHERE content IS NOT NULL AND content... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id text, property_id text, first_name text, las... | [
{
"role": "user",
"content": "For each service order, list the order_id, reservation_id, the full name of the staff who ordered it as ordered_by, and the full name of the staff who delivered it as delivered_by.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT so.order_id,\n 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.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Which staff members processed payments for guests who live in California? I need their names and the corresponding guest names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT st.first_name AS staff_first_name, st.last_name AS staff_last_name... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Show for each game_id the total hidden achievements as hidden_count and total visible achievements as visible_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT achievement.game_id,\n SUM(CASE WHEN achievement.hidden THEN 1 ELSE 0 END) 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, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "List the content and creation time of all posts made in the last 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT content, created_at FROM social_media.posts WHERE created_at >= NOW() - INTERVAL '7 day';",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Find the average session duration in minutes for players from each country.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.country_code, AVG(gs.duration_seconds) / 60 AS avg_duration_minutes FROM gaming_technology.players p JOIN gaming_technology.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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Show me the list of all room numbers and their corresponding guest full names for current reservations (status is 'Occupied' or 'CheckedIn').",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.room_number, g.first_name || ' ' || g.last_name AS guest_fu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "Find all pairs of lawyers from the same firm who have the same specialization.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.lawyer_id AS lawyer_id_1, a.first_name AS first_name_1, a.last_name AS last_name_1, b.lawyer_id AS lawyer_id_2, b.first_na... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.documents ( document_id character varying(64) NOT NULL, case_id chara... | [
{
"role": "user",
"content": "Show me the count of documents grouped by document_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_type, COUNT(*) AS doc_count\nFROM legal_services.documents\nGROUP BY document_type;",
"sql": null
},
{
"role": "user",
"c... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.in_game_items ( item_id uuid PRIMARY KEY, game_id uuid, item_name ... | [
{
"role": "user",
"content": "I need pairs of items within the same game where one item_type is 'Weapon' and the other is 'Consumable'. Show game_id, weapon_name, and consumable_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i1.game_id, i1.item_name AS weapon_name, i2.item_... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, property_... | [
{
"role": "user",
"content": "Show me the review_id, review_date, and comment for all non-public reviews along with the guest's first and last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.review_date, r.comment, g.first_name, g.last_name\nFROM hospitality_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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the first name and last name of citizens who have uploaded documents that are still valid, together with the type of document and the upload timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, d.document_type, d.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.messages (
message_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Find the fastest reply for each conversation, showing conversation_id, initial_message_id, reply_message_id, and response_time in seconds.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m1.conversation_id,\n m1.message_id AS initial_message_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 financial_services.securities (
security_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Show me all securities listed on the 'NYSE' exchange with their ticker symbol and most recent close price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.security_name, s.ticker_symbol, md.close_price\nFROM financial_services.securities s\nJOIN fin... |
You are an expert in writing database language. You can write a corresponding 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": "Count the number of passengers in each month of the year 2024 based on their created_at date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(MONTH FROM created_at) AS month, COUNT(*) AS passenger_count\nFROM transportation.passengers\nWHERE 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 healthcare.medications ( medication_id character varying(64) NOT NULL, medication_na... | [
{
"role": "user",
"content": "List all combinations of manufacturers and generic names. For each combination, display the manufacturer, generic_name, and the number of medications.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT manufacturer, generic_name, COUNT(*) AS medication_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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Retrieve each vehicle's latest maintenance service date and mechanic alongside its make and model.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.vehicle_id, v.make, v.model, ml.service_date, ml.mechanic_name\nFROM transportation.vehicles v\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 web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show each contract address and the count of successful transactions sent to that contract.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.address, COUNT(t.transaction_id) AS success_tx_count FROM web3.contracts c JOIN web3.transactions t ON t.to_ad... |
You are an expert in writing database language. You can write a corresponding 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 text, agency_id text, first_name text, l... | [
{
"role": "user",
"content": "List the full names of employees whose direct manager themselves report to another manager. Also show the direct manager's full name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT E.first_name, E.last_name, M.first_name AS manager_first_name, M.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 web3.token_transfers (
transfer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List all token transfers between two distinct addresses, showing transfer_id, from_address, to_address, value, and transaction_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transfer_id, from_address, to_address, value, transaction_id\nFROM web3.... |
You are an expert in writing database language. You can write a corresponding 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 insurance.policy_beneficiaries (
beneficiary_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all beneficiaries who have a percentage share greater than 50% on a policy. Please include the beneficiary's first name, last name, relationship, the policy ID, and the policy's start date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Retrieve the guest_id, first_name, last_name, and loyalty_member_id for all guests who have communication_consent enabled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id, first_name, last_name, loyalty_member_id\nFROM hospitality_technology.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "Show the post ID and hashtags for all posts containing the word 'conference' in their content.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.post_id, h.hashtag_id, h.tag_name\nFROM social_media.posts p\nJOIN social_media.post_hashtags ph ON p.post... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo... | [
{
"role": "user",
"content": "List all users who currently have a 'pending' KYC status, showing their user ID and username.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username FROM users u JOIN kyc_audit k ON u.user_id = k.user_id WHERE k.status = 'pending';",
... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens where the price is greater than $0.1.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tm.name, tm.contract_address, tm... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, first_name text, last_n... | [
{
"role": "user",
"content": "List all securities that have at least one market data entry with a volume over 5,000,000. Include the security's ticker symbol, security name, and the exchange it trades on.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.ticker_symbol, 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 trading_platform.wallets ( wallet_id character varying(64) NOT NULL, user_id charact... | [
{
"role": "user",
"content": "Find all assets that have metadata linking them to a DApp (where metadata value is a DApp ID), showing asset name, symbol, and the linked DApp name. Assume the metadata key used is 'linked_dapp_id'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.na... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ... | [
{
"role": "user",
"content": "Which token on each chain has the highest ROI and what is its associated PNL and net_flow?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.chain,\n a.token_symbol,\n a.roi,\n a.pnl,\n a.net_flow\nFROM smart_money_token_perfor... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... | [
{
"role": "user",
"content": "Which projects had fundraising rounds in the first quarter of 2022, and what were their investment values and round names?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT project_name, rounds_name, investment_value, investment_date FROM project_fundra... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Show me all users who have liked both a post and a comment. Please include their user IDs, the post IDs, and the comment IDs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT l1.user_id, l1.post_id, l2.comment_id\nFROM social_media.likes l1\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 healthcare.medications (
medication_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "Show me all pairs of medications that share the same manufacturer. Include each medication's medication_id, medication_name, and the manufacturer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m1.medication_id AS med1_id, m1.medication_name AS med1_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medications ( medication_id character varying(64) NOT NULL, medication_na... | [
{
"role": "user",
"content": "Show me all medications, their manufacturer, and NDC code for medications manufactured by 'Johnson & Johnson' or 'Roche'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_name, manufacturer, ndc_code FROM healthcare.medications WHERE manufac... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.service_orders ( order_id text, reservation_id text, guest_id... | [
{
"role": "user",
"content": "Find guests who ordered the same service more than once on the same reservation and date. Return guest_id, reservation_id, service_id, and the date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT so1.guest_id,\n so1.reservation_id,\n so1.... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, first_nam... | [
{
"role": "user",
"content": "List each security and the total amount traded for it, with ticker symbol and security name. Only include trades from the last 90 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, SUM(t.total_amount) AS total_trad... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "I need a list of all group chat names with every username.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, c.group_name\nFROM social_media.users u\nJOIN social_media.conversations c ON 1=1\nWHERE c.is_group_chat = true;",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Get me all unbilled billable time entries with their entry_id, case_id, lawyer_id, hours_spent, and billing_rate.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT entry_id,\n case_id,\n lawyer_id,\n hours_spent,\n billing_rate\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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "Find all invoices that are currently overdue. Include the invoice number, due date, total amount, and the client's name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.invoice_number, i.due_date, i.total_amount, c.first_name, c.last_name FROM legal... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Show me claim_id, incident_date, policy_number, and customer full name for all claims where settlement_amount is null.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, p.policy_number, cu.first_name || ' ' || cu.last_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 transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "List the route number, route type, distance, and the city of the origin location for all routes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.route_number , T1.type , T1.distance_km , T2.city FROM transportation.routes AS T1 JOIN transportati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a... | [
{
"role": "user",
"content": "Show all token transfers where the token_symbol contains 'ETH' and include the transfer id, value, transaction id, and the contract address where the token was created.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tt.transfer_id, tt.value, tt.trans... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Get the average overall review rating for each property. Return property_name and avg_rating.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pr.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.reviews r\nJOIN hospitalit... |
You are an expert in writing database language. You can write a corresponding 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 top 5 Sui NFT collections with the highest number of unique owners, along with their names and collection types.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, collection_type, COUNT(DISTINCT owner) AS unique_owners FROM sui_nfts WH... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.users ( user_id character varying(64) NOT NULL, username character varying(128)... | [
{
"role": "user",
"content": "For each user, find the previous user by registration time. List current user_id and username, previous user_id and username, and the time difference in minutes between their registrations.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_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 text PRIMARY KEY, property_id t... | [
{
"role": "user",
"content": "For each reservation, find the next reservation made by the same guest and calculate the gap in days between them.",
"sql": null
},
{
"role": "assistant",
"content": "select r1.reservation_id as current_reservation_id, r2.reservation_id as next_reservation_id, 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 government_services.employees ( employee_id.text, agency_id.text, first_name.text, l... | [
{
"role": "user",
"content": "List the full names and hire dates of all employees who report directly to a manager with the job title 'Director'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, e.hire_date\nFROM government_services.employees e\nJOIN gove... |
You are an expert in writing database language. You can write a corresponding 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": "List all accounts having both a loan and at least one transaction in the last 7 days. Show account_id, account_type, and the total number of transactions in that period.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.account_id, a.account_type, COU... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "Show me all NFT collections on Ethereum with more than 10,000 tokens, including their names and contract addresses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, contract_address FROM nft_collections WHERE blockchain = 'Ethereum' AND token_cou... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "Which citizens have submitted applications for services that belong to the 'Education' category? List the citizen's full name, the service name, and the application ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.first_name || ' ' || c.last_name... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE manufacturing.components (
component_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "我想获取某个仓库中所有组件的库存信息,包括组件ID、库存数量和接收日期。",
"sql": null
},
{
"role": "assistant",
"content": "SELECT ci.component_id, ci.quantity, ci.received_date\nFROM manufacturing.component_inventory ci\nWHERE ci.location_warehouse = 'specific_warehouse';",
"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.users ( user_id text, username text, email text, password_hash text, created_at... | [
{
"role": "user",
"content": "Find pairs of users who have different usernames but share the same username length. List both user IDs, usernames, and the shared username length.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u1.user_id, u1.username AS user1_username, u2.user_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.insurance_products ( product_id text, product_name text, product_type text... | [
{
"role": "user",
"content": "Show the product name, type, and creation date for products created before January 1st, 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_name, product_type, created_at FROM insurance.insurance_products WHERE created_at < '2023-01-01';",
... |
You are an expert in writing database language. You can write a corresponding 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 full names of guests who have made reservations at properties with a star rating of 5. Include the guest ID and the property name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.guest_id, T3.property_name FROM... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam... | [
{
"role": "user",
"content": "Show me all drivers hired in 2023, including their full name and email address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM transportation.drivers WHERE hire_date >= '2023-01-01' AND hire_date < '2024-01-01';",
... |
You are an expert in writing database language. You can write a corresponding 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.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "List pairs of wallets created on the same day but belonging to different users. Show the wallet IDs, user IDs, and creation dates for both wallets in each pair.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet1_id, w1.user_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 insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show me all active policies for customers who live in California, along with their total premium payments made so far.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.policy_number, c.first_name, c.last_name, p.premium_amount, SUM(pp.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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "List all NFTs minted in the last 30 days, including their contract address, token id, and minter address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, token_id, minter FROM nft_metadata WHERE mint_time >= (strftime('%s', 'now') - ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "How many players are registered for each country? Return the country_code and the player count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT country_code, COUNT(*) AS player_count FROM gaming_technology.players GROUP BY country_code;",
"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 web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a... | [
{
"role": "user",
"content": "List all contracts and the number of different tokens associated with each contract address. Show contract_id, contract address, and token_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.contract_id, c.address, COUNT(DISTINCT t.token_id) AS t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key t... | [
{
"role": "user",
"content": "List the asset names and symbols for all assets of type 'token'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT name, symbol FROM trading_platform.assets WHERE type = 'token';",
"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 blockchain.nodes ( node_id text, ip_address text, port integer, last_seen timestamp ... | [
{
"role": "user",
"content": "How many unique email domains are there among all registered users?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT SUBSTRING(email FROM POSITION('@' IN email) + 1)) AS unique_domains FROM blockchain.users;",
"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 financial_services.customers (
customer_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Show me all active accounts with a balance greater than 2000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_id, account_number, customer_id, account_type, balance, currency\nFROM financial_services.accounts\nWHERE status = 'Open' AND balance... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List the username and email for users who joined after March 1, 2024, and are not verified.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT username, email FROM social_media.users WHERE created_at >= '2024-03-01' AND is_verified = false;",
"sql": ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id text PRIMARY KEY, property_id text, ser... | [
{
"role": "user",
"content": "What is the average price of services grouped by category? Display category and average_price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT category, AVG(price) AS average_price FROM hospitality_technology.services GROUP BY category;",
"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.room_types ( room_type_id.text, property_id.text, type_name.t... | [
{
"role": "user",
"content": "Show all room types that offer 'WiFi' in their amenities.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT room_type_id, property_id, type_name, amenities FROM hospitality_technology.room_types WHERE amenities LIKE '%WiFi%';",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Get each staff member who delivered service orders in the last month and the count of orders they delivered.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id,\n s.first_name,\n s.last_name,\n COUNT(so.order_id) AS delivered... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve document names and the uploader's full name for all documents with version greater than 1.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_name,\n l.first_name || ' ' || l.last_name AS uploader\nFROM legal_services.documents ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// db.createCollection('stations')
// Optional: Add unique index: db.stations.createIndex({ stati... | [
{
"role": "user",
"content": "Can you help me retrieve the details of all bookings for a specific station with station_id 'station_xyz', including the associated schedule and passenger information?",
"sql": null
},
{
"role": "assistant",
"content": "db.bookings.aggregate([\n {\n $l... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, c... | [
{
"role": "user",
"content": "Give me a list of all appointments showing the subject and location, for appointments created after March 1st, 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT subject, location FROM legal_services.appointments WHERE created_at > '2024-03-01';",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "List all SUI coins with status 'exists', showing their object_id, coin_type, and owner.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT object_id, coin_type, owner FROM sui_coins WHERE status = 'exists'",
"sql": null
},
{
"role": "user",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.t... | [
{
"role": "user",
"content": "List all wallets created before '2024-01-01', including the wallet_id, user_id, and creation date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT wallet_id, user_id, created_at FROM wallets WHERE created_at < '2024-01-01';",
"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.medical_records ( record_id text PRIMARY KEY, patient_id text, appointmen... | [
{
"role": "user",
"content": "Count the number of medical records created for each doctor, and list the doctor_id alongside their record count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT doctor_id, COUNT(*) AS record_count FROM healthcare.medical_records GROUP BY doctor_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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "For each asset, show its name, symbol, and the total trade quantity executed in July 2024. Please also display the username of each buyer for these trades.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.name AS asset_name, a.symbol AS asset_symbol,... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve all lawyers specializing in 'Corporate Law', including their first_name, last_name, email, and phone.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email, phone\nFROM legal_services.lawyers\nWHERE specialization = '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 legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"role": "user",
"content": "Compute the total invoiced amount and average payment delay (in days) by status for invoices issued between 2024-01-01 and 2024-06-30.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status,\n SUM(total_amount) AS total_invoiced,\n AVG(EXT... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Find all bookings for which the special_requests field is not null. Show the booking ID, passenger ID, and the special request.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT booking_id, passenger_id, special_requests\nFROM transportation.bookings\nW... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.