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 insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil...
[ { "role": "user", "content": "How many distinct users have uploaded claim documents of type 'ACCIDENT_REPORT'?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT uploaded_by) FROM insurance.claim_documents WHERE document_type = 'ACCIDENT_REPORT';", "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.customers ( customer_id text, first_name text, last_name text, da...
[ { "role": "user", "content": "Show me the total number of customers and their average age grouped by city.", "sql": null }, { "role": "assistant", "content": "SELECT city, COUNT(customer_id) AS total_customers, AVG(EXTRACT(YEAR FROM NOW()) - EXTRACT(YEAR FROM date_of_birth)) AS average_age F...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, contract_id character varying...
[ { "role": "user", "content": "For each contract, can you show the number of different types of events it has emitted along with the contract ID?", "sql": null }, { "role": "assistant", "content": "SELECT contract_id, COUNT(DISTINCT event_name) AS distinct_event_types FROM web3.events GROUP B...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.loans ( loan_id character varying(64) NOT NULL, account_id charac...
[ { "role": "user", "content": "Show me all active loans (loan_id, loan_type, principal_amount) where the remaining term is less than 6 months, along with their account_id and monthly_payment.", "sql": null }, { "role": "assistant", "content": "SELECT loan_id, loan_type, principal_amount, acco...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id.text, post_id.text, user_id.text, parent_comment_...
[ { "role": "user", "content": "Show me the number of direct replies each top-level comment has on post 'P200'.", "sql": null }, { "role": "assistant", "content": "SELECT c.comment_id, COUNT(r.comment_id) AS reply_count FROM comments AS c LEFT JOIN comments AS r ON r.parent_comment_id = c.comm...
You are an expert in writing database language. You can write a corresponding 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": "List the first name, last name, and booking time for all passengers who made a booking in June 2024.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.booking_time FROM transportation.passengers AS T1 JOIN transportation....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for...
[ { "role": "user", "content": "Show the transaction ID, the transaction value from the transactions table, and the sum of the value from token_transfers for all transactions that have at least one associated token transfer. Name the sum column total_token_transfer_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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t...
[ { "role": "user", "content": "What is the total USD value of tokens held by 'Binance' on the 'BSC' chain according to the latest snapshot?", "sql": null }, { "role": "assistant", "content": "SELECT SUM(usd_value) FROM cex_token_balance WHERE exchange = 'Binance' AND chain = 'BSC' AND snapsho...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_...
[ { "role": "user", "content": "Show me all replies to comments on post 'P500', including the reply content and the content of the parent comment.", "sql": null }, { "role": "assistant", "content": "SELECT T1.content AS reply_content, T2.content AS parent_comment_content FROM social_media.comm...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.services ( service_id character varying(64) NOT NULL, propert...
[ { "role": "user", "content": "Show me each department in each property, along with the total number of available services and their combined price.", "sql": null }, { "role": "assistant", "content": "SELECT property_id, department, COUNT(*) AS service_count, SUM(price) AS total_price FROM ho...
You are an expert in writing database language. You can write a corresponding 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": "List the number of documents submitted by each citizen, showing their citizen ID and only include those citizens who have submitted more than 5 documents.", "sql": null }, { "role": "assistant", "content": "SELECT citizen_id, COUNT(*) AS document_count\nFROM gov...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url...
[ { "role": "user", "content": "Count the number of posts that have received at least one comment.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT post_id) FROM social_media.comments", "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, national_i...
[ { "role": "user", "content": "List the sent notifications related to appointments, including notification ID, message subject, citizen full name, and scheduled start time of the appointment.", "sql": null }, { "role": "assistant", "content": "SELECT\n n.notification_id,\n n.message_subject...
You are an expert in writing database language. You can write a corresponding 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.wallets ( wallet_id character varying(64) NOT NULL, user_id charact...
[ { "role": "user", "content": "Count the number of metadata entries for each asset.", "sql": null }, { "role": "assistant", "content": "SELECT asset_id, COUNT(*) AS metadata_count\nFROM trading_platform.metadata\nGROUP BY asset_id;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, docum...
[ { "role": "user", "content": "Which documents have a version number of at least 5? List their document_name, case_id, and version.", "sql": null }, { "role": "assistant", "content": "SELECT document_name, case_id, version\nFROM legal_services.documents\nWHERE version >= 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 Index 'component_inventory'. Mapping: { properties: { inventory_record_id: { type: 'keyword' }, c...
[ { "role": "user", "content": "特定の倉庫にあるコンポーネントの在庫情報を取得したいです。倉庫の場所、ビンの位置、在庫数量、コンポーネントIDを表示してください。", "sql": null }, { "role": "assistant", "content": "SELECT location_warehouse, location_bin, quantity, component_id FROM component_inventory WHERE location_warehouse = 'specific_warehouse';", ...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, first_name text, last_name text, ...
[ { "role": "user", "content": "Show me all patients who have received a prescription for a medication with 'cillin' in its generic name, along with their full name, prescription date, and the prescribing doctor's last name.", "sql": null }, { "role": "assistant", "content": "SELECT p.patient_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "Show the first name, last name, and firm name for all lawyers specializing in 'Intellectual Property'.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.firm_name FROM legal_services.lawyers AS T1 JOIN legal_services.law_...
You are an expert in writing database language. You can write a corresponding 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": "Find pairs of appointment IDs that were scheduled at the same location. Show the IDs of the two appointments.", "sql": null }, { "role": "assistant", "content": "SELECT t1.appointment_id, t2.appointment_id FROM appointments AS t1 JOIN appointments AS t2 ON t1.lo...
You are an expert in writing database language. You can write a corresponding 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 the details of all UTXOs with an amount greater than 5, ordered by amount descending.", "sql": null }, { "role": "assistant", "content": "SELECT utxo_id, transaction_id, output_index, address, amount, spent\nFROM trading_platform.utxos\nWHERE amount > 5\nOR...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character ...
[ { "role": "user", "content": "Please list the first name, last name, and specialty for all doctors in the system.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, specialty FROM healthcare.doctors;", "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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "List the contract ID, address, and deployer address for all contracts deployed on the 'mainnet' network.", "sql": null }, { "role": "assistant", "content": "SELECT contract_id, address, deployer_address FROM web3.contracts WHERE network_id = 'mainnet';", "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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "Show me the top 3 countries by total number of registered guests. Include country_code and guest_count.", "sql": null }, { "role": "assistant", "content": "SELECT g.country_code, COUNT(*) AS guest_count\nFROM hospitality_technology.guests g\nGROUP BY g.country_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 legal_services.cases ( case_id text, case_number text, case_name text, client_id tex...
[ { "role": "user", "content": "Find all cases that were closed in the year 2022, showing their case name, case number, and date closed.", "sql": null }, { "role": "assistant", "content": "SELECT case_name, case_number, date_closed FROM legal_services.cases WHERE date_closed >= '2022-01-01' AN...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "I need to find all pairs of diagnoses for the same patient where one diagnosis is chronic and the other is non-chronic. Show patient_id, chronic diagnosis_id as chronic_id, non-chronic diagnosis_id as acute_id, chronic diagnosis_date, and acute diagnosis_date.", "sql": null...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, -- unique identifie...
[ { "role": "user", "content": "How many users have email_notifications_enabled set to false and private_profile set to true? Return the count.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) AS user_count\nFROM social_media.user_settings\nWHERE email_notifications_enabled ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id text, user_id text, content text, media_url text, media...
[ { "role": "user", "content": "Count how many follow relationships were created in June 2024.", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(follow_id) FROM social_media.follows WHERE created_at >= '2024-06-01' AND created_at < '2024-07-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 financial_services.trades ( trade_id character varying(64) NOT NULL, account_id char...
[ { "role": "user", "content": "Show me the total number of trades and the sum of total_amount for each status in the trades table.", "sql": null }, { "role": "assistant", "content": "SELECT\n t.status,\n COUNT(t.trade_id) AS trade_count,\n SUM(t.total_amount) AS total_amount_by_status\nFRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo...
[ { "role": "user", "content": "For each reservation made in January 2024, show the guest's full name, reservation ID, check-in date, and the property name.", "sql": null }, { "role": "assistant", "content": "SELECT g.first_name, g.last_name, r.reservation_id, r.check_in_date, r.property_id\nF...
You are an expert in writing database language. You can write a corresponding 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 me the title of each game and the total number of game sessions played on servers hosting that game.", "sql": null }, { "role": "assistant", "content": "SELECT t1.title, count(t3.session_id) FROM gaming_technology.games AS t1 JOIN gaming_technology.servers ...
You are an expert in writing database language. You can write a corresponding 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": "Show me all reservations, including the guest's full name, the room number, check-in date, and check-out date.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T3.room_number, T2.check_in_date, T2.check_out_date FROM hospit...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.developers ( developer_id uuid PRIMARY KEY, name text, country tex...
[ { "role": "user", "content": "List all developers founded before the year 2000, showing their name, country, and the year they were founded.", "sql": null }, { "role": "assistant", "content": "SELECT name, country, founded_year FROM gaming_technology.developers WHERE founded_year < 2000;", ...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the player_id, username, and game title for all players who have at least one item in their inventory.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT p.player_id, p.username, g.title\nFROM gaming_technology.players p\nJOIN gaming_te...
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 current job satisfaction level or feedback from staff members working at a specific train station?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on job satisfaction levels or feedback from staff member...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, -- unique iden...
[ { "role": "user", "content": "Show the name, symbol, and total quantity traded for each asset.", "sql": null }, { "role": "assistant", "content": "SELECT a.name, a.symbol, COALESCE(SUM(t.quantity), 0) AS total_quantity_traded\nFROM trading_platform.assets a\nLEFT JOIN trading_platform.trades...
You are an expert in writing database language. You can write a corresponding 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": "Count the number of documents for each document type.", "sql": null }, { "role": "assistant", "content": "SELECT document_type, COUNT(*) FROM government_services.documents GROUP BY document_type;", "sql": null }, { "role": "user", "content": "Onl...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "How many reviews were posted by each guest? Show the guest ID and the count of reviews.", "sql": null }, { "role": "assistant", "content": "SELECT guest_id, COUNT(*) AS review_count\nFROM hospitality_technology.reviews\nGROUP BY guest_id;", "sql": null }, ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "Show me a list of all patient names along with the full names of their doctors for appointments scheduled in February 2024.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name AS patient_first_name, p.last_name AS patient_last_name, d.first_n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_...
[ { "role": "user", "content": "What is the average processing time in days for each service category?", "sql": null }, { "role": "assistant", "content": "SELECT category, AVG(average_processing_time_days) AS avg_processing_time\nFROM government_services.services\nGROUP BY category;", "sql...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Which users have commented on posts that contain media? Please show the commenter username and the post ID.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT u.username, c.post_id\nFROM social_media.comments c\nJOIN social_media.users u ON c.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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash...
[ { "role": "user", "content": "For each achievement, show its name, the game_id it belongs to, and the number of distinct players who have played a session for that game.", "sql": null }, { "role": "assistant", "content": "SELECT a.name, a.game_id, COUNT(DISTINCT gs.player_id) AS players_with...
You are an expert in writing database language. You can write a corresponding 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": "Show me all documents along with the document name and type, together with both the upload_timestamp and the lawyer ID who uploaded them.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, document_name, document_type, upload_timestamp, uplo...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, roo...
[ { "role": "user", "content": "Show me the latest payment timestamp for each guest who has made a payment, along with their full name.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, max(T2.payment_timestamp) FROM hospitality_technology.guests AS T1 JOI...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex...
[ { "role": "user", "content": "Retrieve the policy_number, claim_id, incident_date, and document_type for all claims that have at least one \"Damage Assessment\" document. Sort the results by incident_date descending.", "sql": null }, { "role": "assistant", "content": "SELECT p.policy_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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "List all document names and their types.", "sql": null }, { "role": "assistant", "content": "SELECT document_name, document_type FROM documents;", "sql": null }, { "role": "user", "content": "Only include documents of type 'Contract' and with ver...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.insurance_plans ( plan_id text, plan_name text, insurance_provider text, ...
[ { "role": "user", "content": "Please list the contact phone number and website for each insurance plan.", "sql": null }, { "role": "assistant", "content": "SELECT plan_id, plan_name, contact_phone, website FROM healthcare.insurance_plans;", "sql": null }, { "role": "user", "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 insurance.claim_documents ( document_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Find all documents that have a description and list their document ID, file name, and description.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, file_name, description FROM insurance.claim_documents WHERE description IS NOT NULL AND des...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name....
[ { "role": "user", "content": "Show the full name (first and last name) of employees who are assigned to applications with a status of 'Completed'.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.employees AS T1 INNER JO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.notifications ( notification_id text, user_id text, message text, s...
[ { "role": "user", "content": "Show me all notifications sent in the last 7 days, including the user ID and message.", "sql": null }, { "role": "assistant", "content": "SELECT user_id, message, sent_at FROM trading_platform.notifications WHERE sent_at >= NOW() - INTERVAL '7 days';", "sql"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.bookings ( booking_id.text, passenger_id.text, trip_id.text, seat_num...
[ { "role": "user", "content": "Find all pairs of bookings that share the same payment_transaction_id.", "sql": null }, { "role": "assistant", "content": "SELECT b1.booking_id AS booking_id_1, b2.booking_id AS booking_id_2, b1.payment_transaction_id\nFROM transportation.bookings b1\nJOIN trans...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.locations ( location_id text PRIMARY KEY, name text, type text, addre...
[ { "role": "user", "content": "Show me all locations in New York with latitude above 40.7, including their type and coordinates.", "sql": null }, { "role": "assistant", "content": "SELECT name, type, latitude, longitude FROM transportation.locations WHERE state_province = 'New York' AND latit...
You are an expert in writing database language. You can write a corresponding 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": "Show all tokens on the Ethereum chain in token_dexpool_info that had a price increase in the last 6 hours, along with their 24h trading volume and smart money ROI.", "sql": null }, { "role": "assistant", "content": "SELECT td.token_symbol,\n td.price_chang...
You are an expert in writing database language. You can write a corresponding 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, -- unique id...
[ { "role": "user", "content": "List the name of each law firm along with the first and last name of its managing partner.", "sql": null }, { "role": "assistant", "content": "SELECT T1.firm_name, T2.first_name, T2.last_name FROM law_firms AS T1 JOIN lawyers AS T2 ON T1.managing_partner_id = T2...
You are an expert in writing database language. You can write a corresponding 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.hashtags ( hashtag_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Show me all hashtags that were created in June 2024, and for each, display the hashtag ID, tag name, and when it was created.", "sql": null }, { "role": "assistant", "content": "SELECT hashtag_id, tag_name, created_at FROM social_media.hashtags WHERE created_at ...
You are an expert in writing database language. You can write a corresponding 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 all posts along with the user emails of the authors.", "sql": null }, { "role": "assistant", "content": "SELECT p.post_id, p.content, u.email\nFROM social_media.posts p\nJOIN social_media.users u ON p.user_id = u.user_id;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id tex...
[ { "role": "user", "content": "Which policies have a premium amount greater than the base premium of their respective insurance product? Please show the policy_number, premium_amount, product_name, and base_premium.", "sql": null }, { "role": "assistant", "content": "SELECT p.policy_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.hashtags ( hashtag_id text, tag_name text, created_at timestamp )
[ { "role": "user", "content": "List the tag names and creation dates for all hashtags created on June 12, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT tag_name, created_at FROM social_media.hashtags WHERE created_at::date = '2024-06-12';", "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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_nam...
[ { "role": "user", "content": "List each driver along with the driver_id of the driver who was hired immediately after them.", "sql": null }, { "role": "assistant", "content": "SELECT d1.driver_id AS current_driver_id, d2.driver_id AS next_driver_id FROM transportation.drivers d1 LEFT JOIN tr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "List all insurance plans, showing their ID, name, provider, and plan type.", "sql": null }, { "role": "assistant", "content": "SELECT plan_id, plan_name, insurance_provider, plan_type FROM healthcare.insurance_plans;", "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 insurance.agents ( agent_id character varying(64) NOT NULL, first_name character var...
[ { "role": "user", "content": "Retrieve the agent ID, first and last name, agency name, and their manager's first and last name for every agent.", "sql": null }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name AS agent_first_name, a.last_name AS agent_last_name, a.agency_na...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.room_types ( room_type_id text, property_id text, type_name t...
[ { "role": "user", "content": "Retrieve the average base_rate and maximum occupancy for room types grouped by bed_type.", "sql": null }, { "role": "assistant", "content": "SELECT bed_type,\n AVG(base_rate) AS avg_base_rate,\n MAX(max_occupancy) AS max_occupancy\nFROM hospitality_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 gaming_technology.in_game_items ( item_id uuid PRIMARY KEY, game_id uuid, item_name ...
[ { "role": "user", "content": "Can you list the number of items for each rarity in the system?", "sql": null }, { "role": "assistant", "content": "SELECT rarity, COUNT(*) AS item_count\nFROM gaming_technology.in_game_items\nGROUP BY rarity;", "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.clients ( client_id text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "List the case_number, case_name, and the total amount invoiced for each case.", "sql": null }, { "role": "assistant", "content": "SELECT ca.case_number, ca.case_name, SUM(i.total_amount) AS total_invoiced\nFROM legal_services.cases ca\nLEFT JOIN legal_services.i...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.guests ( guest_id text PRIMARY KEY, first_name text, last_nam...
[ { "role": "user", "content": "Show me the number of service orders placed for each service category.", "sql": null }, { "role": "assistant", "content": "SELECT s.category, COUNT(so.order_id) AS order_count\nFROM hospitality_technology.service_orders so\nJOIN hospitality_technology.services 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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name...
[ { "role": "user", "content": "Provide a count of payments for each unique currency type recorded in the system.", "sql": null }, { "role": "assistant", "content": "SELECT currency, COUNT(*) AS payment_count FROM government_services.payments GROUP BY currency;", "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.text, national_id_number.text, first_name....
[ { "role": "user", "content": "List the agency names and the total amount received from payments with the status 'Pending'.", "sql": null }, { "role": "assistant", "content": "SELECT ag.agency_name, SUM(p.amount) AS total_pending_payments\nFROM government_services.payments p\nJOIN government_...
You are an expert in writing database language. You can write a corresponding 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": "For each account type, show the average balance and the number of completed trades associated with accounts of that type.", "sql": null }, { "role": "assistant", "content": "SELECT a.account_type, AVG(a.balance) AS average_balance, COUNT(t.trade_id) AS completed...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address tex...
[ { "role": "user", "content": "List the top 5 addresses that have received the most token transfers.", "sql": null }, { "role": "assistant", "content": "SELECT to_address, COUNT(*) AS transfer_count FROM web3.token_transfers GROUP BY to_address ORDER BY transfer_count DESC LIMIT 5;", "sql...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.securities ( security_id text, ticker_symbol text, isin_code text...
[ { "role": "user", "content": "List every employee and the total number of trades executed for securities where the security sector matches the employee department. Show the employee full name, department, and total_trade_count.", "sql": null }, { "role": "assistant", "content": "SELECT e.emp...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id.text, username.text, email.text, password_hash.text, fu...
[ { "role": "user", "content": "Show me the usernames and group names for users who have joined group chats and also created at least one post.", "sql": null }, { "role": "assistant", "content": "SELECT u.username, c.group_name\nFROM social_media.conversation_participants cp\nJOIN social_media...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, docum...
[ { "role": "user", "content": "List the case number, case name, and the full name of the client for cases that have uploaded documents.", "sql": null }, { "role": "assistant", "content": "SELECT T1.case_number , T1.case_name , T2.full_name FROM legal_services.cases AS T1 JOIN legal_services...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash...
[ { "role": "user", "content": "Could you list all unique item types available in the system and the number of items that belong to each type?", "sql": null }, { "role": "assistant", "content": "SELECT item_type, COUNT(item_id) AS item_count\nFROM gaming_technology.in_game_items\nGROUP BY item...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "List the first name, last name, license number, and status for all drivers whose license expires in the next 6 months.", "sql": null }, { "role": "assistant", "content": "SELECT\n first_name,\n last_name,\n license_number,\n status\nFROM transportation.drive...
You are an expert in writing database language. You can write a corresponding 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": "Show the appointment ID, scheduled start time, and the full name of the citizen for all appointments related to services with a standard fee greater than 150.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id, a.scheduled_start_time, 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 gaming_technology.developers ( developer_id uuid NOT NULL DEFAULT gen_random_uui...
[ { "role": "user", "content": "Show me all in-game items with the word 'Sword' in their name along with the total number of sessions in those games.", "sql": null }, { "role": "assistant", "content": "SELECT i.item_id, i.item_name, COUNT(s.session_id) AS session_count\nFROM 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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern...
[ { "role": "user", "content": "Show me the number of players who registered each year. List the registration year and the count.", "sql": null }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM registration_date) AS registration_year, COUNT(*) AS player_count FROM gaming_technolog...
You are an expert in writing database language. You can write a corresponding 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, -- uniq...
[ { "role": "user", "content": "Show me the full name and job title for all employees who were hired in the last 3 years, along with the full name of their manager.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name || ' ' || e.last_name AS employee_full_name, e.job_title,...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, customer_id text, account...
[ { "role": "user", "content": "What is the total commission earned from all trades executed in the 'NYSE' venue by employees in the 'Investment' department?", "sql": null }, { "role": "assistant", "content": "SELECT SUM(t.commission) AS total_commission FROM financial_services.trades t JOIN f...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid PRIMARY KEY, username text, email text, p...
[ { "role": "user", "content": "For each player, show their username and the total number of achievements they have unlocked in games where they also own at least one item. Only include players who have unlocked at least one achievement.", "sql": null }, { "role": "assistant", "content": "SELE...
You are an expert in writing database language. You can write a corresponding 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.text, conversation_id.text, sender_user_id.text, ...
[ { "role": "user", "content": "I want to find all notifications for messages containing the word 'holiday' in their content; include notification_id, message content, and notification created_at.", "sql": null }, { "role": "assistant", "content": "SELECT n.notification_id, m.content, n.create...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "Find pairs of citizens who share the same gender but registered in different years. Show each citizen's first and last name along with their registration year.", "sql": null }, { "role": "assistant", "content": "SELECT c1.first_name AS first_name_1,\n c1.l...
You are an expert in writing database language. You can write a corresponding 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.user_settings ( setting_id text PRIMARY KEY, user_id text, theme text, ...
[ { "role": "user", "content": "Show me all user IDs who changed their profile settings after June 1, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT user_id FROM social_media.user_settings WHERE updated_at > '2024-06-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 legal_services.clients ( client_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "Which law firms have handled appointments with clients who registered in 2024? Please provide the law firm name, the client’s first and last name, and the appointment subject.", "sql": null }, { "role": "assistant", "content": "SELECT lf.firm_name, c.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 government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "What are the top 5 most recently registered verified citizens? Return the citizen ID, full name, and registration date.", "sql": null }, { "role": "assistant", "content": "SELECT citizen_id,\n first_name || ' ' || last_name AS full_name,\n registrati...
You are an expert in writing database language. You can write a corresponding 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 service orders for spa services in the last month, including the guest name and staff who delivered the service.", "sql": null }, { "role": "assistant", "content": "SELECT so.order_id, g.first_name, g.last_name, s.service_name, st.first_name AS staff...
You are an expert in writing database language. You can write a corresponding 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 all passengers with their first name, last name, and email.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM transportation.passengers;", "sql": null }, { "role": "user", "content": "Can you also 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 gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.t...
[ { "role": "user", "content": "Find pairs of servers in the same region where one server's current_players is more than twice that of another. Return the region, server1 name, server2 name, and their current_players counts.", "sql": null }, { "role": "assistant", "content": "SELECT s1.region,...
You are an expert in writing database language. You can write a corresponding 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, policy_id character vary...
[ { "role": "user", "content": "Show me all claims handled by agent 'AG123' along with their settlement details and policy IDs.", "sql": null }, { "role": "assistant", "content": "SELECT claim_id, policy_id, settlement_amount, settlement_date FROM insurance.claims WHERE claim_handler_id = 'AG1...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "Show a list of group chat names with their conversation_id, the total number of participants, and the total number of messages sent in each group chat.", "sql": null }, { "role": "assistant", "content": "SELECT c.conversation_id,\n c.group_name,\n CO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "Show me all invoice numbers together with the client IDs and related case IDs for invoices issued after March 1st, 2024.", "sql": null }, { "role": "assistant", "content": "SELECT invoice_number, client_id, case_id FROM legal_services.invoices WHERE issue_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 web3.events ( event_id text, contract_id text, event_name text, data text, emitted_a...
[ { "role": "user", "content": "List all token transfers showing the transfer id, the symbol of the transferred token, and the contract address where the token was created.", "sql": null }, { "role": "assistant", "content": "SELECT tt.transfer_id, t.token_symbol, t.contract_address\nFROM web3....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "Show the top 10 most expensive fuel log entries including fuel_log_id, vehicle make and model, location name and city, and total_cost.", "sql": null }, { "role": "assistant", "content": "SELECT f.fuel_log_id,\n v.make,\n v.model,\n loc.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 gaming_technology.developers ( developer_id.uuid, name.text, country.text, founded_y...
[ { "role": "user", "content": "For each developer, show their name and the total number of achievements in all games they have developed.", "sql": null }, { "role": "assistant", "content": "SELECT d.name AS developer_name, COUNT(a.achievement_id) AS total_achievements\nFROM 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Provide a count of appointments grouped by their current status.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM government_services.appointments GROUP BY status;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_...
[ { "role": "user", "content": "Show for each player the total score achieved in sessions on each server, and the number of sessions per server.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, server_id, SUM(score) AS total_score, COUNT(*) AS session_count\nFROM gaming_te...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "Show me the usernames of users who have the word 'explorer' in their bio.", "sql": null }, { "role": "assistant", "content": "SELECT username\nFROM social_media.users\nWHERE bio ILIKE '%explorer%';", "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.documents ( document_id character varying(64) NOT NULL, applicat...
[ { "role": "user", "content": "How many documents of each type currently have a verification_status of 'Pending'?", "sql": null }, { "role": "assistant", "content": "SELECT\n document_type,\n COUNT(*) AS pending_count\nFROM government_services.documents\nWHERE verification_status = 'Pending...
You are an expert in writing database language. You can write a corresponding 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.wallets ( wallet_id text, user_id text, address text, private_key t...
[ { "role": "user", "content": "Show me pairs of wallets that belong to the same user, listing the wallet_id, user_id, address, and created_at for the earlier and later wallet in each pair.", "sql": null }, { "role": "assistant", "content": "SELECT w1.user_id,\n w1.wallet_id AS earlier_w...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Show me a list of all users who have participated in any trade (either as a buyer or a seller), including their username and the total number of trades they were involved in.", "sql": null }, { "role": "assistant", "content": "SELECT T1.username , count(T2.trade...