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...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.hashtags ( hashtag_id.text, tag_name.text, created_at.timestamp ) CREATE...
[ { "role": "user", "content": "How many notifications are there for each distinct notification type?" }, { "role": "assistant", "content": "SELECT notification_type, COUNT(*) FROM social_media.notifications GROUP BY notification_type;" }, { "role": "user", "content": "What is the aver...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, game_id uuid, server_name tex...
[ { "role": "user", "content": "I need to find every offline server alongside an online server in the same region." }, { "role": "assistant", "content": "SELECT s_off.server_id AS offline_id,\n s_on.server_id AS online_id\nFROM gaming_technology.servers s_off\nJOIN gaming_technology.servers ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE smart_money_token_inflow ( token_address text, token_symbol text, token_amount numeri...
[ { "role": "user", "content": "Which chain has the highest total USD inflow from buy transactions (type=1), and how many distinct tokens were involved in that inflow?" }, { "role": "assistant", "content": "SELECT chain, SUM(usd_value) AS total_inflow, COUNT(DISTINCT token_symbol) AS distinct_toke...
You are an expert in writing database language. You can write a corresponding 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": "For each employee who acts as a manager, please show the number of employees directly reporting to them." }, { "role": "assistant", "content": "SELECT m.first_name || ' ' || m.last_name AS manager_name, COUNT(e.employee_id) AS direct_report_count FROM financial_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, ...
[ { "role": "user", "content": "Show the full name and email of each driver and the number of vehicles currently assigned to their depot." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, d.email, COUNT(v.vehicle_id) AS vehicles_at_depot\nFROM transportation.drivers d\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 government_services.agencies ( agency_id.text, agency_name.text, jurisdiction_level.t...
[ { "role": "user", "content": "I would like to see a list of agencies and the names of their respective parent agencies." }, { "role": "assistant", "content": "SELECT a.agency_id, a.agency_name, p.agency_name AS parent_agency_name\nFROM government_services.agencies a\nLEFT JOIN government_service...
You are an expert in writing database language. You can write a corresponding 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": "Show me all contracts deployed on the 'ethereum' network along with their deployer addresses and the count of transactions they've been involved in, sorted by transaction count in descending order." }, { "role": "assistant", "content": "SELECT c.contract_id, c.addre...
You are an expert in writing database language. You can write a corresponding 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, -- unique...
[ { "role": "user", "content": "How many premium payments are currently in 'Pending' status?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM insurance.premium_payments WHERE status = 'Pending';" }, { "role": "user", "content": "How many notifications have been sent by each ...
You are an expert in writing database language. You can write a corresponding 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": "Which vehicles have had fueling events at locations of type 'Station'? For each vehicle, list the vehicle_id, license_plate, and the name and city of the fueling station." }, { "role": "assistant", "content": "SELECT DISTINCT v.vehicle_id, v.license_plate, l.name AS...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.insurance_products ( product_id.text, product_name.text, product_type.text,...
[ { "role": "user", "content": "List all active products with a base premium exceeding 1500 that were created after January 1, 2023, including their product name, type, and base premium. Order the results by creation date ascending." }, { "role": "assistant", "content": "SELECT product_name, produ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_lo...
[ { "role": "user", "content": "List all completed trips, showing the trip ID, the names of the origin and destination locations for the trip, and the actual arrival time." }, { "role": "assistant", "content": "SELECT t.trip_id, loc_origin.name AS origin_location_name, loc_dest.name AS destination...
You are an expert in writing database language. You can write a corresponding 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, a...
[ { "role": "user", "content": "List each player's most recent achievement unlock, showing the player_id, achievement_id, and unlocked_at timestamp." }, { "role": "assistant", "content": "SELECT pa.player_id, pa.achievement_id, pa.unlocked_at FROM gaming_technology.player_achievements pa INNER JOI...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.lawyers ( lawyer_id text PRIMARY KEY, first_name text, last_name text,...
[ { "role": "user", "content": "Show me the full name of every lawyer, their specialization, and the number of cases they are the lead lawyer for." }, { "role": "assistant", "content": "SELECT CONCAT(l.first_name, ' ', l.last_name) AS lawyer_name, l.specialization, COUNT(c.case_id) AS lead_case_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 government_services.services ( service_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "List the service name, category, and standard fee for all services offered by agencies that have at least one accessible service location in the state of 'California'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.service_name, T1.category, T1.standard_f...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.appointments ( appointment_id text PRIMARY KEY, patient_id text, doctor_id...
[ { "role": "user", "content": "For each patient, find the next appointment after each one. Return patient_id, appointment_id, next_appointment_id, and the waiting time in minutes between them." }, { "role": "assistant", "content": "SELECT A.patient_id,\n A.appointment_id AS current_id,\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.wallets ( wallet_id text, user_id text, address text, private_key te...
[ { "role": "user", "content": "List peer IDs and IP addresses for all peers whose IP address starts with '10.'." }, { "role": "assistant", "content": "SELECT peer_id, ip_address FROM trading_platform.peers WHERE ip_address LIKE '10.%';" }, { "role": "user", "content": "List the first ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.routes ( route_id text PRIMARY KEY, route_number text, description tex...
[ { "role": "user", "content": "For each city, show how many trips have started there (origin), how many have ended there (destination), and the total number of unique vehicles used in trips that started in that city." }, { "role": "assistant", "content": "SELECT l.city,\n COUNT(CASE WHEN 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 legal_services.clients ( client_id text, first_name text, last_name text, company_nam...
[ { "role": "user", "content": "List all appointments along with their subject and start time for lawyers specializing in 'Criminal Law'." }, { "role": "assistant", "content": "SELECT T1.subject, T1.start_time FROM legal_services.appointments AS T1 JOIN legal_services.lawyers AS T2 ON T1.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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birt...
[ { "role": "user", "content": "What is the average commission rate for agents whose status is 'Terminated'?" }, { "role": "assistant", "content": "SELECT AVG(commission_rate) FROM insurance.agents WHERE status = 'Terminated' AND commission_rate IS NOT NULL;" }, { "role": "user", "cont...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.tokens ( token_id character varying(64) NOT NULL, -- unique identifier for ...
[ { "role": "user", "content": "For each token, show its token_id, decimals, and the average total_supply of all tokens with the same decimals." }, { "role": "assistant", "content": "SELECT t.token_id,\n t.decimals,\n avg_data.avg_total_supply\nFROM web3.tokens t\nJOIN (\n SELECT deci...
You are an expert in writing database language. You can write a corresponding 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(), userna...
[ { "role": "user", "content": "Please list the top 5 players by number of achievements unlocked since 2023-01-01. Show each player's username and the total count of achievements they unlocked." }, { "role": "assistant", "content": "SELECT p.username, COUNT(*) AS unlock_count\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 Index 'suppliers'. Mapping: { properties: { supplier_id: { type: 'keyword' }, supplier_name: { typ...
[ { "role": "user", "content": "특정 공급업체 ID로 공급업체의 세부 정보를 조회하고 싶습니다. 모든 필드를 포함해 주세요." }, { "role": "assistant", "content": "GET suppliers/_doc/{supplier_id}" }, { "role": "user", "content": "만약 여러 공급업체 ID를 한 번에 조회하고 싶다면 어떻게 해야 하나요?" }, { "role": "assistant", "content": "GET ...
You are an expert in writing database language. You can write a corresponding 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 i...
[ { "role": "user", "content": "For each route, show its route number, distance in kilometers, and the total number of trips that have used that route." }, { "role": "assistant", "content": "SELECT r.route_number, r.distance_km, COUNT(t.trip_id) AS trip_count\nFROM transportation.routes r\nLEFT JO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_id...
[ { "role": "user", "content": "What is the total revenue (sum of total_amount) and total amount_paid for each booking_source?" }, { "role": "assistant", "content": "SELECT booking_source,\n SUM(total_amount) AS total_revenue,\n SUM(amount_paid) AS total_paid\nFROM reservations\nGROUP ...
You are an expert in writing database language. You can write a corresponding 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(6) NOT NULL, block_number bigint NOT NULL, t...
[ { "role": "user", "content": "List all wallet addresses holding NFTs for contract address '0xabcdef...'. Show the wallet address and amount held." }, { "role": "assistant", "content": "SELECT wallet_address, amount, token_id FROM nft_holders WHERE contract_address = '0xabcdef...';" }, { ...
You are an expert in writing database language. You can write a corresponding 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, addres...
[ { "role": "user", "content": "Find all cities that contain at least one location of type 'Depot' and at least one location of type 'Station'." }, { "role": "assistant", "content": "SELECT city FROM transportation.locations WHERE type IN ('Depot', 'Station') GROUP BY city HAVING COUNT(DISTINCT CA...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "For each document type, how many documents were uploaded by each user? Show the uploaded_by, document_type, and document count, ordered by document_type and count descending." }, { "role": "assistant", "content": "SELECT uploaded_by, document_type, COUNT(*) AS docum...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. You are an expert in writing database language and you can refuse the user's question if the question is not related...
[ { "role": "user", "content": "What are the environmental impact assessments for the production of the Airbus A350 model?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to data regarding the environmental impact assessments for the production of specific aircraft models...
You are an expert in writing database language. You can write a corresponding 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, -- uni...
[ { "role": "user", "content": "Retrieve the document_id, document_type, citizen full name, and verification_status for all documents that have no expiry date set." }, { "role": "assistant", "content": "SELECT d.document_id,\n d.document_type,\n c.first_name || ' ' || c.last_name AS fu...
You are an expert in writing database language. You can write a corresponding 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 t...
[ { "role": "user", "content": "Which service locations are not accessible and belong to agencies with a jurisdiction level of 'Local'? Show the location name and city." }, { "role": "assistant", "content": "SELECT sl.location_name, sl.city\nFROM government_services.service_locations sl\nINNER JOI...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.doctors ( doctor_id character varying(64) NOT NULL, first_name character v...
[ { "role": "user", "content": "How many prescriptions are there for each refills_allowed value?" }, { "role": "assistant", "content": "SELECT refills_allowed,\n COUNT(*) AS prescription_count\nFROM healthcare.prescriptions\nGROUP BY refills_allowed;" }, { "role": "user", "conten...
You are an expert in writing database language. You can write a corresponding 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_lin...
[ { "role": "user", "content": "Show me the payment amount and the name of the property associated with each payment record." }, { "role": "assistant", "content": "SELECT\n p.amount,\n prop.property_name\nFROM hospitality_technology.payments AS p\nJOIN hospitality_technology.reservations AS r 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 legal_services.invoices ( invoice_id character varying(64) NOT NULL, -- unique i...
[ { "role": "user", "content": "Get a list of appointment_id, start_time, and invoice_number for appointments that have a related invoice." }, { "role": "assistant", "content": "SELECT a.appointment_id,\n a.start_time,\n i.invoice_number\nFROM legal_services.appointments a\nJOIN legal_...
You are an expert in writing database language. You can write a corresponding 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, -- uni...
[ { "role": "user", "content": "Find all pairs of citizens who share the same first name and gender but have different last names. Display the shared first name, gender, the full name of the first citizen in the pair, and the full name of the second citizen." }, { "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 gaming_technology.servers ( server_id uuid, game_id uuid, server_name text, region te...
[ { "role": "user", "content": "List all server names and their statuses." }, { "role": "assistant", "content": "SELECT server_name, status FROM gaming_technology.servers;" }, { "role": "user", "content": "Can you also include the region and current_players for each server?" }, { ...
You are an expert in writing database language. You can write a corresponding 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 text, token_name text, token_symbol text, token_address te...
[ { "role": "user", "content": "For the 'DeFi' narrative, what is the average ROI and the total net inflow (usd_value where type=1) from smart money token inflow?" }, { "role": "assistant", "content": "SELECT AVG(sm.roi) AS avg_roi, SUM(smt.usd_value) AS total_net_inflow\nFROM smart_money_token_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 insurance.premium_payments ( payment_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "Find all pairs of overlapping payment periods for the same customer. Return customer_id, first payment_id as payment1_id, second payment_id as payment2_id, and both periods' start and end dates." }, { "role": "assistant", "content": "SELECT p1.customer_id,\n 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 train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- U...
[ { "role": "user", "content": "Can you help me get the total number of passenger cars for each train car type in the database?" }, { "role": "assistant", "content": "SELECT car_type, COUNT(*) as total_cars\nFROM train_station_management.train_cars\nWHERE car_type = 'Passenger'\nGROUP BY car_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 transportation.routes ( route_id.text, route_number.text, description.text, origin_lo...
[ { "role": "user", "content": "List all pairs of routes where the origin location of one route is the destination location of the other, showing both route numbers and their types." }, { "role": "assistant", "content": "SELECT r1.route_number AS route_number_1, r1.type AS type_1,\n r2.route...
You are an expert in writing database language. You can write a corresponding 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": "How many trips used more than 500 units of fuel, and what are their trip IDs and scheduled departure times?" }, { "role": "assistant", "content": "SELECT t.trip_id, t.scheduled_departure, SUM(f.quantity) AS total_fuel\nFROM transportation.trips t\nJOIN transportatio...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ...
[ { "role": "user", "content": "Retrieve each agency’s name along with the count of accessible service locations it has in California." }, { "role": "assistant", "content": "SELECT\n a.agency_name,\n COUNT(l.location_id) AS accessible_location_count\nFROM government_services.agencies a\nJOIN gov...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.post_hashtags ( post_hashtag_id character varying(64) NOT NULL, -- u...
[ { "role": "user", "content": "Show me all conversation IDs (whether group chat or not) that have at least one hashtag used in posts linked to them." }, { "role": "assistant", "content": "SELECT DISTINCT c.conversation_id\nFROM social_media.conversations c\nJOIN social_media.post_hashtags ph ON 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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ...
[ { "role": "user", "content": "Find the total payment amount and payment count made by citizen with national ID number 'A123456789'." }, { "role": "assistant", "content": "SELECT SUM(p.amount) AS total_amount, COUNT(p.payment_id) AS payment_count\nFROM government_services.citizens c\nJOIN governm...
You are an expert in writing database language. You can write a corresponding 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 ide...
[ { "role": "user", "content": "Find all addresses that have both sent and received tokens. For each, show the address, the total value sent, and the total value received." }, { "role": "assistant", "content": "SELECT s.address, s.total_sent, r.total_received\nFROM (\n SELECT from_address AS 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- uni...
[ { "role": "user", "content": "List the names of active services and their categories provided by agencies with a 'Federal' jurisdiction level." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.category FROM government_services.services AS T1 JOIN government_services.agencies 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 web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_at...
[ { "role": "user", "content": "Find token transfers that correspond directly to an event log (same transaction and log index). List the transfer ID, value, and the event name." }, { "role": "assistant", "content": "SELECT T1.transfer_id, T1.value, T2.event_name FROM web3.token_transfers AS T1 JOI...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.transactions ( transaction_id character varying(64) NOT NULL, -- unique ide...
[ { "role": "user", "content": "Show the average gas_price for each transaction status." }, { "role": "assistant", "content": "SELECT status, AVG(gas_price) AS avg_gas_price\nFROM web3.transactions\nGROUP BY status;" }, { "role": "user", "content": "Actually, can you also include the 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 insurance.agents ( agent_id text PRIMARY KEY, first_name text, last_name text, agency...
[ { "role": "user", "content": "List all agents and their managers' full names." }, { "role": "assistant", "content": "SELECT a.first_name, a.last_name, m.first_name AS manager_first_name, m.last_name AS manager_last_name FROM insurance.agents a LEFT JOIN insurance.agents m ON a.manager_id = m.age...
You are an expert in writing database language. You can write a corresponding 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 tex...
[ { "role": "user", "content": "Retrieve the driver_id, first_name, and last_name for all drivers whose license_expiry_date falls within the next 6 months from today." }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name\nFROM transportation.drivers\nWHERE license_expiry_d...
You are an expert in writing database language. You can write a corresponding 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, -- un...
[ { "role": "user", "content": "Which department has the highest number of employees currently employed?" }, { "role": "assistant", "content": "SELECT department FROM government_services.employees WHERE termination_date IS NULL GROUP BY department ORDER BY COUNT(*) DESC LIMIT 1;" }, { "rol...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varyin...
[ { "role": "user", "content": "For each contract that has received transactions, list its address and the total value of Ether received." }, { "role": "assistant", "content": "SELECT T1.address, SUM(T2.value) FROM web3.contracts AS T1 JOIN web3.transactions AS T2 ON T1.address = T2.to_address GRO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.nodes ( node_id character varying(64) NOT NULL, -- unique identifier ...
[ { "role": "user", "content": "Find pairs of distinct nodes that share the same 'last_seen' timestamp but have different port numbers. Show the node IDs, ports, and the shared timestamp for each pair." }, { "role": "assistant", "content": "SELECT T1.node_id AS node1_id , T1.port AS node1_port , ...
You are an expert in writing database language. You can write a corresponding 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": "How many applications are currently in 'Processing' status? Return the total count." }, { "role": "assistant", "content": "SELECT COUNT(*) AS processing_applications_count\nFROM government_services.applications\nWHERE status = 'Processing';" }, { "role": "us...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patient_insurance ( patient_insurance_id text, patient_id text, plan_id te...
[ { "role": "user", "content": "How many insurance policies have 'Group' in their group_number?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM healthcare.patient_insurance WHERE group_number ILIKE '%Group%';" }, { "role": "user", "content": "List all pairs of wallets that ...
You are an expert in writing database language. You can write a corresponding 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.logs ( log_id text PRIMARY KEY, user_id text, action text, details t...
[ { "role": "user", "content": "Count the number of logs for each action type." }, { "role": "assistant", "content": "SELECT action,\n COUNT(*) AS count\nFROM trading_platform.logs\nGROUP BY action;" }, { "role": "user", "content": "What is the reason for the termination of emplo...
You are an expert in writing database language. You can write a corresponding 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": "Show me the count of rooms by status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS room_count\nFROM hospitality_technology.rooms\nGROUP BY status;" }, { "role": "user", "content": "Actually, I need that breakdown by property ...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "For each fuel_type, can you calculate the total total_cost and the average total_cost from the fuel_logs table?" }, { "role": "assistant", "content": "SELECT fuel_type,\n SUM(total_cost) AS total_cost_sum,\n AVG(total_cost) AS average_cost\nFROM transpor...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique identifier fo...
[ { "role": "user", "content": "Find all wallets that were created by users with IDs starting with 'user_' and show their addresses along with creation timestamps." }, { "role": "assistant", "content": "SELECT address, created_at FROM web3.wallets WHERE user_id LIKE 'user_%';" }, { "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.medical_records ( record_id character varying(64) NOT NULL, -- unique...
[ { "role": "user", "content": "List the record ID, record date, patient ID, and chief complaint for medical records belonging to patients whose last name is 'Smith'. Also include the patient's last name in the results." }, { "role": "assistant", "content": "SELECT mr.record_id, mr.record_date, mr...
You are an expert in writing database language. You can write a corresponding 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 character varying(64) NOT NULL, -- unique ident...
[ { "role": "user", "content": "What is the average estimated_duration_minutes for each route type?" }, { "role": "assistant", "content": "SELECT type, AVG(estimated_duration_minutes) AS avg_duration FROM transportation.routes GROUP BY type;" }, { "role": "user", "content": "Exclude ro...
You are an expert in writing database language. You can write a corresponding 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": "How many payments were made using the payment method 'Credit Card'?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS credit_card_payments\nFROM government_services.payments\nWHERE payment_method = 'Credit Card';" }, { "role": "user", "content": ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.agencies ( agency_id character varying(64) NOT NULL, -- uniqu...
[ { "role": "user", "content": "List the number of documents submitted by each citizen, showing their citizen ID and only include those citizens who have submitted more than 5 documents." }, { "role": "assistant", "content": "SELECT citizen_id, COUNT(*) AS document_count\nFROM government_services....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.time_entries ( entry_id text, case_id text, lawyer_id text, date_worke...
[ { "role": "user", "content": "Show me the total hours worked and total amount billed for each case that has associated invoices, along with the case ID and invoice number." }, { "role": "assistant", "content": "SELECT t.case_id, i.invoice_number, SUM(t.hours_spent) AS total_hours, SUM(t.hours_sp...
You are an expert in writing database language. You can write a corresponding 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": "Which users have received both a comment notification and a like notification? List the recipient_user_id and the total number of such users." }, { "role": "assistant", "content": "SELECT COUNT(DISTINCT recipient_user_id) AS user_count\nFROM (\n SELECT recipient_us...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id text, claim_id text, document_type text, file...
[ { "role": "user", "content": "For each claim, retrieve the document_id, file_name, and uploaded_at of the earliest and the latest uploaded document." }, { "role": "assistant", "content": "SELECT\n c1.claim_id,\n c1.document_id AS earliest_document_id,\n c1.file_name AS earliest_file_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 web3.contracts ( contract_id character varying(64) NOT NULL, address character varyin...
[ { "role": "user", "content": "Show each token's symbol, token_name, and the deployer_address and status of the contract where that token was created." }, { "role": "assistant", "content": "SELECT t.token_symbol,\n t.token_name,\n c.deployer_address,\n c.status\nFROM web3.tokens...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE trading_platform.wallets ( wallet_id text, user_id text, address text, private_key te...
[ { "role": "user", "content": "List the asset names and symbols for all assets of type 'token'." }, { "role": "assistant", "content": "SELECT name, symbol FROM trading_platform.assets WHERE type = 'token';" }, { "role": "user", "content": "Find all pairs of achievement unlocks and ite...
You are an expert in writing database language. You can write a corresponding 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": "Show the names and emails of all guests who have communication consent enabled." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM hospitality_technology.guests WHERE communication_consent = TRUE;" }, { "role": "user", "conte...
You are an expert in writing database language. You can write a corresponding 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": "List pairs of drivers who share the same hire_date, showing both driver IDs and the hire_date." }, { "role": "assistant", "content": "SELECT d1.driver_id AS driver1_id,\n d2.driver_id AS driver2_id,\n d1.hire_date\nFROM transportation.drivers d1\nJOIN tr...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, ...
[ { "role": "user", "content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest tpl ON tm.contract...
You are an expert in writing database language. You can write a corresponding 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 ch...
[ { "role": "user", "content": "Show me the make and model of vehicles along with the route number and description for routes where the vehicle's capacity is 60 or less." }, { "role": "assistant", "content": "SELECT v.make, v.model, r.route_number, r.description\nFROM transportation.vehicles v\nJO...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ...
[ { "role": "user", "content": "Retrieve the service names, location names, and cities for active services offered at accessible locations in California." }, { "role": "assistant", "content": "SELECT s.service_name,\n sl.location_name,\n sl.city\nFROM government_services.services AS s\...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.claim_documents ( document_id character varying(64) NOT NULL, claim_id char...
[ { "role": "user", "content": "Find the claim ID and the total number of documents associated with each claim ID that has more than 10 documents." }, { "role": "assistant", "content": "SELECT claim_id, COUNT(*) FROM insurance.claim_documents GROUP BY claim_id HAVING COUNT(*) > 10;" }, { "...
You are an expert in writing database language. You can write a corresponding 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, addres...
[ { "role": "user", "content": "What is the average cost per unit for fuel at each location type? Show the location type and the average cost." }, { "role": "assistant", "content": "SELECT T2.type , AVG(T1.cost_per_unit) FROM transportation.fuel_logs AS T1 JOIN transportation.locations AS T2 ON 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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ...
[ { "role": "user", "content": "List the service_id, service_name, and agency_id for all active services that have an online application URL provided." }, { "role": "assistant", "content": "SELECT service_id,\n service_name,\n agency_id\nFROM government_services.services\nWHERE is_acti...
You are an expert in writing database language. You can write a corresponding 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, -- unique...
[ { "role": "user", "content": "Show me all time entries from the last 90 days, including the entry description, hours spent, the name of the case, and the name of the client." }, { "role": "assistant", "content": "SELECT T1.description, T1.hours_spent, T2.case_name, T3.first_name, T3.last_name 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 social_media.likes ( like_id text PRIMARY KEY, user_id text, post_id text, comment_id...
[ { "role": "user", "content": "Show me all users who have liked both a post and a comment. Please include their user IDs, the post IDs, and the comment IDs." }, { "role": "assistant", "content": "SELECT DISTINCT l1.user_id, l1.post_id, l2.comment_id\nFROM social_media.likes l1\nJOIN social_media....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.bookings ( booking_id text, passenger_id text, trip_id text, seat_numb...
[ { "role": "user", "content": "List each booking with its previous booking time for the same passenger." }, { "role": "assistant", "content": "SELECT b.booking_id,\n b.passenger_id,\n b.booking_time,\n LAG(b.booking_time) OVER (PARTITION BY b.passenger_id ORDER BY b.booking_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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, ...
[ { "role": "user", "content": "For each passenger, show their passenger_id, first_name, last_name, the date and time of their earliest booking, and the date and time of their latest booking." }, { "role": "assistant", "content": "SELECT p.passenger_id,\n p.first_name,\n p.last_name,\n...