query_id
int64
0
2.15k
database_id
stringclasses
40 values
table_id
sequencelengths
1
4
query
stringlengths
22
185
answer
stringlengths
22
608
difficulty
stringclasses
4 values
2,100
advertising_agencies
[ "meetings" ]
What are all meeting types and other details?
SELECT meeting_type , other_details FROM meetings
medium
2,101
advertising_agencies
[ "meetings" ]
Show all meeting outcomes and purposes.
SELECT meeting_outcome , purpose_of_meeting FROM meetings
medium
2,102
advertising_agencies
[ "meetings" ]
What are all meeting outcomes and purposes?
SELECT meeting_outcome , purpose_of_meeting FROM meetings
medium
2,103
advertising_agencies
[ "Invoices", "Payments" ]
Show all payment ids and details for invoices whose status is 'Working'.
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'
medium
2,104
advertising_agencies
[ "Invoices", "Payments" ]
What are all payment ids and payment details for invoices with status Working?
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'
medium
2,105
advertising_agencies
[ "Payments", "Invoices" ]
Show all invoice ids and statuses without a payment.
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
extra
2,106
advertising_agencies
[ "Payments", "Invoices" ]
What are the invoice ids and statuses for invoices without a payment?
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
extra
2,107
advertising_agencies
[ "Payments" ]
How many payments do we have?
SELECT count(*) FROM Payments
easy
2,108
advertising_agencies
[ "Payments" ]
Count the number of payments.
SELECT count(*) FROM Payments
easy
2,109
advertising_agencies
[ "Payments" ]
List all payment ids and its corresponding invoice ids and details.
SELECT payment_id , invoice_id , payment_details FROM Payments
medium
2,110
advertising_agencies
[ "Payments" ]
What are the payment ids, invoice ids, and payment details for all payments?
SELECT payment_id , invoice_id , payment_details FROM Payments
medium
2,111
advertising_agencies
[ "Payments", "Invoices" ]
Show all the different invoice ids and statuses of the payments
SELECT DISTINCT T1.invoice_id , T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id = T2.invoice_id
medium
2,112
advertising_agencies
[ "Payments", "Invoices" ]
What are the distinct invoice ids and statuses for all payments?
SELECT DISTINCT T1.invoice_id , T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id = T2.invoice_id
medium
2,113
advertising_agencies
[ "Payments" ]
Show all invoice ids and the number of payments for each invoice.
SELECT invoice_id , count(*) FROM Payments GROUP BY invoice_id
medium
2,114
advertising_agencies
[ "Payments" ]
How many payments are there for each invoice?
SELECT invoice_id , count(*) FROM Payments GROUP BY invoice_id
medium
2,115
advertising_agencies
[ "Invoices", "Payments" ]
What is the invoice id, status code, and details for the invoice with most number of payments.
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
extra
2,116
advertising_agencies
[ "Invoices", "Payments" ]
Return the invoice ids, statuses, and details for invoices with the most payments?
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
extra
2,117
advertising_agencies
[ "Staff" ]
How many staff do we have?
SELECT count(*) FROM Staff
easy
2,118
advertising_agencies
[ "Staff" ]
Count the number of staff.
SELECT count(*) FROM Staff
easy
2,119
advertising_agencies
[ "Staff" ]
Show the agency ids and the number of staff in each agent?
SELECT agency_id , count(*) FROM Staff GROUP BY agency_id
medium
2,120
advertising_agencies
[ "Staff" ]
Return the agency ids and number of staff in each.
SELECT agency_id , count(*) FROM Staff GROUP BY agency_id
medium
2,121
advertising_agencies
[ "Agencies", "Staff" ]
What is the agent id and details for the agency with most staff?
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
extra
2,122
advertising_agencies
[ "Agencies", "Staff" ]
Return the id and detail for the agency with the most staff.
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
extra
2,123
advertising_agencies
[ "Meetings" ]
Show meeting outcome codes and the number of meeting in each outcome.
SELECT meeting_outcome , count(*) FROM Meetings GROUP BY meeting_outcome
medium
2,124
advertising_agencies
[ "Meetings" ]
How many meetings had each meeting outcome?
SELECT meeting_outcome , count(*) FROM Meetings GROUP BY meeting_outcome
medium
2,125
advertising_agencies
[ "Meetings" ]
List the client ids and the number of meeting for each client.
SELECT client_id , count(*) FROM Meetings GROUP BY client_id
medium
2,126
advertising_agencies
[ "Meetings" ]
How many meetings are there for each client id?
SELECT client_id , count(*) FROM Meetings GROUP BY client_id
medium
2,127
advertising_agencies
[ "Meetings" ]
Show the meeting type codes and the number of meeting for each client.
SELECT meeting_type , count(*) FROM Meetings GROUP BY meeting_type
medium
2,128
advertising_agencies
[ "Meetings" ]
How many meetings are there for each meeting type?
SELECT meeting_type , count(*) FROM Meetings GROUP BY meeting_type
medium
2,129
advertising_agencies
[ "meetings", "clients" ]
Show all meeting ids, meeting outcomes, meeting types and the details of the client atttending it.
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
medium
2,130
advertising_agencies
[ "meetings", "clients" ]
What are the meeting ids, meeting outcomes, meeting types, and client details for all meetings?
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
medium
2,131
advertising_agencies
[ "Staff_in_meetings" ]
Show the meeting ids and the number of staff in each meeting.
SELECT meeting_id , count(*) FROM Staff_in_meetings GROUP BY meeting_id
medium
2,132
advertising_agencies
[ "Staff_in_meetings" ]
Count the number of staff in each meeting by meeting id.
SELECT meeting_id , count(*) FROM Staff_in_meetings GROUP BY meeting_id
medium
2,133
advertising_agencies
[ "Staff_in_meetings" ]
Show the staff id and the number of meetings attended by the staff who attended some meeting but had the lowest attendance.
SELECT staff_id , count(*) FROM Staff_in_meetings GROUP BY staff_id ORDER BY count(*) ASC LIMIT 1;
hard
2,134
advertising_agencies
[ "Staff_in_meetings" ]
What is the staff id of the staff who attended the least meetings but attended some meeting?
SELECT staff_id , count(*) FROM Staff_in_meetings GROUP BY staff_id ORDER BY count(*) ASC LIMIT 1;
hard
2,135
advertising_agencies
[ "Staff_in_meetings" ]
How many staff have attended a meeting?
SELECT count(DISTINCT staff_id) FROM Staff_in_meetings
easy
2,136
advertising_agencies
[ "Staff_in_meetings" ]
Return the number of distinct staff who have attended a meeting?
SELECT count(DISTINCT staff_id) FROM Staff_in_meetings
easy
2,137
advertising_agencies
[ "Staff", "Staff_in_meetings" ]
How many staff did not attend any meeting?
SELECT count(*) FROM Staff WHERE staff_id NOT IN ( SELECT staff_id FROM Staff_in_meetings )
extra
2,138
advertising_agencies
[ "Staff", "Staff_in_meetings" ]
Count the number of staff who did not attend any meeting.
SELECT count(*) FROM Staff WHERE staff_id NOT IN ( SELECT staff_id FROM Staff_in_meetings )
extra
2,139
advertising_agencies
[ "Clients", "invoices", "meetings" ]
What are the ids and details of the clients who have attended any meeting or have any invoice?
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
extra
2,140
advertising_agencies
[ "Clients", "invoices", "meetings" ]
Return the ids and details of clients who have attended a meeting or had an invoice.
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
extra
2,141
advertising_agencies
[ "staff" ]
What are the ids and details of the staff who have attended at least 1 meetings and have the detail with letter 's'?
SELECT staff_id , staff_details FROM staff WHERE staff_details LIKE "%s%" GROUP BY staff_id HAVING count(*) >= 1
hard
2,142
advertising_agencies
[ "staff" ]
Return the ids and details of staff who have attended at least 1 meeting and have an s in their staff details?
SELECT staff_id , staff_details FROM staff WHERE staff_details LIKE "%s%" GROUP BY staff_id HAVING count(*) >= 1
hard
2,143
advertising_agencies
[ "meetings", "invoices", "clients" ]
What are the id, sic code and agency id of the client who has attended 1 meeting and has any invoice.
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
extra
2,144
advertising_agencies
[ "meetings", "invoices", "clients" ]
Return the ids, sic codes, and agency ids of clients who have attended 1 meeting and had an invoice.
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
extra
2,145
advertising_agencies
[ "meetings", "staff_in_meetings", "clients", "staff" ]
List the start time, end time of each meeting, and the corresponding client detail and staff detail.
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
hard
2,146
advertising_agencies
[ "meetings", "staff_in_meetings", "clients", "staff" ]
What are the start and end times of each meeting, as well as the corresponding client and staff details the attendees?
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
hard