You are on page 1of 3

Technological Institute of the Philippines

938 Aurora Blvd. Cubao, Quezon City

College of Computer Studies

ITE 014 – Information Management

Midterm Period

Surname, Firstname Mi. Date:


Program / Section: Instructor: Ms. Roxanne A. Pagaduan
Assessment Task: Laboratory Activity No 5: Displaying Data from Multiple Tables

Instructions:
- Connect to the SQL Plus, SQL Developer, or SQL Live using a database account. Example:
ORA2_PDBRAP
- Analyze and perform the problems below and answer it to the best of your ability
- Include screenshots of your complete SQL Statements and the result/s.
- Include a brief description/caption of each image
- There must be your full name for each image (see example below)
- Save your work as SURNAME_Lab5.DOCX (Ex. Pagaduan_Lab5.DOCX).
- Each item corresponds to one (1) point, total points is 11.

Sample: Questions:

Question: Test your knowledge


Display all the departments' information.
1. Write a query for the HR department to
Answer: produce the addresses of all the
Query: departments. Use the LOCATIONS and
SQL> SELECT * COUNTRIES tables. Show the location
FROM departments; ID, street address, city, state or province,
and country in the output. Use a
Output: NATURAL JOIN to produce the results.

Answer:
Query:

Output:

2. The HR department needs a report of all


employees. Write a query to display the
last name, department number, and
department name for all employees.
Answer:
Query:

Output:

Output: 6. Create a report for the HR department


that displays employee last names,
3. The HR department needs a report of department numbers, and all the
employees in Toronto. Display the last employees who work in the same
name, job, department number, and department as a given employee. Give
department name for all employees who each column an appropriate label. Save
work in Toronto. the script to a file named lab_05_06.sql.

Answer: Answer:
Query: Query:

Output: Output:

4. Create a report to display employees’ 7. The HR department needs a report on


last name and employee number along job grades and salaries. To familiarize
with their manager’s last name and yourself with the JOB_GRADES table,
manager number. Label the columns first show the structure of the
Employee, Emp#, Manager, and Mgr#, JOB_GRADES table. Then create a
respectively. Place your SQL statement query that displays the name, job,
in a text file named department name, salary, and grade for
lab_05_04.sql all employees. (2 points)

Answer: Answer:
Query: Query:

Output: Output:

8. The HR department wants to determine


5. Modify lab_05_04.sql to display all the names of all employees who were
employees including King, who has no hired after Davies. Create a query to
manager. Order the results by the display the name and hire date of any
employee number. Place your SQL employee hired after employee Davies.
statement in a text file named
lab_05_05.sql. Run the query in Answer:
lab_05_05.sql. Query:

Answer:
Query:
Output:

9. The HR department needs to find the


names and hire dates for all employees
who were hired before their managers,
along with their managers’ names and
hire dates. Save the script to a file
named lab_05_09.sql.

Answer:
Query:

Output:

10. Create a report that shows the


organization chart for the entire
employee table. Write the report so that
each level will indent each employee 2
spaces. Use – (minus) symbol instead of
spaces in front of the column.

Answer:
Query:

Output:

Honor Pledge: "I affirm that we have not given


or received any unauthorized help on this
assignment and that this work is my own"

You might also like