-- Database schema
| offices : officeCode [ TEXT ] primary_key , city [ TEXT ] , phone [ TEXT ] , addressLine1 [ TEXT ] , addressLine2 [ TEXT ] , state [ TEXT ] , country [ TEXT ] , postalCode [ TEXT ] , territory [ TEXT ] | employees : employeeNumber [ INTEGER ] primary_key , lastName [ TEXT ] , firstName [ TEXT ] , extension [ TEXT ] , email [ TEXT ] , officeCode [ TEXT ] employees.officeCode = offices.officeCode , reportsTo [ INTEGER ] employees.reportsTo = employees.employeeNumber , jobTitle [ TEXT ] | customers : customerNumber [ INTEGER ] primary_key , customerName [ TEXT ] , contactLastName [ TEXT ] , contactFirstName [ TEXT ] , phone [ TEXT ] , addressLine1 [ TEXT ] , addressLine2 [ TEXT ] , city [ TEXT ] , state [ TEXT ] , postalCode [ TEXT ] , country [ TEXT ] , salesRepEmployeeNumber [ INTEGER ] customers.salesRepEmployeeNumber = employees.employeeNumber , creditLimit [ REAL ] | orders : orderNumber [ INTEGER ] primary_key , orderDate [ DATE ] , requiredDate [ DATE ] , shippedDate [ DATE ] , status [ TEXT ] , comments [ TEXT ] , customerNumber [ INTEGER ] orders.customerNumber = customers.customerNumber | payments : customerNumber [ INTEGER ] payments.customerNumber = customers.customerNumber , checkNumber [ TEXT ] , paymentDate [ DATE ] , amount [ REAL ] | productlines : productLine [ TEXT ] primary_key , textDescription [ TEXT ] , htmlDescription [ TEXT ] , image [ BLOB ] | products : productCode [ TEXT ] primary_key , productName [ TEXT ] , productLine [ TEXT ] products.productLine = productlines.productLine , productScale [ TEXT ] , productVendor [ TEXT ] , productDescription [ TEXT ] , quantityInStock [ INTEGER ] , buyPrice [ REAL ] , MSRP [ REAL ] | orderdetails : orderNumber [ INTEGER ] , productCode [ TEXT ] , quantityOrdered [ INTEGER ] , priceEach [ REAL ] , orderLineNumber [ INTEGER ] |
-- -- State the email of those who are staff of Murphy Diane whose number is 1002 and living in San Francisco

SELECT T1.email FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T1.reportsTo = 1002 AND T2.city = 'San Francisco';