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

  • Good Essays

    Lab 5 deals with writing queries using multiple tables as covered in the reading and lecture material this week. In some cases, you will be given the option to write a query using either the TRADITIONAL method of joining tables or using the JOIN key word. In some cases, you will be asked to use a specific approach. Using the incorrect process when the process is specified will result in points being taken off for that problem.…

    • 1559 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    Part 1 1. Write a script which will Create the needed tables as follows: a. Table name : DEPT i. Column datatype Mandatory? PK? FK?…

    • 1169 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    2. SELECT e.ename, e.deptno, d.dname, d.deptno FROM emp e LEFT OUTER JOIN dept d ON e.deptno = d.deptno ORDER BY e.deptno, e.ename; SQL> SELECT e.ename, e.deptno, d.dname, d.deptno 2 FROM emp e 3 LEFT OUTER JOIN dept d 4 ON e.deptno = d.deptno 5 ORDER BY e.deptno, e.ename; ENAME DEPTNO DNAME DEPTNO ---------- ----------…

    • 1542 Words
    • 7 Pages
    Good Essays
  • Good Essays

    Kudler Fine Food Week 4

    • 284 Words
    • 2 Pages

    Note: Select all of the data from both of your tables before you perform the following.…

    • 284 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    cis3730_Exam1_Studyguide

    • 512 Words
    • 2 Pages

    You will be asked to write SQL scripts to display required information, like we did in the homework.…

    • 512 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    When you include multiple data sources in a query, you use joins to limit the records that you want to see, based on how the data sources are related to each other. You also use joins to combine records from both data sources, so that each pair of records from the sources becomes one record in the query results. I think that a cross-join would be optimized in the library, so that less data was sent over the network and then merged, so that data didn 't need to be combined.…

    • 337 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Structured Query Language (SQL) is a standard database computer language used for querying, modifying and managing data in Relational Database Management Systems (RDBMS). SQL was developed in the 1970's by IBM to initially manipulate and retrieve data in IBM System R. The SQL language was standardized in 1986 by the American National Standards Institute (ANSI); however, later releases were released as International Organization for Standardization (ISO) standards.…

    • 612 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    unit 6

    • 360 Words
    • 2 Pages

    6) The * in SELECT * clause of an SQL statement is a wildcard for returning all columns in a table.…

    • 360 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Assignment Homework

    • 1073 Words
    • 5 Pages

    2. Write queries that performs a join, a subquery, a correlated subquery using the student, enrollment, grade, and zipcode tables. Execute each query to show that it produces the same results. (15 pts)…

    • 1073 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    Write an SQL statement to display all of the columns using the SQL asterisk (*)…

    • 314 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    SQL Queries

    • 423 Words
    • 2 Pages

    Query 3: Find the names and ID's of all faculty members, sorted in reverse alphabetical order by name. The result should be a two column table (SELECT should only be two in order for the table to be 2 columns)…

    • 423 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Instructions HW1

    • 1434 Words
    • 7 Pages

    Write the following queries in SQL. Each of your answers must be a single SQL query. Your SQL queries…

    • 1434 Words
    • 7 Pages
    Better Essays
  • Satisfactory Essays

    Discussion Board

    • 460 Words
    • 2 Pages

    I need to complete this assignment but I am having a hard time understanding it. Can someone give me some pointers on what to write on the DB? I just need a guide to start off with.…

    • 460 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Detailed Design Report

    • 340 Words
    • 2 Pages

    | Unique username of the users that is a combination of letters and numbers only…

    • 340 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Database Sql

    • 755 Words
    • 4 Pages

    Let us see some simple queries and use of select clause to express them in SQL.…

    • 755 Words
    • 4 Pages
    Good Essays

Related Topics