Dataset Viewer
Auto-converted to Parquet Duplicate
system
stringlengths
2.68k
8.8k
conversations
listlengths
4
34
You are an expert in writing database language. You can write a corresponding 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_n...
[ { "role": "user", "content": "How many notifications related to services were sent for each service category in the past 7 days?" }, { "role": "assistant", "content": "SELECT\n s.category,\n COUNT(n.notification_id) AS notification_count\nFROM\n government_services.notifications n\n JOIN 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 hospitality_technology.service_orders ( order_id text PRIMARY KEY, reservation_id tex...
[ { "role": "user", "content": "Get the total_quantity and total_revenue (sum of total_price) for each staff member who placed orders (staff_id_ordered)." }, { "role": "assistant", "content": "SELECT staff_id_ordered,\n SUM(quantity) AS total_quantity,\n SUM(total_price) AS total_reven...
You are an expert in writing database language. You can write a corresponding 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 te...
[ { "role": "user", "content": "Show me all available services with a unit of 'Per Hour'." }, { "role": "assistant", "content": "SELECT service_name , description , price FROM hospitality_technology.services WHERE is_available = true AND unit = 'Per Hour'" }, { "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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name...
[ { "role": "user", "content": "How many drivers and passengers have email addresses ending with 'company.com'? Return the count for each group." }, { "role": "assistant", "content": "SELECT 'drivers' AS role, COUNT(*) AS count\nFROM transportation.drivers\nWHERE email LIKE '%@company.com'\nUNION ...
You are an expert in writing database language. You can write a corresponding 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, room...
[ { "role": "user", "content": "Calculate the total price for all service orders, grouped by their status." }, { "role": "assistant", "content": "SELECT status, SUM(total_price) AS total_revenue FROM hospitality_technology.service_orders GROUP BY status;" }, { "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.token_transfers ( transfer_id text PRIMARY KEY, token_id text, from_address text...
[ { "role": "user", "content": "List all pairs of token transfers occurring within the same transaction where one transferred value is greater than the other, showing both transfer IDs, the transaction ID, and both values." }, { "role": "assistant", "content": "SELECT t1.transaction_id,\n t1...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyin...
[ { "role": "user", "content": "List the usernames and registration dates for users who registered before the earliest deployed contract." }, { "role": "assistant", "content": "SELECT T1.username, T1.created_at FROM web3.users AS T1 JOIN (SELECT MIN(deployed_at) AS earliest_deploy FROM web3.contra...
You are an expert in writing database language. You can write a corresponding 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 NOT NULL DEFAU...
[ { "role": "user", "content": "Calculate for each player the timespan between their earliest and latest achievement unlocks." }, { "role": "assistant", "content": "SELECT pa_min.player_id,\n pa_max.max_time - pa_min.min_time AS span\nFROM (\n SELECT player_id,\n MIN(unlocked_at) AS...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.applications ( application_id text, citizen_id text, service_id t...
[ { "role": "user", "content": "For each citizen, show their citizen ID and the total number of applications and notifications they have." }, { "role": "assistant", "content": "SELECT c.citizen_id,\n COALESCE(a.application_count, 0) AS application_count,\n COALESCE(n.notification_count...
You are an expert in writing database language. You can write a corresponding 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 text, vehicle_id text, service_date date, od...
[ { "role": "user", "content": "Can you provide the mechanic name, service date, and service type for each maintenance log, along with the vehicle's odometer reading for all logs with a cost greater than 1000?" }, { "role": "assistant", "content": "SELECT mechanic_name, service_date, service_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 social_media.comments ( comment_id text PRIMARY KEY, post_id text, user_id text, pare...
[ { "role": "user", "content": "Which users have commented on posts created by the users they follow? Please show the commenter user_ids and the followed user_ids." }, { "role": "assistant", "content": "SELECT DISTINCT c.user_id AS commenter_user_id, f.following_user_id AS followed_user_id FROM so...
You are an expert in writing database language. You can write 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: 'component:<component_id>'. Example: HSET component:LGSTRUT01 part_number...
[ { "role": "user", "content": "Can you help me get a list of components and their associated materials, including the supplier information for each component?" }, { "role": "assistant", "content": "SMEMBERS material_components:<material_id>\nHGETALL component:<component_id>\nHGET component:<compo...
You are an expert in writing database language. You can write a corresponding 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_id...
[ { "role": "user", "content": "Which cities are listed as primary_address for citizens who have a verified account? Can you show the city names and the number of verified citizens in each city?" }, { "role": "assistant", "content": "SELECT SPLIT_PART(primary_address, ',', 1) AS city, COUNT(*) 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 NOT NULL DEFAULT gen_random_uuid...
[ { "role": "user", "content": "Show for each developer and inventory item combination the number of times that item appears in player inventories." }, { "role": "assistant", "content": "SELECT d.developer_id, d.name AS developer_name, pi.item_id, COUNT(pi.inventory_id) AS inventory_count FROM gam...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id text PRIMARY KEY, product_name text, produc...
[ { "role": "user", "content": "List all insurance products along with their product types and the date they were last updated, but only include products where the base premium is greater than 2000." }, { "role": "assistant", "content": "SELECT product_id, product_name, product_type, updated_at\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 social_media.messages ( message_id text PRIMARY KEY, conversation_id text, sender_use...
[ { "role": "user", "content": "Show all messages that include a media attachment, along with the sender's user ID and the conversation ID." }, { "role": "assistant", "content": "SELECT message_id, sender_user_id, conversation_id, media_url, media_type, sent_at FROM social_media.messages WHERE 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 legal_services.documents ( document_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "Show me document names and upload timestamps for documents linked to cases that were opened after January 1, 2023." }, { "role": "assistant", "content": "SELECT T1.document_name, T1.upload_timestamp FROM documents AS T1 JOIN cases AS T2 ON T1.case_id = T2.case_id WH...
You are an expert in writing database language. You can write a corresponding 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.likes ( like_id character varying(64) NOT NULL, -- unique identifier...
[ { "role": "user", "content": "Count the total number of likes on posts versus likes on comments across the entire platform." }, { "role": "assistant", "content": "SELECT CASE WHEN post_id IS NOT NULL THEN 'post' ELSE 'comment' END AS like_target, COUNT(*) AS total_likes FROM social_media.likes 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 legal_services.cases ( case_id character varying(64) NOT NULL, -- unique identif...
[ { "role": "user", "content": "List all documents which have a version greater than 2, along with the case number and name." }, { "role": "assistant", "content": "SELECT d.document_id, d.document_name, d.version, c.case_number, c.case_name\nFROM legal_services.documents d\nJOIN legal_services.cas...
You are an expert in writing database language. You can write a corresponding 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, m...
[ { "role": "user", "content": "For each route type, count the distinct vehicles that have completed trips on those routes. Return type and vehicle_count, sorted by vehicle_count descending." }, { "role": "assistant", "content": "SELECT r.type,\n COUNT(DISTINCT t.vehicle_id) AS vehicle_count...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_lo...
[ { "role": "user", "content": "List every booking together with the route number and description for the trip being booked." }, { "role": "assistant", "content": "SELECT b.booking_id, b.passenger_id, b.trip_id, r.route_number, r.description\nFROM transportation.bookings b\nJOIN transportation.rou...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
4