system stringlengths 367 11.5k | conversations listlengths 2 8 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"content": "Show all token transfers including the token symbol and the address of the contract that created each token. List the transfer id, token id, value, transaction id, the contract address, and the token symbol.",
"role": "user",
"sql": null
},
{
"content": "SELECT tt.transfer_id, tt.t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"content": "Which services have 'Eligibility' mentioned in their eligibility_criteria field?",
"role": "user",
"sql": null
},
{
"content": "SELECT service_name, eligibility_criteria\nFROM government_services.services\nWHERE eligibility_criteria ILIKE '%Eligibility%';",
"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 social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_... | [
{
"content": "How many comments does each post have? Return post_id and comment_count for posts with more than 5 comments.",
"role": "user",
"sql": null
},
{
"content": "SELECT post_id,\n COUNT(*) AS comment_count\nFROM social_media.comments\nGROUP BY post_id\nHAVING COUNT(*) > 5;",
"r... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr... | [
{
"content": "How many visible achievements are there per game, and what is the average point value of these achievements?",
"role": "user",
"sql": null
},
{
"content": "SELECT game_id, COUNT(*) AS visible_count, AVG(points) AS avg_points\nFROM gaming_technology.achievements\nWHERE hidden = FALS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"content": "List all insurance products that have not been updated in the past year. Include product_id, product_name, and updated_at, and order by updated_at ascending.",
"role": "user",
"sql": null
},
{
"content": "SELECT product_id, product_name, updated_at\nFROM insurance.insurance_product... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me all appointment IDs and their scheduled start times along with the employee ID and service ID for appointments that have been booked using the 'Kiosk' booking method.",
"role": "user",
"sql": null
},
{
"content": "SELECT appointment_id, scheduled_start_time, employee_id, se... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... | [
{
"content": "特定の組み立てラインに割り当てられた従業員とそのラインの手順情報を取得したいです。従業員ID、名前、職種と手順名、手順番号を含めてください。",
"role": "user",
"sql": null
},
{
"content": "db.employees.aggregate([\n { $match: { assigned_line_id: '<specific_line_id>' } },\n { $lookup: {\n from: 'assembly_steps',\n localField: 'assig... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case... | [
{
"content": "Which clients have appointments scheduled for a case that also has at least one invoice issued? Please show the client_id, appointment_id, appointment start_time, related case_id, and invoice_number.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.client_id, a.appointment_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 legal_services.cases ( case_id.text, case_number.text, case_name.text, client_id.tex... | [
{
"content": "Show me all time entries, including the case name they are associated with.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.*, T2.case_name FROM time_entries AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id",
"role": "assistant",
"sql": null
},
{
"content"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id.text, token_name.text, token_symbol.text, token_address.t... | [
{
"content": "Show me tokens with a 24-hour trading volume over $1,000,000 from DEX pools that also have a positive net flow from smart money addresses. Display the token symbol, chain, 24h volume, and net flow.",
"role": "user",
"sql": null
},
{
"content": "SELECT tdi.token_symbol, tdi.chain, t... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi... | [
{
"content": "List the application IDs and statuses for applications assigned to employees in the 'Customer Service' department.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.application_id, a.status\nFROM government_services.applications a\nJOIN government_services.employees e ON a.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 character varying(64) NOT NULL, -- unique id... | [
{
"content": "List all appointments handled by lawyers from law firms founded after 2015, showing the appointment subject and the lawyer's firm name.",
"role": "user",
"sql": null
},
{
"content": "SELECT a.subject, f.firm_name\nFROM legal_services.appointments a\nJOIN legal_services.lawyers l ON... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"content": "List all ERC20 tokens from the `token_metas` table that have a total supply greater than 1 followed by 21 zeros. Show their contract address, symbol, name, and total supply.",
"role": "user",
"sql": null
},
{
"content": "SELECT contract_address, symbol, name, total_supply FROM 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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"content": "List maintenance logs including vehicle make, model, service_date, cost, and next_service_due_date for vehicles that are currently 'Active'.",
"role": "user",
"sql": null
},
{
"content": "SELECT ml.log_id,\n v.make,\n v.model,\n ml.service_date,\n ml.cost,\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.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"content": "Find all pairs of origin and destination cities, along with their route_number and distance, where the estimated duration is less than 90 minutes.",
"role": "user",
"sql": null
},
{
"content": "SELECT route_number, origin_location_id, destination_location_id, distance_km FROM trans... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"content": "List all partners who have provided a phone number, showing their full name and email.",
"role": "user",
"sql": null
},
{
"content": "SELECT first_name, last_name, email FROM legal_services.lawyers WHERE is_partner = TRUE AND phone IS NOT NULL;",
"role": "assistant",
"sql":... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"content": "Show all diagnoses, including the diagnosis ID, description, diagnosis date, and the full name of the doctor who made the diagnosis.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.diagnosis_id, T1.description, T1.diagnosis_date, T2.first_name, T2.last_name FROM healthcare... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"content": "Give me the max supply, creator, and current supply for all Avalanche tokens by their tick.",
"role": "user",
"sql": null
},
{
"content": "SELECT tia.tick, tia.max_supply, tia.creator, tb.total_supply\nFROM token_info_avalanche tia\nLEFT JOIN token_balances tb ON tia.tick = tb.tick... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id.text, property_name.text, address_li... | [
{
"content": "Retrieve all reservations and the full name of the guest who made each reservation.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.reservation_id, T2.first_name, T2.last_name FROM hospitality_technology.reservations AS T1 INNER JOIN hospitality_technology.guests AS T2 ON ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"content": "List the first and last names of employees and the number of services offered by their agency.",
"role": "user",
"sql": null
},
{
"content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS service_count\nFROM government_services.employees e\nLEFT JOIN 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 gaming_technology.developers ( developer_id.uuid, name.text, country.text, founded_y... | [
{
"content": "List all developer names and their websites.",
"role": "user",
"sql": null
},
{
"content": "SELECT name, website FROM gaming_technology.developers;",
"role": "assistant",
"sql": null
},
{
"content": "Can you only include developers whose website contains '.net'?",
... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List each user along with how many image-type posts they've made, showing user_id and image_post_count, sorted by the count descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT user_id, COUNT(*) AS image_post_count\nFROM social_media.posts\nWHERE media_type = 'image'\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 blockchain.transactions ( transaction_id text, block_id text, sender_address text, r... | [
{
"content": "I want to know how many times each smart contract has been invoked by transactions; also include the contract creator.",
"role": "user",
"sql": null
},
{
"content": "SELECT sc.contract_id, sc.creator_address, COUNT(t.transaction_id) AS invocation_count\nFROM blockchain.smart_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 erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, am... | [
{
"content": "Which wallets currently hold more than 200 units of ERC1155 NFTs on the Ethereum blockchain? Show the contract address, token ID, wallet address, and amount.",
"role": "user",
"sql": null
},
{
"content": "SELECT nh.contract_address, nh.token_id, nh.wallet_address, nh.amount\nFROM 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 social_media.comments (
comment_id character varying(64) NOT NULL, -- unique ide... | [
{
"content": "List all conversation IDs with the total number of messages sent in each conversation.",
"role": "user",
"sql": null
},
{
"content": "SELECT conversation_id, COUNT(*) AS message_count\nFROM social_media.messages\nGROUP BY conversation_id;",
"role": "assistant",
"sql": null
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id ch... | [
{
"content": "Show me the record_id, patient_id, prescription_id, medication_id, start_date, and the systolic blood pressure from the associated medical record for all prescriptions.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.prescription_id,\n p.medication_id,\n p.start... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"content": "List the city and the count of accessible and inaccessible service locations separately. Return city, accessible_count, and inaccessible_count.",
"role": "user",
"sql": null
},
{
"content": "SELECT city,\n SUM(CASE WHEN is_accessible THEN 1 ELSE 0 END) AS accessible_count,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text, firm_name text, address text, phone text, w... | [
{
"content": "List all billable but unbilled time entries including entry_id, lawyer_id, case_id, date_worked, hours_spent, and billing_rate.",
"role": "user",
"sql": null
},
{
"content": "SELECT entry_id, lawyer_id, case_id, date_worked, hours_spent, billing_rate\nFROM legal_services.time_entri... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"content": "What are the training programs or certifications completed by a staff member with the role of Platform Supervisor?",
"role": "user",
"sql": null
},
{
"content": "I'm sorry, but I don't have access to information about the training programs or certifications completed by staff membe... |
You are an expert in writing database language. You can write a corresponding 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.text, case_number.text, case_name.text, client_id.tex... | [
{
"content": "Show me the number of cases for each case_type that were closed in 2023.",
"role": "user",
"sql": null
},
{
"content": "SELECT case_type,\n COUNT(*) AS case_count\nFROM legal_services.cases\nWHERE date_closed BETWEEN '2023-01-01' AND '2023-12-31'\nGROUP BY case_type;",
"r... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"content": "Show the number of followers for each user who is following others, listing their user_id and follower count.",
"role": "user",
"sql": null
},
{
"content": "SELECT following_user_id AS user_id, COUNT(follower_user_id) AS follower_count\nFROM social_media.follows\nGROUP BY following... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.documents ( document_id text, application_id text, citizen_id te... | [
{
"content": "List the full names of citizens who have uploaded documents with a verification status of 'Pending' and the type of document they uploaded.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.first_name, T1.last_name, T2.document_type FROM government_services.citizens AS T1 JO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"content": "Show the top 5 properties by average overall review rating.",
"role": "user",
"sql": null
},
{
"content": "SELECT p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology.reviews r\n ON p.property_id = r.property_i... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id text, property_id text, service_name te... | [
{
"content": "Can you give me the number of available services and their average price for each department?",
"role": "user",
"sql": null
},
{
"content": "SELECT department, COUNT(*) AS available_services_count, AVG(price) AS average_price\nFROM hospitality_technology.services\nWHERE is_availabl... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Find pairs of active services from the same agency where one service's average processing time is longer than the other's. Display the agency_id, the slower service name with its processing time, and the faster service name with its processing time.",
"role": "user",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"content": "How many citizens are marked as not verified?",
"role": "user",
"sql": null
},
{
"content": "SELECT COUNT(*) FROM government_services.citizens WHERE is_verified = FALSE;",
"role": "assistant",
"sql": null
}
] |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"content": "What is the maintenance schedule for platform 3 at station DEF for the next month?",
"role": "user",
"sql": null
},
{
"content": "I'm sorry, but I don't have access to the maintenance schedule for platforms. The data I have only includes static information about platform details su... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"content": "List all employees who were hired in the last two years along with their department and status.",
"role": "user",
"sql": null
},
{
"content": "SELECT employee_id, first_name, last_name, department, status FROM financial_services.employees WHERE hire_date >= (CURRENT_DATE - INTERVAL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.trips (
trip_id character varying(64) NOT NULL, -- unique identi... | [
{
"content": "Retrieve trip_id and passenger full names for all trips where the passenger record was created before the scheduled departure.",
"role": "user",
"sql": null
},
{
"content": "SELECT t.trip_id, p.first_name || ' ' || p.last_name AS passenger_name\nFROM transportation.trips t\nJOIN tr... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medications (
medication_id character varying(64) NOT NULL, -- unique... | [
{
"content": "List the medication_id, medication_name, and description for all medications whose generic_name starts with 'A'.",
"role": "user",
"sql": null
},
{
"content": "SELECT medication_id, medication_name, description\nFROM healthcare.medications\nWHERE generic_name LIKE 'A%';",
"role... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"content": "Which hashtags appear on the most posts? Return hashtag_id, tag_name, and the number of posts each hashtag is used in, sorted descending, limited to the top 3.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n h.hashtag_id,\n h.tag_name,\n COUNT(ph.post_id) AS post_count\n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"content": "Show each token's symbol, token_name, and the deployer_address and status of the contract where that token was created.",
"role": "user",
"sql": null
},
{
"content": "SELECT t.token_symbol,\n t.token_name,\n c.deployer_address,\n c.status\nFROM web3.tokens t\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
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... | [
{
"content": "特定の組み立てラインに関連するすべての手順を取得したいです。ラインIDと手順名、手順番号、必要なスキルレベルを含めてください。",
"role": "user",
"sql": null
},
{
"content": "db.assembly_steps.find(\n { line_id: '<specific_line_id>' },\n { step_id: 1, line_id: 1, step_number: 1, step_name: 1, required_skill_level: 1, _id: 0 }\n).sort({ st... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"content": "List all job titles of employees who work in the 'Finance' department.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT job_title\nFROM government_services.employees\nWHERE department = 'Finance';",
"role": "assistant",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"content": "List all tokens held by CEX addresses, showing the token symbol, name, current price, and the total USD value held by all CEXes for that token.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.token_symbol, T1.token_name, T1.price, SUM(T2.usd_value) AS total_cex_usd_value F... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.game_sessions ( session_id uuid, player_id uuid, game_id uuid, ser... | [
{
"content": "For each game, which server has hosted the most sessions?",
"role": "user",
"sql": null
},
{
"content": "SELECT game_id, server_id, COUNT(*) AS session_count FROM gaming_technology.game_sessions GROUP BY game_id, server_id;",
"role": "assistant",
"sql": null
},
{
"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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par... | [
{
"content": "Which users have commented on posts created by the users they follow? Please show the commenter user_ids and the followed user_ids.",
"role": "user",
"sql": null
},
{
"content": "SELECT DISTINCT c.user_id AS commenter_user_id, f.following_user_id AS followed_user_id FROM social_med... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"content": "Can you show me, for each account type, the total transaction amount and the number of transactions, including the customer full name for each account type?",
"role": "user",
"sql": null
},
{
"content": "SELECT a.account_type, c.first_name || ' ' || c.last_name AS customer_name, SU... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show me all patients who have non-primary insurance plans with expiration dates within the next 60 days, along with their policy numbers and subscriber names.",
"role": "user",
"sql": null
},
{
"content": "SELECT patient_id, policy_number, subscriber_name FROM healthcare.patient_in... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"content": "List the policy number, start date, product name, and base premium for policies where the base premium of the associated product is greater than 1000.",
"role": "user",
"sql": null
},
{
"content": "SELECT T1.policy_number, T1.start_date, T2.product_name, T2.base_premium FROM insura... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "List each booking with its previous booking time for the same passenger.",
"role": "user",
"sql": null
},
{
"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 BY b.booking_time) AS pre... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"content": "I want a list of all users, showing for each user their user_id, username, KYC status, and the date their account was created.",
"role": "user",
"sql": null
},
{
"content": "SELECT u.user_id, u.username, k.status AS kyc_status, u.created_at\nFROM trading_platform.users u\nLEFT JOIN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.insurance_products (
product_id character varying(64) NOT NULL, -- uni... | [
{
"content": "Retrieve the product_id, product_name, base_premium, and created_at for all active insurance products with a base_premium greater than 1000, ordered by base_premium descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT\n product_id,\n product_name,\n base_premium,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE smart_money_token_performance ( token_address character varying(100) NOT NULL, token... | [
{
"content": "Which token on the Ethereum chain had the highest realized ratio last quarter? Show the symbol, realized ratio, and ROI.",
"role": "user",
"sql": null
},
{
"content": "SELECT token_symbol, realized_ratio, roi FROM smart_money_token_performance WHERE chain = 'Ethereum' AND date_trun... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Show all cases with at least one billed and billable time entry, including case number, case name, total billed amount, and billed hours.",
"role": "user",
"sql": null
},
{
"content": "SELECT cs.case_number, cs.case_name, SUM(te.hours_spent * te.billing_rate) AS total_billed_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.insurance_products ( product_id text PRIMARY KEY, product_name text, produ... | [
{
"content": "List all insurance products along with their type and base premium. Also, show whether each product is active.",
"role": "user",
"sql": null
},
{
"content": "SELECT product_id, product_name, product_type, base_premium, is_active FROM insurance.insurance_products;",
"role": "ass... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id character varying(64) NOT NULL, poli... | [
{
"content": "How many beneficiaries are there for each relationship type?",
"role": "user",
"sql": null
},
{
"content": "SELECT relationship,\n COUNT(*) AS beneficiary_count\nFROM insurance.policy_beneficiaries\nGROUP BY relationship;",
"role": "assistant",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.in_game_items (
item_id uuid NOT NULL DEFAULT gen_random_uuid(... | [
{
"content": "For every game, can you provide the count of unique item types and the average item cost?",
"role": "user",
"sql": null
},
{
"content": "SELECT game_id, COUNT(DISTINCT item_type) AS num_unique_types, AVG(cost_amount) AS avg_item_cost FROM gaming_technology.in_game_items GROUP BY ga... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"content": "What is the current market price of a Boeing 737 MAX aircraft?",
"role": "user",
"sql": null
},
{
"content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and general information about airc... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs.",
"role": "user",
"sql": null
},
{
"content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS case_id_2 FROM legal_servic... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, propert... | [
{
"content": "Show me each department in each property, along with the total number of available services and their combined price.",
"role": "user",
"sql": null
},
{
"content": "SELECT property_id, department, COUNT(*) AS service_count, SUM(price) AS total_price FROM hospitality_technology.serv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text,... | [
{
"content": "For each ERC1155 NFT contract on Ethereum, show the contract address, token_id, and the total amount held across all wallets.",
"role": "user",
"sql": null
},
{
"content": "SELECT nh.contract_address, nh.token_id, SUM(CAST(nh.amount AS NUMERIC)) AS total_amount FROM nft_holder_hist... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"content": "How many service orders were placed by each staff member (staff_id_ordered)? Show the staff ID and the count.",
"role": "user",
"sql": null
},
{
"content": "SELECT staff_id_ordered, COUNT(*) FROM hospitality_technology.service_orders GROUP BY staff_id_ordered;",
"role": "assist... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"content": "List patient_id, full name, policy_number, plan_type, and insurance_provider for all active primary insurance policies.",
"role": "user",
"sql": null
},
{
"content": "SELECT pi.patient_id,\n p.first_name,\n p.last_name,\n pi.policy_number,\n ip.plan_type,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.service_locations ( location_id text, agency_id text, location_n... | [
{
"content": "How many service locations are there for each agency? List the agency ID and the count of locations.",
"role": "user",
"sql": null
},
{
"content": "SELECT agency_id , count(*) FROM government_services.service_locations GROUP BY 1",
"role": "assistant",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs (
fuel_log_id character varying(64) NOT NULL, -- uniqu... | [
{
"content": "Show all fuel logs for vehicle_id 'VH123', including the timestamp, fuel type, quantity, and the location_id. Sort the list by timestamp descending.",
"role": "user",
"sql": null
},
{
"content": "SELECT fuel_log_id, log_timestamp, fuel_type, quantity, location_id\nFROM transportati... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"content": "List policy pairs for the same customer where one policy was cancelled and another active policy started within 30 days after the cancellation. Show customer_id, cancelled policy_number, cancellation_date, active policy_number, start_date.",
"role": "user",
"sql": null
},
{
"conten... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// PUT /stations
{
"mappings": {
"properties": {
"station_id": { "type": "keyword" },... | [
{
"content": "Can you provide the total capacity of all train cars for a specific train with train_id 'TR789'?",
"role": "user",
"sql": null
},
{
"content": "SELECT SUM(capacity) AS total_capacity\nFROM train_cars\nWHERE train_id = 'TR789';",
"role": "assistant",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversation_participants ( participant_id.text, conversation_id.text, ... | [
{
"content": "Show me all participants who joined any conversation before January 1st, 2024. Return participant_id, user_id, conversation_id and the joined_at timestamp.",
"role": "user",
"sql": null
},
{
"content": "SELECT participant_id, user_id, conversation_id, joined_at FROM social_media.co... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2