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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "List the first and last names of employees and the number of services offered by their agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS service_count\nFROM government_services.employees e\nLEFT ... |
You are an expert in writing database language. You can write a corresponding 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": "Show me policies that have at least one overdue premium payment, including policy_number, customer full name, agent_id, due_date, and days overdue.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number,\n c.first_name || ' ' || c.last_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Which lawyers have not yet been assigned to any appointments? Show their first name, last name, and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, l.email\nFROM legal_services.lawyers l\nLEFT JOIN legal_services.appo... |
You are an expert in writing database language. You can write a corresponding 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.wallets (
wallet_id character varying(64) NOT NULL, -- unique identi... | [
{
"role": "user",
"content": "Show me all wallet addresses along with their private keys for users who have more than 3 wallets.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w.address_id, w.private_key FROM blockchain.wallets w WHERE w.user_id IN (SELECT user_id FROM blockchain... |
You are an expert in writing database language. You can write a corresponding 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 pairs of doctors who work at the same hospital but have different specialties. Show the full name of both doctors and their shared hospital affiliation ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d1.first_name AS doctor1_first_name, d1.la... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List each driver's first and last name along with the make and model of the vehicles they have driven, as well as the trip ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, v.make, v.model, t.trip_id\nFROM transportation.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 government_services.agencies (
agency_id character varying(64) NOT NULL, -- uniq... | [
{
"role": "user",
"content": "Show me a list of all agencies and the number of distinct citizens who have submitted documents to each agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.agency_name, COUNT(DISTINCT d.citizen_id) AS citizen_count\nFROM government_services.docu... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, policy_id ch... | [
{
"role": "user",
"content": "For each payment status, how many payments were made and what was the total amount paid? Order the results by the total amount paid in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS payment_count, SUM(amount_paid... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "List each patient's active insurance policy and the number of prescriptions they have during that policy. Show patient_id, plan_id, policy_number, and prescription_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT pi.patient_id, pi.plan_id, pi.po... |
You are an expert in writing database language. You can write a corresponding 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.conversations ( conversation_id.text, created_at.timestamp, last_messag... | [
{
"role": "user",
"content": "List all users with private profiles who have disabled push notifications, including their user_id and email_notifications_enabled status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id,\n email_notifications_enabled\nFROM 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 hospitality_technology.payments ( payment_id text, reservation_id text, guest_id tex... | [
{
"role": "user",
"content": "Show me all payments made with a credit card (payment_method = 'credit_card') where the amount is greater than $500, including the reservation ID and payment timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_id, reservation_id, 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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "Show the vehicle ID and the total number of fuel logs recorded for each vehicle.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id , count(*) FROM transportation.fuel_logs GROUP BY vehicle_id",
"sql": null
},
{
"role": "user",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "List all patients who have had appointments with doctors specializing in 'Oncology', showing patient ID, patient first name, patient last name, doctor ID, doctor first name, and doctor last name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n p.pa... |
You are an expert in writing database language. You can write a corresponding 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": "Find patients who had more than one appointment on the same day. Show patient ID and the date of the appointments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, DATE(appointment_time) AS appointment_date FROM healthcare.appointments GROU... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records ( record_id text PRIMARY KEY, patient_id text, appointmen... | [
{
"role": "user",
"content": "Show me medical records that mention a medication from the 'medications' table by name in their treatment plan. List the record ID, record date, patient ID, and the name of the mentioned medication.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.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 legal_services.appointments ( appointment_id character varying(64) NOT NULL, client_... | [
{
"role": "user",
"content": "List all appointments that have a location specified and their status is not 'Cancelled'. Show the appointment ID, subject, and location.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT appointment_id, subject, location FROM legal_services.appointment... |
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, record_id text, patient_id tex... | [
{
"role": "user",
"content": "List each patient and the number of different insurance plans they have had. Include patient_id and plan_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, COUNT(DISTINCT plan_id) AS plan_count\nFROM healthcare.patient_insurance\nGROUP... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam... | [
{
"role": "user",
"content": "For each fueling event, show the fuel_log_id, vehicle_id, the full name of the assigned driver for the trip during that fueling event, and the log_timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fl.fuel_log_id, fl.vehicle_id, d.first_name |... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show me for each user how many conversations they've participated in, include their email and conversation count, only for those who have participated in more than five conversations.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.email,... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "Show the policy number, policy start date, and the name and type of the insurance product for all active policies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.start_date, ip.product_name, ip.product_type FROM insurance.policies ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, p... | [
{
"role": "user",
"content": "Show the game title and the count of hidden achievements for each game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.title , COUNT(T2.achievement_id) FROM games AS T1 JOIN achievements AS T2 ON T1.game_id = T2.game_id WHERE T2.hidden = TRUE ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "List the claim ID, policy ID, reported date, and settlement date for claims that have been processed by a claim handler.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT claim_id, policy_id, reported_date, settlement_date\nFROM insurance.claims\nWHERE ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.prescriptions ( prescription_id character varying(64) NOT NULL, record_id... | [
{
"role": "user",
"content": "List prescription_id, policy_number, plan_name, and quantity_dispensed for all ongoing prescriptions (end_date IS NULL) where the associated insurance plan_type is 'PPO'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.prescription_id,\n pi.po... |
You are an expert in writing database language. You can write 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 /schedules
{
"mappings": {
"properties": {
"schedule_id": { "type": "keyword" ... | [
{
"role": "user",
"content": "能否帮我查询特定路线(route_id 为 'RT001')的所有行程信息,并关联到乘客的联系方式?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.schedule_id, s.train_id, s.route_id, s.departure_datetime, s.arrival_datetime, s.status, p.passenger_id, p.first_name, p.last_name, p.phone_number, 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 social_media.users ( user_id character varying(64) NOT NULL, username character vary... | [
{
"role": "user",
"content": "List all users who have participated in group conversations created in April 2024, showing their username, conversation ID, and the group name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, c.conversation_id, c.group_name\nFROM ... |
You are an expert in writing database language. You can write a corresponding 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": "How many patients have at least one medical record associated with them?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT patient_id) FROM healthcare.medical_records;",
"sql": null
},
{
"role": "user",
"content": "Now, ca... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "Show me all securities along with the number of employees per branch that work at a branch matching the security's exchange as their branch_id. Show the ticker symbol, security name, exchange, branch_id, and employee count.",
"sql": null
},
{
"role": "assistant",
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "I want to know the usernames of users who have followed more than three different people, along with the date they created their accounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, u.created_at, COUNT(DISTINCT f.following_user_id) AS... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a... | [
{
"role": "user",
"content": "What is the total and average amount of unspent UTXOs per address?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n address,\n COUNT(*) AS utxo_count,\n SUM(amount) AS total_unspent_amount,\n AVG(amount) AS average_unspent_amount\nFROM trading_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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "Show the total number of game sessions played on each server that is currently 'online'. Include the server name, region, and the count of sessions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.server_name, s.region, COUNT(gs.session_id) AS total... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the names and upload timestamps of all documents of type 'Contract' that were uploaded between '2024-03-01' and '2024-03-31'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_name, upload_timestamp\nFROM legal_services.documents\nWHER... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text... | [
{
"role": "user",
"content": "Get the total number of guests for each country_code.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT country_code, COUNT(*) AS guest_count\nFROM hospitality_technology.guests\nGROUP BY country_code;",
"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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre... | [
{
"role": "user",
"content": "List the first and last names, email, and loyalty program ID of all passengers who joined after January 1, 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email, loyalty_program_id\nFROM transportation.passengers\nWHERE cr... |
You are an expert in writing database language. You can write a corresponding 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,... | [
{
"role": "user",
"content": "List the first name and last name of each citizen and the scheduled start time for their appointments.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.scheduled_start_time FROM government_services.citizens AS T1 JOIN go... |
You are an expert in writing database language. You can write a corresponding 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.smart_contracts (
contract_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "List the contract_id and creator_address for all smart contracts created after January 1st, 2023, along with the total number of contracts each creator has created.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.contract_id, s.creator_address, crea... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "For each appointment, show the appointment ID, scheduled start time, the name of the service related to the appointment, and the agency name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.scheduled_start_time, s.service_name, 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "Show me the full names and email addresses of all customers who registered after January 1st, 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM insurance.customers WHERE created_at > '2024-01-01';",
"sql": nul... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "List all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange (exchange = 'NASDAQ') and have a daily trading volume exceeding 1 million shares in the last 30 days.",
"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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "For each group conversation, I need its ID, name, and the count of participants whose last_read_at is earlier than the conversation's last_message_at (i.e., participants with unread messages).",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c.conve... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name charact... | [
{
"role": "user",
"content": "Show me the names, founding dates, and websites of all law firms whose name contains the word 'Legal' and were founded after the year 2005. Sort the results by their founding date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_name, founded_dat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, ... | [
{
"role": "user",
"content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE status = 'expired' AND end_dat... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.achievements ( achievement_id.uuid, game_id.uuid, name.text, descr... | [
{
"role": "user",
"content": "Which players have unlocked any achievement?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT player_id FROM player_achievements;",
"sql": null
},
{
"role": "user",
"content": "Show me the player ID and the total number of poin... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the number of open claims each customer has filed. Return customer_id, first_name, last_name, and open_claim_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT cu.customer_id, cu.first_name, cu.last_name, COUNT(cl.claim_id) AS open_claim_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "Find all pairs of contracts that were deployed on the same network but by different deployer addresses. List the network ID, the addresses of both contracts, and the addresses of their respective deployers.",
"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 financial_services.customers ( customer_id.text, first_name.text, last_name.text, da... | [
{
"role": "user",
"content": "Which cities have more than 50 customers, and what is the average customer age in each?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT city, COUNT(*) AS customer_count, AVG(EXTRACT(YEAR FROM AGE(CURRENT_DATE, date_of_birth))) AS avg_age\nFROM financi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id text PRIMARY KEY, firm_name text, address text, p... | [
{
"role": "user",
"content": "Show the names and phone numbers of all law firms whose website ends with '.org'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_name, phone\nFROM legal_services.law_firms\nWHERE website LIKE '%.org';",
"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.locations ( location_id text, name text, type text, address_line1 tex... | [
{
"role": "user",
"content": "Show all maintenance logs including the vehicle ID, service date, service type, and cost.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, service_date, service_type, cost FROM transportation.maintenance_logs;",
"sql": null
},
{
... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.transactions ( transaction_id text, block_id text, sender_address text, r... | [
{
"role": "user",
"content": "Find all smart contracts deployed in 2022 that have never received any transactions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sc.contract_id, sc.creator_address, sc.timestamp AS deployment_time\nFROM blockchain.smart_contracts sc\nLEFT JOIN blo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_i... | [
{
"role": "user",
"content": "Can you provide a list of patients, their appointment times, and the generic names of any medications they were prescribed on the same day as the appointment?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.patient_id, a.appointment_time, m.generic_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Node Label ':AircraftModel'. Properties: { model_id: String (Constraint: UNIQUE), model_name: Str... | [
{
"role": "user",
"content": "Can you help me retrieve the details of all aircraft builds for a specific aircraft model, including the build start date, estimated completion date, and the assembly line they are built on?",
"sql": null
},
{
"role": "assistant",
"content": "MATCH (ab:AircraftB... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "For each contract, how many tokens are deployed at the contract address? Show contract_id, address, and token_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.contract_id, c.address, COUNT(t.token_id) AS token_count\nFROM web3.contracts c\nLEF... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, property_id ... | [
{
"role": "user",
"content": "Show me all active staff including their staff_id, first_name, last_name, position, and work_email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT staff_id,\n first_name,\n last_name,\n position,\n work_email\nFROM hospitality... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "List each partner lawyer's first_name, last_name along with the count of invoices for the cases they lead.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.lawyer_id, l.first_name, l.last_name, COUNT(i.invoice_id) AS invoice_count\nFROM legal_service... |
You are an expert in writing database language. You can write a corresponding 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": "Can you list each player along with the number of rare items they currently have in their inventory, and also show the total quantity of these rare items?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.username, COUNT(DISTINCT pi.item_id) AS num_ra... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier... | [
{
"role": "user",
"content": "How many agents are currently active in each license state?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT license_state, COUNT(*) AS active_agent_count\nFROM insurance.agents\nWHERE status = 'Active'\nGROUP BY license_state;",
"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.messages ( message_id character varying(64) NOT NULL, conversation_id c... | [
{
"role": "user",
"content": "How many messages include a media attachment?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.messages WHERE media_url IS NOT NULL AND TRIM(media_url) <> '';",
"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.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"role": "user",
"content": "How many customers are there in each state?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) AS customer_count\nFROM insurance.customers\nGROUP BY state;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.trades ( trade_id text, order_id text, buyer_id text, seller_id tex... | [
{
"role": "user",
"content": "List all unspent UTXOs, including their utxo_id, address, amount, and transaction_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT utxo_id, address, amount, transaction_id \nFROM trading_platform.utxos \nWHERE spent = false;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.citizens (
citizen_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "Show the full name and contact phone number for all citizens who registered before 2020.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT CONCAT(first_name, ' ', last_name) AS full_name, contact_phone\nFROM government_services.citizens\nWHERE registrat... |
You are an expert in writing database language. You can write a corresponding 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... | [
{
"role": "user",
"content": "List all comment IDs that have not received any likes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.comment_id FROM social_media.comments AS T1 LEFT JOIN social_media.likes AS T2 ON T1.comment_id = T2.comment_id WHERE T2.like_id IS NULL;",
"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "List all room types and the name of the property manager responsible for that property.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.type_name, t3.first_name, t3.last_name FROM hospitality_technology.room_types AS t1 JOIN 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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi... | [
{
"role": "user",
"content": "How many service locations are marked as accessible?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM government_services.service_locations WHERE is_accessible = TRUE;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.utxos ( utxo_id character varying(64) NOT NULL, transaction_id char... | [
{
"role": "user",
"content": "How many UTXOs are associated with each transaction_id?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, COUNT(*) AS utxo_count FROM trading_platform.utxos GROUP BY transaction_id;",
"sql": null
},
{
"role": "user",
"con... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Show me the total number of time entries for each case.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT case_id, COUNT(*) AS entry_count\nFROM legal_services.time_entries\nGROUP BY case_id;",
"sql": null
},
{
"role": "user",
"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 social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,... | [
{
"role": "user",
"content": "How many conversations are there where the last message was sent before January 1, 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.conversations WHERE last_message_at < '2024-01-01';",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "Show the payment ID, amount, and payment method for all payments made in USD with an amount greater than 50.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT payment_id, amount, payment_method\nFROM government_services.payments\nWHERE currency = 'USD' ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "List NFT collections deployed after block number 10000000 with more than 500 tokens, showing contract_address, name, and token_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, name, token_count\nFROM nft_collections\nWHERE depl... |
You are an expert in writing database language. You can write a corresponding 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": "Find all customers whose email address ends with '@gmail.com'. Please show the customer_id, first name, and email.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, first_name, email FROM insurance.customers WHERE email LIKE '%@gmail.com';"... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appo... | [
{
"role": "user",
"content": "Show all appointments along with the related medical record's record_id and chief complaint, for appointments scheduled in June 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, a.patient_id, a.doctor_id, a.appointment_time, mr.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.servers ( server_id.uuid, game_id.uuid, server_name.text, region.t... | [
{
"role": "user",
"content": "List the 10 most recent achievement unlocks across all players. Show player ID, achievement ID, and unlock timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, achievement_id, unlocked_at FROM gaming_technology.player_achievements ORD... |
You are an expert in writing database language. You can write 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" },... | [
{
"role": "user",
"content": "Can you provide the total capacity of all train cars for a specific train with train_id 'TR789'?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT SUM(capacity) AS total_capacity\nFROM train_cars\nWHERE train_id = 'TR789';",
"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... | [
{
"role": "user",
"content": "List the first and last names of citizens who have scheduled appointments for services offered by agencies with a jurisdiction level of 'Municipal'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_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 financial_services.accounts ( account_id text, customer_id text, account_number text... | [
{
"role": "user",
"content": "For each trade in the past 14 days, show the trade_id, account_id, security_id, and the latest close_price for that security from market_data.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tr.trade_id, tr.account_id, tr.security_id, md.close_price 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": "Show me all staff members along with their positions and the names of the properties they work at.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.staff_id, s.first_name, s.last_name, s.position, p.property_name\nFROM hospitality_technology.staff 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 trading_platform.orders ( order_id character varying(64) NOT NULL, user_id character... | [
{
"role": "user",
"content": "Show each user_id for users with 'pending' KYC status along with the count of unread notifications they have.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT k.user_id, COUNT(n.notification_id) AS unread_count\nFROM trading_platform.kyc_audit k\nJOIN ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "List the first name, last name, email, and the name of the law firm for all lawyers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name , T1.last_name , T1.email , T2.firm_name FROM legal_services.lawyers AS T1 JOIN law_firms AS T2 ON T1... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "Which insurance products have had a policy issued in 2024, and what is the name and type of those products? Show the product_id, product_name, and product_type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT ip.product_id, ip.product_name, 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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3... | [
{
"role": "user",
"content": "Show me the wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount, from the erc20_balances table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.wallet_address, t.symbol, e.amount FROM erc20_balances e... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi... | [
{
"role": "user",
"content": "How many likes have been received by public posts, grouped by media_type? Please show media_type and the count of likes for each.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.media_type,\n COUNT(l.like_id) AS like_count\nFROM social_media.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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, ... | [
{
"role": "user",
"content": "For each chain, which token symbol has the highest pnl and what are its roi and avg_cost?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t.chain, t.token_symbol, t.pnl, t.roi, t.avg_cost\nFROM smart_money_token_performance t\nINNER JOIN (\n SELECT 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 financial_services.transactions ( transaction_id text PRIMARY KEY, account_id text, ... | [
{
"role": "user",
"content": "List transactions where the description includes another transaction's reference_number, showing both transaction IDs and the referenced reference_number.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.transaction_id AS source_id, t2.transaction_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 transportation.maintenance_logs ( log_id character varying(64) NOT NULL, vehicle_id ... | [
{
"role": "user",
"content": "Show all maintenance logs where the 'next_service_due_date' is before the current date, including the log ID, service date, service type, and the overdue next service date.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT log_id, service_date, service_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_time... | [
{
"role": "user",
"content": "List all fuel log IDs along with their vehicle IDs and odometer readings for logs where the quantity is below 10.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT fuel_log_id, vehicle_id, odometer_reading\nFROM transportation.fuel_logs\nWHERE quantity ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.law_firms ( firm_id.text, firm_name.text, address.text, phone.text, w... | [
{
"role": "user",
"content": "List all law firms that do not have a managing partner listed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT firm_name, phone, address, founded_date\nFROM legal_services.law_firms\nWHERE managing_partner_id IS 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 financial_services.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "Provide a list of all employees and their corresponding managers. Please display the full name for both the employee and their manager.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS employee_name, m.first_name |... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, sp... | [
{
"role": "user",
"content": "I need a report showing each doctor's ID, full name, number of completed appointments, and number of medical records they have authored.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.doctor_id,\n d.first_name || ' ' || d.last_name AS doctor_... |
You are an expert in writing database language. You can write a corresponding 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 me all time entries where the hours spent is greater than 5.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT entry_id, date_worked, hours_spent, description FROM legal_services.time_entries WHERE hours_spent > 5;",
"sql": null
}
] |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop... | [
{
"role": "user",
"content": "Get the number of available services for each property. Include the property_name and service_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name,\n COUNT(s.service_id) AS service_count\nFROM hospitality_technology.properties ... |
You are an expert in writing database language. You can write 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 for platform details. Key format: platform:<platform_id>
// HSET platform:plat_123 ... | [
{
"role": "user",
"content": "I need to find all bookings for a specific schedule with schedule_id 'sched_1122' and include the passenger and ticket details.",
"sql": null
},
{
"role": "assistant",
"content": "SMEMBERS schedule:sched_1122:bookings\nHGETALL booking:book_*\nHGETALL passenger: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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern... | [
{
"role": "user",
"content": "For each player, list their username together with the titles of games they have any items from in their inventory.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT p.username, g.title\nFROM gaming_technology.players p\nJOIN gaming_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 financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "Find all distinct pairs of customers having the same first_name but living in different cities. Display a.customer_id, a.first_name, a.city AS city_a, b.customer_id, b.city AS city_b.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS cu... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers (
customer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "List all inactive customers from Texas who were created in the last 2 years, showing their full names and creation dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, created_at FROM insurance.customers WHERE state = 'Texas' ... |
You are an expert in writing database language. You can write a corresponding 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": "List each blockchain (chain) and the centralized exchange that holds the highest total USD value of tokens, as well as the exchange with the lowest total USD value of tokens. Show chain, max_exchange, max_value, min_exchange, and min_value.",
"sql": null
},
{
"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 healthcare.prescriptions ( prescription_id.text, record_id.text, patient_id.text, do... | [
{
"role": "user",
"content": "What is the average quantity_dispensed per route for prescriptions with start_date in 2024? Return route and avg_quantity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT route,\n AVG(quantity_dispensed) AS avg_quantity\nFROM healthcare.prescrip... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ... | [
{
"role": "user",
"content": "List all drivers whose licenses expire in the next 30 days, along with their contact information.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT driver_id, first_name, last_name, license_number, license_expiry_date, contact_number, email FROM transpo... |
You are an expert in writing database language. You can write a corresponding 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": "Show all diagnosis codes and descriptions for patients diagnosed by doctor 'doctor_789'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, diagnosis_code, description FROM healthcare.diagnoses WHERE doctor_id = 'doctor_789';",
"sql": nul... |
You are an expert in writing database language. You can write a corresponding 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": "Can you list each game alongside another game in the same genre but by a different developer?",
"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... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.prescriptions ( prescription_id.text, record_id.text, patient_id.text, do... | [
{
"role": "user",
"content": "For each prescription, find the next prescription for the same patient. Return current prescription_id, next_prescription_id, patient_id, and days between start dates.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p1.patient_id,\n p1.prescript... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.cases ( case_id character varying(64) NOT NULL, case_number character... | [
{
"role": "user",
"content": "Show me the document_id, document_name, and upload_timestamp for all documents uploaded by lawyer with ID 'lawyer_456'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_id, document_name, upload_timestamp\nFROM legal_services.documents\nWHERE ... |
You are an expert in writing database language. You can write a corresponding 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": "How many documents are there for each document_type? Show document_type and count ordered by the count in descending order.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT document_type,\n COUNT(*) AS count\nFROM legal_services.documents\nGROUP ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.