Question: From the database above construct the following queries: 1) Retrieve first name, last name, and date of birth of all male employees with salary less

 From the database above construct the following queries: 1) Retrieve first

From the database above construct the following queries:

1) Retrieve first name, last name, and date of birth of all male employees with salary less than 35000.

SELECT first_name, last_name, date_of_birth FROM employees WHERE gender = 'male' AND salary

2) Retrieve project numbers and project locations of all projects that belong to the Administration department.

SELECT project_number, project_location FROM projects WHERE department = 'Administration';

3) Retrieve first name, last name, and SSN of all employees who work more than 10 hours on project 10.

SELECT first_name, last_name, SSN

FROM employees

WHERE project_id = 10 AND hours_worked > 10;

4) Retrieve name, date of birth, and relationship of all male dependents of employees who work for department 5.

SELECT name, date_of_birth, relationship FROM dependents WHERE gender = 'male' AND employee_id IN (SELECT employee_id FROM employees WHERE department_id = 5);

5) Retrieve first name, last name, date of birth, and salary of employees who manage departments with projects located in Houston.

SELECT first_name, last_name, date_of_birth, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments WHERE project_location = 'Houston' AND manager_id = employee_id);

PROBLEM

The queries have been constructed and I have all the tables in mqSQL database, but each time I run these queries I get the error "Error Code 1146. Table 'company.employees' doesen't exist". Please help!.

For example this query works:

/*Query 2. For every project located in Stafford, list project number, controlling department number, and department managers last name, address, and birth date.*/ SELECT p.pnumber, p.dnum, e.lname, e.address, e.bdate FROM project p, department d, employee e WHERE p.dnum = d.dnumber AND d.mgr_ssn = e.ssn AND p.plocation = 'Stafford';

name, last name, and date of birth of all male employees with

Denartment Dependent Dept_locations Employee Works_on \begin{tabular}{|l|l|l|l|l|l} & pnumber & dnum & Iname & address & bdate \\ \hline 10 & 4 & Wallace & 291 Berry, Bellaire, TX & 19110620 \\ & 30 & 4 & Wallace & 291 Berry, Bellaire, TX & 19110620 \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!