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 financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "List all customers in California ('CA'). Show their full name, city, and date of birth.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, city, date_of_birth FROM financial_services.customers WHERE state = 'CA'",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"role": "user",
"content": "For each blockchain (chain), which token symbol has the highest Return on Investment (ROI)? Show the chain, token symbol, and the highest ROI.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, token_symbol, roi FROM ( SELECT chain, token_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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "Can you list the names of agencies that do not have a parent agency assigned, ordered by their established date?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agency_id, agency_name, established_date\nFROM government_services.agencies\nWHERE parent_... |
You are an expert in writing database language. You can write a corresponding 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 text PRIMARY KEY, medication_name text, gener... | [
{
"role": "user",
"content": "Find all medications whose NDC code starts with '0003'. Show the medication ID and NDC code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT medication_id, ndc_code FROM healthcare.medications WHERE ndc_code LIKE '0003%';",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text... | [
{
"role": "user",
"content": "Find all pairs of doctors who share the same specialty. Display d1.doctor_id, d1.first_name, d1.last_name, d2.doctor_id, d2.first_name, d2.last_name, and the specialty.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.doctor_id AS doctor1_id, d1.fir... |
You are an expert in writing database language. You can write a corresponding 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": "Can you list the email addresses, full names, and loyalty program IDs of all passengers who joined in March 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT email, first_name, last_name, loyalty_program_id FROM transportation.passengers WHERE DAT... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "I want to see all time entries where the description contains the word 'draft' and that have not been billed yet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT *\nFROM legal_services.time_entries\nWHERE description ILIKE '%draft%'\n AND is_billed =... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.room_types ( room_type_id text PRIMARY KEY, property_id text,... | [
{
"role": "user",
"content": "List all guests from California who are loyalty members, including their email and phone number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id, first_name, last_name, email, phone_number FROM hospitality_technology.guests WHERE state_provin... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time... | [
{
"role": "user",
"content": "Calculate the monthly total quantity of fuel consumed and the average cost_per_unit for each fuel_type in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT date_trunc('month', log_timestamp) AS month,\n fuel_type,\n SUM(quantity) ... |
You are an expert in writing database language. You can write a corresponding 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": "For each depot, show the depot name, city, number of active vehicles, and average capacity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT loc.name AS depot_name, loc.city, COUNT(v.vehicle_id) AS active_vehicle_count, ROUND(AVG(v.capacity),2) AS avg_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ... | [
{
"role": "user",
"content": "What is the average ROI and average realized_ratio for each chain?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain,\n AVG(roi) AS avg_roi,\n AVG(realized_ratio) AS avg_realized_ratio\nFROM smart_money_token_performance\nGROUP BY chai... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases (
case_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "List the case ID, case number, and case name for all cases with status 'Open'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_id, case_number, case_name FROM legal_services.cases WHERE status = 'Open';",
"sql": null
},
{
"role": "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 trading_platform.dapps (
dapp_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show the name of DApps and the count of metadata entries linked to them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.name, COUNT(m.metadata_id) FROM trading_platform.dapps d JOIN trading_platform.metadata m ON d.dapp_id = m.asset_id GROUP BY d.n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "List all prescriptions with medication details. Return prescription_id, patient full name, medication_name, and prescription_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pr.prescription_id,\n p.first_name || ' ' || p.last_name AS patien... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "For each route, list the route number, description, and the combined total maintenance cost for all vehicles that have ever operated on that route.",
"sql": null
},
{
"role": "assistant",
"content": "WITH VehicleTotalMaintenance AS ( SELECT vehicle_id, SUM(cost)... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show me the list of all passengers who do not have a loyalty program membership, including their passenger ID and the date their record was created.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT passenger_id, created_at FROM transportation.passenger... |
You are an expert in writing database language. You can write a corresponding 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 all contracts deployed on 'testnet', including the contract_id, address, deployer_address, and deployed_at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_id, address, deployer_address, deployed_at\nFROM web3.contracts\nWHERE network_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, -- unique iden... | [
{
"role": "user",
"content": "For each user, list their username and the total number of filled orders they have placed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, COUNT(o.order_id) AS filled_order_count\nFROM trading_platform.users u\nJOIN trading_platform.orders... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser... | [
{
"role": "user",
"content": "Find the average score for each player who has participated in game sessions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, AVG(score) AS avg_score\nFROM gaming_technology.game_sessions\nGROUP BY player_id;",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "Show the full name and email of all drivers who have an expired license (license_expiry_date before today).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email\nFROM transportation.drivers\nWHERE license_expiry_date < CURRENT_... |
You are an expert in writing database language. You can write a corresponding 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 items in total has each player acquired according to player_inventory?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n player_id,\n SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY player_id;",
"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.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "Retrieve all beneficiaries with their policy numbers, including beneficiary first and last name, relationship, and the policy end date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pb.beneficiary_id, pb.first_name, pb.last_name, pb.relationship, p.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Show me all patients who have scheduled appointments with doctors specializing in Cardiology, along with their appointment times and reasons, ordered by appointment time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, a.app... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, roo... | [
{
"role": "user",
"content": "List the names and prices of all services ordered by guests from 'Texas', along with the guest's full name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.first_name, g.last_name, s.service_name, s.price\nFROM hospitality_technology.guests g\nJOIN ... |
You are an expert in writing database language. You can write a corresponding 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.follows ( follow_id.text, follower_user_id.text, following_user_id.text... | [
{
"role": "user",
"content": "For each user, count how many different conversations they have participated in. Show user_id and conversation_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, COUNT(DISTINCT conversation_id) AS conversation_count\nFROM social_media.con... |
You are an expert in writing database language. You can write a corresponding 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": "For each narrative, show its name and the total market cap of all related tokens based on DEX pool data.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.narrative, SUM(d.market_cap) AS total_market_cap\nFROM narrative_info n\nJOIN token_dexpool_info... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.bookings ( booking_id text, passenger_id text, trip_id text, seat_num... | [
{
"role": "user",
"content": "List each booking with its previous booking time for the same passenger.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT b.booking_id,\n b.passenger_id,\n b.booking_time,\n LAG(b.booking_time) OVER (PARTITION BY b.passenger_id ORDER ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "List smart money addresses on the 'Arbitrum' chain with a realized ratio between 0.5 and 0.8 and positive profit. Show address, profit, and realized_ratio.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, profit, realized_ratio FROM smart_mone... |
You are an expert in writing database language. You can write a corresponding 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.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, p... | [
{
"role": "user",
"content": "Which law firms were founded in the same year and share the same managing partner? Show the firm names, founding year, and managing partner ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.firm_name AS firm_name_1, f2.firm_name AS firm_name_2, E... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "List all premium payments that were made using 'credit card' as the payment method.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_id, policy_id, customer_id, payment_date, amount_paid, payment_method\nFROM insurance.premium_payments\nWHERE p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id tex... | [
{
"role": "user",
"content": "Show the invoice_id and total hours logged for each invoice.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT invoice_id, SUM(hours_spent) AS total_hours FROM legal_services.time_entries WHERE invoice_id IS NOT NULL GROUP BY invoice_id;",
"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 token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, t... | [
{
"role": "user",
"content": "What is the total amount of the ERC20 token with contract address '0x112233...' held across all wallets?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(CAST(amount AS DECIMAL)) FROM erc20_balances_historical WHERE contract_address = '0x112233...'... |
You are an expert in writing database language. You can write a corresponding 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 contract, find the next contract deployed on the same network. Show the original contract_id, the next contract_id, network_id, and the time difference in hours between deployments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c1.contra... |
You are an expert in writing database language. You can write a corresponding 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": "Find appointments and prescriptions associated with the same patient and doctor. Show the appointment ID, prescription ID, patient ID, and doctor ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.appointment_id , T2.prescription_id , T1.patient... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "List all trips that were completed and experienced a significant delay in actual arrival compared to the scheduled arrival (more than 45 minutes).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n trip_id,\n vehicle_id,\n driver_id,\n scheduled_ar... |
You are an expert in writing database language. You can write a corresponding 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": "Show the first name, last name, and the date they joined (created_at) for all passengers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, created_at FROM transportation.passengers;",
"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 healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text... | [
{
"role": "user",
"content": "List all chronic diagnoses made by Cardiology specialists in the last year, including the patient ID, diagnosis description, and doctor's full name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT dg.patient_id, dg.description, d.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 web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "Find all events emitted by contracts that are also associated with token transfers. Show the event id, contract id, event name, emitted_at, transaction id, and also include the corresponding transfer id from token_transfers.",
"sql": null
},
{
"role": "assistant",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), g... | [
{
"role": "user",
"content": "I need to list all pairs of in-game items in the same game where one item is Epic and the other is Legendary, showing game_id, epic_item, and legendary_item.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.game_id,\n a.item_name AS epic_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 financial_services.securities ( security_id.text, ticker_symbol.text, isin_code.text... | [
{
"role": "user",
"content": "I want to see, for each security, the total number of market data points and the average adjusted_close_price, including ticker_symbol and security_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, s.security_name, COUNT(md.data_p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.transactions ( transaction_id character varying(64) NOT NULL, acc... | [
{
"role": "user",
"content": "Which accounts initiated transfer transactions to related accounts in April 2024, and what is the total amount sent per account?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT account_id, SUM(amount) AS total_sent\nFROM financial_services.transaction... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "Calculate the total and average premium amounts for policies that are currently Active.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(premium_amount) AS total_premium,\n AVG(premium_amount) AS average_premium\nFROM insurance.policies\nWHER... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id.text, user_id.text, content.text, media_url.text, media... | [
{
"role": "user",
"content": "List all comments made on public posts that have a location specified, including comment_id, post_id, comment content, and the comment's created_at timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.comment_id,\n c.post_id,\n c.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.patients ( patient_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "List all prescriptions with the corresponding patient's emergency contact name and phone number. Show prescription ID, patient full name, emergency contact name, and emergency contact phone.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pr.prescript... |
You are an expert in writing database language. You can write a corresponding 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": "Which lawyers have handled cases in the 'Federal Court' jurisdiction? Return each lawyer's first and last name, the case number, and the court jurisdiction.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, c.case_number, c.co... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "Which transaction_id has the highest total value transferred? Show the transaction_id and the sum of values for that transaction.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, SUM(value) AS total_transaction_value FROM web3.token_tra... |
You are an expert in writing database language. You can write a corresponding 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.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "List all pairs of tokens that are deployed on the same contract address and have the same number of decimals. Show both token IDs, the shared contract_address, and the decimals value.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.token_id AS toke... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.reservations ( reservation_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "Show all reviews made by guests along with the guest_id, guest's reservation_id, and the related property's property_id and review_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.review_id, r.guest_id, r.reservation_id, r.property_id, r.review... |
You are an expert in writing database language. You can write 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": "我想查询所有检查结果为'Pass'的记录,包括检查类型、检查时间和检查备注,同时关联到对应的组件信息。",
"sql": null
},
{
"role": "assistant",
"content": "db.inspections.aggregate([\n {\n $match: {\n result: 'Pass'\n }\n },\n {\n $lookup: {\n from: 'components',\n localField: 'componen... |
You are an expert in writing database language. You can write a corresponding 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_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "For each chain, show the total number of smart money addresses and the count of addresses with positive profit.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT chain, COUNT(address) AS total_addresses, COUNT(CASE WHEN profit > 0 THEN address END) AS p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "For each trip that has associated bookings, show the trip ID, the total number of passengers recorded for the trip, and the total fare collected from all bookings for that trip.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.trip_id, T1.passenger_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.guests ( guest_id.text, first_name.text, last_name.text, emai... | [
{
"role": "user",
"content": "How many guests are there in each city? Show the city and the guest count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT city, COUNT(guest_id) FROM hospitality_technology.guests GROUP BY city;",
"sql": null
},
{
"role": "user",
"cont... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ... | [
{
"role": "user",
"content": "Show the full name and contact email of citizens who have submitted at least one application for services that are currently inactive.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_... |
You are an expert in writing database language. You can write a corresponding 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": "Show me the total unbilled billable hours per lawyer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lawyer_id, SUM(hours_spent) AS total_unbilled_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\n AND is_billed = FALSE\nGROUP BY 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 web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex... | [
{
"role": "user",
"content": "Find token transfers within the same transaction where the recipient of an earlier transfer (based on log_index) becomes the sender of a later transfer. List the transaction ID, the earlier transfer ID, the later transfer ID, the shared address, and the value transferred in bot... |
You are an expert in writing database language. You can write a corresponding 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": "Which users have commented on posts created by the users they follow? Please show the commenter user_ids and the followed user_ids.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT c.user_id AS commenter_user_id, f.following_user_id AS followe... |
You are an expert in writing database language. You can write a corresponding 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": "For each achievement, list how many unique players have unlocked it.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT achievement_id, COUNT(DISTINCT player_id) AS unique_players FROM gaming_technology.player_achievements GROUP BY achievement_id;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), g... | [
{
"role": "user",
"content": "Can you show me the count of items and the average cost_amount for each item_type and rarity?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_type, rarity, COUNT(*) AS item_count, AVG(cost_amount) AS avg_cost_amount\nFROM gaming_technology.in_gam... |
You are an expert in writing database language. You can write a corresponding 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": "List all staff members who work at properties offering 'Wellness' services, including the staff member's full name and position, and the property ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT s.first_name, s.last_name, s.position, s.pro... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "I need to find all pairs of policies for each customer whose coverage periods overlap. Show customer_id, the two policy_ids for each overlapping pair.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.customer_id,\n p1.policy_id AS policy1_id,\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash... | [
{
"role": "user",
"content": "List all item names and quantities a player with username 'DragonRider' owns, and include the game titles for those items.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.item_name, pi.quantity, g.title AS game_title\nFROM gaming_technology.players ... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, agency_id ... | [
{
"role": "user",
"content": "Provide the count of applications grouped by their status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS application_count\nFROM government_services.applications\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 web3.token_transfers ( transfer_id character varying(64) NOT NULL, token_id characte... | [
{
"role": "user",
"content": "For each token, list the number of distinct sender addresses that have sent that token. Show the token ID and the count of distinct senders.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_id, COUNT(DISTINCT from_address) AS distinct_sender_coun... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.messages ( message_id character varying(64) NOT NULL, conversation_id c... | [
{
"role": "user",
"content": "List `user_id` and `conversation_id` for participants who are in conversations where there is at least one message sent by *another* user that they have not read.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.user_id, T1.conversation_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.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "What is the total revenue generated for each department from delivered service orders? Return department and total_revenue.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.department,\n SUM(so.total_price) AS total_revenue\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 insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.ti... | [
{
"role": "user",
"content": "List each claim_handler_id and the number of claims they handled that were reported in 2023.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_handler_id,\n COUNT(*) AS claims_count\nFROM insurance.claims\nWHERE reported_date::date BETWEEN '... |
You are an expert in writing database language. You can write a corresponding 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": "Get a list of all policies that have at least two beneficiaries with a percentage_share greater than 20%. Include policy_id, policy_number, and beneficiary_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_id, p.policy_number, COUNT(pb.b... |
You are an expert in writing database language. You can write a corresponding 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 a list of diagnoses along with the chief complaint noted in the corresponding medical record. Display diagnosis description, diagnosis date, and the chief complaint.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.description, T1.diagnosis_dat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices (
invoice_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Show me the total invoice amount and the number of invoices for each client in 2024, and include the earliest and latest invoice issue date for each client.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT client_id, SUM(total_amount) AS total_invoice_... |
You are an expert in writing database language. You can write a corresponding 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 first name, last name, and agency name of agents who have sold at least one policy to a customer living in 'CA'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name, T1.agency_name FROM insurance.agents AS T1 ... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the history of incidents or accidents that occurred on platform 5 at station GHI?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information about the history of incidents or accidents on platform 5 at station GHI. My ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "Retrieve the policy_number, start_date, end_date, premium_amount, and corresponding product_name for policies with a coverage_limit greater than 500000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.start_date, p.end_date, p.premi... |
You are an expert in writing database language. You can write a corresponding 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": "For citizens who registered before January 1, 2023, show the total number of notifications sent to them for each channel. List the citizen's first name, last name, the channel, and the count of notifications.",
"sql": null
},
{
"role": "assistant",
"content": "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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Show me the usernames and emails of users who have liked any comment, along with the comment IDs and when the like occurred.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, u.email, l.comment_id, l.created_at\nFROM social_media.likes l\nJO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "Which agents have sold more than 10 insurance policies, and what are the average premium amounts of the policies they sold? Also, include the agent ID and their name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agent_id, a.first_name, a.last_nam... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show all contracts and the names of all events they have ever emitted. Include contract_id, contract address, and event_name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.contract_id, c.address, e.event_name\nFROM web3.contracts c\nJOIN web3.even... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me the count of trips by status for each vehicle, but only include vehicles that have had more than 5 trips total.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, status, COUNT(*) as trip_count FROM transportation.trips GROUP BY vehic... |
You are an expert in writing database language. You can write a corresponding 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, address character varyi... | [
{
"role": "user",
"content": "For each contract that has received transactions, list its address and the total value of Ether received.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.address, SUM(T2.value) FROM web3.contracts AS T1 JOIN web3.transactions AS T2 ON T1.address = ... |
You are an expert in writing database language. You can write a corresponding 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.text, agency_id.text, location_n... | [
{
"role": "user",
"content": "For each service location, find its nearest accessible location by geographic distance.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sl.location_id,\n sl.location_name,\n nearest.location_id AS nearest_location_id,\n nearest.loc... |
You are an expert in writing database language. You can write a corresponding 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.text, transaction_id.text, output_index.integer, ad... | [
{
"role": "user",
"content": "Show me the distribution of UTXO amounts by creating buckets (0-10, 10-50, 50-100, 100-500, 500+), along with the count and total amount in each bucket.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT CASE WHEN amount <= 10 THEN '0-10' WHEN 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.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "Show all premium payments along with the incident date and estimated loss of any associated claims for the same policy. List payment_id, amount_paid, payment_date, incident_date, and estimated_loss.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.p... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.service_orders ( order_id.text, reservation_id.text, guest_id... | [
{
"role": "user",
"content": "For each staff member who delivered at least one service order, show their staff_id_delivered and the total revenue (sum of total_price) of orders they delivered.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT staff_id_delivered, SUM(total_price) 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, property_id text, guest_i... | [
{
"role": "user",
"content": "List reservations, including the reservation ID, check-in date, check-out date, property name, room type name, and room type base rate, for reservations with 3 or more adults.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.reservation_id, T1.check... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "Find pairs of servers that are currently 'online' and share the same game_id, listing their server names and the shared game_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1_name, s2.server_name AS server2_name, s1.game_id... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.utxos (
utxo_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "For each transaction ID, provide a count of unspent UTXOs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, COUNT(*) FROM utxos WHERE spent = FALSE GROUP BY transaction_id;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.premium_payments ( payment_id.text, policy_id.text, customer_id.text, paym... | [
{
"role": "user",
"content": "List all pending premium payments made in March 2024, showing payment_id, customer_id, amount_paid, and due_date, ordered by payment_date ascending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_id,\n customer_id,\n amount_paid,\... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show me all users whose email address contains the word 'test', along with their user IDs and the date they registered.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, username, email, created_at FROM trading_platform.users WHERE email ILIKE ... |
You are an expert in writing database language. You can write a corresponding 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": "Count the number of medications for each unique generic name. Show the generic name and the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n generic_name,\n COUNT(medication_id) AS medication_count\nFROM healthcare.medications\nWHERE\n gene... |
You are an expert in writing database language. You can write a corresponding 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 usernames of users that are being followed by user 'U123'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T2.username FROM social_media.follows AS T1 JOIN social_media.users AS T2 ON T1.following_user_id = T2.user_id WHERE T1.follower_user_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 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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas tm ON eb.cont... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.insurance_plans ( plan_id text PRIMARY KEY, plan_name text, insurance_pro... | [
{
"role": "user",
"content": "Provide each pair of plans that share the same plan_type but are offered by different providers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.plan_type,\n p1.plan_id AS plan1_id,\n p1.plan_name AS plan1_name,\n p1.insurance_pro... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversation_participants (
participant_id character varying(64) NO... | [
{
"role": "user",
"content": "Find all users who share a conversation with user 'user123', listing their user_id and the conversation_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT cp2.user_id, cp2.conversation_id\nFROM social_media.conversation_participants cp1\nJOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "Show me the count of law firms grouped by the year they were founded. Include the founding year and the number of firms.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n EXTRACT(YEAR FROM founded_date) AS founding_year,\n COUNT(firm_id) AS firm_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 gaming_technology.player_inventory ( inventory_id uuid, player_id uuid, item_id uuid... | [
{
"role": "user",
"content": "Show me all unique player IDs who have at least one item in their inventory with a quantity greater than 10.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT player_id FROM gaming_technology.player_inventory WHERE quantity > 10;",
"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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Find all vehicles that share the same make and model but were manufactured in different years. Show both vehicle IDs, the make, model, and their respective years.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v1.vehicle_id AS vehicle1_id,\n v2... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id... | [
{
"role": "user",
"content": "Find all appointments where the employee ID is not null and show the appointment ID, employee ID, and the scheduled start time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, employee_id, scheduled_start_time FROM government_services.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var... | [
{
"role": "user",
"content": "Show tokens with a trend rank worse than 30 (higher number) that also have a positive price change over the last 24 hours. Display their symbol, chain, price, trend rank, and 24h price change.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symb... |
You are an expert in writing database language. You can write a corresponding 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": "Which clients have had at least one case led by a lawyer who is a partner? Show the client name, the case name, and the name of the lead lawyer.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cl.first_name || ' ' || cl.last_name AS client_name, ca.ca... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "For each fundraising round, what is the average valuation of the participating projects? Show the round name and the average valuation.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rounds_name, AVG(valuation) AS avg_valuation FROM project_fundraisi... |
You are an expert in writing database language. You can write a corresponding 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": "Show all appointments, including subject, start time, and the billing rate for the lawyer who handled the appointment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.subject, a.start_time, te.billing_rate\nFROM legal_services.appointments a\nJOIN l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.