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.players ( player_id.uuid, username.text, email.text, password_hash...
[ { "role": "user", "content": "Could you list each game title along with the total number of players currently connected across all its servers?", "sql": null }, { "role": "assistant", "content": "SELECT g.title, SUM(s.current_players) AS total_current_players FROM gaming_technology.games g J...
You are an expert in writing database language and you can refuse the user's question if the question is not related to the table structure. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREA...
[ { "role": "user", "content": "What is the maintenance schedule for the train car with car_id 'CAR456'?", "sql": null }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about the maintenance schedule for train cars as it is not included in the data available in t...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id text PRIMARY KEY, first_name text, last_name text, ...
[ { "role": "user", "content": "How many patients are there in each gender category?", "sql": null }, { "role": "assistant", "content": "SELECT gender,\n COUNT(*) AS patient_count\nFROM healthcare.patients\nGROUP BY gender;", "sql": null }, { "role": "user", "content": "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 gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un...
[ { "role": "user", "content": "How many games are available on each platform?", "sql": null }, { "role": "assistant", "content": "SELECT platform,\n COUNT(*) AS game_count\nFROM gaming_technology.games\nGROUP BY platform;", "sql": null }, { "role": "user", "content": "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 web3.transactions ( transaction_id text PRIMARY KEY, from_address text, to_address t...
[ { "role": "user", "content": "Show all transactions where the transaction value is greater than the average value of all transactions, including transaction_id, from_address, to_address, value, and timestamp.", "sql": null }, { "role": "assistant", "content": "SELECT transaction_id, from_add...
You are an expert in writing database language. You can write a corresponding 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": "For each citizen who has made at least one payment, list their full name and the total amount they've paid in each currency.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.currency, SUM(T2.amount) FROM government_servi...
You are an expert in writing database language. You can write a corresponding 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": "Show me the post ID, content, and creation time for all posts made by user 'user789'.", "sql": null }, { "role": "assistant", "content": "SELECT post_id, content, created_at FROM social_media.posts WHERE user_id = 'user789';", "sql": null }, { "role"...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.prescriptions ( prescription_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Which doctors have issued prescriptions with a route of 'Oral'? Please show doctor_id and the number of such prescriptions they have written.", "sql": null }, { "role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS oral_prescription_count\nFROM healthca...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name te...
[ { "role": "user", "content": "Show me the total quantity of fuel consumed and the total cost for each vehicle that has fuel log entries, including the vehicle's make and model.", "sql": null }, { "role": "assistant", "content": "SELECT T1.vehicle_id, T2.make, T2.model, SUM(T1.quantity) AS to...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List the first name and last name of citizens who have scheduled appointments, along with the scheduled start time and purpose of their appointments.", "sql": null }, { "role": "assistant", "content": "SELECT T1.first_name, T1.last_name, T2.scheduled_start_time,...
You are an expert in writing database language. You can write a corresponding 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 the usernames and email addresses of users who have participated in any conversation.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT T1.username, T1.email FROM social_media.users AS T1 JOIN social_media.conversation_participants AS T2 O...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.loans ( loan_id text, account_id text, loan_type text, principal_...
[ { "role": "user", "content": "For each loan type, show the total outstanding principal balance and the number of active loans.", "sql": null }, { "role": "assistant", "content": "SELECT loan_type, SUM(current_principal_balance) AS total_outstanding_balance, COUNT(*) AS active_loan_count 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 hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text...
[ { "role": "user", "content": "List each property_name along with the count of rooms that are currently marked as 'Available'.", "sql": null }, { "role": "assistant", "content": "SELECT p.property_name, COUNT(r.room_id) AS available_room_count\nFROM hospitality_technology.properties p\nLEFT J...
You are an expert in writing database language. You can write a corresponding 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 the earliest unlock date for each achievement along with the player_id who unlocked it.", "sql": null }, { "role": "assistant", "content": "SELECT achievement_id, player_id, MIN(unlocked_at) AS earliest_unlock FROM gaming_technology.player_achievements G...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.payments ( payment_id character varying(64) NOT NULL, applicatio...
[ { "role": "user", "content": "Can you show the total amount paid and number of payments per citizen in 2024?", "sql": null }, { "role": "assistant", "content": "SELECT citizen_id, SUM(amount) AS total_paid, COUNT(*) AS payment_count FROM government_services.payments WHERE payment_timestamp >...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.medical_records ( record_id text, patient_id text, appointment_id text, d...
[ { "role": "user", "content": "List all medical records created by doctor 'doctor_001' for patients who had their last medical record on or after '2024-01-01', including record_id, patient_id, record_date, chief_complaint, and doctor_id.", "sql": null }, { "role": "assistant", "content": "SEL...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.users ( user_id character varying(64) NOT NULL, username character ...
[ { "role": "user", "content": "Show assets of type 'token', including their name, symbol, and any associated metadata key and value.", "sql": null }, { "role": "assistant", "content": "SELECT t1.name, t1.symbol, t2.key, t2.value FROM trading_platform.assets AS t1 LEFT JOIN trading_platform.me...
You are an expert in writing database language. You can write a corresponding 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": "Give me the count of clients who registered in each month of 2023.", "sql": null }, { "role": "assistant", "content": "SELECT TO_CHAR(date_registered, 'YYYY-MM') AS reg_month, COUNT(*) AS client_count FROM legal_services.clients WHERE date_registered BETWEEN '20...
You are an expert in writing database language. You can write a corresponding 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": "For each user, calculate the total value of 'buy' and 'sell' orders (quantity * price).", "sql": null }, { "role": "assistant", "content": "SELECT b.user_id,\n b.total_buy_value,\n s.total_sell_value\nFROM (\n SELECT user_id,\n SUM(quantity ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash text,...
[ { "role": "user", "content": "List all SUI coins with 'active' status and their object_id, owner address, coin_type, and balance.", "sql": null }, { "role": "assistant", "content": "SELECT object_id, owner, coin_type, balance FROM sui_coins WHERE status = 'active';", "sql": null }, {...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate c...
[ { "role": "user", "content": "For each passenger, compute the count of bookings and average fare for bookings made in February 2024.", "sql": null }, { "role": "assistant", "content": "SELECT p.passenger_id, COUNT(b.booking_id) AS booking_count, AVG(b.fare) AS avg_fare\nFROM transportation.p...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List pairs of citizens who share the same gender but registered in different years. Show each citizen’s full name and their registration year.", "sql": null }, { "role": "assistant", "content": "SELECT c1.first_name || ' ' || c1.last_name AS name1,\n c2.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 trading_platform.orders ( order_id text PRIMARY KEY, user_id text, wallet_id text, a...
[ { "role": "user", "content": "Show a list of all DApps together with the total number of unique assets linked to each via the metadata table.", "sql": null }, { "role": "assistant", "content": "SELECT d.dapp_id, d.name, d.url, COUNT(DISTINCT m.asset_id) AS unique_asset_count\nFROM trading_pl...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Show me all appointments scheduled to last exactly 60 minutes.", "sql": null }, { "role": "assistant", "content": "SELECT appointment_id, patient_id, doctor_id, appointment_time, duration_minutes, status\nFROM healthcare.appointments\nWHERE duration_minutes = 60...
You are an expert in writing database language. You can write a corresponding 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": "List all players from 'Germany' whose status is currently 'online', and show their username and registration date.", "sql": null }, { "role": "assistant", "content": "SELECT username, registration_date FROM gaming_technology.players WHERE country_code = 'DE' AND...
You are an expert in writing database language. You can write a corresponding 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": "How many unique conversations have messages?", "sql": null }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT conversation_id) FROM social_media.messages;", "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 text PRIMARY KEY, first_name text, last_name text...
[ { "role": "user", "content": "List clients who have appointments with lawyers from law firms founded before the year 2010. Show the client's first name, last name, the appointment subject, the lawyer's first name, last name, and the firm name.", "sql": null }, { "role": "assistant", "content...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 3 months, along with their narrative information if available.", "sql": null }, { "role": "assistant", "content": "SELECT pfr.project_name, pfr.valuation, pfr.rounds_name, pfr....
You are an expert in writing database language. You can write a corresponding 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 service orders delivered in the last 30 days, show each guest's ID, first and last name, the count of service orders, and total spent.", "sql": null }, { "role": "assistant", "content": "SELECT so.guest_id,\n g.first_name,\n g.last_name,\n ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case...
[ { "role": "user", "content": "For each case, show the total amount of all invoices and the number of scheduled appointments. Only include cases that have both an invoice and at least one appointment.", "sql": null }, { "role": "assistant", "content": "SELECT i.case_id, SUM(i.total_amount) AS...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text, customer_id text, account_number text...
[ { "role": "user", "content": "What is the total balance and the number of accounts for each currency, including only accounts opened in the last 2 years?", "sql": null }, { "role": "assistant", "content": "SELECT currency , SUM(balance) AS total_balance , COUNT(*) AS account_count FROM fin...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "List the names of service locations and the names of the agencies they belong to, specifically for locations situated in the state of 'Texas' that are marked as accessible.", "sql": null }, { "role": "assistant", "content": "SELECT t1.location_name, t2.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 insurance.claim_documents ( document_id.text, claim_id.text, document_type.text, fil...
[ { "role": "user", "content": "What are the distinct MIME types of documents stored in the system?", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT mime_type FROM insurance.claim_documents;", "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.servers ( server_id.uuid, game_id.uuid, server_name.text, region.t...
[ { "role": "user", "content": "List every offline server alongside an online server in the same region. Show offline_server and online_server names.", "sql": null }, { "role": "assistant", "content": "SELECT o.server_name AS online_server, f.server_name AS offline_server\nFROM gaming_technolo...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.rooms ( room_id text, property_id text, room_number text, roo...
[ { "role": "user", "content": "List guests who have written reviews, showing their full name and the review comment.", "sql": null }, { "role": "assistant", "content": "SELECT g.first_name || ' ' || g.last_name AS guest_full_name, r.comment FROM hospitality_technology.guests AS g JOIN hospita...
You are an expert in writing database language. You can write a corresponding 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": "Provide a summary for each user, showing their user_id, username, and the total number of orders they have placed overall.", "sql": null }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(o.order_id) AS total_orders\nFROM trading_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 CREATE TABLE financial_services.customers ( customer_id text PRIMARY KEY, first_name text, last_n...
[ { "role": "user", "content": "I want to see for each account the total outgoing and incoming transaction amounts in the past 30 days.", "sql": null }, { "role": "assistant", "content": "SELECT t.account_id,\n SUM(CASE WHEN t.transaction_type = 'DEBIT' THEN t.amount ELSE 0 END) AS total...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text, property_name text, address_li...
[ { "role": "user", "content": "Show me the property ID, name, and creation date for all properties created after January 1, 2022.", "sql": null }, { "role": "assistant", "content": "SELECT property_id, property_name, created_at FROM hospitality_technology.properties WHERE created_at >= '2022-...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, prop...
[ { "role": "user", "content": "Retrieve the property_id, property_name, city, and star_rating for properties in the USA, sorted by star_rating descending.", "sql": null }, { "role": "assistant", "content": "SELECT property_id,\n property_name,\n city,\n star_rating\nFROM hos...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE gaming_technology.games ( game_id uuid NOT NULL DEFAULT gen_random_uuid(), -- un...
[ { "role": "user", "content": "List all games and the servers hosting them, showing the game title, server name, region, and status.", "sql": null }, { "role": "assistant", "content": "SELECT g.title, s.server_name, s.region, s.status FROM gaming_technology.games g JOIN gaming_technology.serv...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text,...
[ { "role": "user", "content": "Show the full names and contact emails of all citizens who have made a payment for an application that is currently in 'Pending' status.", "sql": null }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contac...