Preview

Week 1 Submission

Good Essays
Open Document
Open Document
1120 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Week 1 Submission
Homework (100 points)
Part 1
Create the tables from demo.sql script
Download and
Copy the demo.sql file from the Doc Share to the C:\temp directory. At the sql prompt enter the command @V:\temp\demo.sql. This will create some tables and insert data into them. View the script in notepad to determine the table names that were created. Use the describe command to view the structure of the tables. Please use the template below to provide your solutions.
Write SQL statements to solve the following requests. Question (4 pts per question) | SQL statement or answer | 1. List all employee information in department 30. | SELECT * FROM emp WHERE deptno = 30; | 2. List employees name, job, and salary that is a manager and has a salary > $1,000 | SELECT ename,job,sal FROM emp WHERE sal > 1000 AND job = 'MANAGER'; | 3. Repeat exercise 2 for any employee that is not a manager or earns a salary > $1,000 | SELECT ename,job,sal FROM emp WHERE sal > 1000 AND job != 'MANAGER'; | 4. Show all employee names and salary that earn between $1,000 anod $2,000. Use the between operator. | SELECT ename,sal FROM emp WHERE sal between 1000 and 2000; | 5. Select all employees that are in department 10 and 30. Use the IN operator. | SELECT * FROM EMP WHERE DEPTNO IN (10,30); | 6. Select all employee names with an “A” in the first position of the employee name. Use the substring function or a wild card. | SELECT * FROM EMP WHERE ENAME LIKE 'A%'; | 7. Select all employees with an “A” as the second character of their name. Use a wildcard. | SELECT * FROM EMP WHERE ENAME LIKE 'A%'; | 8. List the employee names in alphabetical sequence. | SELECT ENAME FROM EMP ORDER BY ENAME ASC; | 9. List the job, salary, and employee name in job order and then salary in descending order. | SELECT job,sal,ename FROM emp ORDER BY JOB,SAL DESC; | 10. Show a list of different jobs. Eliminate repeating values. | SELECT DISTINCT

You May Also Find These Documents Helpful

  • Good Essays

    This file of MGT 496 Week 5 Discussion Question 1 Warehouse Manager Position comprises: Assume you are searching for a position as a warehouse manager. Go to one of the major job-search websites (e.g. Monster.com, CareerBuilder.com) and look for positions that match…

    • 383 Words
    • 2 Pages
    Good Essays
  • Good Essays

    SET ServerOutput on > By default, SQL*Plus doesn’t display output from PL/SQL, execute this command can unblock this function…

    • 193 Words
    • 1 Page
    Good Essays
  • Satisfactory Essays

    Hiredate DATE No No Job VARCHAR2(15) No No Mgrno number(4) no no yes ( to emp.empno) Salary number(8,2) no no Comm number(8,2) no no Deptno number(2) no no yes ( to…

    • 1169 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    i. List the customer number, last name, first name, and balance of every customer, sort by balance in descending order, and last name in ascending order.…

    • 2322 Words
    • 10 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
  • Satisfactory Essays

    HRM 300 Week 3 DQ 1

    • 429 Words
    • 3 Pages

    Employee selection methods introduced in Chapter 7 of our text include applications, employment tests, interviews, background investigations, and medical or physical examinations.…

    • 429 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    b. The probability the selected employee is either a production worker or supervisor is 0.97, found by (57/100) + (40/100).…

    • 265 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Team Strategy Plan

    • 557 Words
    • 3 Pages

    |Create employee groups to be separately |Employees who work well together, who are |Avoid employees that cause division. |…

    • 557 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Hrm 590 Recruitment Plan

    • 467 Words
    • 2 Pages

    3. Current employees – I will ask department heads to identify employees who will be a good fit for the HR receptionist position based on KSA to fill the position, with the desired qualifications and experience needed. This method of recruitment will save the organization from searching, spending time Onboarding and mentoring employees as the employee will already have some basic knowledge of the organization’s culture and values.…

    • 467 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    cheat sheet

    • 1430 Words
    • 6 Pages

    3. Find all employees who live in the same city and street as their manager (3 pts)…

    • 1430 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    6) The names of the positions in a corporation, such as chief operating officer or controller, are examples of what level of measurement?…

    • 326 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    G22 health and safety

    • 266 Words
    • 2 Pages

    c. Detail the lists and reports available within the workplace, and state the information they give…

    • 266 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Workforce Planning

    • 640 Words
    • 3 Pages

    b. How would you identify desirable workers who can be developed and retained to fill key positions that might become vacant within the organisation? You do not have to limit your ideas to those provided in the text. Why do you think your method of identifying desirable workers would be…

    • 640 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    P2P Cycle

    • 542 Words
    • 3 Pages

    If the person is not registered yet, you must register new employee first, but if the person is already in the system, just query the person’s name…

    • 542 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    ACL in practice

    • 1275 Words
    • 6 Pages

    Tasks: View the employee data project. Get a statistical picture. Check for duplicate employee records.…

    • 1275 Words
    • 6 Pages
    Powerful Essays

Related Topics