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 gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, ...
[ { "role": "user", "content": "Show me all players who have unlocked achievements, and for each, also list the total number of achievements they've unlocked.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, COUNT(*) AS achievements_unlocked FROM gaming_technology.player_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 trading_platform.orders ( order_id text, user_id text, wallet_id text, asset_id text...
[ { "role": "user", "content": "I want to see the number of 'buy' and 'sell' orders for each asset, along with the asset_id.", "sql": null }, { "role": "assistant", "content": "SELECT asset_id, order_type, COUNT(*) AS order_count FROM trading_platform.orders GROUP BY asset_id, order_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 token_basic_info ( coin_id character varying(100) NOT NULL, -- the id of the token t...
[ { "role": "user", "content": "Show me the top 3 narratives by trend rank, along with their top 3 tokens and 7-day price change percentage.", "sql": null }, { "role": "assistant", "content": "SELECT n.narrative, n.top_3_coins, n.price_change_percentage_7d FROM narrative_info n ORDER BY n.tren...
You are an expert in writing database language. You can write a corresponding 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 the full names of patients who have ever been prescribed a medication manufactured by 'Novartis'.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT p.first_name, p.last_name\nFROM healthcare.patients p\nJOIN healthcare.prescriptions pr 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.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List all room types that have at least one service in the 'Spa' category, including the room type name, property name, and service name.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT rt.type_name, p.property_name, s.service_name\nFROM hospi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE erc20_balances ( block_number.bigint, contract_address.text, wallet_address.text, am...
[ { "role": "user", "content": "For each NFT collection deployed on Ethereum, count the number of distinct wallets that have ever held any token from that collection.", "sql": null }, { "role": "assistant", "content": "SELECT\n nc.contract_address,\n nc.name,\n COUNT(DISTINCT nh.wallet_addr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, username character vary...
[ { "role": "user", "content": "List all users who commented on posts tagged with hashtag 'spring', showing user_id, comment_id, content, and tag_name.", "sql": null }, { "role": "assistant", "content": "SELECT c.user_id, c.comment_id, c.content, h.tag_name\nFROM social_media.comments c\nJOIN ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, from_address char...
[ { "role": "user", "content": "Provide a count of transactions grouped by their status.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM web3.transactions GROUP BY status;", "sql": null }, { "role": "user", "content": "Now, only show the statuse...
You are an expert in writing database language. You can write a corresponding 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": "Can you find all players who registered in 2023 and unlocked at least one achievement?", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT p.player_id, p.username\nFROM gaming_technology.players p\nJOIN gaming_technology.player_achievements pa 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 trading_platform.notifications ( notification_id.text, user_id.text, message.text, s...
[ { "role": "user", "content": "I want to find the average time it takes for a notification to be marked as read, calculated for each user. Please show the user ID and the average read time in seconds, considering only notifications that have been read.", "sql": null }, { "role": "assistant", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "How many citizens are marked as not verified?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM government_services.citizens WHERE is_verified = FALSE;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text, national_id_number text, first_name ...
[ { "role": "user", "content": "Could you show me all scheduled appointments including appointment_id, scheduled_start_time, the citizen's full name, and the location name?", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id,\n a.scheduled_start_time,\n c.fi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), usern...
[ { "role": "user", "content": "For each player, can you list the total number of achievements they have unlocked and the total number of sessions they have played, along with their username?", "sql": null }, { "role": "assistant", "content": "SELECT p.player_id, p.username, COUNT(DISTINCT pa....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash...
[ { "role": "user", "content": "How can I calculate how many years each developer has been in business based on their founded_year?", "sql": null }, { "role": "assistant", "content": "SELECT name,\n EXTRACT(year FROM age(CURRENT_DATE, make_date(founded_year, 1, 1))) AS years_in_business\...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.posts ( post_id character varying(64) NOT NULL, user_id character varyi...
[ { "role": "user", "content": "How many likes have been received by public posts, grouped by media_type? Please show media_type and the count of likes for each.", "sql": null }, { "role": "assistant", "content": "SELECT p.media_type,\n COUNT(l.like_id) AS like_count\nFROM social_media.p...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text,...
[ { "role": "user", "content": "Could you provide the number of vehicles for each fuel_type?", "sql": null }, { "role": "assistant", "content": "SELECT fuel_type, COUNT(*) AS vehicle_count\nFROM transportation.vehicles\nGROUP BY fuel_type;", "sql": null }, { "role": "user", "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 gaming_technology.achievements ( achievement_id uuid, game_id uuid, name text, descr...
[ { "role": "user", "content": "How many visible achievements are there per game, and what is the average point value of these achievements?", "sql": null }, { "role": "assistant", "content": "SELECT game_id, COUNT(*) AS visible_count, AVG(points) AS avg_points\nFROM gaming_technology.achievem...
You are an expert in writing database language. You can write a corresponding 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": "List all pairs of record_id for the same patient that were created on the same day. Show the two record_ids, patient_id, and the date.", "sql": null }, { "role": "assistant", "content": "SELECT\n mr1.patient_id,\n date_trunc('day', mr1.record_date) AS reco...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Show me all appointments for doctor 'doctor_100' in June 2024, including the appointment time and the patient ID.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, appointment_time\nFROM healthcare.appointments\nWHERE doctor_...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List all documents, including their document_id, document_type, upload_timestamp, and the reference number of the associated application.", "sql": null }, { "role": "assistant", "content": "SELECT d.document_id, d.document_type, d.upload_timestamp, a.reference_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.agencies ( agency_id.text, agency_name.text, jurisdiction_level....
[ { "role": "user", "content": "Find the names and addresses of service locations where no appointments have been scheduled.", "sql": null }, { "role": "assistant", "content": "SELECT sl.location_name, sl.address FROM government_services.service_locations sl LEFT JOIN government_services.appoi...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, docum...
[ { "role": "user", "content": "Find, for each case, pairs of documents where one document_type is 'Contract' and the other is 'Evidence'. Return the case_id, the name of the contract document as contract_name, and the name of the evidence document as evidence_name.", "sql": null }, { "role": "ass...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifi...
[ { "role": "user", "content": "Could you show me the usernames of users who have received likes on their posts, along with the total number of likes each user's posts have received?", "sql": null }, { "role": "assistant", "content": "SELECT T1.username, count(T3.like_id) AS total_likes_receiv...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List each case's number and name with the full name of its lead lawyer and the firm name they belong to.", "sql": null }, { "role": "assistant", "content": "SELECT c.case_number, c.case_name, CONCAT(l.first_name, ' ', l.last_name) AS lead_lawyer, f.firm_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 hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Get the review comments along with the reservation check-in and check-out dates, and the guest's first and last name.", "sql": null }, { "role": "assistant", "content": "SELECT rev.comment, res.check_in_date, res.check_out_date, g.first_name, g.last_name\nFROM 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 gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ...
[ { "role": "user", "content": "Show the number of achievements unlocked by each player per month. Display player_id, month (as YYYY-MM), and achievement_count.", "sql": null }, { "role": "assistant", "content": "SELECT player_id,\n TO_CHAR(unlocked_at, 'YYYY-MM') AS year_month,\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 trading_platform.metadata ( metadata_id character varying(64) NOT NULL, asset_id cha...
[ { "role": "user", "content": "List asset_id, issuer and launch_date metadata values for each asset that has both 'issuer' and 'launch_date' keys.", "sql": null }, { "role": "assistant", "content": "SELECT m_iss.asset_id,\n m_iss.value AS issuer,\n m_ld.value AS launch_date\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 insurance.claim_documents ( document_id text, claim_id text, document_type text, fil...
[ { "role": "user", "content": "Show me all claim documents that are police reports and were uploaded in the last 30 days, along with their file sizes.", "sql": null }, { "role": "assistant", "content": "SELECT document_id, claim_id, file_name, file_size_bytes, uploaded_at FROM insurance.claim...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.transactions ( transaction_id text, account_id text, related_acco...
[ { "role": "user", "content": "I want to see for each security the ticker_symbol, security_name, and the highest single-day close_price from the market_data.", "sql": null }, { "role": "assistant", "content": "SELECT s.ticker_symbol, s.security_name, MAX(m.close_price) AS highest_close_price\...
You are an expert in writing database language. You can write a corresponding 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.applications ( application_id.text, citizen_id.text, service_id....
[ { "role": "user", "content": "List all appointments along with their scheduled start time and the purpose, as well as the name of the location where each appointment is scheduled.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id, a.scheduled_start_time, a.purpose, ...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve review comments and their overall rating for properties that currently have at least one room with a status of 'Available'. Include the review ID, property ID, and review date.", "sql": null }, { "role": "assistant", "content": "SELECT r.review_id, r.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 hospitality_technology.service_orders ( order_id character varying(64) NOT NULL,...
[ { "role": "user", "content": "For each guest, show the count of service orders they placed for services in the 'Food & Beverage' department. Include the guest's full name and the order count.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, COUNT(T2.ord...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id character varying(64) NOT N...
[ { "role": "user", "content": "List all reviews where the cleanliness rating is 3 or below. Include the review comment and the full name of the guest who submitted it.", "sql": null }, { "role": "assistant", "content": "SELECT T1.comment, T2.first_name, T2.last_name FROM hospitality_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 smart_money_token_inflow ( token_address text, token_symbol text, token_amount numer...
[ { "role": "user", "content": "List tokens with net outflow (type=2) on the 'Ethereum' chain. Show token_symbol and total usd_value sold.", "sql": null }, { "role": "assistant", "content": "SELECT token_symbol, SUM(usd_value) AS total_sold\nFROM smart_money_token_inflow\nWHERE type = 2 AND ch...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique id...
[ { "role": "user", "content": "List the names of all open cases, the name of the client for each case, and the name of the lead lawyer, but only for cases where the lead lawyer specializes in 'Family Law'.", "sql": null }, { "role": "assistant", "content": "SELECT T1.case_name , T2.first_nam...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.customers ( customer_id text, first_name text, last_name text, da...
[ { "role": "user", "content": "Show me the average high price and average low price for each security sector using market data.", "sql": null }, { "role": "assistant", "content": "SELECT T1.sector, AVG(T2.high_price) AS average_high_price, AVG(T2.low_price) AS average_low_price FROM financial...
You are an expert in writing database language. You can write a corresponding 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": "How many posts are currently marked as 'private' visibility?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.posts WHERE visibility = 'private'", "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.guests ( guest_id character varying(64) NOT NULL, first_name ...
[ { "role": "user", "content": "List all unique service categories and the count of services in each category.", "sql": null }, { "role": "assistant", "content": "SELECT category, COUNT(service_id) FROM hospitality_technology.services GROUP BY category;", "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 gaming_technology.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), -...
[ { "role": "user", "content": "I want to find regions where the average number of current_players across servers exceeds 200. Provide a SQL query that lists each region and its average current_players.", "sql": null }, { "role": "assistant", "content": "SELECT region, AVG(current_players) AS ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.fuel_logs ( fuel_log_id.text, vehicle_id.text, trip_id.text, log_time...
[ { "role": "user", "content": "Show me the number of fuel logs per location, including the location name and city.", "sql": null }, { "role": "assistant", "content": "SELECT fl.location_id, loc.name AS location_name, loc.city, COUNT(*) AS fuel_log_count\nFROM transportation.fuel_logs fl\nJOIN...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all insurance products that have not been updated in the past year. Include product_id, product_name, and updated_at, and order by updated_at ascending.", "sql": null }, { "role": "assistant", "content": "SELECT product_id, product_name, updated_at\nFROM 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 financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "Show all active customers who live in the same zip_code.", "sql": null }, { "role": "assistant", "content": "SELECT a.customer_id AS cust1,\n b.customer_id AS cust2,\n a.zip_code\nFROM financial_services.customers a\nJOIN financial_services.customers...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.addresses ( address_id.text, public_key.text, balance.numeric ) CREATE TA...
[ { "role": "user", "content": "Show me all wallet addresses along with their public keys and balances, but only for wallets that have a balance greater than 1000.", "sql": null }, { "role": "assistant", "content": "SELECT w.address_id, a.public_key, a.balance FROM blockchain.wallets w JOIN bl...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.employees ( employee_id character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "I need a list of departments and the number of current employees in each department.", "sql": null }, { "role": "assistant", "content": "SELECT department,\n COUNT(*) AS employee_count\nFROM government_services.employees\nWHERE termination_date IS NULL\nGR...
You are an expert in writing database language. You can write a corresponding 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": "For each transaction, show the transaction id and the total number of unique addresses involved in token transfers for that transaction (both as sender and receiver).", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, COUNT(DISTINCT addr)...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all agents who have sold policies with a coverage limit above 500000. Show agent_id, first_name, last_name, and the count of such policies as policy_count.", "sql": null }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name, a.last_name, COU...
You are an expert in writing database language. You can write a corresponding 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": "I want to know the number of agencies established each year by jurisdiction level.", "sql": null }, { "role": "assistant", "content": "SELECT jurisdiction_level, EXTRACT(YEAR FROM established_date) AS year, COUNT(*) AS agency_count\nFROM government_services.agen...
You are an expert in writing database language. You can write a corresponding 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": "List all premium payments along with the payment date, amount, and the status of the related policy.", "sql": null }, { "role": "assistant", "content": "SELECT pp.payment_id, pp.payment_date, pp.amount_paid, p.status AS policy_status\nFROM insurance.premium_paym...
You are an expert in writing database language. You can write a corresponding 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 citizen_id, first_name, last_name, and registration_date for all citizens who registered during March 2024.", "sql": null }, { "role": "assistant", "content": "SELECT citizen_id, first_name, last_name, registration_date\nFROM government_services.citizen...
You are an expert in writing database language. You can write a corresponding 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_rand...
[ { "role": "user", "content": "Can you show me the total number of each item acquired by every player, along with their player_id and item_id?", "sql": null }, { "role": "assistant", "content": "SELECT player_id, item_id, SUM(quantity) AS total_acquired FROM gaming_technology.player_inventory...
You are an expert in writing database language. You can write a corresponding 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": "Retrieve the first and last names of passengers along with the total sum of fares they've paid for bookings with status 'Completed', ordered by the sum descending.", "sql": null }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, SUM(b.fare) ...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "Show the number of securities per exchange and the average length of their ticker symbols, including only exchanges that have more than 5 securities.", "sql": null }, { "role": "assistant", "content": "SELECT exchange, COUNT(*) AS securities_count, AVG(LENGTH(ti...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, ...
[ { "role": "user", "content": "I want to see the total fare and number of bookings for each passenger.", "sql": null }, { "role": "assistant", "content": "SELECT b.passenger_id, COUNT(b.booking_id) AS booking_count, SUM(b.fare) AS total_fare\nFROM transportation.bookings b\nGROUP BY b.passeng...
You are an expert in writing database language. You can write a corresponding 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": "For each property, calculate the total outstanding balance from reservations where the amount paid is less than the total amount. Show the property name and the total outstanding balance.", "sql": null }, { "role": "assistant", "content": "SELECT T2.property_nam...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identif...
[ { "role": "user", "content": "List all active policies, including their policy number, start date, end date, premium amount, and the name of the insurance product.", "sql": null }, { "role": "assistant", "content": "SELECT T1.policy_number, T1.start_date, T1.end_date, T1.premium_amount, T2.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 healthcare.medical_records ( record_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "Show the record_id, patient_id, record_date and systolic blood pressure from vitals for all medical records where the systolic blood pressure is above 140.", "sql": null }, { "role": "assistant", "content": "SELECT record_id, patient_id, record_date, (vitals->>'...
You are an expert in writing database language. You can write a corresponding 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 the username and email of all users who own at least one wallet.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM blockchain.users AS T1 JOIN blockchain.wallets AS T2 ON T1.user_id = T2.user_id;", "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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeri...
[ { "role": "user", "content": "Show the top 5 narratives by 24h volume, displaying narrative and volume_24h.", "sql": null }, { "role": "assistant", "content": "SELECT narrative, volume_24h FROM narrative_info ORDER BY volume_24h DESC LIMIT 5;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "Get the total number of guests for each country_code.", "sql": null }, { "role": "assistant", "content": "SELECT country_code, COUNT(*) AS guest_count\nFROM hospitality_technology.guests\nGROUP BY country_code;", "sql": null }, { "role": "user", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id.text, property_id.text, room_number.text, roo...
[ { "role": "user", "content": "List all guests who have made reservations for rooms located on floor 1 along with the property name and the room number.", "sql": null }, { "role": "assistant", "content": "SELECT g.guest_id, g.first_name, g.last_name, r.property_id, ro.room_number\nFROM hospit...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "I need the total amount and count of payments for each policy.", "sql": null }, { "role": "assistant", "content": "SELECT policy_id,\n COUNT(*) AS payment_count,\n SUM(amount_paid) AS total_paid\nFROM insurance.premium_payments\nGROUP BY policy_id;",...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name...
[ { "role": "user", "content": "List the first and last names of employees and the number of services offered by their agency.", "sql": null }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, COUNT(s.service_id) AS service_count\nFROM government_services.employees e\nLEFT ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "List all staff members, including their first name, last name, position, and the name of the property they work at.", "sql": null }, { "role": "assistant", "content": "SELECT s.first_name, s.last_name, s.position, p.property_name FROM hospitality_technology.staf...
You are an expert in writing database language. You can write a corresponding 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, case_id.text, lawyer_id.text, date_work...
[ { "role": "user", "content": "How many billable hours has each lawyer logged in July 2024? Return the lawyer_id and the total billable hours, only including entries that have been billed, sorted by total hours descending.", "sql": null }, { "role": "assistant", "content": "SELECT lawyer_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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyi...
[ { "role": "user", "content": "Count the number of contracts for each network_id.", "sql": null }, { "role": "assistant", "content": "SELECT network_id, COUNT(*) FROM web3.contracts GROUP BY network_id;", "sql": null }, { "role": "user", "content": "Now, only show networks wit...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id text PRIMARY KEY, creator_address text, cod...
[ { "role": "user", "content": "Show me the earliest created smart contract for each creator address.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT ON (creator_address) contract_id, creator_address, code, timestamp FROM blockchain.smart_contracts ORDER BY creator_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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_i...
[ { "role": "user", "content": "Show the full names and contact emails of all citizens who have applied for services with a standard fee greater than 100.", "sql": null }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS full_name, c.contact_email\nFROM governmen...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.premium_payments ( payment_id character varying(64) NOT NULL, policy_id ch...
[ { "role": "user", "content": "Show me all premium payments made via credit card in the last 30 days, along with their policy IDs and payment amounts, sorted by payment date in descending order.", "sql": null }, { "role": "assistant", "content": "SELECT policy_id, amount_paid, payment_date FR...
You are an expert in writing database language. You can write a corresponding 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": "Show me the insurance provider, plan name, and count of insurance plans that have a '.org' website. Group by insurance provider and plan name.", "sql": null }, { "role": "assistant", "content": "SELECT insurance_provider, plan_name, COUNT(*) AS plan_count\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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name charac...
[ { "role": "user", "content": "Get me a list of upcoming appointments with appointment_id, client full name, case number, and start_time for appointments with status 'scheduled'.", "sql": null }, { "role": "assistant", "content": "SELECT a.appointment_id,\n CONCAT(cl.first_name, ' ', cl...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id.uuid, title.text, developer_id.uuid, publisher_id....
[ { "role": "user", "content": "I need a count of games per platform and the earliest release date on each platform.", "sql": null }, { "role": "assistant", "content": "SELECT platform, COUNT(*) AS game_count, MIN(release_date) AS first_release\nFROM gaming_technology.games\nGROUP BY platform;...
You are an expert in writing database language. You can write 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": "Can you show me the total number of passengers registered in the database?", "sql": null }, { "role": "assistant", "content": "db.passengers.countDocuments({})", "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 Use Hashes. Key pattern: 'inv:<inventory_record_id>'. Example: HSET inv:INVREC500 component_id "c...
[ { "role": "user", "content": "Can you help me retrieve the inventory details for a specific component ID, including the quantity and warehouse location?", "sql": null }, { "role": "assistant", "content": "HGETALL inv:<inventory_record_id>", "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 web3.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created...
[ { "role": "user", "content": "List all pairs of wallet addresses that were created by the same user but on different dates. Show both wallet IDs, their addresses, the user ID, and their creation dates.", "sql": null }, { "role": "assistant", "content": "SELECT w1.wallet_id AS wallet_id_1, w1...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.trips ( trip_id character varying(64) NOT NULL, -- unique identi...
[ { "role": "user", "content": "Show me the trip details including actual and scheduled times, and the difference between them for all trips associated with a specific driver, say driver_id 'DRV789'.", "sql": null }, { "role": "assistant", "content": "SELECT\n trip_id,\n vehicle_id,\n sched...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.comments ( comment_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "List all conversation IDs with the total number of messages sent in each conversation.", "sql": null }, { "role": "assistant", "content": "SELECT conversation_id, COUNT(*) AS message_count\nFROM social_media.messages\nGROUP BY conversation_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.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List all payments processed in the last 90 days, showing payment ID, amount, currency, method, and status.", "sql": null }, { "role": "assistant", "content": "SELECT payment_id, amount, currency_code, payment_method, status FROM hospitality_technology.payments 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 social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp,...
[ { "role": "user", "content": "List the names of group conversations and the usernames of participants who joined after '2023-01-01'.", "sql": null }, { "role": "assistant", "content": "SELECT T1.group_name, T3.username FROM social_media.conversations AS T1 JOIN social_media.participants AS 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 transportation.drivers ( driver_id text, employee_id text, first_name text, last_nam...
[ { "role": "user", "content": "I need a report showing the count of drivers per status.", "sql": null }, { "role": "assistant", "content": "SELECT status, COUNT(*) AS driver_count\nFROM transportation.drivers\nGROUP BY status;", "sql": null }, { "role": "user", "content": "Act...
You are an expert in writing database language. You can write a corresponding 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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character...
[ { "role": "user", "content": "Find all active policies with a coverage limit of at least 1,000,000. List the policy_id, policy_number, and coverage_limit.", "sql": null }, { "role": "assistant", "content": "SELECT policy_id, policy_number, coverage_limit\nFROM insurance.policies\nWHERE statu...
You are an expert in writing database language. You can write a corresponding 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": "For each trip, show the trip_id, vehicle's license plate, total fuel quantity, and number of fueling events.", "sql": null }, { "role": "assistant", "content": "SELECT t.trip_id, v.license_plate, SUM(f.quantity) AS total_fuel, COUNT(f.fuel_log_id) AS fueling_eve...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.customers ( customer_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Give a list of all policies where the deductible is less than 1000. Show policy_id, policy_number, start_date, and deductible.", "sql": null }, { "role": "assistant", "content": "SELECT policy_id, policy_number, start_date, deductible\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 erc1155_approval_for_all ( block_number bigint NOT NULL, block_timestamp timestamp(3...
[ { "role": "user", "content": "For wallet address '0xWalletA', list the ERC20 tokens held, showing contract address and amount.", "sql": null }, { "role": "assistant", "content": "SELECT contract_address, amount FROM erc20_balances WHERE wallet_address = '0xWalletA';", "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 character varying(64) NOT NULL, first_name characte...
[ { "role": "user", "content": "List all appointments that are currently scheduled and show their appointment time.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, doctor_id, appointment_time FROM healthcare.appointments WHERE status = 'Scheduled';", ...
You are an expert in writing database language. You can write a corresponding 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": "What is the minimum, maximum, and average commission rate among all agents?", "sql": null }, { "role": "assistant", "content": "SELECT MIN(commission_rate) AS min_commission_rate, MAX(commission_rate) AS max_commission_rate, AVG(commission_rate) AS average_commi...
You are an expert in writing database language. You can write a corresponding 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": "Show me the first name, last name, and license number for all doctors whose specialty is 'Pediatrics'.", "sql": null }, { "role": "assistant", "content": "SELECT first_name, last_name, license_number FROM healthcare.doctors WHERE specialty = 'Pediatrics';", ...
You are an expert in writing database language. You can write a corresponding 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": "For each doctor, show their full name along with all plan names of insurance plans that have a 'contact_phone' beginning with '+44'.", "sql": null }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, ip.plan_name\nFROM healthcare.doctors d\nCR...
You are an expert in writing database language. You can write a corresponding 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": "For each city that has a fueling location, show the city name and the total quantity of fuel refueled.", "sql": null }, { "role": "assistant", "content": "SELECT T2.city , SUM(T1.quantity) FROM transportation.fuel_logs AS T1 JOIN transportation.locations AS 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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, inci...
[ { "role": "user", "content": "Find claims where the estimated loss is greater than the average estimated loss for claims with a status of 'Closed'. Show the claim ID, incident date, estimated loss, and status.", "sql": null }, { "role": "assistant", "content": "SELECT claim_id, incident_date...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_u...
[ { "role": "user", "content": "For each player, show the total quantity of all items they have ever acquired and their earliest acquisition date.", "sql": null }, { "role": "assistant", "content": "SELECT player_id, SUM(quantity) AS total_quantity, MIN(acquired_at) AS earliest_acquisition FRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_na...
[ { "role": "user", "content": "Show me all time entries where the hours spent is greater than 5.", "sql": null }, { "role": "assistant", "content": "SELECT entry_id, date_worked, hours_spent, description FROM legal_services.time_entries WHERE hours_spent > 5;", "sql": null } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id t...
[ { "role": "user", "content": "Show me all primary insurance policies along with their policy numbers and effective dates for patient with ID 'patient_555'.", "sql": null }, { "role": "assistant", "content": "SELECT patient_insurance_id, policy_number, effective_date FROM healthcare.patient_i...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.maintenance_logs ( log_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "Show me all maintenance logs for 'Engine Repair' service type where the cost is greater than 400, including the vehicle ID, service date, cost, and mechanic name.", "sql": null }, { "role": "assistant", "content": "SELECT vehicle_id, service_date, cost, mechanic...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.employees ( employee_id text, agency_id text, first_name text, l...
[ { "role": "user", "content": "Can you show the number of employees working for each agency and the number of service locations each agency has?", "sql": null }, { "role": "assistant", "content": "SELECT e.agency_id, COUNT(DISTINCT e.employee_id) AS employee_count, COUNT(DISTINCT sl.location_...
You are an expert in writing database language. You can write a corresponding 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": "Calculate the total billable hours spent by each lawyer for entries in March 2024.", "sql": null }, { "role": "assistant", "content": "SELECT lawyer_id,\n SUM(hours_spent) AS total_hours\nFROM legal_services.time_entries\nWHERE is_billable = TRUE\n AND da...
You are an expert in writing database language. You can write a corresponding 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": "List the names and symbols of all assets that have at least one associated metadata entry in the metadata table.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.name, T1.symbol FROM trading_platform.assets AS T1 JOIN trading_platform.metad...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.bookings ( booking_id character varying(64) NOT NULL, -- unique ...
[ { "role": "user", "content": "Show me the total number of bookings and total fare collected per trip. Only include trips that have collected more than 500 in total fare.", "sql": null }, { "role": "assistant", "content": "SELECT trip_id, COUNT(*) AS booking_count, SUM(fare) AS total_fare\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 healthcare.prescriptions ( prescription_id text PRIMARY KEY, record_id text, patient...
[ { "role": "user", "content": "Show me all prescriptions, including the prescription ID, medication ID, prescription date, and the prescribing doctor's ID, for patients who have received more than 2 prescriptions.", "sql": null }, { "role": "assistant", "content": "SELECT prescription_id, med...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id text, username text, email text, password_hash text, fu...
[ { "role": "user", "content": "List all comments on a given post along with the commenter’s username and the comment time.", "sql": null }, { "role": "assistant", "content": "SELECT c.comment_id, c.content, u.username, c.created_at\nFROM social_media.comments c\nJOIN social_media.users u ON c...