List from which date and to which date these staff work: project staff of the project which hires the most staffs
CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, project_id VARCHAR, role_code VARCHAR)
SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT TOP 1 project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader'
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, project_id VARCHAR, role_code VARCHAR) Question: List from which date and to which date these staff work: project staff of the project which hires the most staffs [/INST] SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT TOP 1 project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader' </s>