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 train_station_management.train_cars (
car_id character varying(64) NOT NULL, -- ... | [
{
"role": "user",
"content": "Can you assist me in finding all staff members assigned to schedules for a specific route with route_id 'RT456', including the train details and schedule status?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT st.staff_id, st.first_name, st.last_name,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.service_locations ( location_id.text, agency_id.text, location_n... | [
{
"role": "user",
"content": "List all service locations with their IDs, names, latitude, and longitude.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT location_id,\n location_name,\n latitude,\n longitude\nFROM government_services.service_locations;",
"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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac... | [
{
"role": "user",
"content": "List all clients with the count of cases they have opened.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c.client_id,\n c.first_name,\n c.last_name,\n COUNT(cs.case_id) AS case_count\nFROM legal_services.clients c\nLEFT JOIN legal_services.cas... |
You are an expert in writing database language. You can write a corresponding 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": "Find all pairs of securities that are issued by the same issuer but listed on different exchanges.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.issuer_name, a.ticker_symbol AS symbol_a, a.exchange AS exchange_a, b.ticker_symbol AS symbol_b, b.exc... |
You are an expert in writing database language. You can write a corresponding 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": "Can you show me all achievement unlock records where the same player unlocked two different achievements within the same day? Please show player_id, achievement_id_1, achievement_id_2, and the unlock dates for each.",
"sql": null
},
{
"role": "assistant",
"conte... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policy_beneficiaries ( beneficiary_id text, policy_id text, customer_id te... | [
{
"role": "user",
"content": "List all pairs of beneficiaries on the same policy, showing policy_id, beneficiary1_id, beneficiary1 first_name, beneficiary1 last_name, beneficiary2_id, beneficiary2 first_name, and beneficiary2 last_name.",
"sql": null
},
{
"role": "assistant",
"content": "SEL... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i... | [
{
"role": "user",
"content": "List the first and last names of citizens along with the reference numbers of the applications they have submitted.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , T2.reference_number FROM government_services.citizens ... |
You are an expert in writing database language. You can write a corresponding 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.orders ( order_id character varying(64) NOT NULL, user_id character... | [
{
"role": "user",
"content": "I want the number of peers per port, but only ports with more than 5 peers. List port and peer_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT port, COUNT(*) AS peer_count\nFROM trading_platform.peers\nGROUP BY port\nHAVING COUNT(*) > 5;",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "Could you list all agencies along with the name of their parent agency?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT child.agency_name AS agency_name, parent.agency_name AS parent_agency_name FROM government_services.agencies AS child LEFT JOIN gov... |
You are an expert in writing database language. You can write a corresponding 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.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id... | [
{
"role": "user",
"content": "List all chronic and active diagnoses for patient 'patient_456', including diagnosis_code, description, and diagnosis_date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT diagnosis_code, description, diagnosis_date FROM healthcare.diagnoses WHERE pat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.addresses ( address_id.text, public_key.text, balance.numeric )
CREATE TA... | [
{
"role": "user",
"content": "Show me all wallet addresses along with their public keys and balances, but only for wallets that have a balance greater than 1000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w.address_id, a.public_key, a.balance FROM blockchain.wallets w JOIN bl... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt... | [
{
"role": "user",
"content": "I need a count of appointments per patient that took place between '2024-04-01' and '2024-04-30', showing patient_id, first_name, last_name, and the total number of appointments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_na... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, docum... | [
{
"role": "user",
"content": "List each document_name along with the count of its versions, but only include those document_names that have more than 3 versions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name,\n COUNT(version) AS version_count\nFROM legal_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 legal_services.cases ( case_id text, case_number text, case_name text, client_id tex... | [
{
"role": "user",
"content": "Show me all cases that are associated with the court jurisdiction 'Federal Court'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM legal_services.cases WHERE court_jurisdiction = 'Federal Court';",
"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 hospitality_technology.services ( service_id.text, property_id.text, service_name.te... | [
{
"role": "user",
"content": "Can you show me the total number of available services and the average price for each department?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS available_service_count, AVG(price) AS average_price FROM hospitality_technology.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "List all cancelled policies along with any active policy for the same customer. Show cancelled policy number, cancellation_date, and active policy number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p_cancel.policy_number AS cancelled_policy_numbe... |
You are an expert in writing database language. You can write a corresponding 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.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a... | [
{
"role": "user",
"content": "Show me all users who have both placed orders and have KYC status approved, along with their order count and most recent KYC review date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT o.user_id, COUNT(o.order_id) as order_count, MAX(k.reviewed_at) a... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text,... | [
{
"role": "user",
"content": "What is the average commission_rate for each agent status and only show statuses with an average commission_rate above 0.05?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status,\n AVG(commission_rate) AS avg_commission_rate\nFROM insurance.ag... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.employees ( employee_id text, agency_id text, first_name text, l... | [
{
"role": "user",
"content": "Which employees share the same department with at least one other employee? Please show the employee ID, full name, and department.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e1.employee_id, e1.first_name || ' ' || e1.last_name AS full_name, e1.d... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "What's the average session duration and average score per game genre?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.genre,\n AVG(gs.duration_seconds) AS avg_duration,\n AVG(gs.score) AS avg_score\nFROM gaming_technology.game_sessions g... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a... | [
{
"role": "user",
"content": "List each contract along with the deployer address, and status for contracts deployed on network_id 'mainnet'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_id, address, deployer_address, status FROM web3.contracts WHERE network_id = 'mainn... |
You are an expert in writing database language. You can write a corresponding 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": "Show the first name, last name, and license number of all drivers whose license expiry date is after January 1, 2026, along with their status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, license_number, status FROM transport... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, property_id c... | [
{
"role": "user",
"content": "Show all currently available rooms along with their room numbers and the number of times each room has been reserved.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT rm.room_id, rm.room_number, COUNT(r.reservation_id) AS reservation_count\nFROM hospit... |
You are an expert in writing database language. You can write a corresponding 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, case_number character... | [
{
"role": "user",
"content": "Show me a list of all cases and include the case number, case name, and the court jurisdiction for each case, as well as the lead lawyer's ID and the case status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_number, case_name, court_jurisdicti... |
You are an expert in writing database language. You can write a corresponding 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": "Which narrative in narrative_info has the highest volume_24h, and what are its top_3_coins and token_num?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative,\n top_3_coins,\n token_num\nFROM narrative_info\nORDER BY volume_24h DESC\nLIMIT 1;"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.likes ( like_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "List user IDs and the creation timestamp of likes made by users who have email notifications enabled.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.user_id, T1.created_at FROM social_media.likes AS T1 JOIN social_media.user_settings AS T2 ON T1.u... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, passenger_id ch... | [
{
"role": "user",
"content": "List all booking IDs and their status for bookings that have a special request recorded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT booking_id, status\nFROM transportation.bookings\nWHERE special_requests IS NOT NULL;",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "List all public reviews that have a staff response, showing the review ID, overall rating, and the full name of the staff member who responded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.review_id, T1.rating_overall, T2.first_name, T2.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 social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_... | [
{
"role": "user",
"content": "Show me the notification ID, recipient user ID, and notification type for notifications received by users that user 'user123' is following.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.notification_id, n.recipient_user_id, n.notification_type FRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "For each service, show the service name and the total number of applications submitted for it.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_name, COUNT(a.application_id) AS total_applications\nFROM government_services.services s\nLEFT JOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Use Hashes. Key pattern: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_numbe... | [
{
"role": "user",
"content": "Can you help me get a list of components and their associated materials, including the supplier information for each component?",
"sql": null
},
{
"role": "assistant",
"content": "SMEMBERS material_components:<material_id>\nHGETALL component:<component_id>\nHGET... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3... | [
{
"role": "user",
"content": "List SUI coins with owner, coin type, balance, and status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT owner, coin_type, balance, status FROM sui_coins;",
"sql": null
},
{
"role": "user",
"content": "Only include coins where status... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.assets ( asset_id text PRIMARY KEY, name text, symbol text, type te... | [
{
"role": "user",
"content": "Show the number of UTXOs associated with each unique address in the system.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, COUNT(utxo_id) FROM trading_platform.utxos GROUP BY address;",
"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.medications ( medication_id.text, medication_name.text, generic_name.text... | [
{
"role": "user",
"content": "List all patients who have an active prescription for a medication manufactured by 'AstraZeneca', along with their policy number and the prescription ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, pi.policy_number, pr.prescription_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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "Which users have sent messages in conversations that are group chats, and what are the names of those group chats?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, c.group_name\nFROM social_media.messages m\nJOIN social_media.users... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Find patients whose emergency_contact_phone matches another patient's phone_number and show both patients' IDs, full names, and the shared phone number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.patient_id AS contact_of_id,\n p1.first_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_inflow ( token_address character varying(100) NOT NULL, -- the tok... | [
{
"role": "user",
"content": "Which narrative had the highest total USD token inflow during Q1 of 2024, and which chain did these inflows primarily occur on?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, chain, SUM(usd_value) AS total_inflow FROM smart_money_token_inf... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Which users have registered but never created a wallet? Show their user_id, username, and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, u.email\nFROM trading_platform.users u\nLEFT JOIN trading_platform.wallets w ON u.u... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, first_name text, last_name text,... | [
{
"role": "user",
"content": "List each insurance product's name and type, along with the number of active policies and the total premium_amount collected for those policies. Only include products that have at least one active policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELEC... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patient_insurance (
patient_insurance_id character varying(64) NOT NU... | [
{
"role": "user",
"content": "List all patients who have insurance plans with group numbers, showing their patient IDs and the count of such plans per patient.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, COUNT(*) AS plan_count FROM healthcare.patient_insurance WHER... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE project_fundraising_record (",
"id character varying(32) NOT NULL, -- fundrai... | [
{
"role": "user",
"content": "List the top 5 tokens by 24 hour trading volume on DEX pools.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, volume_24h \nFROM token_dexpool_info \nORDER BY volume_24h DESC LIMIT 5;",
"sql": null
},
{
"role": "us... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE manufacturing.components (
component_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "我想查询某个特定组件ID的详细信息,包括组件名称、材料名称、材料密度以及供应商ID,同时还需要知道该组件在哪个装配线上的飞机型号ID。",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.component_id, c.component_name, m.material_name, m.density_kg_m3, c.supplier_id, al.aircraft_model_id\nFROM manufacturing.components ... |
You are an expert in writing database language. You can write a corresponding 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": "How many securities are there for each security type?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT security_type, COUNT(*) AS security_count FROM financial_services.securities GROUP BY security_type;",
"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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List all rooms, showing their room number, type name, and the name of the property they are in.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.room_number, T2.type_name, T3.property_name FROM hospitality_technology.rooms AS T1 JOIN hospitality_tec... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "Which tokens have a current price above $20 and belong to the 'DeFi' narrative?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, token_name, chain, price\nFROM token_basic_info\nWHERE price > 20 AND narrative = 'DeFi';",
"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.insurance_products ( product_id.text, product_name.text, product_type.text... | [
{
"role": "user",
"content": "List all claim documents along with the beneficiary first and last names and their relationship for policies where a document of type 'MEDICAL_REPORT' exists.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cd.document_id, cd.claim_id, cd.file_name, 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.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, crea... | [
{
"role": "user",
"content": "Retrieve conversation IDs and user IDs of participants who joined after '2024-01-01', including their last_read_at timestamps.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT conversation_id, user_id, last_read_at FROM social_media.conversation_partic... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_l... | [
{
"role": "user",
"content": "Show me a list of all bus routes, including their route numbers, type, and the names of both the origin and destination locations.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r.route_number, r.type, lo.name AS origin_name, ld.name AS destination_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.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "I need a list of conversation IDs and participant usernames for conversations that have media messages. Include conversation_id, username, and media_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT m.conversation_id, u.username, m.media_type\nFRO... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "Show me all replies to comments, including the reply's comment ID, the parent comment ID, and the content.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT comment_id, parent_comment_id, content FROM social_media.comments WHERE parent_comment_id IS NOT... |
You are an expert in writing database language. You can write a corresponding 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.transactions ( transaction_id text, from_address text, to_address text, value n... | [
{
"role": "user",
"content": "For each transaction, find the next transaction initiated by the same sender. List the original transaction_id, the next transaction_id, the sender address, and the time difference in hours between them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT... |
You are an expert in writing database language. You can write a corresponding 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": "How many prescriptions are there for each refills_allowed value?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT refills_allowed,\n COUNT(*) AS prescription_count\nFROM healthcare.prescriptions\nGROUP BY refills_allowed;",
"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.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "Can you show the fuel_log_id, vehicle make, and quantity for all fuel logs where the quantity is greater than 100?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.fuel_log_id, v.make, f.quantity\nFROM transportation.fuel_logs f\nJOIN transportation.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"role": "user",
"content": "Find all tokens on the 'BSC' chain in the latest snapshot where the individual holding `usd_value` is greater than $1,000,000. Show their symbol, exchange, balance, and USD value.",
"sql": null
},
{
"role": "assistant",
"content": "WITH latest_snapshot AS (\n S... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, am... | [
{
"role": "user",
"content": "List each Avalanche token's total transfer volume over the past 7 days along with its creator from token_info.",
"sql": null
},
{
"role": "assistant",
"content": "WITH recent_transfers AS (\n SELECT\n ta.tick,\n SUM(ta.amt) AS total_volume\n FROM token_a... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, patient_id ... | [
{
"role": "user",
"content": "Retrieve all appointments for doctor 'doc123' scheduled in April 2024, showing appointment ID, patient ID, time, and status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, patient_id, appointment_time, status FROM healthcare.appointme... |
You are an expert in writing database language. You can write a corresponding 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 each game's title along with the name of the developer and the total number of servers currently hosting that game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, g.developer_id, COUNT(s.server_id) AS total_servers\nFROM gaming_technolo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.maintenance_logs ( log_id text, vehicle_id text, service_date date, o... | [
{
"role": "user",
"content": "List each vehicle and the date of its most recent maintenance, including the service type and cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_type, cost, service_date FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY vehicle_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 government_services.notifications ( notification_id text, citizen_id text, applicati... | [
{
"role": "user",
"content": "Find all notifications where the message subject contains the word 'Alert'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT notification_id, citizen_id, application_id, message_subject, message_body, channel, sent_at, status, related_entity_type, rela... |
You are an expert in writing database language. You can write a corresponding 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_dexpool_info (",
"pair_address character varying(512) NOT NULL, -- the ... | [
{
"role": "user",
"content": "List the top 3 tokens by liquidity on BSC and show their token symbols, prices, market cap, and liquidity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, price, market_cap, liquidity\nFROM token_dexpool_info\nWHERE chain = 'BSC'\nORDER ... |
You are an expert in writing database language. You can write a corresponding 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": "For each claim, show the corresponding product_type of the insurance product for the related policy.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cl.claim_id, ip.product_type\nFROM insurance.claims cl\nJOIN insurance.policies p ON cl.policy_id = 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 government_services.notifications ( notification_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Find pairs of notifications for the same application where one was sent via 'Email' and the other via 'SMS'. Display the application_id, email_notification_id, sms_notification_id, email_sent_at, and sms_sent_at.",
"sql": null
},
{
"role": "assistant",
"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 insurance.premium_payments ( payment_id text PRIMARY KEY, policy_id text, customer_i... | [
{
"role": "user",
"content": "Which customers have made more than three premium payments in 2024? Show the customer_id and the number of payments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, COUNT(*) AS payment_count FROM insurance.premium_payments WHERE payment_d... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List all payments, including the associated reservation ID, guest's full name, payment amount, and timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.payment_id, T1.reservation_id, T3.first_name, T3.last_name, T1.amount, T1.payment_timestam... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, policy_id text, customer_i... | [
{
"role": "user",
"content": "For each customer, calculate the average number of days between their consecutive premium payments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.customer_id,\n AVG(t.days_diff) AS avg_days_between\nFROM (\n SELECT p1.customer_id,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "Show me the top 5 hashtags by number of distinct public posts they're used in. Return tag_name and post_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT h.tag_name,\n COUNT(DISTINCT ph.post_id) AS post_count\nFROM social_media.hashtags 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.services ( service_id character varying(64) NOT NULL, propert... | [
{
"role": "user",
"content": "Give me a breakdown of available services by unit, with the count of services and the average price, grouped by property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_id, unit, COUNT(*) AS service_count, AVG(price) AS avg_price FROM hospit... |
You are an expert in writing database language. You can write a corresponding 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": "Show the route number and description for routes that have bookings associated with them.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.route_number, T1.description FROM transportation.routes AS T1 JOIN transportation.bookings AS T2 ON 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 healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "List all appointments, showing the appointment ID, appointment time, patient's insurance plan name, and status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.appointment_time, ip.plan_name, a.status FROM healthcare.appointments a... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li... | [
{
"role": "user",
"content": "List the property_name and the total number of rooms that are designated as smoking rooms for each property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name, COUNT(*) AS smoking_room_count\nFROM hospitality_technology.rooms r\nJOIN hos... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "Find customers who have at least two policies with overlapping coverage periods. Show customer_id, policy1_id, policy2_id, overlap_start and overlap_end.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.customer_id,\n p1.policy_id AS policy1_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.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"role": "user",
"content": "List all payments made using a credit card, including guest_id, amount, payment_method, and payment_timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT guest_id, amount, payment_method, payment_timestamp FROM hospitality_technology.payments WHE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ... | [
{
"role": "user",
"content": "List appointments including ID, patient ID, doctor ID, time, and duration, where the reason is 'follow-up'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, patient_id, doctor_id, appointment_time, duration_minutes FROM healthcare.appoi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "List all server names and their statuses.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_name, status FROM gaming_technology.servers;",
"sql": null
},
{
"role": "user",
"content": "Can you also include the region and current_pl... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Find all properties in California (state_province = 'California') that have a phone number and email address listed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT property_name, city, phone_number, email_address FROM hospitality_technology.propertie... |
You are an expert in writing database language. You can write a corresponding 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": "Provide a daily summary of completed transfers showing the date, total amount, and count of transfers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT effective_date,\n SUM(amount) AS total_transfer_amount,\n COUNT(*) AS transfer_count\nFR... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
"CREATE TABLE cex_token_balance (",
"snapshot_time character varying(32) NOT NULL, -- the ... | [
{
"role": "user",
"content": "Which token symbol has the highest price among all tokens held by CEXes on the Polygon chain?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, MAX(price) AS max_price FROM cex_token_balance WHERE chain = 'Polygon' GROUP BY token_symbol OR... |
You are an expert in writing database language. You can write a corresponding 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": "Show the subject and start time for all appointments that are related to a case that also has an invoice. Include the case number and the invoice number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.subject, T1.start_time, T2.case_number, T3.inv... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all room types that have at least one service in the 'Spa' category, including the room type name, property name, and service name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT rt.type_name, p.property_name, s.service_name\nFROM hospi... |
You are an expert in writing database language. You can write a corresponding 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.transactions (
transaction_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Find the top 5 transactions with the highest gas prices, including the from_address, to_address, and block_number, sorted by gas_price in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, from_address, to_address, block... |
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 are the safety ratings or crash statistics for the Boeing 787 Dreamliner?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to safety ratings or crash statistics for specific aircraft models like the Boeing 787 Dreamline... |
You are an expert in writing database language. You can write a corresponding 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": "For each private conversation (is_group_chat = false), list the conversation_id and the usernames of its two participants.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.conversation_id,\n u1.username AS participant_one,\n u2.username A... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.room_types (
room_type_id character varying(64) NOT NULL,... | [
{
"role": "user",
"content": "List all reviews that have a staff response, including the review comment, staff response text, and the ID of the staff who responded.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT comment, staff_response, response_staff_id FROM hospitality_technolo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List vehicle make, model, maintenance service date, and cost for all maintenance logs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT v.make, v.model, ml.service_date, ml.cost FROM transportation.vehicles AS v JOIN transportation.maintenance_logs AS ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.locations ( location_id character varying(64) NOT NULL, name characte... | [
{
"role": "user",
"content": "Get all pairs of locations in the same city, showing both location IDs, names, and the shared city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l1.location_id AS location1_id, l1.name AS location1_name,\n l2.location_id AS location2_id, l2.n... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "How many customers were created in 2023?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM insurance.customers\nWHERE EXTRACT(YEAR FROM created_at) = 2023;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number... | [
{
"role": "user",
"content": "Show me case number, case name, and the lead lawyer's full name for all cases in the 'State Court' jurisdiction.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.case_number, T1.case_name, T2.first_name, T2.last_name FROM cases AS T1 JOIN lawyers AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "List the usernames and user IDs of all users whose bio contains the word 'developer'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, username\nFROM social_media.users\nWHERE bio ILIKE '%developer%';",
"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.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url... | [
{
"role": "user",
"content": "Can you show me all followers of a given user, including their usernames and the date they started following?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f.follower_user_id, u.username, f.created_at\nFROM social_media.follows f\nJOIN social_media.... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "I need a list of genres and pairs of game titles in the same genre.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g1.genre, g1.title AS game1, g2.title AS game2\nFROM gaming_technology.games g1\nJOIN gaming_technology.games g2\n ON g1.genre = g2.ge... |
You are an expert in writing database language. You can write a corresponding 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": "List each payment method, the total amount paid, and the number of payments for each method for services in the 'Education' category.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.payment_method, SUM(p.amount) AS total_amount, COUNT(p.payment_id) ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medications (
medication_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "List the names of manufacturers that produce at least one medication with a description and at least one medication without a description.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT manufacturer FROM healthcare.medications m1 WHERE manuf... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "Show usernames of players who own items of 'Legendary' rarity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username FROM players AS T1 JOIN player_inventory AS T2 ON T1.player_id = T2.player_id JOIN in_game_items AS T3 ON T2.item_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.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_... | [
{
"role": "user",
"content": "List pairs of distinct servers that share the same ip_address. Show server1_name, server2_name, and the shared ip_address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s1.server_name AS server1_name,\n s2.server_name AS server2_name,\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.invoices ( invoice_id.text, invoice_number.text, client_id.text, case... | [
{
"role": "user",
"content": "Count the total number of invoices issued in each calendar year and month. Show the year, month, and the count, ordered chronologically.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(YEAR FROM issue_date) AS issue_year, EXTRACT(MONTH FROM is... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri... | [
{
"role": "user",
"content": "Find narratives with a market cap greater than $500,000,000 and a 7-day price change percentage above 5%. Show the narrative, market_cap, and price_change_percentage_7d.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap, price_chan... |
You are an expert in writing database language. You can write a corresponding 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 patients who have more than two primary active insurance policies, showing their patient ID and the count of such policies. Also, list the plan names for these policies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.patient_id, COUNT(*) ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.staff ( staff_id text PRIMARY KEY, property_id text, first_na... | [
{
"role": "user",
"content": "List staff members who were hired in the last calendar year, showing their full name, position, and hire date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, position, hire_date FROM hospitality_technology.staff WHERE hire_date... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ... | [
{
"role": "user",
"content": "I want to identify pairs of players who unlocked the same achievement within one hour of each other. List player1_id, player2_id, achievement_id, and the time difference in minutes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pa1.player_id AS play... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.conversation_participants ( participant_id.text, conversation_id.text, ... | [
{
"role": "user",
"content": "Show me all participants who joined any conversation before January 1st, 2024. Return participant_id, user_id, conversation_id and the joined_at timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT participant_id, user_id, conversation_id, joine... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.