db_id
stringclasses
40 values
query
stringlengths
22
608
question
stringlengths
22
185
advertising_agencies
SELECT meeting_type , other_details FROM meetings
What are all meeting types and other details?
advertising_agencies
SELECT meeting_outcome , purpose_of_meeting FROM meetings
Show all meeting outcomes and purposes.
advertising_agencies
SELECT meeting_outcome , purpose_of_meeting FROM meetings
What are all meeting outcomes and purposes?
advertising_agencies
SELECT T1.payment_id , T1.payment_details FROM Payments AS T1 JOIN Invoices AS T2 ON T1.invoice_id = T2.invoice_id WHERE T2.invoice_status = 'Working'
Show all payment ids and details for invoices whose status is 'Working'.
advertising_agencies
SELECT T1.payment_id , T1.payment_details FROM Payments AS T1 JOIN Invoices AS T2 ON T1.invoice_id = T2.invoice_id WHERE T2.invoice_status = 'Working'
What are all payment ids and payment details for invoices with status Working?
advertising_agencies
SELECT invoice_id , invoice_status FROM Invoices EXCEPT SELECT T1.invoice_id , T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id = T2.invoice_id
Show all invoice ids and statuses without a payment.
advertising_agencies
SELECT invoice_id , invoice_status FROM Invoices EXCEPT SELECT T1.invoice_id , T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id = T2.invoice_id
What are the invoice ids and statuses for invoices without a payment?
advertising_agencies
SELECT count(*) FROM Payments
How many payments do we have?
advertising_agencies
SELECT count(*) FROM Payments
Count the number of payments.
advertising_agencies
SELECT payment_id , invoice_id , payment_details FROM Payments
List all payment ids and its corresponding invoice ids and details.
advertising_agencies
SELECT payment_id , invoice_id , payment_details FROM Payments
What are the payment ids, invoice ids, and payment details for all payments?
advertising_agencies
SELECT DISTINCT T1.invoice_id , T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id = T2.invoice_id
Show all the different invoice ids and statuses of the payments
advertising_agencies
SELECT DISTINCT T1.invoice_id , T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id = T2.invoice_id
What are the distinct invoice ids and statuses for all payments?
advertising_agencies
SELECT invoice_id , count(*) FROM Payments GROUP BY invoice_id
Show all invoice ids and the number of payments for each invoice.
advertising_agencies
SELECT invoice_id , count(*) FROM Payments GROUP BY invoice_id
How many payments are there for each invoice?
advertising_agencies
SELECT T1.invoice_id , T2.invoice_status , T2.invoice_details FROM Payments AS T1 JOIN Invoices AS T2 ON T1.invoice_id = T2.invoice_id GROUP BY T1.invoice_id ORDER BY count(*) DESC LIMIT 1
What is the invoice id, status code, and details for the invoice with most number of payments.
advertising_agencies
SELECT T1.invoice_id , T2.invoice_status , T2.invoice_details FROM Payments AS T1 JOIN Invoices AS T2 ON T1.invoice_id = T2.invoice_id GROUP BY T1.invoice_id ORDER BY count(*) DESC LIMIT 1
Return the invoice ids, statuses, and details for invoices with the most payments?
advertising_agencies
SELECT count(*) FROM Staff
How many staff do we have?
advertising_agencies
SELECT count(*) FROM Staff
Count the number of staff.
advertising_agencies
SELECT agency_id , count(*) FROM Staff GROUP BY agency_id
Show the agency ids and the number of staff in each agent?
advertising_agencies
SELECT agency_id , count(*) FROM Staff GROUP BY agency_id
Return the agency ids and number of staff in each.
advertising_agencies
SELECT T1.agency_id , T2.agency_details FROM Staff AS T1 JOIN Agencies AS T2 ON T1.agency_id = T2.agency_id GROUP BY T1.agency_id ORDER BY count(*) DESC LIMIT 1
What is the agent id and details for the agency with most staff?
advertising_agencies
SELECT T1.agency_id , T2.agency_details FROM Staff AS T1 JOIN Agencies AS T2 ON T1.agency_id = T2.agency_id GROUP BY T1.agency_id ORDER BY count(*) DESC LIMIT 1
Return the id and detail for the agency with the most staff.
advertising_agencies
SELECT meeting_outcome , count(*) FROM Meetings GROUP BY meeting_outcome
Show meeting outcome codes and the number of meeting in each outcome.
advertising_agencies
SELECT meeting_outcome , count(*) FROM Meetings GROUP BY meeting_outcome
How many meetings had each meeting outcome?
advertising_agencies
SELECT client_id , count(*) FROM Meetings GROUP BY client_id
List the client ids and the number of meeting for each client.
advertising_agencies
SELECT client_id , count(*) FROM Meetings GROUP BY client_id
How many meetings are there for each client id?
advertising_agencies
SELECT meeting_type , count(*) FROM Meetings GROUP BY meeting_type
Show the meeting type codes and the number of meeting for each client.
advertising_agencies
SELECT meeting_type , count(*) FROM Meetings GROUP BY meeting_type
How many meetings are there for each meeting type?
advertising_agencies
SELECT T1.meeting_id , T1.meeting_outcome , T1.meeting_type , T2.client_details FROM meetings AS T1 JOIN clients AS T2 ON T1.client_id = T2.client_id
Show all meeting ids, meeting outcomes, meeting types and the details of the client atttending it.
advertising_agencies
SELECT T1.meeting_id , T1.meeting_outcome , T1.meeting_type , T2.client_details FROM meetings AS T1 JOIN clients AS T2 ON T1.client_id = T2.client_id
What are the meeting ids, meeting outcomes, meeting types, and client details for all meetings?
advertising_agencies
SELECT meeting_id , count(*) FROM Staff_in_meetings GROUP BY meeting_id
Show the meeting ids and the number of staff in each meeting.
advertising_agencies
SELECT meeting_id , count(*) FROM Staff_in_meetings GROUP BY meeting_id
Count the number of staff in each meeting by meeting id.
advertising_agencies
SELECT staff_id , count(*) FROM Staff_in_meetings GROUP BY staff_id ORDER BY count(*) ASC LIMIT 1;
Show the staff id and the number of meetings attended by the staff who attended some meeting but had the lowest attendance.
advertising_agencies
SELECT staff_id , count(*) FROM Staff_in_meetings GROUP BY staff_id ORDER BY count(*) ASC LIMIT 1;
What is the staff id of the staff who attended the least meetings but attended some meeting?
advertising_agencies
SELECT count(DISTINCT staff_id) FROM Staff_in_meetings
How many staff have attended a meeting?
advertising_agencies
SELECT count(DISTINCT staff_id) FROM Staff_in_meetings
Return the number of distinct staff who have attended a meeting?
advertising_agencies
SELECT count(*) FROM Staff WHERE staff_id NOT IN ( SELECT staff_id FROM Staff_in_meetings )
How many staff did not attend any meeting?
advertising_agencies
SELECT count(*) FROM Staff WHERE staff_id NOT IN ( SELECT staff_id FROM Staff_in_meetings )
Count the number of staff who did not attend any meeting.
advertising_agencies
SELECT T1.client_id , T1.client_details FROM Clients AS T1 JOIN meetings AS T2 ON T1.client_id = T2.client_id UNION SELECT T1.client_id , T1.client_details FROM Clients AS T1 JOIN invoices AS T2 ON T1.client_id = T2.client_id
What are the ids and details of the clients who have attended any meeting or have any invoice?
advertising_agencies
SELECT T1.client_id , T1.client_details FROM Clients AS T1 JOIN meetings AS T2 ON T1.client_id = T2.client_id UNION SELECT T1.client_id , T1.client_details FROM Clients AS T1 JOIN invoices AS T2 ON T1.client_id = T2.client_id
Return the ids and details of clients who have attended a meeting or had an invoice.
advertising_agencies
SELECT staff_id , staff_details FROM staff WHERE staff_details LIKE "%s%" GROUP BY staff_id HAVING count(*) >= 1
What are the ids and details of the staff who have attended at least 1 meetings and have the detail with letter 's'?
advertising_agencies
SELECT staff_id , staff_details FROM staff WHERE staff_details LIKE "%s%" GROUP BY staff_id HAVING count(*) >= 1
Return the ids and details of staff who have attended at least 1 meeting and have an s in their staff details?
advertising_agencies
SELECT T1.client_id , T1.sic_code , T1.agency_id FROM clients AS T1 JOIN meetings AS T2 ON T1.client_id = T2.client_id GROUP BY T1.client_id HAVING count(*) = 1 INTERSECT SELECT T1.client_id , T1.sic_code , T1.agency_id FROM clients AS T1 JOIN invoices AS T2 ON T1.client_id = T2.client_id
What are the id, sic code and agency id of the client who has attended 1 meeting and has any invoice.
advertising_agencies
SELECT T1.client_id , T1.sic_code , T1.agency_id FROM clients AS T1 JOIN meetings AS T2 ON T1.client_id = T2.client_id GROUP BY T1.client_id HAVING count(*) = 1 INTERSECT SELECT T1.client_id , T1.sic_code , T1.agency_id FROM clients AS T1 JOIN invoices AS T2 ON T1.client_id = T2.client_id
Return the ids, sic codes, and agency ids of clients who have attended 1 meeting and had an invoice.
advertising_agencies
SELECT T1.start_date_time , T1.end_date_time , T2.client_details , T4.staff_details FROM meetings AS T1 JOIN clients AS T2 ON T1.client_id = T2.client_id JOIN staff_in_meetings AS T3 ON T1.meeting_id = T3.meeting_id JOIN staff AS T4 ON T3.staff_id = T4.staff_id
List the start time, end time of each meeting, and the corresponding client detail and staff detail.
advertising_agencies
SELECT T1.start_date_time , T1.end_date_time , T2.client_details , T4.staff_details FROM meetings AS T1 JOIN clients AS T2 ON T1.client_id = T2.client_id JOIN staff_in_meetings AS T3 ON T1.meeting_id = T3.meeting_id JOIN staff AS T4 ON T3.staff_id = T4.staff_id
What are the start and end times of each meeting, as well as the corresponding client and staff details the attendees?