What is the id and name of the department store that has both marketing and managing department?
CREATE TABLE department_stores (dept_store_id VARCHAR, store_name VARCHAR); CREATE TABLE departments (dept_store_id VARCHAR, department_name VARCHAR)
SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = "marketing" INTERSECT SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = "managing"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE department_stores (dept_store_id VARCHAR, store_name VARCHAR); CREATE TABLE departments (dept_store_id VARCHAR, department_name VARCHAR) Question: What is the id and name of the department store that has both marketing and managing department? [/INST] SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = "marketing" INTERSECT SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = "managing" </s>