system stringlengths 336 7.84k | 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Show the patient ID, first name, last name, and email for all patients who have provided both an email address and a phone number."
},
{
"role": "assistant",
"content": "SELECT patient_id, first_name, last_name, email FROM healthcare.patients WHERE email IS NOT 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": "Show me all medical records created before January 1, 2022."
},
{
"role": "assistant",
"content": "SELECT * FROM healthcare.medical_records WHERE record_date < '2022-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 transportation.maintenance_logs ( log_id text PRIMARY KEY, vehicle_id text, service_... | [
{
"role": "user",
"content": "Show me all maintenance logs for vehicles that had an 'Oil Change' service in the last 3 months, including the vehicle ID, service date, and cost."
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, cost FROM transportation.maintenance_logs WHERE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"role": "user",
"content": "Which players have not logged in in the last 30 days but have unlocked any achievements? Show player_id, username, and total unlocked achievements."
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, COUNT(pa.achievement_id) AS total_unlocked\nFRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "I need to get the count of appointments grouped by their status."
},
{
"role": "assistant",
"content": "SELECT a.status, \n COUNT(*) AS appointment_count\nFROM legal_services.appointments a\nGROUP BY a.status;"
},
{
"role": "user",
"content": "Only... |
You are an expert in writing database language. You can write a corresponding 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, -- unique iden... | [
{
"role": "user",
"content": "List all users whose usernames start with the letter 'B'."
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, created_at FROM trading_platform.users WHERE username LIKE 'B%';"
},
{
"role": "user",
"content": "Can you make it case-inse... |
You are an expert in writing database language. You can write a corresponding 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": "How many likes has post 'P789' received in total?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS total_likes\nFROM social_media.likes\nWHERE post_id = 'P789';"
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "List the top 5 addresses that have received the most token transfers."
},
{
"role": "assistant",
"content": "SELECT to_address, COUNT(*) AS transfer_count FROM web3.token_transfers GROUP BY to_address ORDER BY transfer_count DESC LIMIT 5;"
},
{
"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
Collection 'inspections'. Document structure: { _id: <ObjectId (or inspection_id)>, inspection_id... | [
{
"role": "user",
"content": "Can you help me retrieve all inspection records for a specific build ID, including the inspection type, result, and the timestamp of the inspection, along with the associated component ID if available?"
},
{
"role": "assistant",
"content": "db.inspections.find({ bui... |
You are an expert in writing database language. You can write a corresponding 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, citizen_id.text, applicati... | [
{
"role": "user",
"content": "For each application that has at least one failed notification, provide the application ID, the total number of notifications received for that application, and the count of failed notifications."
},
{
"role": "assistant",
"content": "SELECT application_id, COUNT(*)... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.blocks ( block_id.text, previous_block_id.text, timestamp.timestamp, nonc... | [
{
"role": "user",
"content": "Retrieve the username and email for every user, along with the wallet ID and associated address ID for any wallets they own."
},
{
"role": "assistant",
"content": "SELECT\n u.username,\n u.email,\n w.wallet_id,\n w.address_id\nFROM\n blockchain.users ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Show me all users who have never commented on any post."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username\nFROM social_media.users u\nLEFT JOIN social_media.comments c ON u.user_id = c.user_id\nWHERE c.comment_id IS 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.conversation_participants ( participant_id text, conversation_id text, ... | [
{
"role": "user",
"content": "Show me the usernames of users who have joined more than one conversation, and list the conversation IDs for each user."
},
{
"role": "assistant",
"content": "SELECT user_id, ARRAY_AGG(conversation_id) AS conversation_ids\nFROM social_media.conversation_participants... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"role": "user",
"content": "For each exchange, compute the percentage change in total USD value of its holdings between snapshots '2023-01-01 00:00:00' and '2023-02-01 00:00:00'. Show exchange, chain, value_jan, value_feb, and pct_change."
},
{
"role": "assistant",
"content": "SELECT t1.exchan... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash... | [
{
"role": "user",
"content": "Show the usernames of players and a count of how many different item types they have in their inventory."
},
{
"role": "assistant",
"content": "SELECT T1.username, count(DISTINCT T3.item_type) FROM gaming_technology.players AS T1 JOIN gaming_technology.player_invent... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Show the names of all insurance plans and the number of patients enrolled in each plan."
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, COUNT(pi.patient_id) AS enrolled_patients FROM healthcare.insurance_plans ip JOIN healthcare.patient_insurance pi ON i... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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."
},
{
"role": "assistant",
"content": "SELECT claim_id\nFROM insurance.claim_documents\nWHERE document_type IN ('Accident Report', 'Damage Assessment')\nGROUP BY 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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "List all drivers whose licenses expire in the next 30 days, along with their contact information."
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name, license_number, license_expiry_date, contact_number, email FROM transportation.drivers W... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id character varying(64) NOT NULL, product_na... | [
{
"role": "user",
"content": "Show me the total premium paid by each customer for insurance products where the base premium is less than 2000. I want to see customer_id, product_id, and total_premium_paid."
},
{
"role": "assistant",
"content": "SELECT pp.customer_id, ip.product_id, SUM(pp.amount... |
You are an expert in writing database language. You can write a corresponding 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": "How many distinct users have uploaded claim documents of type 'ACCIDENT_REPORT'?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT uploaded_by) FROM insurance.claim_documents WHERE document_type = 'ACCIDENT_REPORT';"
}
] |
You are an expert in writing database language. You can write a corresponding 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."
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.incident_date, p.policy_number, cu.first_name || ' ' || cu.last_name AS customer_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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var... | [
{
"role": "user",
"content": "Retrieve the agent ID, first and last name, agency name, and their manager's first and last name for every agent."
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agent_last_name, a.agency_name, m.first_name ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE smart_money_token_inflow (",
"token_address character varying(100) NOT NULL, ... | [
{
"role": "user",
"content": "What are the top 3 narratives with the highest total USD buy value?"
},
{
"role": "assistant",
"content": "SELECT narrative,\n SUM(usd_value) AS total_buy_usd\nFROM smart_money_token_inflow\nWHERE type = 1\nGROUP BY narrative\nORDER BY total_buy_usd DESC\nLIMI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.services ( service_id text, agency_id text, service_name text, d... | [
{
"role": "user",
"content": "Which services charge more than the average standard fee of their category? Show the service name, its fee, and the average fee for that category."
},
{
"role": "assistant",
"content": "SELECT\n s.service_name,\n s.standard_fee,\n avg_fees.avg_fee\nFROM governmen... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount."
},
{
"role": "assistant",
"content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas tm ON eb.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 legal_services.documents ( document_id text, case_id text, document_name text, docum... | [
{
"role": "user",
"content": "Show the latest version number of each document_name for every case."
},
{
"role": "assistant",
"content": "SELECT case_id,\n document_name,\n MAX(version) AS latest_version\nFROM legal_services.documents\nGROUP BY case_id, document_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.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "List the content and creation time of posts made by users who have a private profile."
},
{
"role": "assistant",
"content": "SELECT T1.content, T1.created_at FROM social_media.posts AS T1 JOIN social_media.users AS T2 ON T1.user_id = T2.user_id JOIN social_media.use... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil... | [
{
"role": "user",
"content": "Find pairs of claim documents for the same claim where the upload time difference is less than 5 minutes. List the document IDs of the pairs and the claim ID."
},
{
"role": "assistant",
"content": "SELECT a.document_id AS document1_id, b.document_id AS document2_id,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "I want to see a list of all patients, including their full name and date of birth, along with every doctor they have been diagnosed by and that doctor's specialty."
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name || ' ' || p.last_name AS pati... |
You are an expert in writing database language. You can write a corresponding 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": "Show me pairs of invoice numbers for the same case."
},
{
"role": "assistant",
"content": "SELECT T1.invoice_number, T2.invoice_number, T1.case_id FROM legal_services.invoices AS T1 JOIN legal_services.invoices AS T2 ON T1.case_id = T2.case_id AND T1.invoice_id <> 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"role": "user",
"content": "List all SUI coins that have status 'exists' in both `sui_coins` and `sui_coins_metadata`. Show their `coin_type`, `balance`, and `owner`."
},
{
"role": "assistant",
"content": "SELECT sc.coin_type, sc.balance, sc.owner FROM sui_coins sc JOIN sui_coins_metadata scm ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Show me the top 5 most recent medical records with a fever recorded. Return record_id, patient_id, record_date, and the temperature value from vitals."
},
{
"role": "assistant",
"content": "SELECT record_id,\n patient_id,\n record_date,\n vitals->>... |
You are an expert in writing database language. You can write a corresponding 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 with status 'Cancelled' and show the reservation_id, property_name, and room_type_name."
},
{
"role": "assistant",
"content": "SELECT res.reservation_id,\n p.property_name,\n rt.type_name AS room_type_name\nFROM hospitality_tech... |
You are an expert in writing database language. You can write a corresponding 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": "Show all appointments that have 'follow-up' mentioned in the notes field."
},
{
"role": "assistant",
"content": "SELECT * FROM healthcare.appointments WHERE notes LIKE '%follow-up%';"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve each patient's full name, total number of appointments, and date of their most recent appointment."
},
{
"role": "assistant",
"content": "SELECT p.first_name || ' ' || p.last_name AS patient_name, COUNT(a.appointment_id) AS appointment_count, MAX(a.appointm... |
You are an expert in writing database language. You can write a corresponding 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.prescriptions ( prescription_id.text, record_id.text, patient_id.text, do... | [
{
"role": "user",
"content": "What is the average quantity_dispensed per route for prescriptions with start_date in 2024? Return route and avg_quantity."
},
{
"role": "assistant",
"content": "SELECT route,\n AVG(quantity_dispensed) AS avg_quantity\nFROM healthcare.prescriptions\nWHERE star... |
You are an expert in writing database language. You can write a corresponding 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.assets ( asset_id character varying(64) NOT NULL, name character va... | [
{
"role": "user",
"content": "Show me all assets whose symbol starts with 'BTC' or 'ETH', along with their full names and types."
},
{
"role": "assistant",
"content": "SELECT asset_id, name, symbol, type FROM trading_platform.assets WHERE symbol LIKE 'BTC%' OR symbol LIKE 'ETH%';"
}
] |
You are an expert in writing database language. You can write a corresponding 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": "Calculate the average length of stay in days for completed reservations for each property."
},
{
"role": "assistant",
"content": "SELECT p.property_id,\n p.property_name,\n AVG(res.check_out_date - res.check_in_date) AS avg_stay_days\nFROM hospitality_te... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text, username text, email text, password_hash text... | [
{
"role": "user",
"content": "List the user ID and username for users who have placed orders for assets of type 'cryptocurrency'."
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.user_id, T1.username FROM trading_platform.users AS T1 JOIN trading_platform.orders AS T2 ON T1.user_id = 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 legal_services.documents ( document_id text, case_id text, document_name text, docum... | [
{
"role": "user",
"content": "Show me all documents that have a version greater than 2 and include the document name, upload timestamp, and description."
},
{
"role": "assistant",
"content": "SELECT document_id, document_name, upload_timestamp, description FROM legal_services.documents WHERE ver... |
You are an expert in writing database language. You can write a corresponding 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.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"role": "user",
"content": "List all failed payments (status = 'failed') with their reservation IDs and amounts, ordered by the payment timestamp."
},
{
"role": "assistant",
"content": "SELECT payment_id, reservation_id, amount, payment_timestamp FROM hospitality_technology.payments WHERE stat... |
You are an expert in writing database language. You can write a corresponding 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 log entries associated with users who have participated in any trade, showing the log details and the trade ID."
},
{
"role": "assistant",
"content": "SELECT T1.log_id, T1.action, T1.details, T1.logged_at, T2.trade_id, T2.buyer_id, T2.seller_id FROM logs 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": "Show me case number, case name, and the lead lawyer's full name for all cases in the 'State Court' jurisdiction."
},
{
"role": "assistant",
"content": "SELECT T1.case_number, T1.case_name, T2.first_name, T2.last_name FROM cases AS T1 JOIN lawyers AS T2 ON T1.lead_la... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.service_locations ( location_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List the number of appointments for each booking method."
},
{
"role": "assistant",
"content": "SELECT\n a.booking_method,\n COUNT(*) AS appointment_count\nFROM appointments a\nGROUP BY a.booking_method;"
},
{
"role": "user",
"content": "Filter this to... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medications (
medication_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "List the medication_id, medication_name, and description for all medications whose generic_name starts with 'A'."
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, description\nFROM healthcare.medications\nWHERE generic_name LIKE '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 healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id ch... | [
{
"role": "user",
"content": "For each patient, find their latest medical record and show patient_id, latest_record_id, and record_date."
},
{
"role": "assistant",
"content": "SELECT a.patient_id,\n a.record_id AS latest_record_id,\n a.record_date\nFROM healthcare.medical_records a\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.patient_insurance (
patient_insurance_id character varying(64) NOT NU... | [
{
"role": "user",
"content": "Retrieve a list of all patient insurance policies, showing the subscriber name and the name of the insurance provider for the plan."
},
{
"role": "assistant",
"content": "SELECT T1.subscriber_name, T2.insurance_provider FROM healthcare.patient_insurance AS T1 JOIN h... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.dapps (
dapp_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List the names of all DApps whose description contains the word 'auction' along with the user IDs of anyone who has had a KYC audit."
},
{
"role": "assistant",
"content": "SELECT d.name AS dapp_name, k.user_id\nFROM trading_platform.dapps d\nJOIN trading_platform.ky... |
You are an expert in writing database language. You can write a corresponding 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": "Get the usernames of users who have created any public posts, and count how many public posts each user has made. Order the results by the post count in descending order."
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(p.post_id) AS public_post_count... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE 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."
},
{
"role": "assistant",
"content": "SELECT s.security_name, s.ticker_symbol, md.close_price\nFROM financial_services.securities s\nJOIN financial_services.m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.