system stringlengths 323 8.06k | conversations listlengths 6 56 |
|---|---|
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.users ( user_id text PRIMARY KEY, username text, email text, passwo... | [
{
"role": "user",
"content": "Show me each completed order with order_id, the username of the user who placed it, asset_id, quantity, and price.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n o.order_id,\n u.username,\n o.asset_id,\n o.quantity,\n o.price\nFROM trading_pla... |
You are an expert in writing database language. You can write a corresponding 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": "Find pairs of consecutive maintenance logs for the same vehicle based on service date. Show the vehicle ID, log IDs, service dates, and odometer readings for both logs in each pair.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT vehicle_id, log_id, 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 insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produ... | [
{
"role": "user",
"content": "Get the number of insurance products grouped by product_type and their active status. Return product_type, is_active, and the count of products.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT product_type, is_active, COUNT(*) AS product_count\nFROM 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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdi... | [
{
"role": "user",
"content": "Provide the message_subject and agency_name for all notifications that are related to agencies and have a status of 'Sent'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT n.message_subject, a.agency_name\nFROM government_services.notifications n\nJOI... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.... | [
{
"role": "user",
"content": "Can you list the names of agencies that do not have a parent agency assigned, ordered by their established date?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT agency_id, agency_name, established_date\nFROM government_services.agencies\nWHERE parent_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_u... | [
{
"role": "user",
"content": "Show me, for each item, the total number of times it has been acquired and the earliest date it was acquired. Also, show the number of unique players who have acquired each item.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT item_id, COUNT(*) AS tot... |
You are an expert in writing database language. You can write a corresponding 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": "List employees whose job title is different from their manager's job title, showing the employee's full name and their manager's full name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, m.first_name AS manager_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 hospitality_technology.staff ( staff_id text PRIMARY KEY, property_id text, first_na... | [
{
"role": "user",
"content": "List staff members who responded to public reviews with an overall rating of 3 or less. Include the staff member's first name, last name, and the review ID.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.review_id FROM... |
You are an expert in writing database language. You can write a corresponding 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": "Could you provide the booking ID, route number, and fare for all bookings?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.booking_id, T2.route_number, T1.fare FROM transportation.bookings AS T1 JOIN transportation.routes AS T2 ON T1.trip_id = T2.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.games (
game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un... | [
{
"role": "user",
"content": "List each genre and the number of games in that genre.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT genre,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY genre;",
"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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "What is the average and maximum standard fee for services in each category?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT category, AVG(standard_fee) AS avg_standard_fee, MAX(standard_fee) AS max_standard_fee FROM government_services.services GROUP ... |
You are an expert in writing database language. You can write a corresponding 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, -- ... | [
{
"role": "user",
"content": "For each property, show the property name, average price of available services, and the maximum price of available services.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.property_name,\n AVG(s.price) AS avg_price,\n MAX(s.price) AS ma... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List usernames and email addresses of users who have enabled both email and push notifications.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, T1.email FROM social_media.users AS T1 INNER JOIN social_media.user_settings AS T2 ON T1.user_... |
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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character... | [
{
"role": "user",
"content": "Which projects had fundraising rounds named 'Series A' in 2022, and what are their token symbols and current token prices from DEX pools?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.project_name, p.rounds_name, d.token_symbol, d.price\nFROM proj... |
You are an expert in writing database language. You can write a corresponding 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 all documents along with the document type and the case name they are associated with.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT d.document_name, d.document_type, c.case_name\nFROM legal_services.documents d\nJOIN legal_services.cases c ON ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "List all room numbers, their type names, and base rates for rooms located on floor 5.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.room_number, T2.type_name, T2.base_rate FROM hospitality_technology.rooms AS T1 JOIN hospitality_technology.room_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
// PUT /schedules
{
"mappings": {
"properties": {
"schedule_id": { "type": "keyword" ... | [
{
"role": "user",
"content": "能否帮我查询特定列车行程(schedule_id 为 'sched_001')的详细信息,包括列车出发和到达时间,以及该行程所属路线的ID和相关乘客信息?",
"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.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 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 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 training programs or certifications completed by a staff member with the role of Platform Supervisor?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to information about the training programs or certifications... |
You are an expert in writing database language. You can write a corresponding 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": "Find all pairs of different routes where the estimated duration in minutes is identical. For each pair, show both route IDs, their route numbers, and the shared duration.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT r1.route_id AS route1_id, r1.rou... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_basic_info ( coin_id character varying(100) NOT NULL, token_name character var... | [
{
"role": "user",
"content": "List all tokens with a price below $1 and a 24-hour trading volume over $5 million.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_name, token_symbol, price, total_volume FROM token_basic_info WHERE price < 1 AND total_volume::numeric > 5000000... |
You are an expert in writing database language. You can write a corresponding 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 character varying(512) NOT NULL, -- the id of na... | [
{
"role": "user",
"content": "Which smart money address on the 'Ethereum' chain has the highest profit from tokens in the 'DeFi' narrative, and what is their ROI?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sm.address, sm.profit, sm.roi\nFROM smart_money_profit sm\nJOIN smart_... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the schedule of trains arriving at station with ID 'ST789' tomorrow?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the train schedule for station ID 'ST789' as this information is not available in the current database... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE legal_services.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id tex... | [
{
"role": "user",
"content": "List all time entries that do not have a description, including the entry ID, date worked, hours spent, and the first and last name of the lawyer who recorded the entry.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT te.entry_id, te.date_worked, te.h... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies (
policy_id character varying(64) NOT NULL, -- unique identif... | [
{
"role": "user",
"content": "Which customers have more than one active policy at the same time? Show the customer ID and the number of active policies.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT customer_id, COUNT(policy_id) AS active_policy_count\nFROM insurance.policies\nW... |
You are an expert in writing database language. You can write a corresponding 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": "For each player, can you find the username and registration_date of the player who registered immediately before them in the same country?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id,\n p.username AS current_username,\n p.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 web3.users ( user_id text PRIMARY KEY, username text, email text, password_hash text... | [
{
"role": "user",
"content": "Show the user_id, username, and email for users who registered at the same timestamp as another user.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u1.user_id, u1.username, u1.email FROM web3.users u1 JOIN web3.users u2 ON u1.created_at = u2.created... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.drivers ( driver_id character varying(64) NOT NULL, employee_id chara... | [
{
"role": "user",
"content": "Could you provide the route number, the name of the origin location, and the name of the destination location for all routes?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.route_number , T2.name , T3.name FROM transportation.routes AS T1 JOIN 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 project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "What is the total investment_value per fundraising round for the year 2023? Order by total investment descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n substr(investment_date,1,7) AS month,\n rounds_name,\n SUM(investment_value) AS tota... |
You are an expert in writing database language. You can write a corresponding 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.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen ti... | [
{
"role": "user",
"content": "Show me all nodes that were last seen in the past 30 days, along with their IP addresses and ports.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port, last_seen FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '30 days... |
You are an expert in writing database language. You can write a corresponding 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 text, user_id text, address_id text, private_key text... | [
{
"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 w1.address_id, w1.private_key FROM blockchain.wallets w1 INNER JOIN (SELECT user_id FROM blockchain.wall... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying... | [
{
"role": "user",
"content": "Count the number of events for each hour of the day based on the emitted_at timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT EXTRACT(HOUR FROM emitted_at) AS event_hour, COUNT(*) AS event_count FROM web3.events GROUP BY event_hour ORDER BY 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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch... | [
{
"role": "user",
"content": "List all ERC20 tokens from token_metas that are marked as a proxy (is_proxy = 1). Show their contract address, symbol, and name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address, symbol, name FROM token_metas WHERE is_erc20 = 1 AND 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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "List the first name, last name, and email of all customers who live in New York or California.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM insurance.customers WHERE state IN ('NY', 'CA');",
"sql": null
},
... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the total number of vacation days taken by employee with ID 'EMP101' in the past year?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide information on the vacation days taken by an employee as this data is not stored in ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users (
user_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "List users who commented on posts and the content of the post they commented on. Show commenter username and post content.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.username, T2.content FROM social_media.users AS T1 JOIN social_media.comments... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "Can you provide a list of all medical records created by doctors for patients who are associated with 'PPO' type insurance plans? I need the record ID, patient ID, doctor ID, record date, and insurance plan name.",
"sql": null
},
{
"role": "assistant",
"content"... |
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREA... | [
{
"role": "user",
"content": "What is the maintenance schedule for platform 3 at station DEF for the next month?",
"sql": null
},
{
"role": "assistant",
"content": "I'm sorry, but I don't have access to the maintenance schedule for platforms. The data I have only includes static information ... |
You are an expert in writing database language. You can write a corresponding 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": "I’d like to see a list of appointments along with any prescriptions made on the same day. Include appointment_id, prescription_id, medication_name, and appointment_time.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.appointment_id, p.prescription_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.tokens (
token_id character varying(64) NOT NULL, -- unique identifier for... | [
{
"role": "user",
"content": "Count how many tokens exist for each contract_address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT contract_address,\n COUNT(*) AS token_count\nFROM web3.tokens\nGROUP BY contract_address;",
"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 smart_money_profit ( address text, rank numeric, profit numeric, roi numeric, realiz... | [
{
"role": "user",
"content": "How many addresses on the Ethereum chain have an ROI between 2 and 4?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) AS address_count FROM smart_money_profit WHERE chain = 'Ethereum' AND roi >= 2 AND roi <= 4;",
"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, ... | [
{
"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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name... | [
{
"role": "user",
"content": "List the full name of employees and the names of the agencies they work for, but only for employees who are currently employed.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, a.agency_name\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 web3.transactions ( transaction_id text, from_address text, to_address text, value n... | [
{
"role": "user",
"content": "Count the number of transactions for each status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) AS tx_count\nFROM web3.transactions\nGROUP BY status;",
"sql": null
},
{
"role": "user",
"content": "Actually, only incl... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Index 'component_inventory'. Mapping: { properties: { inventory_record_id: { type: 'keyword' }, c... | [
{
"role": "user",
"content": "特定のコンポーネントの在庫情報を取得したいです。コンポーネントIDと在庫数量、倉庫の場所を含めてください。",
"sql": null
},
{
"role": "assistant",
"content": "SELECT component_id, quantity, location_warehouse FROM component_inventory WHERE component_id = 'specific_component_id';",
"sql": null
},
{
"rol... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.utxos (
utxo_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "For each transaction ID, provide a count of unspent UTXOs.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, COUNT(*) FROM utxos WHERE spent = FALSE GROUP BY transaction_id;",
"sql": null
},
{
"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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_... | [
{
"role": "user",
"content": "List the payment ID, amount, and the name of the service for all payments associated with services in the 'Licensing' category.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.payment_id, p.amount, s.service_name FROM government_services.payments 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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "Provide a count of contracts for each unique combination of network ID and status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT network_id, status, COUNT(*) FROM web3.contracts GROUP BY network_id, status;",
"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 transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c... | [
{
"role": "user",
"content": "For each passenger, compute the count of bookings and average fare for bookings made in February 2024.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.passenger_id, COUNT(b.booking_id) AS booking_count, AVG(b.fare) AS avg_fare\nFROM transportation.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 insurance.claim_documents ( document_id text, claim_id text, document_type text, fil... | [
{
"role": "user",
"content": "For each claim, retrieve the document_id, file_name, and uploaded_at of the earliest and the latest uploaded document.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n c1.claim_id,\n c1.document_id AS earliest_document_id,\n c1.file_name 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.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, par... | [
{
"role": "user",
"content": "Show all users who follow both user 'U100' and user 'U101'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT f1.follower_user_id\nFROM social_media.follows f1\nJOIN social_media.follows f2 ON f1.follower_user_id = f2.follower_user_id\nWHERE f1.followin... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu... | [
{
"role": "user",
"content": "List the usernames and email addresses of users who have participated in group chats, along with the names of those group chats.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, u.email, c.group_name\nFROM social_media.users u\nJOIN social_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,... | [
{
"role": "user",
"content": "Show me the balance history of wallet '0xdeadbeef' for token at contract '0xaaaa...' .",
"sql": null
},
{
"role": "assistant",
"content": "SELECT block_number, amount\nFROM erc20_balances_historical\nWHERE wallet_address = '0xdeadbeef'\n AND contract_address = ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.assets (
asset_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Give me the list of DApp names and URLs whose description contains any asset symbol from the assets table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT d.name, d.url\nFROM trading_platform.dapps d\nJOIN trading_platform.assets a ON d.descr... |
You are an expert in writing database language. You can write a corresponding 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 all policies that started before January 1, 2022, including policy_id, policy_number, start_date, and status.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT policy_id, policy_number, start_date, status\nFROM insurance.policies\nWHERE start_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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,... | [
{
"role": "user",
"content": "Retrieve the service names, location names, and cities for active services offered at accessible locations in California.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT s.service_name,\n sl.location_name,\n sl.city\nFROM government_servic... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description te... | [
{
"role": "user",
"content": "Show each passenger's name and the total number of trips they have booked.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, COUNT(b.booking_id) AS trip_count\nFROM transportation.passengers p\nJOIN transportation.bookings b O... |
You are an expert in writing database language. You can write a corresponding 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": "Show me all group chats with their names and the time they were last active.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT group_name, last_message_at FROM social_media.conversations WHERE is_group_chat = TRUE;",
"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.patient_insurance (
patient_insurance_id character varying(64) NOT NU... | [
{
"role": "user",
"content": "List all insurance plans that will expire within the next 30 days, showing the patient IDs and subscriber names.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT patient_id, subscriber_name, policy_number, expiration_date\nFROM healthcare.patient_insur... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, first_nam... | [
{
"role": "user",
"content": "Show me all trades with their corresponding ticker_symbol and security_name for trades executed in the last 7 days.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tr.trade_id, tr.account_id, tr.trade_type, tr.quantity, tr.price_per_unit, tr.total_amo... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.token_transfers (
transfer_id character varying(64) NOT NULL, -- unique id... | [
{
"role": "user",
"content": "Find cases where an address received tokens in one transfer and then sent tokens in another. List the receive transfer_id, the send transfer_id, the address, and both transfer values.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT recv.transfer_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 legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, c... | [
{
"role": "user",
"content": "List pairs of invoices for the same case where one invoice's total_amount is lower than another's; show lower_invoice_number, higher_invoice_number, and case_id.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.invoice_number AS lower_invoice_number,... |
You are an expert in writing database language. You can write a corresponding 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_historical ( block_number bigint, contract_address varchar, wallet_ad... | [
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and contract address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT wallet_address, token_id, contract_address FROM nft_holders WHERE contract_type =... |
You are an expert in writing database language. You can write a corresponding 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": "List all employees and the department their manager belongs to. Include the employee's full name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, m.department AS manager_department FROM financial_services.employees AS e LEFT... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,... | [
{
"role": "user",
"content": "Retrieve the passenger_id, first_name, last_name, and total number of bookings each passenger has made in 2023, including only those with at least one booking.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.passenger_id, p.first_name, p.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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu... | [
{
"role": "user",
"content": "List the username and full name of all users who have set their profile to private.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT u.username, u.full_name FROM social_media.users u JOIN social_media.user_settings us ON u.user_id = us.user_id WHERE 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 financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "Show me for each loan_type, the total number of loans and the average principal_amount, along with the average account balance for the accounts associated with those loans.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT l.loan_type, COUNT(l.loan_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 financial_services.market_data (
data_point_id bigserial NOT NULL, -- auto-incre... | [
{
"role": "user",
"content": "For each security sector, what is the average volume recorded in the market data?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T2.sector, AVG(T1.volume) FROM financial_services.market_data AS T1 JOIN financial_services.securities AS T2 ON T1.securi... |
You are an expert in writing database language. You can write a corresponding 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 all applications including the application reference number, the first and last name of the citizen who submitted it, and the name of the service the application is for.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.reference_number, T2.firs... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
Collection 'assembly_steps'. Document structure: { _id: <ObjectId (or step_id)>, step_id: String,... | [
{
"role": "user",
"content": "特定の職種の従業員情報を取得したいです。従業員ID、名前、職種、雇用日を表示してください。",
"sql": null
},
{
"role": "assistant",
"content": "db.employees.find(\n { job_title: '<specific_job_title>' },\n { employee_id: 1, first_name: 1, last_name: 1, job_title: 1, hire_date: 1, _id: 0 }\n).sort({ hi... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, first_name charact... | [
{
"role": "user",
"content": "Show me the policy number, premium amount, and payment status for every premium payment made, along with the customer's full name for each one.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, pp.amount_paid, pp.status, c.first_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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi... | [
{
"role": "user",
"content": "List all events and any token transfers that occurred in the same transaction, showing event_id, event_name, transfer_id, and token_symbol.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n e.event_id,\n e.event_name,\n tt.transfer_id,\n tk.token_... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character... | [
{
"role": "user",
"content": "List all policies that have a coverage limit greater than 750000 and a premium amount greater than 1000. Show the policy number, product ID, coverage limit, and premium amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n policy_number,\n produ... |
You are an expert in writing database language. You can write a corresponding 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": "Find the total unbilled but billable hours for each lawyer. Only include lawyers with more than 10 such hours, and sort by total hours descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT lawyer_id, SUM(hours_spent) AS total_unbilled_hours FROM... |
You are an expert in writing database language. You can write a corresponding 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 id of dexp... | [
{
"role": "user",
"content": "List tokens on 'Arbitrum' with liquidity over 5000000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT * FROM token_dexpool_info WHERE chain = 'Arbitrum' AND liquidity > 5000000;",
"sql": null
},
{
"role": "user",
"content": "Filter th... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE trading_platform.assets ( asset_id character varying(64) NOT NULL, name character va... | [
{
"role": "user",
"content": "List all asset types in the platform along with the count of assets for each type.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT type, COUNT(*) as asset_count FROM trading_platform.assets GROUP BY 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 legal_services.time_entries (
entry_id character varying(64) NOT NULL, -- uniqu... | [
{
"role": "user",
"content": "I want to see all time entries where the description contains the word 'draft' and that have not been billed yet.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT *\nFROM legal_services.time_entries\nWHERE description ILIKE '%draft%'\n AND is_billed =... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "Retrieve all unique chief complaints from medical_records.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT chief_complaint\nFROM healthcare.medical_records;",
"sql": null
},
{
"role": "user",
"content": "Now show chief complai... |
You are an expert in writing database language. You can write a corresponding 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 all locations situated within the state of California.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT location_id, name, city, state_province FROM transportation.locations WHERE state_province = 'CA';",
"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 web3.contracts (
contract_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each user with at least two wallets, calculate the average time difference in hours between consecutive wallet creations. Return user_id and avg_diff_hours.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT user_id, AVG(EXTRACT(EPOCH FROM (created_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 government_services.payments ( payment_id character varying(64) NOT NULL, applicatio... | [
{
"role": "user",
"content": "Can you show the total amount paid and number of payments per citizen in 2024?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT citizen_id, SUM(amount) AS total_paid, COUNT(*) AS payment_count FROM government_services.payments WHERE payment_timestamp >... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text PRIMARY KEY, property_id text, room_numb... | [
{
"role": "user",
"content": "List the room_id, room_number, and current_condition for all rooms that have 'Jacuzzi' in their features.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT room_id, room_number, current_condition\nFROM hospitality_technology.rooms\nWHERE features LIKE '... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE web3.events ( event_id text PRIMARY KEY, contract_id text, event_name text, data tex... | [
{
"role": "user",
"content": "Show me all token transfers where the corresponding transaction also emitted an event named 'Transfer', along with the transfer value and event data.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tt.transfer_id, tt.value, e.data FROM web3.token_tran... |
You are an expert in writing database language. You can write a corresponding 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.reviews ( review_id.text, property_id.text, reservation_id.te... | [
{
"role": "user",
"content": "Show me reviews from 'Expedia' that have an overall rating of 1 or 2.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT review_id, property_id, guest_id, rating_overall, review_date, comment FROM hospitality_technology.reviews WHERE review_source = 'Exp... |
You are an expert in writing database language. You can write a corresponding 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": "For each case, show the total amount of all invoices and the number of scheduled appointments. Only include cases that have both an invoice and at least one appointment.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT i.case_id, SUM(i.total_amount) 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 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 transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te... | [
{
"role": "user",
"content": "Retrieve the route number and description for routes whose estimated duration exceeds 120 minutes.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT route_number, description\nFROM transportation.routes\nWHERE estimated_duration_minutes > 120;",
"sq... |
You are an expert in writing database language. You can write a corresponding 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 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 financial_services.customers ( customer_id text, first_name text, last_name text, da... | [
{
"role": "user",
"content": "Can you show me all pairs of customers living in the same city but with different last names? Show both customer IDs, both full names, and their city.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.customer_id AS customer_id_a, CONCAT(a.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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -... | [
{
"role": "user",
"content": "I'd like a list of all games, displaying game title, developer name, and total number of achievements for each game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT g.title, d.name AS developer_name, COUNT(a.achievement_id) AS total_achievements\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 government_services.service_locations ( location_id text PRIMARY KEY, agency_id text... | [
{
"role": "user",
"content": "Get the number of service locations per state.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT state, COUNT(*) AS location_count\nFROM service_locations\nGROUP BY state;",
"sql": null
},
{
"role": "user",
"content": "Now only include 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 smart_money_token_performance ( token_address.text, token_symbol.text, pnl.numeric, ... | [
{
"role": "user",
"content": "List token symbols on any chain that have both a realized ratio above 0.8 and an ROI greater than 5. Show their symbol, chain, realized ratio, and ROI.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT token_symbol, chain, realized_ratio, roi FROM smart... |
You are an expert in writing database language. You can write a corresponding 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": "Retrieve each guest's full name and the date of their most recent review, including review_source.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT sub.guest_id, sub.full_name, sub.review_date AS last_review_date, sub.review_source\nFROM (\n SELECT 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.wallets ( wallet_id text, user_id text, address text, private_key text, created... | [
{
"role": "user",
"content": "List all pairs of wallets that use the same private_key. Display w1.wallet_id, w1.user_id, w2.wallet_id, w2.user_id, and the shared private_key.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT w1.wallet_id AS wallet1_id,\n w1.user_id AS user1_... |
You are an expert in writing database language. You can write 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: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c... | [
{
"role": "user",
"content": "Can you help me fetch the inventory records for components stored in a specific warehouse, along with their expiry dates?",
"sql": null
},
{
"role": "assistant",
"content": "HGETALL inv:<inventory_record_id>\nZRANGE component_expiry:<component_id> 0 -1 WITHSCORE... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE transportation.passengers (
passenger_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Show the first and last name of each passenger along with the total number of bookings they have made.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, COUNT(b.booking_id) AS booking_count FROM transportation.passengers p LEF... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
// db.createCollection('passengers')
// Optional: db.passengers.createIndex({ passenger_id: 1 }, ... | [
{
"role": "user",
"content": "I need to find passengers who have a specific phone number prefix '+1555'. Can you help with that?",
"sql": null
},
{
"role": "assistant",
"content": "db.passengers.find({ phone_number: { $regex: '^\\+1555' } }, { first_name: 1, last_name: 1, phone_number: 1, em... |
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, customer_id... | [
{
"role": "user",
"content": "Show me each account along with any loans linked to it. Include the account type, account balance, loan type, and loan principal amount.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT a.account_type, a.balance, l.loan_type, l.principal_amount FROM fi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.