Академический Документы
Профессиональный Документы
Культура Документы
Y 2020-2021
“Weekly 11-19 only hnd ko kasama exam i-feedback niyo ko para
masend ko thru sa inyo “ happy answering!
Answer: False
Answer: False
Select one:
Select one:
Answer: DML
Update the Treasury department to Cash department. And this will be managed by the Manager
of Finance department.
Answer: UPDATE departments SET department_name = 'Procurement', manager_id = 100
WHERE department_name = 'Treasury'
Diana Lorentz was transferred to Administration department. Using the employees and
department table information update the profile of employee.
Answer: UPDATE employees SET manager_id = 200, department_id = 10 WHERE last_name
= 'Lorentz' AND first_name = 'Diana';
Add a 500 pesos increase in salary of all employees who have rendered services 10 years and
above.
Answer: UPDATE employees SET salary = salary + 500 where TO_CHAR(sysdate,'YYYY') -
TO_CHAR(hire_date,'YYYY') >= 10
Update the Purchasing department name to Procurement. And this will be managed by the
Manager of Administration department.
Answer: UPDATE departments SET department_name = 'Procurement', manager_id = 200
WHERE department_name = 'Purchasing'
Create a SQL command to add a new position Java Developer with job id of JAVA_DEV whose
salary ranges from 7,000 to 8,000.
Answer: INSERT INTO jobs VALUES ('JAVA_DEV', 'Java Developer', 7000, 8000)
Display all the employee id, names of employees ,job id and department nameof all
employees of the Finance Department.
Answer: SELECT A.first_name, A.last_name, A.job_id, B.department_name FROM
employees A JOIN departments B ON ( A.department_id = B.department_id)
WHERE B.department_name = 'Finance'
Create a SQL command to add a new position Database Administrator with job id of
DB_ADMIN whose salary ranges from 10,000 to 18,000.
Answer: INSERT INTO jobs VALUES ('DB_ADMIN', 'Database Administrator', 10000,
18000)
Employee id : 200
Name : Mr. Gary Park
Date hired : July 1, 2017
Position :IT Programmer
Salary : 10000
Department of assignment : 60
Reporting to manager : 103
Answer: INSERT INTO employees
(employee_id,first_name,last_name,hire_date,job_id,salary,manager_id,department
_id)
VALUES (200,'Gary','Park', TO_CHAR('Jul 1, 2017', 'MON DD, YYYY'), 'IT_PROG',
10000, 103, 60)
Display the location id of all employee's name and salary whose salary is from 5000 to 10000.
Answer: SELECT first_name, last_name, salary FROM employees JOIN departments
USING (department_id) WHERE salary >= 5000 AND salary <= 10000
A new department name Training with department id 300 was created in the company.
This will be managed by a Manager with ID of 203 and will located at location id 2400.
Which of the following DOES NOT describes the state of the data after the COMMIT command
Answer: None of the choices
Given the DEPARTMENTS table and USER user1, evaluate the SQL command:
GRANT select
ON user1
TO departments;
Answer: The SQL command is incorrect
TRUE OR FALSE.
A FOREIGN KEY is a field in one table that refers to the PRIMARY KEY in another table.
Answer: True
Which of the following will grant a query privileges on the STUDENT table
Answer: GRANT select ON student TO matt
A join between two tables that returns the results of the INNER join as well as the_______________
rows from the left (or right) table is called a left (or right) OUTER join.
Answer: Unmatched
A _______________ consists of a collection of DML statements that form a logical unit of work.
Answer: Transaction
Which of the following command will delete all records in the table employees
Answer: DELETE FROM employees
Which of the following will erase all records in the departments table
Answer: TRUNCATE TABLE departments
Angelica is the Oracle Database Administrator. She was been assigned to create an
access for the newly hired employee named Matt to the Oracle Database.
You want to cancel the privilege of matt to add records from the employees table.
Answer: REVOKE insert ON employees FROM matt;
Which of the following SQL command that the DBA will run to provide Matt to create a table in
the Oracle Database.
Answer: GRANT create table TO matt
TRUE OR FALSE.
Multiple fields in NOT allowed in a Foreign key.
Answer: False
These are privileges that performs a particular action within the database.
Answer: System Privileges
Nathaniel had accidentally deleted all the records in the newly updated ORACLE database
using the DELETE SQL command.
Answer: Run the ROLLBACK command
You want to cancel the privilege of matt to retrieve records from the employees table.
Answer: REVOKE select ON matt FROM employees;
This has the highest level of privileges for task such as creating new users, removing users and tables and
backing up tables.
Answer: DBA
A join between two tables that returns the results of an INNER join as well as the results of a
left and right join is
Answer: FULL OUTER JOIN
This is a type of cursor which is created and managed internally by the Oracle server to process
SQL statements
Answer: Implicit
You want to display all the records of employee the same with the salary employee number 103.
Answer: SELECT * FROM employees WHERE salary = (SELECT salary from employees where
employee_id= 103)
You have been tasked to update the database by creating a PL/SQL to increase the salary of all
IT Programmer employees by twice of their existing salary. Which of the following will execute
successfully?
Answer: DECLARE
v_job_id employees.job_id%TYPE := 'IT_PROG';
BEGIN
UPDATE employees SET salary = salary * 2 WHERE job_id = v_job_id;
END;
Which of the following PL/SQL that will display the total number employees whose salary is
10000 and above?
Answer: DECLARE
v_salary employees.salary%TYPE := 10000;
BEGIN
SELECT COUNT(*) INTO v_salary FROM employees WHERE salary >= v_salary;
DBMS_OUTPUT.PUT_LINE(v_salary);
END;
1. DECLARE
2. v_first_name VARCHAR2(50);
3. v_last_name VARCHAR2(50);
4. v_salary INTEGER(20);
5. BEGIN
6. SELECT first_name, last_name, salary INTO v_first_name, v_last_name, v_salary
FROM employees WHERE department_id = 60;
7. DBMS_OUTPUT.PUT_LINE('Firstname : '|| v_first_name);
8. DBMS_OUTPUT.PUT_LINE('Lastname : '|| v_last_name);
9. DBMS_OUTPUT.PUT_LINE('Salary : '|| v_salary);
10. END;
Answer: Error in Line 6.
Actions are being performed when error occurs during PL/SQL execution in the
Answer: EXCEPTION
You have been tasked to update the database by creating a PL/SQL to increase the
salary of all IT Programmer employees by 50% of their existing salary.
1 DECLARE
2 v_employee_id employees.employee_id%TYPE := 114;
3 BEGIN
4 DELETE employees WHERE employee_id = v_employee_id;
5 END;
Answer: The PL/SQL will delete employee number 114.
What is the error trapping function that returns the numeric value of the error code?
Answer: SQLCODE
You can use this procedure to issue user-defined error messages from stored subprograms.
Answer: RAISE_APPLICATION_ERROR
What is the exception name when single row SELECT returned no data.
Answer: NO_DATA_FOUND
RAISE_APPLICATION_ERROR is used in two different places. These are ___________________.
Answer: Executable and exceptions section
You can trap any error by including a corresponding handler within the exception-handling