Practice 1 solutions part 1 1 initiate an i sqlplus

This preview shows page 5 - 8 out of 28 pages.

Practice 1: Solutions Part 1 1. Initiate an i SQL*Plus session using the user ID and password that are provided by the instructor. 2. i SQL*Plus commands access the database. True/ False 3. The following SELECT statement executes successfully: SELECT last_name, job_id, salary AS Sal FROM employees;
True /False 4. The following SELECT statement executes successfully: SELECT *
5. There are four coding errors in this statement. Can you identify them?
Part 2 You have been hired as a SQL programmer for Acme Corporation. Your first task is to create some reports based on data from the Human Resources tables. 6. Your first task is to determine the structure of the DEPARTMENTS table and its contents.
7. You need to determine the structure of the EMPLOYEES table. DESCRIBE employees The HR department wants a query to display the last name, job code, hire date, and employee number for each employee, with employee number appearing first. Provide an alias STARTDATE for the HIRE_DATE column. Save your SQL statement to a file named lab_01_07.sql so that you can dispatch this file to the HR department.
8. Test your query in the file lab_01_07.sql to ensure that it runs correctly.
9. The HR department needs a query to display all unique job codes from the EMPLOYEES table.
6
INF3707/102 FROM employees; Part 3 If you have time, complete the following exercises: 10. The HR department wants more descriptive column headings for its report on employees. Copy the statement from lab_01_07.sql to the iSQL*Plus Edit window. Name the column headings Emp #, Employee, Job, and Hire Date, respectively. Then run your query again.
7

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture