Oracle Data Base
Oracle Data Base
Oracle Data Base
Started on
State
Finished
Completed on
Time taken
4 mins 57 secs
Grade
14.00 out of 14.00 (100%)
Question 1
Complete
Flag question
Question text
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.
Select one:
b. INSERT FROM jobs SET job_id = 'DB_ADMIN', job_title= 'Database Administrator', min_salary = 10000,
max_salary=18000
Question 2
Complete
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. The statement is incorrect. Only users of the database can be created by the Database Administrator.
b. The statement is incorrect. DBA can only create users and tables. Removal of users and tables will be
done by the higher authority of the database.
Question 3
Complete
Flag question
Question text
Actions are being performed when error occurs during PL/SQL execution in the
Select one:
a. EXCEPTION
b. ERROR HANDLING
c. FUNCTION
d. BEGIN section
Question 4
Complete
Flag question
Question text
Create an SQL command to display the name of the parts, warehouse number, price and the available
stock on hand whose price is below 500. Arrange the list by warehouse number and by class.
Select one:
a. SELECT partnum, description, warehouse, onhand, price WHERE price < 500 ORDER BY warehouse,
class FROM parts
b. SELECT partnum, description, warehouse, onhand, price FROM parts WHERE price < 500 ORDER BY
warehouse, class;
c. SELECT partnum, description, warehouse, onhand, price FROM parts ORDER BY warehouse, class
WHERE price < 500;
d. SELECT partnum, description, warehouse, onhand, price FROM parts ORDER BY warehouse, class
WHERE 500 < price;
e. SELECT partnum, description, warehouse, onhand, price ORDER BY warehouse, class ORDER BY
warehouse, class FROM parts WHERE price < 500
Question 5
Complete
Flag question
Question text
Select one:
a. Oracle SQL Developer; SQL command line
Question 6
Complete
Flag question
Question text
Actions are being performed when error occurs during PL/SQL execution in the
Select one:
a. BEGIN section
b. FUNCTION
c. ERROR HANDLING
d. EXCEPTION
Question 7
Complete
Flag question
Question text
A _______________ consists of a collection of DML statements that form a logical unit of work.
Select one:
a. Transaction
b. SQL command
c. Database
Question 8
Complete
Question text
Display employee id, lastname, firstname, department name, annual salary, location id of employees
whose location id is 1700 and working in Finance Department. Label the annual salary to ANNUAL
SALARY.
Select one:
FROM employees E
FROM employees E
FROM employees E
FROM employees E
Question 9
Complete
Flag question
Question text
Select one:
a. DISPLAY TABLE
b. DISPLAY
c. DISPLAY STRUCTURE
d. DESCRIBE
Question 10
Complete
Flag question
Question text
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.
Select one:
Question 1
Answer saved
Flag question
Question text
Display part number description and warehouse number whose part number starts with letter K.
Select one:
a. SELECT partnum, description, warehouse FROM parts WHERE partnum LIKE 'K%';
b. SELECT partnumber, description, warehouse FROM parts WHERE partnum = LIKE ‘K%’;
c. SELECT partnumber, description, warehouse FROM parts WHERE partnum LIKE 'K*';
d. SELECT * FROM parts WHERE partnum LIKE 'K_';
e. SELECT partnum, description, warehouse FROM parts WHERE partnum LIKE '*K*';
g. SELECT partnum, description, warehouse FROM parts WHERE partnum = LIKE ‘K%’;
Display all the records sorted by price from most expensive to the cheapest parts.
Select one:
Display all the records whose stock is below 20 and in warehouse number 3.
Select one:
Employee id :250
Position :Accountant
Salary : 10000
Select one:
Select one:
b. SELECT location_id FROM departments WHERE location_id BETWEEN 1000 AND 2000
Display all employees id and remainder of the his/her salary after it is divided by 3,000 for all employees
with the job id of IT_PROG.
Select one:
a. SELECT employee_id, job_id, salary, salary/3000 FROM employees WHERE job_id = 'IT_PROG'
b. SELECT employee_id, job_id, salary, MOD(salary, 3000) FROM employees WHERE job_id = 'IT_PROG'
c. SELECT employee_id, job_id, salary, REM(salary/3000) FROM employees WHERE job_id = 'IT_PROG'
d. SELECT employee_id, job_id, salary FROM employees WHERE job_id = 'IT_PROG' AND salary/3000
e. SELECT employee_id, job_id, salary FROM employees WHERE job_id = 'IT_PROG' AND MOD(salary,
3000)
Diana Lorentz was transferred to Administration department. Using the employees and department
table information update the profile of employee.
Select one:
a. UPDATE FROM employees SET manager_id = 200, department_id = 10 WHERE last_name = 'Lorentz'
AND first_name = 'Diana';
b. UPDATE FROM employees SET manager_id = 200, SET department_id = 10 WHERE last_name =
'Lorentz' AND first_name = 'Diana';
c. UPDATE employees SET manager_id = 200, SET department_id = 10 WHERE last_name = 'Lorentz' AND
first_name = 'Diana';
d. UPDATE employees SET manager_id = 200, department_id = 10 WHERE last_name = 'Lorentz' AND
first_name = 'Diana';
Display all the employee's id and salary whose annual salary is from 100,000 to 200,000. Arrange the
output by salary in descending order.
Select one:
a. SELECT employee_id, salary, salary *12 FROM employees WHERE 12* salary = 100000 AND 12 *salary
= 200000 ORDER BY salary
b. SELECT employee_id, salary FROM employees WHERE salary >= 100000 AND salary <= 200000 ORDER
BY salary
c. SELECT employee_id, salary FROM employees WHERE salary *12 >= 100000 AND salary *12 <= 200000
ORDER BY salary desc
d. SELECT employee_id, salary FROM employees WHERE salary *12 >= 100000 AND salary *12 <=
200000 ORDER BY salary
Display the employee id and the last name of every employee in the company whose salary is between
5000 to 10000. Display the output in a single column with the format 100 : King Label the column as
Employee
Select one:
c. SELECT CONCAT(employee_id, ':', last_name) AS Employee, salary FROM employees WHERE salary
BETWEEN 5000 TO 10000
Display all the records in the employee table. Arrange the output in by lastname from A-Z order.
Select one:
a. SELECT * FROM employees ORDER BY lastname
Display a summary table of the total quantity on hand above 50 very class per warehouse
Select one:
a. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouseWHERE SUM(ONHAND) >
50
b. SELECT warehouse, class, sum(onhand) FROM parts GROUP BY warehouse HAVING SUM(ONHAND) >
50
Display employee's name and id whose firstname starts with letter D and job id is SA_REP. Sort the
output by department.
Select one:
d. SELECT employees FROM employee_id, first_name, last_name WHERE first_name LIKE ‘D%’ and
job_id = ‘IT_PROG’ ORDER BY department_id
e. SELECT employee_id, first_name, last_name FROM employees WHERE first_name LIKE 'D%' and
job_id = 'IT_PROG' ORDER BY department_id
Display employee's name and id whose firstname starts with letter D and job id is IT_PROG.
Select one:
a. SELECT employee_id, first_name, last_name FROM employees WHERE first_name LIKE 'D%' and
job_id = 'IT_PROG' ORDER BY department_id
b. SELECT employees FROM employee_id, first_name, last_name WHERE first_name LIKE ‘D%’ and
job_id = ‘IT_PROG’ ORDER BY department_id
Display all the employee id, names of employees , job id, hiring_date and department name of all
employees of the IT Department
Select one:
Diana Lorentz was transferred to Administration department. Using the employees and department
table information update the profile of employee.
Select one:
a. UPDATE employees SET manager_id = 200, department_id = 10 WHERE last_name = 'Lorentz' AND
first_name = 'Diana';
b. UPDATE FROM employees SET manager_id = 200, SET department_id = 10 WHERE last_name =
'Lorentz' AND first_name = 'Diana';
c. UPDATE FROM employees SET manager_id = 200, department_id = 10 WHERE last_name = 'Lorentz'
AND first_name = 'Diana';
d. UPDATE employees SET manager_id = 200, SET department_id = 10 WHERE last_name = 'Lorentz'
AND first_name = 'Diana';
Clear my choice
Create a SQL script to display the fullname of evey employee with the format Lastname, Firstname
example Santos, Arnold. Display the output in a single column. Label the column as Fullname
Select one:
Error! Not a valid embedded object.a. SELECT CONCAT(last_name, first_name) AS Fullname FROM
employees;
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.
Select one:
a. INSERT FROM jobs SET jobs_id = ‘JAVA_DEV’, job_title = ‘Java Developer’ , min_salary =7000 ,
max_salary= 8000
b. INSERT FROM jobs(jobs_id, job_title, min_salary, max_salary) VALUES ('JAVA_DEV', 'Java Developer',
7000, 8000)
Employee id : 200
Department of assignment : 60
Select one:
VALUES (200,'Gary','Park',TO_DATE('Jul 1, 2017', 'MON DD, YYYY'), 'IT_PROG', 10000, 103, 60)
VALUES (200,'Gary','Park', TO_CHAR('Jul 1, 2017', 'MON DD, YYYY'), 'IT_PROG', 10000, 103, 60)
VALUES (200,'Gary','Park', TO_CHAR('Jul 1, 2017', 'MON DD, YYYY'), 'IT_PROG', 10000, 103, 60)
VALUES (200,'Gary','Park',TO_DATE('Jul 1, 2017', 'MON DD, YYYY'), 'IT_PROG', 10000, 103, 60)
Display all the employee id, names of employees ,job id and department nameof all employees of the
Finance Department.
Select one:
Started on
State
Finished
Completed on
Time taken
9 mins 26 secs
Marks
20.00/20.00
Grade
Question 1
Complete
Flag question
Question text
1 DECLARE
3 BEGIN
5 END;
Select one:
Question 2
Complete
Flag question
Question text
Select one:
c. The SQL command will display employees with department id 60 and 70.
Complete
Flag question
Question text
DECLARE
v_amount accumulator;
v_num1 NUMBER;
v_num2 NUMBER;
v_num3 NUMBER;
BEGIN
v_amount := 10.50;
v_num1 := 1;
v_num2 := 2;
v_num3 := 3;
v_num1 := v_amount;
END;
Select one:
a. 18
c. 8.5
d. -1
Question 4
Complete
Flag question
Question text
Select one:
Question 5
Complete
Flag question
Question text
Evaluate the following PL/SQL. At what line number is the error of the PL/SQL?
DECLARE
e_invalid EXCEPTION;
BEGIN
END IF;
COMMIT;
EXCEPTION
END;
Select one:
a. 8
b. 2
c. 12
d. 7
e. 3
Question 6
Complete
Flag question
Question text
SELECT employee_id, salary from employees where salary = ANY (SELECT salary FROM employees
WHERE job_id = 'IT_PROG') AND job_id = 'ST_CLERK'
Select one:
b. This will return an error. Employees table can not be used in the subquery if it used in the main query.
Question 7
Complete
Flag question
Question text
SELECT employee_id, job_id, salary from employees where salary < ALL (SELECT salary FROM employees
WHERE job_id = 'FI_ACCOUNT') AND job_id = 'IT_PROG'
Select one:
Question 8
Complete
Flag question
Question text
Every employee will get a bonus of 150% of his/her current salary. Display the employee id, salary and
the bonus of every employee. Label the computed bonus with Bonus
Select one:
Question 9
Complete
Flag question
Question text
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;
10. END;
Select one:
a. No Error.
c. Error in Line 6.
Question 10
Complete
Mark 1.00 out of 1.00
Flag question
Question text
1 DECLARE
3 BEGIN
5 END;
Select one:
Question 11
Complete
Flag question
Question text
DECLARE
v_first_name VARCHAR2(50);
v_last_name VARCHAR2(50);
v_salary INTEGER(20);
BEGIN
SELECT first_name, last_name, salary INTO v_first_name, v_last_name, v_salary FROM employees
WHERE department_id = 60;
END;
Select one:
d. No Error.
Question 12
Complete
Flag question
Question text
DECLARE
v_email VARCHAR(20);
BEGIN
SELECT email INTO v_email FROM EMPLOYEES WHERE email like 'D%';
|| v_email);
EXCEPTION
END;
Select one:
Question 13
Complete
Flag question
Question text
DECLARE
v_email VARCHAR(20);
BEGIN
SELECT email INTO v_email FROM EMPLOYEES WHERE email like 'D%';
DBMS_OUTPUT.PUT_LINE ('Employees whose email address starts with letter D :'
|| v_email);
EXCEPTION
END;
Select one:
Question 14
Complete
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
b. The SQL will display the employee id, department id and the minimum and maximum salary whose
salary is between 10000 and 20000.
Question 15
Complete
Flag question
Question text
Select one:
a. The SQL will return an error. Main query should interchanged with the sub query.
Question 16
Complete
Flag question
Question text
Evaluate the following PL/SQL. Which of the following will line creates an error?
p_department_id IN employees.department_id%TYPE,
IS
BEGIN
FROM employees
END query_emp;
Select one:
a. Line 3
b. Line 1
c. Line 11
d. Line 5
e. No error
f. Line 9
Question 17
Complete
Flag question
Question text
WHERE condition;
Select one:
d. Correct syntax.
Question 18
Complete
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
c. The SQL command should have ALIAS for the table to produce a correct output.
Question 19
Complete
Flag question
Question text
Given the answer in item __________, which of the folllowing stored procedure will display the
employee id and salary of Steven King?
Select one:
a. DECLARE
BEGIN
END;
b. DECLARE
BEGIN
END;
c. DECLARE
v_employee_id employees.employee_id%TYPE;
v_emp_sal employees.salary%TYPE;
BEGIN
DBMS_OUTPUT.PUT_LINE('Employee ID ' || v_employee_id ||' earns '|| to_char(v_emp_sal,
'$999,999.00'));
END;
d. DECLARE
v_employee_id employees.employee_id%TYPE;
v_emp_sal employees.salary%TYPE;
BEGIN
END;
Question 20
Complete
Flag question
Question text
SELECT employee_id, last_name, first_name, job_id FROM employees WHERE department_id = (SELECT
max(department_id) FROM employees GROUP BY department_id)
Select one:
d. This will return an error. Department Id should be included in the list of field in the main query.