Preview

Pos 410 Week Dq

Powerful Essays
Open Document
Open Document
703 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Pos 410 Week Dq
POS 410 Week 3 –
/****************************************************************
* Week Three Individual Assignment * Date: September, 20, 2011 ****************************************************************/

* 3.3 Write a SQL query that joins two tables in the example database and uses BETWEEN * to restrict record selection. (Use salary to restrict the data.) */ SELECT e.Last_name, e.First_name, e.Wage, j.Job_title, j.EEO_1_Classification
FROM Employee e
JOIN Job_title j ON e.Job_title = j.Job_title
WHERE e.Wage BETWEEN 30000 AND 60000;

GO /* * 3.4 Write a SQL query that joins two tables in the example database and uses BETWEEN * to restrict record selection. (Use hire dates to restrict the data.) */ SELECT e.Last_name, e.First_name, e.Hire_date, j.Job_title, j.EEO_1_Classification
FROM Employee e
JOIN Job_title j ON e.Job_title = j.Job_title
WHERE e.Hire_date BETWEEN '1-JAN-2000' AND '1-JAN-2003';

GO

/* * 3.5 Write a SQL query that joins two tables in the example database and uses LIKE * to restrict record selection. (Use telephone area codes to restrict data.) */ SELECT e.Last_name, e.First_name, e.Telephone_area_code, j.Job_title, j.EEO_1_Classification
FROM Employee e
JOIN Job_title j ON e.Job_title = j.Job_title
WHERE e.Telephone_area_code LIKE '7%';

GO

/* * 3.6 Write a SQL query that joins two tables in the example database and uses LIKE * to restrict record selection. (Use age to find all people in their 20¡¯s.) */

SELECT e.Last_name, e.First_name, e.Age, j.Job_title, j.EEO_1_Classification
FROM Employee e
JOIN Job_title j ON e.Job_title = j.Job_title
WHERE e.Age LIKE '2%';

GO

/* * 3.7 Write a SQL query that uses UNION of the two tables. Be creative. * Select the employees in 20's or 30's */ SELECT Last_name, First_name, Age
FROM Employee
WHERE Age LIKE '2%'
UNION
SELECT Last_name, First_name, Age
FROM

You May Also Find These Documents Helpful

Related Topics