system
stringlengths
461
8.8k
conversations
listlengths
2
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 insurance.claims ( claim_id text PRIMARY KEY, policy_id text, customer_id text, incid...
[ { "role": "user", "content": "Show me all insurance products along with the number of distinct agents whose handled claims are for policies using that product. Include product_id, product_name, and agent_count." }, { "role": "assistant", "content": "SELECT ip.product_id, ip.product_name, COUNT(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 gaming_technology.players ( player_id uuid, username text, email text, password_hash ...
[ { "role": "user", "content": "Can you list each developer's name along with the number of games they have published by joining developers and games?" }, { "role": "assistant", "content": "SELECT d.name AS developer_name,\n COUNT(g.game_id) AS games_published\nFROM gaming_technology.develop...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_...
[ { "role": "user", "content": "Summarize the trades by trade type, showing the total quantity and the total amount for each type." }, { "role": "assistant", "content": "SELECT trade_type, SUM(quantity) AS total_quantity, SUM(total_amount) AS total_amount FROM financial_services.trades GROUP BY 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 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 transportation.vehicles ( vehicle_id text, license_plate text, vin text, make text, m...
[ { "role": "user", "content": "For each trip, can you show the trip_id, number of passengers, and the make and model of the assigned vehicle?" }, { "role": "assistant", "content": "SELECT b.trip_id, COUNT(b.passenger_id) AS passenger_count, v.make, v.model\nFROM transportation.bookings b\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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name...
[ { "role": "user", "content": "Could you list the route number and the name of the destination location for routes that start at a location of type 'Depot'?" }, { "role": "assistant", "content": "SELECT T1.route_number , T2.name FROM transportation.routes AS T1 JOIN transportation.locations AS T...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE transportation.drivers ( driver_id text PRIMARY KEY, employee_id text, first_name tex...
[ { "role": "user", "content": "List the first and last names of all drivers with status 'Active' along with the route number and type of all Express routes." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, r.route_number, r.type\nFROM transportation.drivers d\nCROSS JOIN 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.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 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 blockchain.smart_contracts ( contract_id.text, creator_address.text, code.text, times...
[ { "role": "user", "content": "Find all smart contracts where the contract code contains the keyword 'proxy'." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE code LIKE '%proxy%';" }, { "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.notifications ( notification_id.text, citizen_id.text, applicatio...
[ { "role": "user", "content": "For each application that has at least one failed notification, provide the application ID, the total number of notifications received for that application, and the count of failed notifications." }, { "role": "assistant", "content": "SELECT application_id, 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 legal_services.law_firms ( firm_id character varying(64) NOT NULL, firm_name characte...
[ { "role": "user", "content": "List all law firms founded in the year 2015. Show their names, phone numbers, and website." }, { "role": "assistant", "content": "SELECT firm_name, phone, website\nFROM legal_services.law_firms\nWHERE EXTRACT(YEAR FROM founded_date) = 2015;" }, { "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 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 CREATE TABLE legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case_...
[ { "role": "user", "content": "Count the total number of invoices issued in each calendar year and month. Show the year, month, and the count, ordered chronologically." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM issue_date) AS issue_year, EXTRACT(MONTH FROM issue_date) AS issu...
You are an expert in writing database language. You can write a corresponding 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 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 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 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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, ...
[ { "role": "user", "content": "List all public reviews from the past 30 days with the property name and overall rating." }, { "role": "assistant", "content": "SELECT r.review_id, p.property_name, r.rating_overall, r.review_date\nFROM hospitality_technology.reviews AS r\nJOIN hospitality_technolog...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan." }, { "role": "assistant", "content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) AS enrolled_patie...
You are an expert in writing database language. You can write a corresponding 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 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 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 social_media.users ( user_id character varying(64) NOT NULL, username character varyi...
[ { "role": "user", "content": "Find all users who have set their bio to a non-empty value, showing their username and email." }, { "role": "assistant", "content": "SELECT username, email\nFROM social_media.users\nWHERE bio IS NOT NULL AND TRIM(bio) != '';" }, { "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 transportation.locations ( location_id.text, name.text, type.text, address_line1.text...
[ { "role": "user", "content": "List pairs of distinct locations in the same city that share the same location type. Show both location IDs, names, city, and the shared type." }, { "role": "assistant", "content": "SELECT L1.location_id AS location1_id, L1.name AS location1_name, L2.location_id 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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising recor...
[ { "role": "user", "content": "List the total amount invested in each month of 2023." }, { "role": "assistant", "content": "SELECT SUBSTRING(investment_date, 1, 7) AS month, SUM(investment_value) AS total_invested FROM project_fundraising_record WHERE investment_date LIKE '2023%' GROUP BY SUBSTRI...
You are an expert in writing database language. You can write a corresponding 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 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 gaming_technology.servers ( server_id.uuid, game_id.uuid, server_name.text, region.te...
[ { "role": "user", "content": "Show me all servers in the same region that have different statuses. I want to see the server names, regions, and their statuses for each pair." }, { "role": "assistant", "content": "SELECT s1.server_name AS server1, s2.server_name AS server2, s1.region, s1.status A...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 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 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 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 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 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 social_media.likes ( like_id text PRIMARY KEY, user_id text, post_id text, comment_id...
[ { "role": "user", "content": "Find the total number of likes made on posts versus comments. Show two columns: like_type (either 'post' or 'comment') and like_count." }, { "role": "assistant", "content": "SELECT CASE WHEN post_id IS NOT NULL THEN 'post' ELSE 'comment' END AS like_type, COUNT(*) A...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE legal_services.invoices ( invoice_id text, invoice_number text, client_id text, case_...
[ { "role": "user", "content": "Show me all invoices for case_id 'case_777', including the invoice number, total amount, and status." }, { "role": "assistant", "content": "SELECT invoice_number, total_amount, status FROM legal_services.invoices WHERE case_id = 'case_777';" }, { "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 social_media.conversations ( conversation_id text PRIMARY KEY, created_at timestamp, ...
[ { "role": "user", "content": "How many unread notifications are there with the type 'mention'?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM social_media.notifications WHERE read_at IS NULL AND notification_type = 'mention';" }, { "role": "user", "content": "List all do...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE social_media.users ( user_id character varying(64) NOT NULL, -- unique identifie...
[ { "role": "user", "content": "List all users who have a non-empty bio and a profile picture URL." }, { "role": "assistant", "content": "SELECT\n user_id,\n username,\n full_name,\n bio,\n profile_picture_url\nFROM social_media.users\nWHERE\n bio IS NOT NULL AND profile_picture_url IS NOT N...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.documents ( document_id character varying(64) NOT NULL, -- un...
[ { "role": "user", "content": "Count the number of documents for each unique document type." }, { "role": "assistant", "content": "SELECT document_type, COUNT(*) AS document_count FROM government_services.documents GROUP BY document_type ORDER BY document_count DESC;" }, { "role": "user",...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.documents ( document_id character varying(64) NOT NULL, applicati...
[ { "role": "user", "content": "List application IDs that have both documents and payments associated with them." }, { "role": "assistant", "content": "SELECT DISTINCT T1.application_id FROM documents AS T1 JOIN payments AS T2 ON T1.application_id = T2.application_id" }, { "role": "user", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.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. ##Table Structure CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text,...
[ { "role": "user", "content": "List all guests who have a loyalty_member_id, showing their guest_id, first_name, last_name, and loyalty_member_id." }, { "role": "assistant", "content": "SELECT guest_id,\n first_name,\n last_name,\n loyalty_member_id\nFROM hospitality_technology....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.smart_contracts ( contract_id text PRIMARY KEY, creator_address text, code...
[ { "role": "user", "content": "Show me the earliest created smart contract for each creator address." }, { "role": "assistant", "content": "SELECT DISTINCT ON (creator_address) contract_id, creator_address, code, timestamp FROM blockchain.smart_contracts ORDER BY creator_address, timestamp ASC;" ...
You are an expert in writing database language. You can write a corresponding 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": "List pairs of documents uploaded by the same lawyer, showing uploader ID and both document names." }, { "role": "assistant", "content": "SELECT d1.uploaded_by_lawyer_id, d1.document_name AS doc1, d2.document_name AS doc2 FROM legal_services.documents d1 JOIN legal_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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, m...
[ { "role": "user", "content": "Get the total fuel cost per route, showing route_number and the sum of total_cost for all fuel logs associated with trips on that route." }, { "role": "assistant", "content": "SELECT r.route_number,\n SUM(fl.total_cost) AS total_fuel_cost\nFROM transportation....
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.services ( service_id text PRIMARY KEY, agency_id text, service_n...
[ { "role": "user", "content": "Which services have the longest average processing times? List the top 5 services by average processing time." }, { "role": "assistant", "content": "SELECT\n service_name,\n average_processing_time_days\nFROM\n government_services.services\nORDER BY\n average_pr...
You are an expert in writing database language. You can write a corresponding 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 // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_n...
[ { "role": "user", "content": "Can you retrieve the total number of train cars for each train in the database?" }, { "role": "assistant", "content": "MATCH (t:Train)<-[:PART_OF_TRAIN]-(tc:TrainCar)\nRETURN t.train_id, t.train_number, COUNT(tc) AS total_cars\nORDER BY t.train_id" }, { "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 insurance.policies ( policy_id.text, customer_id.text, product_id.text, agent_id.text...
[ { "role": "user", "content": "List all policies that expired in the last 30 days, along with their product IDs and premium amounts." }, { "role": "assistant", "content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE end_date BETWEEN DATE_SUB(CURRENT_DATE, INTERVAL 3...
You are an expert in writing database language. You can write a corresponding 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 PRIMARY KEY, citizen_id text, ...
[ { "role": "user", "content": "Find all applications that were submitted in 2023 but received a decision ('Approved' or 'Rejected') in 2024. List the application ID, submitted date, decision date, and status." }, { "role": "assistant", "content": "SELECT application_id, submitted_at, decision_dat...
You are an expert in writing database language. You can write a corresponding 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 text, post_id text, hashtag_id text ) CR...
[ { "role": "user", "content": "Get all notifications for posts tagged with hashtag 'H123', showing notification_id and created_at." }, { "role": "assistant", "content": "SELECT n.notification_id, n.created_at\nFROM social_media.notifications n\nJOIN social_media.post_hashtags ph\n ON n.target_en...
You are an expert in writing database language. You can write a corresponding 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.payments ( payment_id text PRIMARY KEY, reservation_id text, g...
[ { "role": "user", "content": "Find the total amount of payments and the number of payments for each status." }, { "role": "assistant", "content": "SELECT status, SUM(amount) AS total_amount, COUNT(*) AS payment_count\nFROM hospitality_technology.payments\nGROUP BY status;" }, { "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 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 insurance.customers ( customer_id text, first_name text, last_name text, date_of_birt...
[ { "role": "user", "content": "Show the total number of customers in each state." }, { "role": "assistant", "content": "SELECT\n state,\n COUNT(customer_id)\nFROM insurance.customers\nGROUP BY\n state;" }, { "role": "user", "content": "List all users whose password hash contains th...
You are an expert in writing database language. You can write a corresponding 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 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 social_media.conversation_participants ( participant_id character varying(64) NOT...
[ { "role": "user", "content": "List each participant_id along with the total number of participants in their conversation, and include user_id and conversation_id." }, { "role": "assistant", "content": "SELECT cp.participant_id, cp.user_id, cp.conversation_id, counts.participant_count\nFROM socia...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "List all patients who have received a prescription with the route 'Topical', showing their ID, first name, and last name." }, { "role": "assistant", "content": "SELECT DISTINCT\n p.patient_id,\n p.first_name,\n p.last_name\nFROM\n healthcare.patients p\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 web3.events ( event_id character varying(64) NOT NULL, -- unique identifier for ...
[ { "role": "user", "content": "Show the transaction ID, the transaction value from the transactions table, and the sum of the value from token_transfers for all transactions that have at least one associated token transfer. Name the sum column total_token_transfer_value." }, { "role": "assistant", ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 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 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 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 CREATE TABLE healthcare.medical_records ( record_id character varying(64) NOT NULL, patient_id cha...
[ { "role": "user", "content": "For each patient, count the total number of medical records they have in the system, and show patient_id along with record_count." }, { "role": "assistant", "content": "SELECT patient_id,\n COUNT(*) AS record_count\nFROM healthcare.medical_records\nGROUP BY pa...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id ...
[ { "role": "user", "content": "Can you list all appointments along with the scheduled start time, purpose, and booking method, as well as the employee ID and location ID for each appointment?" }, { "role": "assistant", "content": "SELECT appointment_id, scheduled_start_time, purpose, booking_meth...
You are an expert in writing database language. You can write a corresponding 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 hospitality_technology.payments ( payment_id text, reservation_id text, guest_id text...
[ { "role": "user", "content": "List all payments made using a credit card, including guest_id, amount, payment_method, and payment_timestamp." }, { "role": "assistant", "content": "SELECT guest_id, amount, payment_method, payment_timestamp FROM hospitality_technology.payments WHERE payment_method...
You are an expert in writing database language. You can write a corresponding 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": "Provide a list of all log entries recorded since the start of 2024, including the user ID, action, and the exact time the log occurred." }, { "role": "assistant", "content": "SELECT user_id, action, logged_at FROM logs WHERE logged_at >= '2024-01-01';" }, { ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character ...
[ { "role": "user", "content": "Find all customers who have at least two active policies with overlapping coverage periods. List the customer ID and the policy numbers of any two such overlapping active policies." }, { "role": "assistant", "content": "SELECT\n p1.customer_id,\n p1.policy_number ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE hospitality_technology.reservations ( reservation_id text, property_id text, guest_id...
[ { "role": "user", "content": "Find all pairs of overlapping reservations for the same room. Show the two reservation IDs, room_id, and both reservations' check-in and check-out dates." }, { "role": "assistant", "content": "SELECT r1.reservation_id AS reservation1_id, r2.reservation_id AS reserva...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // Node Label: :Station // Properties: // station_id: String (Constraint: UNIQUE) // station_n...
[ { "role": "user", "content": "能否帮我统计特定车站(station_id 为 'station_xyz')的所有工作人员数量?" }, { "role": "assistant", "content": "MATCH (s:Station {station_id: 'station_xyz'})<-[:BASED_AT]-(staff:Staff)\nRETURN COUNT(staff) AS total_staff" }, { "role": "user", "content": "Show me the total estim...
You are an expert in writing database language. You can write a corresponding 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": "List the names of agencies and their established dates, but only for agencies that offer at least one service." }, { "role": "assistant", "content": "SELECT DISTINCT T1.agency_name , T1.established_date FROM government_services.agencies AS T1 JOIN government_servic...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE government_services.citizens ( citizen_id.text, national_id_number.text, first_name.t...
[ { "role": "user", "content": "Show the full names and contact emails of all citizens who have made payments for applications assigned to employees with the job title 'Supervisor'." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name || ' ' || c.last_name AS full_name, c.contact_em...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE web3.wallets ( wallet_id text, user_id text, address text, private_key text, created_...
[ { "role": "user", "content": "List the user IDs who own more than one wallet and show how many wallets each of them has." }, { "role": "assistant", "content": "SELECT user_id, COUNT(*) FROM web3.wallets GROUP BY user_id HAVING COUNT(*) > 1;" }, { "role": "user", "content": "Find all ...
You are an expert in writing database language. You can write a corresponding 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 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 // db.createCollection('platforms') // Optional: db.platforms.createIndex({ platform_id: 1 }, { un...
[ { "role": "user", "content": "Can you help me get the total number of operational platforms across all stations?" }, { "role": "assistant", "content": "db.platforms.countDocuments({ status: 'Operational' });" }, { "role": "user", "content": "Show me the top 5 users with the most KYC ...
You are an expert in writing database language. You can write a corresponding 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 government_services.services ( service_id character varying(64) NOT NULL, -- uniq...
[ { "role": "user", "content": "Find the names of service locations where services categorized as 'Licensing' have had appointments scheduled." }, { "role": "assistant", "content": "SELECT DISTINCT T1.location_name FROM service_locations AS T1 JOIN appointments AS T2 ON T1.location_id = T2.locatio...
You are an expert in writing database language. You can write 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.employees ( employee_id.text, agency_id.text, first_name.text, la...
[ { "role": "user", "content": "List the full names and hire dates of all employees who report directly to a manager with the job title 'Director'." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, e.hire_date\nFROM government_services.employees e\nJOIN government_services.e...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE financial_services.accounts ( account_id text PRIMARY KEY, customer_id text, account_...
[ { "role": "user", "content": "What is the total commission earned from all trades executed in the 'NYSE' venue by employees in the 'Investment' department?" }, { "role": "assistant", "content": "SELECT SUM(t.commission) AS total_commission FROM financial_services.trades t JOIN financial_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 // Use Hashes for ticket details. Key format: ticket:<ticket_id> // HSET ticket:tkt_1a2b ticket_id...
[ { "role": "user", "content": "特定のプラットフォームID 'plat_123' に関連するメンテナンス記録を取得するのを手伝っていただけますか?また、記録のステータスも含めてください。" }, { "role": "assistant", "content": "SMEMBERS platform:plat_123:maintenance\nHGETALL maintenance_record:<record_id>" }, { "role": "user", "content": "ステータスが 'Completed' の記録だけ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number....
[ { "role": "user", "content": "Show me the names of all law firms and the total number of lawyers associated with each firm." }, { "role": "assistant", "content": "SELECT T1.firm_name, count(T2.lawyer_id) FROM legal_services.law_firms AS T1 JOIN legal_services.lawyers AS T2 ON T1.firm_id = T2.fir...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE healthcare.patients ( patient_id.text, first_name.text, last_name.text, date_of_birth...
[ { "role": "user", "content": "Show the first and last names, email, and phone number for all patients who were added to the system in the last 90 days along with their emergency contact name." }, { "role": "assistant", "content": "SELECT first_name, last_name, email, phone_number, emergency_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 social_media.users ( user_id text PRIMARY KEY, username text, email text, password_ha...
[ { "role": "user", "content": "List all posts that contain a non-empty media_url and show the usernames of their authors." }, { "role": "assistant", "content": "SELECT p.post_id, p.media_url, u.username\nFROM social_media.posts p\nJOIN social_media.users u ON p.user_id = u.user_id\nWHERE p.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. 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 is the manufacturing date of the train car with car_id 'CAR789'?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the manufacturing date of train cars. The data available in the train_cars table only includes detail...
You are an expert in writing database language. You can write a corresponding 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 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 legal_services.lawyers ( lawyer_id.text, first_name.text, last_name.text, bar_number....
[ { "role": "user", "content": "List all invoices that were paid within 7 days of their issue date. Show invoice number, issue date, payment date, and total amount." }, { "role": "assistant", "content": "SELECT invoice_number, issue_date, payment_date, total_amount FROM legal_services.invoices WHE...
You are an expert in writing database language. You can write a corresponding 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 gaming_technology.achievements ( achievement_id uuid NOT NULL DEFAULT gen_random_...
[ { "role": "user", "content": "Show me the count of achievements that are hidden versus those that are not hidden." }, { "role": "assistant", "content": "SELECT hidden, COUNT(*) FROM achievements GROUP BY hidden;" }, { "role": "user", "content": "Include the average points for each gr...
You are an expert in writing database language. You can write a corresponding 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, agency_id text, service_name text, de...
[ { "role": "user", "content": "List the names of employees and the agency they work for who have scheduled at least one appointment. Show the employee's first name, last name, and agency_id." }, { "role": "assistant", "content": "SELECT DISTINCT e.first_name, e.last_name, e.agency_id\nFROM govern...
You are an expert in writing database language. You 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. 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 is the reason behind the cost variation for maintenance of asset_id 'ASSET456' over the past year?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the reasons behind cost variations for maintenance. The data in the maintenan...
You are an expert in writing database language. You can write a corresponding 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, -- uniqu...
[ { "role": "user", "content": "For each scheduled appointment, list the appointment_id, appointment_time, patient_id, and the name of the patient's primary insurance plan. Only include appointments that have not been cancelled." }, { "role": "assistant", "content": "SELECT a.appointment_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 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...